Package llvm-cov in llvm-profdata.zip (take 2)
Bug: http://b/214396112
It is needed for code coverage smoke test. Retain the
`llvm-profdata.zip` name since it is used in Tradefed.
This fixes aosp/2017370 which incorrectly packaged llvm-profdata twice.
Test: `CLANG_COVERAGE=true m dist` and inspect llvm-profdata.zip
Change-Id: Ic1cbebff3f6fbea04a6c58c6d57557d0ffde14ae
diff --git a/core/Makefile b/core/Makefile
index 9db0018..fd32cd0 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -5913,12 +5913,15 @@
#
ifeq (true,$(CLANG_COVERAGE))
LLVM_PROFDATA := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata
+ LLVM_COV := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-cov
LIBCXX := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/libc++.so.1
- PROFDATA_ZIP := $(PRODUCT_OUT)/llvm-profdata.zip
- $(PROFDATA_ZIP): $(SOONG_ZIP)
- $(hide) $(SOONG_ZIP) -d -o $@ -C $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION) -f $(LLVM_PROFDATA) -f $(LIBCXX)
+ # Use llvm-profdata.zip for backwards compatibility with tradefed code.
+ LLVM_COVERAGE_TOOLS_ZIP := $(PRODUCT_OUT)/llvm-profdata.zip
- $(call dist-for-goals,droidcore-unbundled apps_only,$(PROFDATA_ZIP))
+ $(LLVM_COVERAGE_TOOLS_ZIP): $(SOONG_ZIP)
+ $(hide) $(SOONG_ZIP) -d -o $@ -C $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION) -f $(LLVM_PROFDATA) -f $(LIBCXX) -f $(LLVM_COV)
+
+ $(call dist-for-goals,droidcore-unbundled apps_only,$(LLVM_COVERAGE_TOOLS_ZIP))
endif
# -----------------------------------------------------------------