From 3d99bae59a829c34b2aa3fac5bf2959b99c14482 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Fri, 13 Dec 2024 11:29:21 +0800 Subject: [PATCH] gcov: Prevent pile insertion recursion Signed-off-by: wangmingrong1 --- libs/libbuiltin/libgcc/CMakeLists.txt | 2 ++ libs/libbuiltin/libgcc/Make.defs | 7 +++++++ 2 files changed, 9 insertions(+) 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