Skip to content

Commit

Permalink
cmake/linker: replace --script= with -T to enhance compatibility
Browse files Browse the repository at this point in the history
Some niche toolchains do not support the "--script=" option, such as tricore-elf-gcc

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Jul 17, 2024
1 parent d6c67c5 commit 5a435dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 5a435dd

Please sign in to comment.