From 4bbc6c790bd3b0a4894cc844059e73b5721a28fd Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 19 Sep 2014 14:25:57 -0700 Subject: [PATCH] Add option for generating coverage info. To enable building with coverage, the environment variable NATIVE_COVERAGE must be set to true. Set `LOCAL_NATIVE_COVERAGE := true` to generate coverage information for a given component. This is currently not supported for clang (b/17574078, b/17583330). If static library A is included in a binary B (dynamic or static executable, or shared library), and A is built with coverage information, B is required to link with libgcov.a. Since the make does not offer a good way to track this dependency, link libgcov.a even if LOCAL_NATIVE_COVERAGE is not set (but still guarded by NATIVE_COVERAGE). This ensures that all of the libgcov dependencies will always be resolved, and causes no change in the resulting binary if coverage is not used. Bug: 10134489 Change-Id: Id5a19f2c215e4be80e6eae27ecc19b582f2f6813 --- core/binary.mk | 26 ++++++++++++++++++++++++++ core/clear_vars.mk | 1 + core/combo/TARGET_linux-arm.mk | 5 ++++- core/combo/TARGET_linux-arm64.mk | 5 +++++ core/combo/TARGET_linux-mips.mk | 5 ++++- core/combo/TARGET_linux-mips64.mk | 5 ++++- core/combo/TARGET_linux-x86.mk | 7 +++++-- core/combo/TARGET_linux-x86_64.mk | 7 +++++-- core/executable_internal.mk | 2 ++ core/shared_library_internal.mk | 2 ++ core/target_test_internal.mk | 3 +-- 11 files changed, 59 insertions(+), 9 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index 936b42973..ae0186039 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -113,6 +113,7 @@ my_cc := $(LOCAL_CC) my_cxx := $(LOCAL_CXX) my_c_includes := $(LOCAL_C_INCLUDES) my_generated_sources := $(LOCAL_GENERATED_SOURCES) +my_native_coverage := $(LOCAL_NATIVE_COVERAGE) # MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because # all code is position independent, and then those warnings get promoted to @@ -321,6 +322,31 @@ my_target_global_cppflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAG my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LDFLAGS) endif # my_clang +# If the global flag NATIVE_COVERAGE is set, my_native_coverage will be true +# unless the module explicitly sets my_native_coverage := false. +ifeq ($(NATIVE_COVERAGE),true) + ifeq ($(my_native_coverage),true) + # We can't currently generate coverage for clang binaries for two + # reasons: + # + # 1) b/17574078 We currently don't have a prebuilt + # libclang_rt.profile-.a, which clang is hardcoded to link if + # --coverage is passed in the link stage. For now we manually link + # libprofile_rt (which is the name it is built as from + # external/compiler-rt). + # + # 2) b/17583330 Clang doesn't generate .gcno files when using + # -no-integrated-as. Since most of the assembly in our tree is + # incompatible with clang's assembler, we can't turn off this flag. + ifneq ($(my_clang),true) + my_target_global_cflags += --coverage + my_target_global_ldflags += --coverage + endif + endif +else + my_native_coverage := false +endif + $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_includes) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 61a0927bd..23ff97d46 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -158,6 +158,7 @@ LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN:= LOCAL_MODULE_HOST_ARCH:= LOCAL_NO_FPIE := LOCAL_CXX_STL := default +LOCAL_NATIVE_COVERAGE := # arch specific variables LOCAL_SRC_FILES_$(TARGET_ARCH):= diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index c9a34e762..2d7faae77 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -164,7 +164,7 @@ $(combo_2nd_arch_prefix)TARGET_LIBGCC := $(shell $($(combo_2nd_arch_prefix)TARGE $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) -print-libgcc-file-name) $(combo_2nd_arch_prefix)TARGET_LIBATOMIC := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) \ $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) -print-file-name=libatomic.a) -target_libgcov := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \ +$(combo_2nd_arch_prefix)TARGET_LIBGCOV := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \ -print-file-name=libgcov.a) endif @@ -213,6 +213,7 @@ $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \ $(PRIVATE_LDLIBS) @@ -240,6 +241,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \ $(PRIVATE_LDLIBS) @@ -263,6 +265,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \ $(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \ $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ -Wl,--end-group \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk index 82eb7fdc9..f0fab7b65 100644 --- a/core/combo/TARGET_linux-arm64.mk +++ b/core/combo/TARGET_linux-arm64.mk @@ -131,6 +131,8 @@ TARGET_LIBGCC := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ -print-libgcc-file-name) TARGET_LIBATOMIC := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ -print-file-name=libatomic.a) +TARGET_LIBGCOV := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ + -print-file-name=libgcov.a) KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-$(TARGET_ARCH) @@ -177,6 +179,7 @@ $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \ $(PRIVATE_LDLIBS) @@ -204,6 +207,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \ $(PRIVATE_LDLIBS) @@ -227,6 +231,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \ $(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \ $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ -Wl,--end-group \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk index 92ad21a6e..b2600734d 100644 --- a/core/combo/TARGET_linux-mips.mk +++ b/core/combo/TARGET_linux-mips.mk @@ -136,7 +136,7 @@ LIBGCC_EH := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_pre ifneq ($(LIBGCC_EH),libgcc_eh.a) $(combo_2nd_arch_prefix)TARGET_LIBGCC += $(LIBGCC_EH) endif -target_libgcov := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \ +$(combo_2nd_arch_prefix)TARGET_LIBGCOV := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \ --print-file-name=libgcov.a) endif @@ -185,6 +185,7 @@ $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \ $(PRIVATE_LDLIBS) @@ -212,6 +213,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \ $(PRIVATE_LDLIBS) @@ -235,6 +237,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \ $(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \ $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ -Wl,--end-group \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk index 343581432..ef66a734b 100644 --- a/core/combo/TARGET_linux-mips64.mk +++ b/core/combo/TARGET_linux-mips64.mk @@ -137,7 +137,7 @@ LIBGCC_EH := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) -print-file-name=libgc ifneq ($(LIBGCC_EH),libgcc_eh.a) TARGET_LIBGCC += $(LIBGCC_EH) endif -target_libgcov := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ +TARGET_LIBGCOV := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ --print-file-name=libgcov.a) endif @@ -189,6 +189,7 @@ $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \ $(PRIVATE_LDLIBS) @@ -216,6 +217,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \ $(PRIVATE_LDLIBS) @@ -239,6 +241,7 @@ $(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \ $(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \ $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ -Wl,--end-group \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index 6e5f5ac09..ef37de064 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -62,8 +62,8 @@ $(combo_2nd_arch_prefix)TARGET_LIBGCC := \ $(shell $($(combo_2nd_arch_prefix)TARGET_CC) -m32 -print-file-name=libgcc.a) $(combo_2nd_arch_prefix)TARGET_LIBATOMIC := \ $(shell $($(combo_2nd_arch_prefix)TARGET_CC) -m32 -print-file-name=libatomic.a) -target_libgcov := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \ - -print-file-name=libgcov.a) +$(combo_2nd_arch_prefix)TARGET_LIBGCOV := \ + $(shell $($(combo_2nd_arch_prefix)TARGET_CC) -m32 -print-file-name=libgcov.a) endif $(combo_2nd_arch_prefix)TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined @@ -165,6 +165,7 @@ $(hide) $(PRIVATE_CXX) \ -o $@ \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \ $(PRIVATE_LDLIBS) @@ -192,6 +193,7 @@ $(hide) $(PRIVATE_CXX) \ -o $@ \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \ $(PRIVATE_LDLIBS) @@ -213,6 +215,7 @@ $(hide) $(PRIVATE_CXX) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ -Wl,--end-group \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk index 0fb879566..c7a53a699 100644 --- a/core/combo/TARGET_linux-x86_64.mk +++ b/core/combo/TARGET_linux-x86_64.mk @@ -62,8 +62,8 @@ TARGET_LIBGCC := \ $(shell $(TARGET_CC) -m64 -print-file-name=libgcc.a) TARGET_LIBATOMIC := \ $(shell $(TARGET_CC) -m64 -print-file-name=libatomic.a) -target_libgcov := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ - -print-file-name=libgcov.a) +TARGET_LIBGCOV := \ + $(shell $(TARGET_CC) -m64 -print-file-name=libgcov.a) endif TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined @@ -170,6 +170,7 @@ $(hide) $(PRIVATE_CXX) \ -o $@ \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) endef @@ -196,6 +197,7 @@ $(hide) $(PRIVATE_CXX) \ -o $@ \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \ $(PRIVATE_LDLIBS) @@ -217,6 +219,7 @@ $(hide) $(PRIVATE_CXX) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBATOMIC) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \ $(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \ -Wl,--end-group \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \ diff --git a/core/executable_internal.mk b/core/executable_internal.mk index 762f8fecc..2655dd1bf 100644 --- a/core/executable_internal.mk +++ b/core/executable_internal.mk @@ -36,6 +36,7 @@ endif # Define PRIVATE_ variables from global vars my_target_global_ld_dirs := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LD_DIRS) my_target_fdo_lib := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_LIB) +my_target_libgcov := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBGCOV) my_target_libgcc := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBGCC) my_target_libatomic := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBATOMIC) my_target_crtbegin_dynamic_o := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTBEGIN_DYNAMIC_O) @@ -56,6 +57,7 @@ endif $(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs) $(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags) $(linked_module): PRIVATE_TARGET_FDO_LIB := $(my_target_fdo_lib) +$(linked_module): PRIVATE_TARGET_LIBGCOV := $(my_target_libgcov) $(linked_module): PRIVATE_TARGET_LIBGCC := $(my_target_libgcc) $(linked_module): PRIVATE_TARGET_LIBATOMIC := $(my_target_libatomic) $(linked_module): PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O := $(my_target_crtbegin_dynamic_o) diff --git a/core/shared_library_internal.mk b/core/shared_library_internal.mk index abef11fe5..29b7d445e 100644 --- a/core/shared_library_internal.mk +++ b/core/shared_library_internal.mk @@ -41,6 +41,7 @@ include $(BUILD_SYSTEM)/dynamic_binary.mk # Define PRIVATE_ variables from global vars my_target_global_ld_dirs := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LD_DIRS) my_target_fdo_lib := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_LIB) +my_target_libgcov := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBGCOV) my_target_libgcc := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBGCC) my_target_libatomic := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_LIBATOMIC) my_target_crtbegin_so_o := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_CRTBEGIN_SO_O) @@ -59,6 +60,7 @@ endif $(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs) $(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags) $(linked_module): PRIVATE_TARGET_FDO_LIB := $(my_target_fdo_lib) +$(linked_module): PRIVATE_TARGET_LIBGCOV := $(my_target_libgcov) $(linked_module): PRIVATE_TARGET_LIBGCC := $(my_target_libgcc) $(linked_module): PRIVATE_TARGET_LIBATOMIC := $(my_target_libatomic) $(linked_module): PRIVATE_TARGET_CRTBEGIN_SO_O := $(my_target_crtbegin_so_o) diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk index 6b147b1be..65def9c25 100644 --- a/core/target_test_internal.mk +++ b/core/target_test_internal.mk @@ -24,8 +24,7 @@ ifndef LOCAL_SDK_VERSION LOCAL_C_INCLUDES += bionic \ bionic/libstdc++/include \ external/stlport/stlport -LOCAL_SHARED_LIBRARIES += libstlport -LOCAL_STATIC_LIBRARIES += libstdc++ +LOCAL_SHARED_LIBRARIES += libstlport libstdc++ endif endif