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}