From d1c9bfe87a25dc534ecd7ea23b1053cb6fbbfe38 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Mon, 6 Jan 2020 13:50:55 +0000 Subject: [PATCH] Respect JIT-zygote config when generating boot image location. Earlier CL Ida40dfae8c83bf7c2e737d5c7ea418e1197ad826 introduced Soong-generated Make variable 'DEXPREOPT_IMAGE_LOCATIONS'. That CL was erroneous in that it did not take JIT-zygote config into account and generated identical location for "boot" and "apex" boot images. This caused build breakages, because in case of JIT-zygote config the two variables 'DexPreoptImages' and 'DexPreoptImageLocations' in the module's dexpreopt.config were out of sync: 'DexPreoptImages' was for the "apex" image, and 'DexPreoptImageLocations' was for the "boot" image. CL I9a91fc48e54d7d43abec2cb2b5a11e3581db380b introduced a workaround for this problem: incorrect 'DexPreoptImageLocations' from the module dexpreopt.config was ignored, and instead boot image location was manually reconstructed from 'DexPreoptImages'. This workaround would not work when we start using boot image extension and location will become more complex. This CL fixes the way 'DexPreoptImageLocations' is generated by spliting the 'DEXPREOPT_IMAGE_LOCATIONS' variable in two variables depending on the boot image flavour "boot" of "apex". This is aligned with the way other similar variables are generated. Test: aosp_walleye-userdebug boots. Test: walleye_jitzygote-userdebug builds (on git_rvc-release branch with this CL cherry-picked). Change-Id: I449c968909635dd8cc431323fccbc7fce440fea5 --- core/dex_preopt_odex_install.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index aa3fd80508..e6b50102d0 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -111,6 +111,7 @@ endif my_dexpreopt_archs := my_dexpreopt_images := my_dexpreopt_images_deps := +my_dexpreopt_image_locations := my_dexpreopt_infix := boot ifeq (true, $(DEXPREOPT_USE_APEX_IMAGE)) my_dexpreopt_infix := apex @@ -183,6 +184,8 @@ ifdef LOCAL_DEX_PREOPT endif # TARGET_2ND_ARCH endif # LOCAL_MODULE_CLASS + my_dexpreopt_image_locations += $(DEXPREOPT_IMAGE_LOCATIONS_$(my_dexpreopt_infix)) + my_filtered_optional_uses_libraries := $(filter-out $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES), \ $(LOCAL_OPTIONAL_USES_LIBRARIES)) @@ -234,7 +237,7 @@ ifdef LOCAL_DEX_PREOPT $(call end_json_map) $(call add_json_list, Archs, $(my_dexpreopt_archs)) $(call add_json_list, DexPreoptImages, $(my_dexpreopt_images)) - $(call add_json_list, DexPreoptImageLocations, $(DEXPREOPT_IMAGE_LOCATIONS)) + $(call add_json_list, DexPreoptImageLocations, $(my_dexpreopt_image_locations)) $(call add_json_list, PreoptBootClassPathDexFiles, $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)) $(call add_json_list, PreoptBootClassPathDexLocations,$(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS)) $(call add_json_bool, PreoptExtractedApk, $(my_preopt_for_extracted_apk))