From 70470166c76f7436e1530be558d10e18df5379ec Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Thu, 25 Aug 2016 13:50:15 +0100 Subject: [PATCH] Update build rules for VDEX ART now produces a new output file called VDEX, produced alongside the existing OAT file. This patch updates the relevant build rules. Bug: 30937355 Change-Id: Ib6be9f8f36c8f061dbbebd72cb55a5d4b6dc27eb --- core/dex_preopt_libart.mk | 4 ++-- core/dex_preopt_odex_install.mk | 17 +++++++++++++++-- core/setup_one_odex.mk | 5 +++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index d01eb1de5a..5a2f07f150 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -75,8 +75,8 @@ LIBART_TARGET_BOOT_DEX_FILES := $(foreach jar,$(LIBART_TARGET_BOOT_JARS),$(call # is converted into to boot.art (to match the legacy assumption that boot.art # exists), and the rest are converted to boot-.art. # In addition, each .art file has an associated .oat file. -LIBART_TARGET_BOOT_ART_EXTRA_FILES := $(foreach jar,$(wordlist 2,999,$(LIBART_TARGET_BOOT_JARS)),boot-$(jar).art boot-$(jar).oat) -LIBART_TARGET_BOOT_ART_EXTRA_FILES += boot.oat +LIBART_TARGET_BOOT_ART_EXTRA_FILES := $(foreach jar,$(wordlist 2,999,$(LIBART_TARGET_BOOT_JARS)),boot-$(jar).art boot-$(jar).oat boot-$(jar).vdex) +LIBART_TARGET_BOOT_ART_EXTRA_FILES += boot.oat boot.vdex my_2nd_arch_prefix := include $(BUILD_SYSTEM)/dex_preopt_libart_boot.mk diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index b7ecf2e717..16e930777a 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -41,8 +41,11 @@ endif endif built_odex := +built_vdex := installed_odex := +installed_vdex := built_installed_odex := +built_installed_vdex := ifdef LOCAL_DEX_PREOPT dexpreopt_boot_jar_module := $(filter $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)) ifdef dexpreopt_boot_jar_module @@ -91,7 +94,9 @@ endif # LOCAL_MODULE_CLASS endif # boot jar built_odex := $(strip $(built_odex)) +built_vdex := $(strip $(built_vdex)) installed_odex := $(strip $(installed_odex)) +installed_vdex := $(strip $(installed_vdex)) ifdef built_odex ifndef LOCAL_DEX_PREOPT_FLAGS @@ -103,17 +108,25 @@ endif $(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS) +$(built_vdex): $(built_odex) + # Use pattern rule - we may have multiple installed odex files. # Ugly syntax - See the definition get-odex-file-path. $(installed_odex) : $(dir $(LOCAL_INSTALLED_MODULE))%$(notdir $(word 1,$(installed_odex))) \ : $(dir $(LOCAL_BUILT_MODULE))%$(notdir $(word 1,$(built_odex))) @echo "Install: $@" $(copy-file-to-target) +$(installed_vdex) : $(dir $(LOCAL_INSTALLED_MODULE))%$(notdir $(word 1,$(installed_vdex))) \ + : $(dir $(LOCAL_BUILT_MODULE))%$(notdir $(word 1,$(built_vdex))) + @echo "Install: $@" + $(copy-file-to-target) endif # Add the installed_odex to the list of installed files for this module. ALL_MODULES.$(my_register_name).INSTALLED += $(installed_odex) +ALL_MODULES.$(my_register_name).INSTALLED += $(installed_vdex) ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_odex) +ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_vdex) # Record dex-preopt config. DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT) @@ -128,7 +141,7 @@ DEXPREOPT.MODULES.$(LOCAL_MODULE_CLASS) := $(sort \ $(DEXPREOPT.MODULES.$(LOCAL_MODULE_CLASS)) $(LOCAL_MODULE)) -# Make sure to install the .odex when you run "make " -$(my_register_name): $(installed_odex) +# Make sure to install the .odex and .vdex when you run "make " +$(my_register_name): $(installed_odex) $(installed_vdex) endif # LOCAL_DEX_PREOPT diff --git a/core/setup_one_odex.mk b/core/setup_one_odex.mk index ec8a28a5bd..40dbb553bb 100644 --- a/core/setup_one_odex.mk +++ b/core/setup_one_odex.mk @@ -35,5 +35,10 @@ $(my_built_odex) : $($(my_2nd_arch_prefix)DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BO my_installed_odex := $(call get-odex-file-path,$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH),$(LOCAL_INSTALLED_MODULE)) built_odex += $(my_built_odex) +built_vdex += $(patsubst %.odex,%.vdex,$(my_built_odex)) + installed_odex += $(my_installed_odex) +installed_vdex += $(patsubst %.odex,%.vdex,$(my_installed_odex)) + built_installed_odex += $(my_built_odex):$(my_installed_odex) +built_installed_vdex += $(my_built_vdex):$(my_installed_vdex)