From 3ca27229a9e6d05e4cd371d696964f9dee799fc6 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 22 Jan 2026 18:00:57 +1100 Subject: [PATCH] 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 --- ports/esp32/esp32_common.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32/esp32_common.cmake b/ports/esp32/esp32_common.cmake index 4f520f408..d6a4aedb8 100644 --- a/ports/esp32/esp32_common.cmake +++ b/ports/esp32/esp32_common.cmake @@ -289,6 +289,7 @@ endif() # Add additional extmod and usermod components. if (MICROPY_PY_BTREE) target_link_libraries(${MICROPY_TARGET} $) + target_link_libraries(${MICROPY_TARGET} "-u abort_") # micropy_extmod_btree links to this symbol found in MICROPY_TARGET endif() target_link_libraries(${MICROPY_TARGET} usermod)