From 5a435dd7835e49647e6239dbd51b83a840aba1d1 Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 17 Jul 2024 21:04:49 +0800 Subject: [PATCH] cmake/linker: replace --script= with -T to enhance compatibility Some niche toolchains do not support the "--script=" option, such as tricore-elf-gcc Signed-off-by: chao an --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9a3832dbdeff..3f6455a35ce13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -637,7 +637,7 @@ if(NOT CONFIG_ARCH_SIM) # TODO: nostart/nodefault not applicable to nuttx toolchain target_link_libraries( - nuttx PRIVATE -Wl,--script=${ldscript} -Wl,--start-group ${nuttx_libs} + nuttx PRIVATE -T${ldscript} -Wl,--start-group ${nuttx_libs} ${nuttx_extra_libs} -Wl,--end-group) # generate binary outputs in different formats (.bin, .hex, etc) @@ -770,7 +770,7 @@ if(CONFIG_BUILD_PROTECTED) get_property(nuttx_apps_libs GLOBAL PROPERTY NUTTX_APPS_LIBRARIES) get_property(user_ldscript GLOBAL PROPERTY LD_SCRIPT_USER) - list(TRANSFORM user_ldscript PREPEND "-Wl,--script=") + list(TRANSFORM user_ldscript PREPEND "-T") execute_process( COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${NUTTX_EXTRA_FLAGS}