Skip to content

Commit 810b55a

Browse files
authored
Fix IDF 4.3 atomic 64 exchange (#62)
* Fix IDF 4.3 atomic 64 exchange * Conditional strip * Update
1 parent e174a69 commit 810b55a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ externalproject_add(libmicroros_project
3030
IDF_PATH=${IDF_PATH}
3131
IDF_TARGET=${IDF_TARGET}
3232
APP_COLCON_META=${APP_COLCON_META}
33+
IDF_VERSION_MAJOR=${IDF_VERSION_MAJOR}
34+
IDF_VERSION_MINOR=${IDF_VERSION_MINOR}
3335
INSTALL_COMMAND ""
3436
BUILD_BYPRODUCTS ${COMPONENT_DIR}/libmicroros.a
3537
)

libmicroros.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32s2 esp32c3))
9797
mkdir $(UROS_DIR)/atomic_workaround; cd $(UROS_DIR)/atomic_workaround; \
9898
$(AR) x $(UROS_DIR)/install/lib/librcutils.a; \
9999
$(STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_fetch_add_8; \
100+
if [ $(IDF_VERSION_MAJOR) -ge 4 ] && [ $(IDF_VERSION_MINOR) -ge 3 ]; then \
101+
$(STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_exchange_8; \
102+
fi; \
100103
$(AR) rc -s librcutils.a *.obj; \
101104
cp -rf librcutils.a $(UROS_DIR)/install/lib/librcutils.a; \
102105
rm -rf $(UROS_DIR)/atomic_workaround; \

0 commit comments

Comments
 (0)