Skip to content

Commit

Permalink
cmake:fix sim gc-section option build failed
Browse files Browse the repository at this point in the history
Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 committed Oct 16, 2024
1 parent a2544b9 commit 85de22f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/sim/src/cmake/Toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ if(CONFIG_SCHED_GCOV)
add_compile_options(-fprofile-generate -ftest-coverage)
endif()

if(CONFIG_SCHED_GPROF_ALL OR CONFIG_SIM_GPROF)
add_compile_options(-pg)
endif()

if(CONFIG_SIM_ASAN)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
Expand Down Expand Up @@ -190,5 +194,6 @@ endif()
if(APPLE)
add_link_options(-Wl,-dead_strip)
else()
add_link_options(-Wl,--gc-sections)
add_link_options(-Wl,-Ttext-segment=0x40000000)
endif()

0 comments on commit 85de22f

Please sign in to comment.