From 389cd00ca0d7610bb0d9f20380f6e3fbcb4fcf70 Mon Sep 17 00:00:00 2001 From: Oliver Nguyen Date: Wed, 11 Dec 2019 14:55:52 -0800 Subject: [PATCH] Export llvm-profdata for Clang coverage builds. This tool must match the one used to compile the source code for compatibility. Bug: 143977934 Test: m CLANG_COVERAGE=true dist Merged-In: I71e0e7afb05dedd5f6a09d5e4099387c6262387f Change-Id: I71e0e7afb05dedd5f6a09d5e4099387c6262387f (cherry picked from commit b02f7dbaa4c25fb4c3b5cedb027a69481e7e6bc5) --- core/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/Makefile b/core/Makefile index 15f7681d2..a0cc1fb43 100644 --- a/core/Makefile +++ b/core/Makefile @@ -4887,6 +4887,19 @@ $(COVERAGE_ZIP): $(SOONG_ZIP) $(hide) find $(TARGET_OUT_COVERAGE) | sort >$(PRIVATE_LIST_FILE) $(hide) $(SOONG_ZIP) -d -o $@ -C $(TARGET_OUT_COVERAGE) -l $(PRIVATE_LIST_FILE) +#------------------------------------------------------------------ +# Export the LLVM profile data tool and dependencies for Clang coverage processing +# +ifeq (true,$(CLANG_COVERAGE)) + LLVM_PROFDATA := $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata + 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) + + $(call dist-for-goals,droidcore,$(PROFDATA_ZIP)) +endif + # ----------------------------------------------------------------- # A zip of the Android Apps. Not keeping full path so that we don't # include product names when distributing