Merge "dex_preopt: Use the unstripped jar file for generating profiles." into oc-mr1-dev

This commit is contained in:
TreeHugger Robot
2017-08-29 08:43:34 +00:00
committed by Android (Google) Code Review
5 changed files with 24 additions and 2 deletions

View File

@@ -142,16 +142,19 @@ ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE))
ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING
$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING))
endif
ifeq (,$(dex_preopt_profile_src_file))
$(call pretty-error, Internal error: dex_preopt_profile_src_file must be set)
endif
my_built_profile := $(dir $(LOCAL_BUILT_MODULE))/profile.prof
my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))
$(built_odex): $(my_built_profile)
$(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := --profile-file=$(my_built_profile)
$(my_built_profile): PRIVATE_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
$(my_built_profile): PRIVATE_BUILT_MODULE := $(dex_preopt_profile_src_file)
$(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location)
$(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)
$(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)
$(my_built_profile): $(PROFMAN)
$(my_built_profile): $(LOCAL_BUILT_MODULE)
$(my_built_profile): $(dex_preopt_profile_src_file)
$(my_built_profile):
$(hide) mkdir -p $(dir $@)
ANDROID_LOG_TAGS="*:e" $(PROFMAN) \
@@ -159,6 +162,7 @@ $(my_built_profile):
--apk=$(PRIVATE_BUILT_MODULE) \
--dex-location=$(PRIVATE_DEX_LOCATION) \
--reference-profile-file=$@
dex_preopt_profile_src_file:=
my_installed_profile := $(LOCAL_INSTALLED_MODULE).prof
$(eval $(call copy-one-file,$(my_built_profile),$(my_installed_profile)))
build_installed_profile:=$(my_built_profile):$(my_installed_profile)

View File

@@ -381,6 +381,19 @@ include $(BUILD_SYSTEM)/java_common.mk
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_HAS_RS_SOURCES := $(if $(renderscript_sources),true)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RS_SOURCE_INTERMEDIATES_DIR := $(intermediates.COMMON)/renderscript
# Set the profile source so that the odex / profile code included from java.mk
# can find it.
#
# TODO: b/64896089, this is broken when called from package_internal.mk, since the file
# we preopt from is a temporary file. This will be addressed in a follow up, possibly
# by disabling stripping for profile guided preopt (which may be desirable for other
# reasons anyway).
#
# Note that we set this only when called from package_internal.mk and not in other cases.
ifneq (,$(called_from_package_internal)
dex_preopt_profile_src_file := $(LOCAL_BUILT_MODULE)
endif
#######################################
# defines built_odex along with rule to install odex
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk

View File

@@ -44,6 +44,7 @@ endif
# java libraries produce javalib.jar, so we will copy classes.jar there too.
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
common_javalib.jar := $(intermediates.COMMON)/javalib.jar
dex_preopt_profile_src_file := $(common_javalib.jar)
LOCAL_INTERMEDIATE_TARGETS += $(common_javalib.jar)
ifeq ($(LOCAL_PROGUARD_ENABLED),disabled)

View File

@@ -327,9 +327,11 @@ endif
include $(BUILD_SYSTEM)/android_manifest.mk
called_from_package_internal := true
#################################
include $(BUILD_SYSTEM)/java.mk
#################################
called_from_package_internal :=
LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION))
ifeq ($(LOCAL_SDK_RES_VERSION),)

View File

@@ -283,6 +283,8 @@ my_extracted_apk :=
my_extract_apk :=
endif
dex_preopt_profile_src_file := $(my_prebuilt_src_file)
rs_compatibility_jni_libs :=
include $(BUILD_SYSTEM)/install_jni_libs.mk