Merge "Remove support for stripping dex." am: 8567331a4f am: fbdf5ef4df am: f7f7f8cdd9

am: 31931c7b1a

Change-Id: Ia318b3df8da3e7f96b831b5fb6d572d7a4d13b52
This commit is contained in:
Nicolas Geoffray 2019-10-22 03:40:34 -07:00 committed by android-build-merger
commit 5a13fa45c3
9 changed files with 7 additions and 91 deletions

View File

@ -2557,7 +2557,7 @@ pdk_odex_apps := $(strip $(foreach m,$(DEXPREOPT.MODULES.APPS),\
$(if $(filter $(DEXPREOPT.$(m).INSTALLED_STRIPPED),$(ALL_DEFAULT_INSTALLED_MODULES)),$(m)))) $(if $(filter $(DEXPREOPT.$(m).INSTALLED_STRIPPED),$(ALL_DEFAULT_INSTALLED_MODULES)),$(m))))
pdk_classes_dex := $(strip \ pdk_classes_dex := $(strip \
$(foreach m,$(pdk_odex_javalibs),$(call intermediates-dir-for,JAVA_LIBRARIES,$(m),,COMMON)/javalib.jar) \ $(foreach m,$(pdk_odex_javalibs),$(call intermediates-dir-for,JAVA_LIBRARIES,$(m),,COMMON)/javalib.jar) \
$(foreach m,$(pdk_odex_apps),$(call intermediates-dir-for,APPS,$(m))/package.dex.apk)) $(foreach m,$(pdk_odex_apps),$(call intermediates-dir-for,APPS,$(m))/package.apk))
pdk_odex_config_mk := $(PRODUCT_OUT)/pdk_dexpreopt_config.mk pdk_odex_config_mk := $(PRODUCT_OUT)/pdk_dexpreopt_config.mk
$(pdk_odex_config_mk): PRIVATE_JAVA_LIBRARIES := $(pdk_odex_javalibs) $(pdk_odex_config_mk): PRIVATE_JAVA_LIBRARIES := $(pdk_odex_javalibs)
@ -2575,7 +2575,7 @@ $(pdk_odex_config_mk) :
$(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\ $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\
) )
$(foreach m,$(PRIVATE_APPS),\ $(foreach m,$(PRIVATE_APPS),\
$(hide) echo "PDK.DEXPREOPT.$(m).SRC:=$(patsubst $(OUT_DIR)/%,%,$(call intermediates-dir-for,APPS,$(m))/package.dex.apk)" >> $@$(newline)\ $(hide) echo "PDK.DEXPREOPT.$(m).SRC:=$(patsubst $(OUT_DIR)/%,%,$(call intermediates-dir-for,APPS,$(m))/package.apk)" >> $@$(newline)\
$(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT:=$(DEXPREOPT.$(m).DEX_PREOPT)" >> $@$(newline)\ $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT:=$(DEXPREOPT.$(m).DEX_PREOPT)" >> $@$(newline)\
$(hide) echo "PDK.DEXPREOPT.$(m).MULTILIB:=$(DEXPREOPT.$(m).MULTILIB)" >> $@$(newline)\ $(hide) echo "PDK.DEXPREOPT.$(m).MULTILIB:=$(DEXPREOPT.$(m).MULTILIB)" >> $@$(newline)\
$(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\ $(hide) echo "PDK.DEXPREOPT.$(m).DEX_PREOPT_FLAGS:=$(DEXPREOPT.$(m).DEX_PREOPT_FLAGS)" >> $@$(newline)\

View File

@ -215,17 +215,6 @@ $(built_module) : $(appcompat-files)
$(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE) $(LOCAL_BUILT_MODULE): PRIVATE_INSTALLED_MODULE := $(LOCAL_INSTALLED_MODULE)
endif endif
ifneq ($(BUILD_PLATFORM_ZIP),)
$(built_module) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk
endif
ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
ifdef LOCAL_DEX_PREOPT
$(built_module) : PRIVATE_STRIP_SCRIPT := $(intermediates)/strip.sh
$(built_module) : $(intermediates)/strip.sh
$(built_module) : | $(DEXPREOPT_STRIP_DEPS)
$(built_module) : .KATI_DEPFILE := $(built_module).d
endif
endif
ifeq ($(module_run_appcompat),true) ifeq ($(module_run_appcompat),true)
$(built_module) : $(AAPT2) $(built_module) : $(AAPT2)
endif endif
@ -235,23 +224,11 @@ $(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(ZIP2ZIP) $(SIGNAPK_JAR
ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) ifeq (true, $(LOCAL_UNCOMPRESS_DEX))
$(uncompress-dexs) $(uncompress-dexs)
endif # LOCAL_UNCOMPRESS_DEX endif # LOCAL_UNCOMPRESS_DEX
ifdef LOCAL_DEX_PREOPT
ifneq ($(BUILD_PLATFORM_ZIP),)
@# Keep a copy of apk with classes.dex unstripped
$(hide) cp -f $@ $(dir $@)package.dex.apk
endif # BUILD_PLATFORM_ZIP
endif # LOCAL_DEX_PREOPT
ifneq ($(LOCAL_CERTIFICATE),PRESIGNED) ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
@# Only strip out files if we can re-sign the package.
# Run appcompat before stripping the classes.dex file.
ifeq ($(module_run_appcompat),true) ifeq ($(module_run_appcompat),true)
$(call appcompat-header, aapt2) $(call appcompat-header, aapt2)
$(run-appcompat) $(run-appcompat)
endif # module_run_appcompat endif # module_run_appcompat
ifdef LOCAL_DEX_PREOPT
mv -f $@ $@.tmp
$(PRIVATE_STRIP_SCRIPT) $@.tmp $@
endif # LOCAL_DEX_PREOPT
$(sign-package) $(sign-package)
# No need for align-package because sign-package takes care of alignment # No need for align-package because sign-package takes care of alignment
else # LOCAL_CERTIFICATE == PRESIGNED else # LOCAL_CERTIFICATE == PRESIGNED

View File

@ -56,7 +56,7 @@ LOCAL_DEX_PREOPT_APP_IMAGE:=
LOCAL_DEX_PREOPT_FLAGS:= LOCAL_DEX_PREOPT_FLAGS:=
LOCAL_DEX_PREOPT_GENERATE_PROFILE:= LOCAL_DEX_PREOPT_GENERATE_PROFILE:=
LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING:= LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING:=
LOCAL_DEX_PREOPT:= # '',true,false,nostripping LOCAL_DEX_PREOPT:= # '',true,false
LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG:= LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG:=
LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES:= LOCAL_DISABLE_RESOLVE_SUPPORT_LIBRARIES:=
LOCAL_DONT_CHECK_MODULE:= LOCAL_DONT_CHECK_MODULE:=

View File

@ -14,16 +14,9 @@ SYSTEM_OTHER_ODEX_FILTER ?= \
product/app/% \ product/app/% \
product/priv-app/% \ product/priv-app/% \
# The default values for pre-opting. To support the runtime module we ensure no dex files
# get stripped.
ifeq ($(PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING),)
PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING := true
endif
# Conditional to building on linux, as dex2oat currently does not work on darwin. # Conditional to building on linux, as dex2oat currently does not work on darwin.
ifeq ($(HOST_OS),linux) ifeq ($(HOST_OS),linux)
ifeq (eng,$(TARGET_BUILD_VARIANT)) ifeq (eng,$(TARGET_BUILD_VARIANT))
# Don't strip for quick development turnarounds.
DEX_PREOPT_DEFAULT := nostripping
# For an eng build only pre-opt the boot image and system server. This gives reasonable performance # For an eng build only pre-opt the boot image and system server. This gives reasonable performance
# and still allows a simple workflow: building in frameworks/base and syncing. # and still allows a simple workflow: building in frameworks/base and syncing.
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
@ -87,7 +80,6 @@ ifeq ($(WRITE_SOONG_VARIABLES),true)
$(call json_start) $(call json_start)
$(call add_json_bool, DefaultNoStripping, $(filter nostripping,$(DEX_PREOPT_DEFAULT)))
$(call add_json_bool, DisablePreopt, $(call invert_bool,$(filter true,$(WITH_DEXPREOPT)))) $(call add_json_bool, DisablePreopt, $(call invert_bool,$(filter true,$(WITH_DEXPREOPT))))
$(call add_json_list, DisablePreoptModules, $(DEXPREOPT_DISABLED_MODULES)) $(call add_json_list, DisablePreoptModules, $(DEXPREOPT_DISABLED_MODULES))
$(call add_json_bool, OnlyPreoptBootImageAndSystemServer, $(filter true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))) $(call add_json_bool, OnlyPreoptBootImageAndSystemServer, $(filter true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)))
@ -174,6 +166,3 @@ DEXPREOPT_GEN_DEPS := \
$(SOONG_ZIP) \ $(SOONG_ZIP) \
$(ZIP2ZIP) \ $(ZIP2ZIP) \
$(BUILD_SYSTEM)/construct_context.sh \ $(BUILD_SYSTEM)/construct_context.sh \
DEXPREOPT_STRIP_DEPS := \
$(ZIP2ZIP) \

View File

@ -207,8 +207,7 @@ ifdef LOCAL_DEX_PREOPT
$(call json_start) $(call json_start)
# DexPath, StripInputPath, and StripOutputPath are not set, they will # DexPath is not set: it will be filled in by dexpreopt_gen.
# be filled in by dexpreopt_gen.
$(call add_json_str, Name, $(LOCAL_MODULE)) $(call add_json_str, Name, $(LOCAL_MODULE))
$(call add_json_str, DexLocation, $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))) $(call add_json_str, DexLocation, $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE)))
@ -237,13 +236,10 @@ ifdef LOCAL_DEX_PREOPT
$(call add_json_bool, ForceCreateAppImage, $(filter true,$(LOCAL_DEX_PREOPT_APP_IMAGE))) $(call add_json_bool, ForceCreateAppImage, $(filter true,$(LOCAL_DEX_PREOPT_APP_IMAGE)))
$(call add_json_bool, PresignedPrebuilt, $(filter PRESIGNED,$(LOCAL_CERTIFICATE))) $(call add_json_bool, PresignedPrebuilt, $(filter PRESIGNED,$(LOCAL_CERTIFICATE)))
$(call add_json_bool, NoStripping, $(filter nostripping,$(LOCAL_DEX_PREOPT)))
$(call json_end) $(call json_end)
my_dexpreopt_config := $(intermediates)/dexpreopt.config my_dexpreopt_config := $(intermediates)/dexpreopt.config
my_dexpreopt_script := $(intermediates)/dexpreopt.sh my_dexpreopt_script := $(intermediates)/dexpreopt.sh
my_strip_script := $(intermediates)/strip.sh
my_dexpreopt_zip := $(intermediates)/dexpreopt.zip my_dexpreopt_zip := $(intermediates)/dexpreopt.zip
$(my_dexpreopt_config): PRIVATE_MODULE := $(LOCAL_MODULE) $(my_dexpreopt_config): PRIVATE_MODULE := $(LOCAL_MODULE)
@ -252,17 +248,15 @@ ifdef LOCAL_DEX_PREOPT
@echo "$(PRIVATE_MODULE) dexpreopt.config" @echo "$(PRIVATE_MODULE) dexpreopt.config"
echo -e -n '$(subst $(newline),\n,$(subst ','\'',$(subst \,\\,$(PRIVATE_CONTENTS))))' > $@ echo -e -n '$(subst $(newline),\n,$(subst ','\'',$(subst \,\\,$(PRIVATE_CONTENTS))))' > $@
.KATI_RESTAT: $(my_dexpreopt_script) $(my_strip_script) .KATI_RESTAT: $(my_dexpreopt_script)
$(my_dexpreopt_script): PRIVATE_MODULE := $(LOCAL_MODULE) $(my_dexpreopt_script): PRIVATE_MODULE := $(LOCAL_MODULE)
$(my_dexpreopt_script): PRIVATE_GLOBAL_CONFIG := $(DEX_PREOPT_CONFIG_FOR_MAKE) $(my_dexpreopt_script): PRIVATE_GLOBAL_CONFIG := $(DEX_PREOPT_CONFIG_FOR_MAKE)
$(my_dexpreopt_script): PRIVATE_MODULE_CONFIG := $(my_dexpreopt_config) $(my_dexpreopt_script): PRIVATE_MODULE_CONFIG := $(my_dexpreopt_config)
$(my_dexpreopt_script): PRIVATE_STRIP_SCRIPT := $(my_strip_script)
$(my_dexpreopt_script): .KATI_IMPLICIT_OUTPUTS := $(my_strip_script)
$(my_dexpreopt_script): $(DEXPREOPT_GEN) $(my_dexpreopt_script): $(DEXPREOPT_GEN)
$(my_dexpreopt_script): $(my_dexpreopt_config) $(DEX_PREOPT_CONFIG_FOR_MAKE) $(my_dexpreopt_script): $(my_dexpreopt_config) $(DEX_PREOPT_CONFIG_FOR_MAKE)
@echo "$(PRIVATE_MODULE) dexpreopt gen" @echo "$(PRIVATE_MODULE) dexpreopt gen"
$(DEXPREOPT_GEN) -global $(PRIVATE_GLOBAL_CONFIG) -module $(PRIVATE_MODULE_CONFIG) \ $(DEXPREOPT_GEN) -global $(PRIVATE_GLOBAL_CONFIG) -module $(PRIVATE_MODULE_CONFIG) \
-dexpreopt_script $@ -strip_script $(PRIVATE_STRIP_SCRIPT) \ -dexpreopt_script $@ \
-out_dir $(OUT_DIR) -out_dir $(OUT_DIR)
my_dexpreopt_deps := $(my_dex_jar) my_dexpreopt_deps := $(my_dex_jar)
@ -302,6 +296,5 @@ ifdef LOCAL_DEX_PREOPT
my_dexpreopt_config := my_dexpreopt_config :=
my_dexpreopt_script := my_dexpreopt_script :=
my_strip_script :=
my_dexpreopt_zip := my_dexpreopt_zip :=
endif # LOCAL_DEX_PREOPT endif # LOCAL_DEX_PREOPT

View File

@ -85,17 +85,6 @@ endif # LOCAL_UNCOMPRESS_DEX
.KATI_RESTAT: $(common_javalib.jar) .KATI_RESTAT: $(common_javalib.jar)
ifdef LOCAL_DEX_PREOPT
$(LOCAL_BUILT_MODULE): PRIVATE_STRIP_SCRIPT := $(intermediates)/strip.sh
$(LOCAL_BUILT_MODULE): $(intermediates)/strip.sh
$(LOCAL_BUILT_MODULE): | $(DEXPREOPT_STRIP_DEPS)
$(LOCAL_BUILT_MODULE): .KATI_DEPFILE := $(LOCAL_BUILT_MODULE).d
$(LOCAL_BUILT_MODULE): $(common_javalib.jar)
$(PRIVATE_STRIP_SCRIPT) $< $@
else # LOCAL_DEX_PREOPT
$(eval $(call copy-one-file,$(common_javalib.jar),$(LOCAL_BUILT_MODULE))) $(eval $(call copy-one-file,$(common_javalib.jar),$(LOCAL_BUILT_MODULE)))
endif # LOCAL_DEX_PREOPT
endif # !LOCAL_IS_STATIC_JAVA_LIBRARY endif # !LOCAL_IS_STATIC_JAVA_LIBRARY

View File

@ -45,19 +45,8 @@ ALL_MODULES.$(my_register_name).CLASSES_JAR := $(common_classes_jar)
# defines built_odex along with rule to install odex # defines built_odex along with rule to install odex
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
####################################### #######################################
ifdef LOCAL_DEX_PREOPT
$(built_module): PRIVATE_STRIP_SCRIPT := $(intermediates)/strip.sh
$(built_module): $(intermediates)/strip.sh
$(built_module): | $(DEXPREOPT_STRIP_DEPS)
$(built_module): .KATI_DEPFILE := $(built_module).d
$(built_module): $(my_prebuilt_src_file)
$(PRIVATE_STRIP_SCRIPT) $< $@
else # ! LOCAL_DEX_PREOPT
$(built_module) : $(my_prebuilt_src_file) $(built_module) : $(my_prebuilt_src_file)
$(call copy-file-to-target) $(call copy-file-to-target)
endif # LOCAL_DEX_PREOPT
else # ! prebuilt_module_is_dex_javalib else # ! prebuilt_module_is_dex_javalib
$(built_module) : $(my_prebuilt_src_file) $(built_module) : $(my_prebuilt_src_file)

View File

@ -538,15 +538,6 @@ endif
ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) ifeq (true, $(LOCAL_UNCOMPRESS_DEX))
$(LOCAL_BUILT_MODULE) : $(ZIP2ZIP) $(LOCAL_BUILT_MODULE) : $(ZIP2ZIP)
endif endif
ifneq ($(BUILD_PLATFORM_ZIP),)
$(LOCAL_BUILT_MODULE) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package.dex.apk
endif
ifdef LOCAL_DEX_PREOPT
$(LOCAL_BUILT_MODULE) : PRIVATE_STRIP_SCRIPT := $(intermediates)/strip.sh
$(LOCAL_BUILT_MODULE) : $(intermediates)/strip.sh
$(LOCAL_BUILT_MODULE) : | $(DEXPREOPT_STRIP_DEPS)
$(LOCAL_BUILT_MODULE): .KATI_DEPFILE := $(LOCAL_BUILT_MODULE).d
endif
$(LOCAL_BUILT_MODULE): PRIVATE_USE_EMBEDDED_NATIVE_LIBS := $(LOCAL_USE_EMBEDDED_NATIVE_LIBS) $(LOCAL_BUILT_MODULE): PRIVATE_USE_EMBEDDED_NATIVE_LIBS := $(LOCAL_USE_EMBEDDED_NATIVE_LIBS)
$(LOCAL_BUILT_MODULE): $(LOCAL_BUILT_MODULE):
@echo "target Package: $(PRIVATE_MODULE) ($@)" @echo "target Package: $(PRIVATE_MODULE) ($@)"
@ -569,19 +560,11 @@ ifeq (true, $(LOCAL_UNCOMPRESS_DEX))
@# No need to align, sign-package below will do it. @# No need to align, sign-package below will do it.
$(uncompress-dexs) $(uncompress-dexs)
endif endif
# Run appcompat before stripping the classes.dex file. # Run appcompat before signing.
ifeq ($(module_run_appcompat),true) ifeq ($(module_run_appcompat),true)
$(appcompat-header) $(appcompat-header)
$(run-appcompat) $(run-appcompat)
endif # module_run_appcompat endif # module_run_appcompat
ifdef LOCAL_DEX_PREOPT
ifneq ($(BUILD_PLATFORM_ZIP),)
@# Keep a copy of apk with classes.dex unstripped
$(hide) cp -f $@ $(dir $@)package.dex.apk
endif # BUILD_PLATFORM_ZIP
mv -f $@ $@.tmp
$(PRIVATE_STRIP_SCRIPT) $@.tmp $@
endif # LOCAL_DEX_PREOPT
$(sign-package) $(sign-package)
ifdef LOCAL_COMPRESSED_MODULE ifdef LOCAL_COMPRESSED_MODULE
$(compress-package) $(compress-package)

View File

@ -97,10 +97,6 @@ endif # LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE
java-dex: $(LOCAL_SOONG_DEX_JAR) java-dex: $(LOCAL_SOONG_DEX_JAR)
ifneq ($(BUILD_PLATFORM_ZIP),)
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(dir $(LOCAL_BUILT_MODULE))package.dex.apk))
endif
my_built_installed := $(foreach f,$(LOCAL_SOONG_BUILT_INSTALLED),\ my_built_installed := $(foreach f,$(LOCAL_SOONG_BUILT_INSTALLED),\
$(call word-colon,1,$(f)):$(PRODUCT_OUT)$(call word-colon,2,$(f))) $(call word-colon,1,$(f)):$(PRODUCT_OUT)$(call word-colon,2,$(f)))
my_installed := $(call copy-many-files, $(my_built_installed)) my_installed := $(call copy-many-files, $(my_built_installed))