From c209ef8ce1d24d06760ea46ba17bff15de9f260f Mon Sep 17 00:00:00 2001 From: Ryan Campbell Date: Mon, 3 Oct 2016 11:23:40 -0700 Subject: [PATCH] Support multiple arch for coverage packaging. Modify copy rule to support multiple architectures. Use a method similar to symbols. Test: make lights.bullhead NATIVE_COVERAGE=true COVERAGE_PATHS=test/vts/hals/light/ Bug: 31911253 Change-Id: Ib3c53b4b305cbfcfd186010c5500b8d678190ddf --- core/shared_library_internal.mk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/shared_library_internal.mk b/core/shared_library_internal.mk index 05886fad1..1a8975af8 100644 --- a/core/shared_library_internal.mk +++ b/core/shared_library_internal.mk @@ -96,17 +96,23 @@ built_static_gcno_libraries := \ STATIC_LIBRARIES,$(lib),$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX), \ $(my_host_cross))/$(lib)$(gcno_suffix)) -GCNO_ARCHIVE := $(LOCAL_MODULE)$(gcno_suffix) +ifdef LOCAL_IS_HOST_MODULE +my_coverage_path := $($(my_prefix)OUT_COVERAGE)/$(patsubst $($(my_prefix)OUT)/%,%,$(my_module_path)) +else +my_coverage_path := $(TARGET_OUT_COVERAGE)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path)) +endif + +GCNO_ARCHIVE := $(basename $(my_installed_module_stem))$(gcno_suffix) $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_OBJECTS := $(strip $(LOCAL_GCNO_FILES)) $(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := $(strip $(built_whole_gcno_libraries)) $(strip $(built_static_gcno_libraries)) $(intermediates)/$(GCNO_ARCHIVE) : $(LOCAL_GCNO_FILES) $(built_whole_gcno_libraries) $(built_static_gcno_libraries) $(transform-o-to-static-lib) -$($(my_prefix)OUT_COVERAGE)/$(GCNO_ARCHIVE) : $(intermediates)/$(GCNO_ARCHIVE) +$(my_coverage_path)/$(GCNO_ARCHIVE) : $(intermediates)/$(GCNO_ARCHIVE) $(copy-file-to-target) -$(LOCAL_BUILT_MODULE): $($(my_prefix)OUT_COVERAGE)/$(GCNO_ARCHIVE) +$(LOCAL_BUILT_MODULE): $(my_coverage_path)/$(GCNO_ARCHIVE) endif endif # skip_build_from_source