sim: Fixes the linker 'noexecstack' warning

Signed-off-by: Leo Chung <gewalalb@gmail.com>
This commit is contained in:
Leo Chung 2025-01-12 13:13:27 +08:00 committed by Xiang Xiao
parent 43797ea6cc
commit 63c8de5f03
2 changed files with 5 additions and 0 deletions

View file

@ -727,6 +727,7 @@ else()
OUTPUT nuttx.rel OUTPUT nuttx.rel
COMMAND COMMAND
${CMAKE_C_COMPILER} ARGS -r $<$<BOOL:${CONFIG_SIM_M32}>:-m32> ${CMAKE_C_COMPILER} ARGS -r $<$<BOOL:${CONFIG_SIM_M32}>:-m32>
$<$<BOOL:${CONFIG_HOST_LINUX}>:-Wl,-z,noexecstack>
$<TARGET_OBJECTS:sim_head> $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--start-group> $<TARGET_OBJECTS:sim_head> $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--start-group>
${nuttx_libs_paths} $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--end-group> -o ${nuttx_libs_paths} $<$<NOT:$<BOOL:${APPLE}>>:-Wl,--end-group> -o
nuttx.rel nuttx.rel

View file

@ -200,3 +200,7 @@ else()
add_link_options(-Wl,--gc-sections) add_link_options(-Wl,--gc-sections)
add_link_options(-Wl,-Ttext-segment=0x40000000) add_link_options(-Wl,-Ttext-segment=0x40000000)
endif() endif()
if(CONFIG_HOST_LINUX)
add_link_options(-Wl,-z,noexecstack)
endif()