Skip to content

Commit 4d8eedb

Browse files
xiaoxiang781216acassis
authored andcommitted
arch/sim: Link to libgcov.a when CONFIG_ARCH_COVERAGE is enabled
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent 94af148 commit 4d8eedb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

arch/sim/src/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
110110
STDLIBS += -lm
111111
endif
112112

113+
ifeq ($(CONFIG_ARCH_COVERAGE),y)
114+
STDLIBS += -lgcov
115+
endif
116+
113117
ifeq ($(CONFIG_STACK_COLORATION),y)
114118
CSRCS += sim_checkstack.c
115119
endif

arch/sim/src/sim/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ set(HOSTSRCS)
2727
set(HOST_INCLUDE_DIRS)
2828
set(STDLIBS pthread)
2929

30+
if(CONFIG_ARCH_COVERAGE)
31+
list(APPEND STDLIBS gcov)
32+
endif()
33+
3034
list(APPEND HOST_DEFINITIONS -D__SIM__)
3135

3236
# common guest sources

0 commit comments

Comments
 (0)