diff --git a/libs/libbuiltin/libgcc/CMakeLists.txt b/libs/libbuiltin/libgcc/CMakeLists.txt index b944bc183d..00fa268ced 100644 --- a/libs/libbuiltin/libgcc/CMakeLists.txt +++ b/libs/libbuiltin/libgcc/CMakeLists.txt @@ -25,5 +25,7 @@ endif() if(CONFIG_COVERAGE_MINI AND CONFIG_ARCH_TOOLCHAIN_GCC) nuttx_add_system_library(libcoverage) + target_compile_options(libcoverage PRIVATE -fno-profile-arcs + -fno-test-coverage) target_sources(libcoverage PRIVATE gcov.c) endif() diff --git a/libs/libbuiltin/libgcc/Make.defs b/libs/libbuiltin/libgcc/Make.defs index ec8a2101a9..0cdb47efa1 100644 --- a/libs/libbuiltin/libgcc/Make.defs +++ b/libs/libbuiltin/libgcc/Make.defs @@ -24,6 +24,13 @@ endif ifeq ($(CONFIG_COVERAGE_MINI)$(CONFIG_ARCH_TOOLCHAIN_GCC),yy) CSRCS += gcov.c + +GCOV_CFLAGS += -fno-profile-arcs -fno-test-coverage +GCOV_CFLAGS += -fno-stack-protector + +bin/gcov.o: CFLAGS += $(GCOV_CFLAGS) +kbin/gcov.o: CFLAGS += $(GCOV_CFLAGS) + endif DEPPATH += --dep-path libgcc