2013-11-15 08:44:56 +01:00
|
|
|
####################################
|
|
|
|
# dexpreopt support for ART
|
|
|
|
#
|
|
|
|
####################################
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# The full system boot classpath
|
|
|
|
|
2018-08-28 14:18:25 +02:00
|
|
|
LIBART_TARGET_BOOT_JARS := $(DEXPREOPT_BOOT_JARS_MODULES)
|
2019-01-15 12:46:32 +01:00
|
|
|
LIBART_TARGET_BOOT_DEX_LOCATIONS := $(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS)
|
|
|
|
LIBART_TARGET_BOOT_DEX_FILES := $(foreach mod,$(NON_UPDATABLE_BOOT_MODULES),$(call intermediates-dir-for,JAVA_LIBRARIES,$(mod),,COMMON)/javalib.jar)
|
2013-11-15 08:44:56 +01:00
|
|
|
|
2019-01-23 17:07:02 +01:00
|
|
|
# Copy the files to a location Soong dex preopt will look at.
|
|
|
|
$(foreach mod,$(LIBART_TARGET_BOOT_JARS),$(eval $(call copy-one-file,$(call intermediates-dir-for,JAVA_LIBRARIES,$(mod),,COMMON)/javalib.jar,$(DEXPREOPT_BOOT_JARS_INPUT_PATH)/$(mod).jar)))
|
|
|
|
|
2016-03-08 22:21:49 +01:00
|
|
|
# dex preopt on the bootclasspath produces multiple files. The first dex file
|
|
|
|
# is converted into to boot.art (to match the legacy assumption that boot.art
|
|
|
|
# exists), and the rest are converted to boot-<name>.art.
|
|
|
|
# In addition, each .art file has an associated .oat file.
|
2018-09-26 13:57:21 +02:00
|
|
|
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
|
2017-08-16 10:28:05 +02:00
|
|
|
LIBART_TARGET_BOOT_ART_VDEX_FILES := $(foreach jar,$(wordlist 2,999,$(LIBART_TARGET_BOOT_JARS)),boot-$(jar).vdex)
|
|
|
|
LIBART_TARGET_BOOT_ART_VDEX_FILES += boot.vdex
|
2016-03-08 22:21:49 +01:00
|
|
|
|
2017-06-29 03:23:37 +02:00
|
|
|
# If we use a boot image profile.
|
|
|
|
my_use_profile_for_boot_image := $(PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE)
|
|
|
|
ifeq (,$(my_use_profile_for_boot_image))
|
2017-10-25 00:22:57 +02:00
|
|
|
# If not set, set the default to true if we are not a PDK build. PDK builds
|
|
|
|
# can't build the profile since they don't have frameworks/base.
|
|
|
|
ifneq (true,$(TARGET_BUILD_PDK))
|
2017-08-29 03:42:02 +02:00
|
|
|
my_use_profile_for_boot_image := true
|
2017-06-29 03:23:37 +02:00
|
|
|
endif
|
2017-10-25 00:22:57 +02:00
|
|
|
endif
|
2018-06-20 08:03:34 +02:00
|
|
|
ifeq (,$(strip $(LIBART_TARGET_BOOT_DEX_FILES)))
|
|
|
|
my_use_profile_for_boot_image := false
|
|
|
|
endif
|
2017-06-29 03:23:37 +02:00
|
|
|
|
|
|
|
ifeq (true,$(my_use_profile_for_boot_image))
|
|
|
|
|
2018-07-02 12:51:49 +02:00
|
|
|
boot_image_profiles := $(PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION)
|
|
|
|
|
|
|
|
ifeq (,$(boot_image_profiles))
|
2017-06-29 03:23:37 +02:00
|
|
|
# If not set, use the default.
|
2018-07-02 12:51:49 +02:00
|
|
|
boot_image_profiles := frameworks/base/config/boot-image-profile.txt
|
2017-06-29 03:23:37 +02:00
|
|
|
endif
|
|
|
|
|
2018-07-02 12:51:49 +02:00
|
|
|
# Location of text based profile for the boot image.
|
|
|
|
my_boot_image_profile_location := $(PRODUCT_OUT)/dex_bootjars/boot-image-profile.txt
|
|
|
|
|
|
|
|
$(my_boot_image_profile_location): $(boot_image_profiles)
|
|
|
|
@echo 'Generating $@ for profman'
|
|
|
|
@rm -rf $@
|
|
|
|
$(hide) cat $^ > $@
|
|
|
|
|
2017-06-29 03:23:37 +02:00
|
|
|
# Code to create the boot image profile, not in dex_preopt_libart_boot.mk since the profile is the same for all archs.
|
|
|
|
my_out_boot_image_profile_location := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/boot.prof
|
|
|
|
$(my_out_boot_image_profile_location): PRIVATE_PROFILE_INPUT_LOCATION := $(my_boot_image_profile_location)
|
|
|
|
$(my_out_boot_image_profile_location): $(PROFMAN) $(LIBART_TARGET_BOOT_DEX_FILES) $(my_boot_image_profile_location)
|
|
|
|
@echo "target profman: $@"
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
ANDROID_LOG_TAGS="*:e" $(PROFMAN) \
|
|
|
|
--create-profile-from=$(PRIVATE_PROFILE_INPUT_LOCATION) \
|
|
|
|
$(addprefix --apk=,$(LIBART_TARGET_BOOT_DEX_FILES)) \
|
|
|
|
$(addprefix --dex-location=,$(LIBART_TARGET_BOOT_DEX_LOCATIONS)) \
|
|
|
|
--reference-profile-file=$@
|
|
|
|
|
|
|
|
# We want to install the profile even if we are not using preopt since it is required to generate
|
|
|
|
# the image on the device.
|
|
|
|
my_installed_profile := $(TARGET_OUT)/etc/boot-image.prof
|
|
|
|
$(eval $(call copy-one-file,$(my_out_boot_image_profile_location),$(my_installed_profile)))
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(my_installed_profile)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2017-08-16 10:28:05 +02:00
|
|
|
LIBART_TARGET_BOOT_ART_VDEX_INSTALLED_SHARED_FILES := $(addprefix $(PRODUCT_OUT)/$(DEXPREOPT_BOOT_JAR_DIR)/,$(LIBART_TARGET_BOOT_ART_VDEX_FILES))
|
|
|
|
|
2014-05-13 22:57:28 +02:00
|
|
|
my_2nd_arch_prefix :=
|
|
|
|
include $(BUILD_SYSTEM)/dex_preopt_libart_boot.mk
|
|
|
|
|
2016-03-17 03:53:19 +01:00
|
|
|
ifneq ($(TARGET_TRANSLATE_2ND_ARCH),true)
|
2014-05-13 22:57:28 +02:00
|
|
|
ifdef TARGET_2ND_ARCH
|
|
|
|
my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
|
|
|
|
include $(BUILD_SYSTEM)/dex_preopt_libart_boot.mk
|
|
|
|
endif
|
2016-03-17 03:53:19 +01:00
|
|
|
endif
|
2013-11-15 08:44:56 +01:00
|
|
|
|
2017-08-16 10:28:05 +02:00
|
|
|
# Copy shared vdex to the directory and create corresponding symlinks in primary and secondary arch.
|
|
|
|
$(LIBART_TARGET_BOOT_ART_VDEX_INSTALLED_SHARED_FILES) : PRIMARY_ARCH_DIR := $(dir $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE))
|
|
|
|
$(LIBART_TARGET_BOOT_ART_VDEX_INSTALLED_SHARED_FILES) : SECOND_ARCH_DIR := $(dir $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE))
|
|
|
|
$(LIBART_TARGET_BOOT_ART_VDEX_INSTALLED_SHARED_FILES) : $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME)
|
|
|
|
@echo "Install: $@"
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@rm -f $@
|
|
|
|
$(hide) cp "$(dir $<)$(notdir $@)" "$@"
|
|
|
|
# Make symlink for both the archs. In the case its single arch the symlink will just get overridden.
|
|
|
|
@mkdir -p $(PRIMARY_ARCH_DIR)
|
|
|
|
$(hide) ln -sf /$(DEXPREOPT_BOOT_JAR_DIR)/$(notdir $@) $(PRIMARY_ARCH_DIR)$(notdir $@)
|
|
|
|
@mkdir -p $(SECOND_ARCH_DIR)
|
|
|
|
$(hide) ln -sf /$(DEXPREOPT_BOOT_JAR_DIR)/$(notdir $@) $(SECOND_ARCH_DIR)$(notdir $@)
|
|
|
|
|
|
|
|
my_2nd_arch_prefix :=
|