From 5aabca204f4175a9b737d63ac10b5f58c4d074e4 Mon Sep 17 00:00:00 2001 From: Jeff Hao Date: Wed, 16 Dec 2015 17:20:11 -0800 Subject: [PATCH] Build: Build changes for multi oat/image support. Use the --multi-image option to generate a preopted boot image. This generates a separate oat file and image file output for each dex file input. Stop inlining core. (cherry picked from commit d1d3fd933f3d79dfffc12c68a21ae1a1e1b21cc0) Change-Id: Ibd23bc06d346ff404cabd88f7461f041af6016dd --- core/dex_preopt_libart.mk | 1 + core/dex_preopt_libart_boot.mk | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index 3f52876eb..97e77bac2 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -97,5 +97,6 @@ $(hide) $(DEX2OAT) \ --instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info \ --abort-on-hard-verifier-error \ + --no-inline-from=core-oj.jar \ $(PRIVATE_DEX_PREOPT_FLAGS) endef diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk index 253afe28b..f8fc655e3 100644 --- a/core/dex_preopt_libart_boot.mk +++ b/core/dex_preopt_libart_boot.mk @@ -42,8 +42,8 @@ endif # The rule to install boot.art and boot.oat $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE) : $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) | $(ACP) - $(call copy-file-to-target) - $(hide) $(ACP) -fp $(patsubst %.art,%.oat,$<) $(patsubst %.art,%.oat,$@) + $(hide) $(ACP) -fp $(dir $<)/*.art $(dir $@) + $(hide) $(ACP) -fp $(dir $<)/*.oat $(dir $@) $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix) # Use dex2oat debug version for better error reporting @@ -51,6 +51,9 @@ $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGE @echo "target dex2oat: $@" @mkdir -p $(dir $@) @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED)) + @rm -f $(dir $@)/*.art $(dir $@)/*.oat + @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.art + @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.oat $(hide) $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ --image-classes=$(PRELOADED_CLASSES) \ $(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \ @@ -63,4 +66,5 @@ $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGE --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 \ + --multi-image --no-inline-from=core-oj.jar \ $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(COMPILED_CLASSES_FLAGS)