gcov: Fix not linked gcov rtio functions

This commit is contained in:
Alexey Gerenkov 2023-06-29 21:15:46 +03:00
parent 4ce0a6adc5
commit 9fcb551b8e

View File

@ -50,10 +50,12 @@ idf_component_register(SRCS "${srcs}"
PRIV_REQUIRES soc esp_ipc
LDFRAGMENTS linker.lf)
if(CONFIG_APPTRACE_GCOV_ENABLE)
# disable --coverage for this component, as it is used as transport
# for gcov
target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
# Force app_trace to also appear later than gcov in link line
# Force app_trace to appear later than gcov in link line
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
target_link_libraries(${COMPONENT_LIB} INTERFACE
"-Wl,--undefined=gcov_rtio_atexit" $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
endif()