From b5caccb2ba2d50f5576d4db83525d26ed0317e6c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 2 Nov 2022 14:52:18 -0700 Subject: [PATCH] lib/picolibc: Use zephyr_libc_link_libraries to find toolchain lib When using the toolchain C library, that must be added to the link command after all other libraries and modules in the system to resolve undefined symbols. Signed-off-by: Keith Packard --- lib/libc/picolibc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/picolibc/CMakeLists.txt b/lib/libc/picolibc/CMakeLists.txt index bfbe4bca8c3..c32295e1d27 100644 --- a/lib/libc/picolibc/CMakeLists.txt +++ b/lib/libc/picolibc/CMakeLists.txt @@ -13,7 +13,7 @@ if(NOT CONFIG_PICOLIBC_USE_MODULE) zephyr_compile_options(--specs=picolibc.specs) zephyr_compile_definitions(_POSIX_C_SOURCE=200809) - zephyr_link_libraries(-T/dev/null --specs=picolibc.specs c -lgcc) + zephyr_libc_link_libraries(-T/dev/null --specs=picolibc.specs c -lgcc) if(CONFIG_PICOLIBC_IO_FLOAT) zephyr_compile_definitions(PICOLIBC_DOUBLE_PRINTF_SCANF) zephyr_link_libraries(-DPICOLIBC_DOUBLE_PRINTF_SCANF)