Skip to content

Commit 3ca2722

Browse files
projectgusdpgeorge
authored andcommitted
esp32: Fix linker errors with CMake <3.25 and libbtree.
As we add the object files to the linker command line directly, they go after the other library dependencies and therefore don't resolve their dependencies. Turns out the only dependent symbol of the btree library is abort_, so explicitly include it in the link. The old way of linking the entire library is cleaner, but stopped working with ESP-IDF V5.5... This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 5e04827 commit 3ca2722

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

ports/esp32/esp32_common.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ endif()
289289
# Add additional extmod and usermod components.
290290
if (MICROPY_PY_BTREE)
291291
target_link_libraries(${MICROPY_TARGET} $<TARGET_OBJECTS:micropy_extmod_btree>)
292+
target_link_libraries(${MICROPY_TARGET} "-u abort_") # micropy_extmod_btree links to this symbol found in MICROPY_TARGET
292293
endif()
293294
target_link_libraries(${MICROPY_TARGET} usermod)
294295

0 commit comments

Comments
 (0)