Skip to content

Commit

Permalink
Merge branch 'bugfix/link_gcov_rtio_v4.4' into 'release/v4.4'
Browse files Browse the repository at this point in the history
gcov: Fix not linked gcov rtio functions

See merge request espressif/esp-idf!24503
  • Loading branch information
dobairoland committed Aug 8, 2023
2 parents 8aa1395 + 9fcb551 commit 41b695a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions components/app_trace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ idf_component_register(SRCS "${srcs}"
PRIV_REQUIRES soc esp_ipc
LDFRAGMENTS linker.lf)

# 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
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)
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 appear later than gcov in link line
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
target_link_libraries(${COMPONENT_LIB} INTERFACE
"-Wl,--undefined=gcov_rtio_atexit" $<TARGET_FILE:${app_trace}> gcov $<TARGET_FILE:${app_trace}> c)
endif()

0 comments on commit 41b695a

Please sign in to comment.