arch/sim: Link to libgcov.a when CONFIG_ARCH_COVERAGE is enabled

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-07-16 10:11:46 +08:00 committed by Alan Carvalho de Assis
parent 94af148fb3
commit 4d8eedb09a
2 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,10 @@ ifeq ($(CONFIG_LIBM_TOOLCHAIN),y)
STDLIBS += -lm
endif
ifeq ($(CONFIG_ARCH_COVERAGE),y)
STDLIBS += -lgcov
endif
ifeq ($(CONFIG_STACK_COLORATION),y)
CSRCS += sim_checkstack.c
endif

View File

@ -27,6 +27,10 @@ set(HOSTSRCS)
set(HOST_INCLUDE_DIRS)
set(STDLIBS pthread)
if(CONFIG_ARCH_COVERAGE)
list(APPEND STDLIBS gcov)
endif()
list(APPEND HOST_DEFINITIONS -D__SIM__)
# common guest sources