You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2025/07/02 16:18:06 UTC
(nuttx) 02/11: CMake: Fix link error
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 7bbb96205bac176d63b0a41cf739c70879b00ddf
Author: wangmingrong1 <wa...@xiaomi.com>
AuthorDate: Wed Feb 19 12:04:52 2025 +0800
CMake: Fix link error
Bringing the code coverage option when linking may cause gcc or g++ to automatically link the libgcov.a that comes with the toolchain.
Signed-off-by: wangmingrong1 <wa...@xiaomi.com>
---
libs/libbuiltin/libgcc/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libs/libbuiltin/libgcc/CMakeLists.txt b/libs/libbuiltin/libgcc/CMakeLists.txt
index 52f3faa7ba..45f318035b 100644
--- a/libs/libbuiltin/libgcc/CMakeLists.txt
+++ b/libs/libbuiltin/libgcc/CMakeLists.txt
@@ -28,5 +28,10 @@ if(CONFIG_COVERAGE_MINI AND CONFIG_ARCH_TOOLCHAIN_GCC)
target_compile_options(
libcoverage PRIVATE -fno-profile-arcs -fno-test-coverage
-fno-stack-protector)
+
+ list(REMOVE_ITEM NUTTX_EXTRA_FLAGS "-fprofile-arcs" "-ftest-coverage"
+ "-fno-inline")
+ set_property(GLOBAL PROPERTY NUTTX_EXTRA_FLAGS ${NUTTX_EXTRA_FLAGS})
+
target_sources(libcoverage PRIVATE gcov.c)
endif()