cmake:fix sim gc-section option build failed

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
xuxin19 2024-10-16 22:40:19 +08:00 committed by Xiang Xiao
parent da19d79656
commit 8da0206a40
1 changed files with 5 additions and 0 deletions

View File

@ -90,6 +90,10 @@ if(CONFIG_SCHED_GCOV_ALL)
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)
@ -188,5 +192,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()