diff --git a/arch/sim/src/cmake/Toolchain.cmake b/arch/sim/src/cmake/Toolchain.cmake index a480c004e745b..d7d911fdf72eb 100644 --- a/arch/sim/src/cmake/Toolchain.cmake +++ b/arch/sim/src/cmake/Toolchain.cmake @@ -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) @@ -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()