Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 1 | # Rules to build boot.art |
| 2 | # Input variables: |
| 3 | # my_2nd_arch_prefix: indicates if this is to build for the 2nd arch. |
| 4 | |
| 5 | # The image "location" is a symbolic path that with multiarchitecture |
| 6 | # support doesn't really exist on the device. Typically it is |
| 7 | # /system/framework/boot.art and should be the same for all supported |
| 8 | # architectures on the device. The concrete architecture specific |
| 9 | # content actually ends up in a "filename" that contains an |
| 10 | # architecture specific directory name such as arm, arm64, mips, |
| 11 | # mips64, x86, x86_64. |
| 12 | # |
| 13 | # Here are some example values for an x86_64 / x86 configuration: |
| 14 | # |
| 15 | # DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION=out/target/product/generic_x86_64/dex_bootjars/system/framework/boot.art |
| 16 | # DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME=out/target/product/generic_x86_64/dex_bootjars/system/framework/x86_64/boot.art |
| 17 | # LIBART_BOOT_IMAGE=/system/framework/x86_64/boot.art |
| 18 | # |
| 19 | # 2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION=out/target/product/generic_x86_64/dex_bootjars/system/framework/boot.art |
| 20 | # 2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME=out/target/product/generic_x86_64/dex_bootjars/system/framework/x86/boot.art |
| 21 | # 2ND_LIBART_BOOT_IMAGE=/system/framework/x86/boot.art |
| 22 | |
| 23 | $(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/boot.art |
| 24 | $(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH)/boot.art |
| 25 | $(my_2nd_arch_prefix)LIBART_BOOT_IMAGE_FILENAME := /$(DEXPREOPT_BOOT_JAR_DIR)/$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH)/boot.art |
| 26 | |
| 27 | # The .oat with symbols |
| 28 | $(my_2nd_arch_prefix)LIBART_TARGET_BOOT_OAT_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)$(patsubst %.art,%.oat,$($(my_2nd_arch_prefix)LIBART_BOOT_IMAGE_FILENAME)) |
| 29 | |
| 30 | $(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE := |
| 31 | ifneq ($(PRODUCT_DEX_PREOPT_IMAGE_IN_DATA),true) |
| 32 | $(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE := $(PRODUCT_OUT)$($(my_2nd_arch_prefix)LIBART_BOOT_IMAGE_FILENAME) |
| 33 | endif |
| 34 | |
Igor Murashkin | da9f1a7 | 2014-10-30 16:08:07 -0700 | [diff] [blame] | 35 | # Compile boot.oat as position-independent code if WITH_DEXPREOPT_PIC=true |
| 36 | ifeq (true,$(WITH_DEXPREOPT_PIC)) |
| 37 | PRODUCT_DEX_PREOPT_BOOT_FLAGS += --compile-pic |
| 38 | endif |
| 39 | |
Andreas Gampe | 4fec0bb | 2014-11-18 11:45:10 -0800 | [diff] [blame] | 40 | # If we have a compiled-classes file, create a parameter. |
| 41 | COMPILED_CLASSES_FLAGS := |
| 42 | ifneq ($(COMPILED_CLASSES),) |
| 43 | COMPILED_CLASSES_FLAGS := --compiled-classes=$(COMPILED_CLASSES) |
| 44 | endif |
| 45 | |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 46 | # The rule to install boot.art and boot.oat |
| 47 | $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE) : $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) | $(ACP) |
| 48 | $(call copy-file-to-target) |
| 49 | $(hide) $(ACP) -fp $(patsubst %.art,%.oat,$<) $(patsubst %.art,%.oat,$@) |
| 50 | |
| 51 | $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix) |
| 52 | # Use dex2oat debug version for better error reporting |
| 53 | $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(DEX2OATD_DEPENDENCY) |
| 54 | @echo "target dex2oat: $@ ($?)" |
| 55 | @mkdir -p $(dir $@) |
| 56 | @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED)) |
Colin Cross | dd2ff55 | 2014-07-09 22:09:50 -0700 | [diff] [blame] | 57 | $(hide) $(DEX2OATD) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Brian Carlstrom | cffe289 | 2014-07-08 10:35:29 -0700 | [diff] [blame] | 58 | --image-classes=$(PRELOADED_CLASSES) \ |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 59 | $(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \ |
| 60 | $(addprefix --dex-location=,$(LIBART_TARGET_BOOT_DEX_LOCATIONS)) \ |
| 61 | --oat-symbols=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED) \ |
| 62 | --oat-file=$(patsubst %.art,%.oat,$@) \ |
| 63 | --oat-location=$(patsubst %.art,%.oat,$($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_BOOT_IMAGE_FILENAME)) \ |
| 64 | --image=$@ --base=$(LIBART_IMG_TARGET_BASE_ADDRESS) \ |
| 65 | --instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \ |
| 66 | --instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ |
Ying Wang | 70d617a | 2014-10-07 18:07:23 -0700 | [diff] [blame] | 67 | --android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate --no-include-debug-symbols \ |
Andreas Gampe | 4fec0bb | 2014-11-18 11:45:10 -0800 | [diff] [blame] | 68 | $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(COMPILED_CLASSES_FLAGS) |