From e469063a932c84c7e0bf464ab2e519da81f89ca8 Mon Sep 17 00:00:00 2001 From: Alexey Alexandrov Date: Mon, 19 Sep 2016 10:54:21 -0700 Subject: [PATCH] Generate SHA-1 build ID for host-generated *.oat files (2/2). For host-generated *.oat files, generate a SHA-1 build ID based on the file content and write it to .note.gnu.build-id ELF section. This should allow various developer tools like profilers correlate the data captured for files like boot.oat on the device with the corresponding known version of the file during an offline analysis. Test: Verified that boot.oat contains the build ID section now. Test: make test-art-host Bug: 31292208 Change-Id: Iee48e437009488f20995e73868d5059d349701c0 --- core/dex_preopt_libart.mk | 3 ++- core/dex_preopt_libart_boot.mk | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index ab54b1d8e..7a0fb958c 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -104,7 +104,8 @@ $(hide) ANDROID_LOG_TAGS="*:e" $(DEX2OAT) \ --instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \ --instruction-set-variant=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) \ --instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ - --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info \ + --include-patch-information --runtime-arg -Xnorelocate \ + --no-generate-debug-info --generate-build-id \ --abort-on-hard-verifier-error \ --no-inline-from=core-oj.jar \ $(PRIVATE_DEX_PREOPT_FLAGS) \ diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk index 1a0dc5b07..9f27db725 100644 --- a/core/dex_preopt_libart_boot.mk +++ b/core/dex_preopt_libart_boot.mk @@ -71,6 +71,7 @@ $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGE --instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \ --instruction-set-variant=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) \ --instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ - --android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info \ + --android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate \ + --no-generate-debug-info --generate-build-id \ --multi-image --no-inline-from=core-oj.jar \ $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(GLOBAL_DEXPREOPT_FLAGS) $(COMPILED_CLASSES_FLAGS) $(ART_BOOT_IMAGE_EXTRA_ARGS) -- 2.11.0