Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 17 | ######################################################################## |
Brian Carlstrom | 7ab763c | 2013-12-09 00:38:02 -0800 | [diff] [blame] | 18 | # Rules to build a smaller "core" image to support core libraries |
| 19 | # (that is, non-Android frameworks) testing on the host and target |
| 20 | # |
| 21 | # The main rules to build the default "boot" image are in |
| 22 | # build/core/dex_preopt_libart.mk |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 23 | |
Nicolas Geoffray | 611e1db | 2014-10-09 17:34:45 +0100 | [diff] [blame] | 24 | include art/build/Android.common_build.mk |
Dave Allison | 7020278 | 2013-10-22 17:52:19 -0700 | [diff] [blame] | 25 | |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 26 | LOCAL_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 27 | ifeq ($(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),) |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 28 | LOCAL_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=default |
| 29 | else |
| 30 | LOCAL_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=$(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES) |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 31 | endif |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 32 | LOCAL_$(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 33 | ifeq ($($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),) |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 34 | LOCAL_$(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=default |
| 35 | else |
| 36 | LOCAL_$(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=$($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES) |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 37 | endif |
| 38 | |
Nicolas Geoffray | 1db132d | 2014-03-26 10:56:24 +0000 | [diff] [blame] | 39 | # Use dex2oat debug version for better error reporting |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 40 | # $(1): compiler - optimizing, interpreter or interp-ac (interpreter-access-checks). |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 41 | # $(2): 2ND_ or undefined, 2ND_ for 32-bit host builds. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 42 | define create-core-oat-host-rules |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 43 | core_compile_options := |
| 44 | core_image_name := |
| 45 | core_oat_name := |
| 46 | core_infix := |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 47 | core_dex2oat_dependency := $(DEX2OAT_DEPENDENCY) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 48 | |
| 49 | ifeq ($(1),optimizing) |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 50 | core_compile_options += --compiler-backend=Optimizing |
Nicolas Geoffray | c13f13a | 2015-10-06 12:39:17 +0100 | [diff] [blame] | 51 | core_dex2oat_dependency := $(DEX2OAT) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 52 | endif |
| 53 | ifeq ($(1),interpreter) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 54 | core_compile_options += --compiler-filter=quicken |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 55 | core_infix := -interpreter |
| 56 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 57 | ifeq ($(1),interp-ac) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 58 | core_compile_options += --compiler-filter=extract --runtime-arg -Xverify:softfail |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 59 | core_infix := -interp-ac |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 60 | endif |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 61 | ifneq ($(filter-out interpreter interp-ac optimizing,$(1)),) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 62 | #Technically this test is not precise, but hopefully good enough. |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 63 | $$(error found $(1) expected interpreter, interp-ac, or optimizing) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 64 | endif |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 65 | |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 66 | core_image_location := $(HOST_OUT_JAVA_LIBRARIES)/core$$(core_infix)$(CORE_IMG_SUFFIX) |
Vladimir Marko | 4519b9d | 2018-10-10 15:21:21 +0100 | [diff] [blame] | 67 | core_image_name := $($(2)HOST_CORE_IMG_OUT_BASE)$$(core_infix)$(CORE_IMG_SUFFIX) |
| 68 | core_oat_name := $($(2)HOST_CORE_OAT_OUT_BASE)$$(core_infix)$(CORE_OAT_SUFFIX) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 69 | |
| 70 | # Using the bitness suffix makes it easier to add as a dependency for the run-test mk. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 71 | ifeq ($(2),) |
Vladimir Marko | 4519b9d | 2018-10-10 15:21:21 +0100 | [diff] [blame] | 72 | HOST_CORE_IMAGE_$(1)_64 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 73 | else |
Vladimir Marko | 4519b9d | 2018-10-10 15:21:21 +0100 | [diff] [blame] | 74 | HOST_CORE_IMAGE_$(1)_32 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 75 | endif |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 76 | HOST_CORE_IMG_OUTS += $$(core_image_name) |
| 77 | HOST_CORE_OAT_OUTS += $$(core_oat_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 78 | |
| 79 | $$(core_image_name): PRIVATE_CORE_COMPILE_OPTIONS := $$(core_compile_options) |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 80 | $$(core_image_name): PRIVATE_CORE_IMAGE_LOCATION := $$(core_image_location) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 81 | $$(core_image_name): PRIVATE_CORE_IMG_NAME := $$(core_image_name) |
| 82 | $$(core_image_name): PRIVATE_CORE_OAT_NAME := $$(core_oat_name) |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 83 | # In addition to the primary core image containing HOST_CORE_IMG_DEX_FILES, |
| 84 | # also build a boot image extension for the remaining HOST_CORE_DEX_FILES. |
| 85 | $$(core_image_name): $$(HOST_CORE_DEX_LOCATIONS) $$(core_dex2oat_dependency) |
Shinichiro Hamaji | c5d2905 | 2015-12-18 15:51:51 +0900 | [diff] [blame] | 86 | @echo "host dex2oat: $$@" |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 87 | @mkdir -p $$(dir $$@) |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 88 | $$(hide) ANDROID_LOG_TAGS="*:e" $$(DEX2OAT) \ |
| 89 | --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 90 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 91 | $$(addprefix --dex-file=,$$(HOST_CORE_IMG_DEX_FILES)) \ |
| 92 | $$(addprefix --dex-location=,$$(HOST_CORE_IMG_DEX_LOCATIONS)) \ |
| 93 | --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 94 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) \ |
| 95 | --image=$$(PRIVATE_CORE_IMG_NAME) \ |
| 96 | --base=$$(LIBART_IMG_HOST_BASE_ADDRESS) \ |
| 97 | --instruction-set=$$($(2)ART_HOST_ARCH) \ |
| 98 | $$(LOCAL_$(2)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION) \ |
| 99 | --host --android-root=$$(HOST_OUT) \ |
| 100 | --generate-debug-info --generate-build-id \ |
| 101 | --runtime-arg -XX:SlowDebug=true \ |
| 102 | --no-inline-from=core-oj-hostdex.jar \ |
| 103 | $$(PRIVATE_CORE_COMPILE_OPTIONS) && \ |
| 104 | ANDROID_LOG_TAGS="*:e" $$(DEX2OAT) \ |
| 105 | --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
| 106 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
| 107 | --runtime-arg -Xbootclasspath:$$(subst $$(space),:,$$(strip \ |
| 108 | $$(HOST_CORE_DEX_FILES))) \ |
| 109 | --runtime-arg -Xbootclasspath-locations:$$(subst $$(space),:,$$(strip \ |
| 110 | $$(HOST_CORE_DEX_LOCATIONS))) \ |
| 111 | $$(addprefix --dex-file=, \ |
| 112 | $$(filter-out $$(HOST_CORE_IMG_DEX_FILES),$$(HOST_CORE_DEX_FILES))) \ |
| 113 | $$(addprefix --dex-location=, \ |
| 114 | $$(filter-out $$(HOST_CORE_IMG_DEX_LOCATIONS),$$(HOST_CORE_DEX_LOCATIONS))) \ |
| 115 | --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
| 116 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) \ |
| 117 | --boot-image=$$(PRIVATE_CORE_IMAGE_LOCATION) \ |
| 118 | --image=$$(PRIVATE_CORE_IMG_NAME) \ |
| 119 | --instruction-set=$$($(2)ART_HOST_ARCH) \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 120 | $$(LOCAL_$(2)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION) \ |
Richard Uhler | 556cba0 | 2017-02-28 17:06:29 +0000 | [diff] [blame] | 121 | --host --android-root=$$(HOST_OUT) \ |
Vladimir Marko | a2da9b9 | 2018-10-10 14:21:55 +0100 | [diff] [blame] | 122 | --generate-debug-info --generate-build-id \ |
Andreas Gampe | e8f74ca | 2018-01-02 09:26:16 -0800 | [diff] [blame] | 123 | --runtime-arg -XX:SlowDebug=true \ |
Vladimir Marko | 4519b9d | 2018-10-10 15:21:21 +0100 | [diff] [blame] | 124 | --no-inline-from=core-oj-hostdex.jar \ |
| 125 | $$(PRIVATE_CORE_COMPILE_OPTIONS) |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 126 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 127 | $$(core_oat_name): $$(core_image_name) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 128 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 129 | # Clean up locally used variables. |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 130 | core_dex2oat_dependency := |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 131 | core_compile_options := |
| 132 | core_image_name := |
| 133 | core_oat_name := |
| 134 | core_infix := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 135 | endef # create-core-oat-host-rules |
| 136 | |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 137 | # $(1): compiler - optimizing, interpreter or interp-ac (interpreter-access-checks). |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 138 | define create-core-oat-host-rule-combination |
Vladimir Marko | 4519b9d | 2018-10-10 15:21:21 +0100 | [diff] [blame] | 139 | $(call create-core-oat-host-rules,$(1),) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 140 | |
| 141 | ifneq ($(HOST_PREFER_32_BIT),true) |
Vladimir Marko | 4519b9d | 2018-10-10 15:21:21 +0100 | [diff] [blame] | 142 | $(call create-core-oat-host-rules,$(1),2ND_) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 143 | endif |
| 144 | endef |
| 145 | |
Vladimir Marko | 4519b9d | 2018-10-10 15:21:21 +0100 | [diff] [blame] | 146 | $(eval $(call create-core-oat-host-rule-combination,optimizing)) |
| 147 | $(eval $(call create-core-oat-host-rule-combination,interpreter)) |
| 148 | $(eval $(call create-core-oat-host-rule-combination,interp-ac)) |
Brian Carlstrom | 2b7cdf4 | 2011-10-13 11:18:28 -0700 | [diff] [blame] | 149 | |
Dan Willemsen | d60f5a2 | 2018-07-24 14:45:33 -0700 | [diff] [blame] | 150 | .PHONY: test-art-host-dex2oat-host |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 151 | test-art-host-dex2oat-host: $(HOST_CORE_IMG_OUTS) |
| 152 | |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 153 | # $(1): compiler - optimizing, interpreter or interp-ac (interpreter-access-checks). |
| 154 | # $(2): 2ND_ or undefined |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 155 | define create-core-oat-target-rules |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 156 | core_compile_options := |
| 157 | core_image_name := |
| 158 | core_oat_name := |
| 159 | core_infix := |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 160 | core_dex2oat_dependency := $(DEX2OAT_DEPENDENCY) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 161 | |
| 162 | ifeq ($(1),optimizing) |
Serban Constantinescu | 010cf91 | 2014-12-04 18:12:21 +0000 | [diff] [blame] | 163 | core_compile_options += --compiler-backend=Optimizing |
Nicolas Geoffray | 7701d10 | 2015-10-05 09:51:36 +0100 | [diff] [blame] | 164 | # With the optimizing compiler, we want to rerun dex2oat whenever there is |
| 165 | # a dex2oat change to catch regressions early. |
| 166 | core_dex2oat_dependency := $(DEX2OAT) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 167 | endif |
| 168 | ifeq ($(1),interpreter) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 169 | core_compile_options += --compiler-filter=quicken |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 170 | core_infix := -interpreter |
| 171 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 172 | ifeq ($(1),interp-ac) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 173 | core_compile_options += --compiler-filter=extract --runtime-arg -Xverify:softfail |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 174 | core_infix := -interp-ac |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 175 | endif |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 176 | ifneq ($(filter-out interpreter interp-ac optimizing,$(1)),) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 177 | # Technically this test is not precise, but hopefully good enough. |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 178 | $$(error found $(1) expected interpreter, interp-ac, or optimizing) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 179 | endif |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 180 | |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 181 | core_image_location := $(ART_TARGET_TEST_OUT)/core$$(core_infix)$(CORE_IMG_SUFFIX) |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 182 | core_image_name := $($(2)TARGET_CORE_IMG_OUT_BASE)$$(core_infix)$(CORE_IMG_SUFFIX) |
| 183 | core_oat_name := $($(2)TARGET_CORE_OAT_OUT_BASE)$$(core_infix)$(CORE_OAT_SUFFIX) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 184 | |
| 185 | # Using the bitness suffix makes it easier to add as a dependency for the run-test mk. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 186 | ifeq ($(2),) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 187 | ifdef TARGET_2ND_ARCH |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 188 | TARGET_CORE_IMAGE_$(1)_64 := $$(core_image_name) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 189 | else |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 190 | TARGET_CORE_IMAGE_$(1)_32 := $$(core_image_name) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 191 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 192 | else |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 193 | TARGET_CORE_IMAGE_$(1)_32 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 194 | endif |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 195 | TARGET_CORE_IMG_OUTS += $$(core_image_name) |
| 196 | TARGET_CORE_OAT_OUTS += $$(core_oat_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 197 | |
| 198 | $$(core_image_name): PRIVATE_CORE_COMPILE_OPTIONS := $$(core_compile_options) |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 199 | $$(core_image_name): PRIVATE_CORE_IMAGE_LOCATION := $$(core_image_location) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 200 | $$(core_image_name): PRIVATE_CORE_IMG_NAME := $$(core_image_name) |
| 201 | $$(core_image_name): PRIVATE_CORE_OAT_NAME := $$(core_oat_name) |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 202 | # In addition to the primary core image containing TARGET_CORE_IMG_DEX_FILES, |
| 203 | # also build a boot image extension for the remaining TARGET_CORE_DEX_FILES. |
| 204 | $$(core_image_name): $$(TARGET_CORE_DEX_FILES) $$(core_dex2oat_dependency) |
Shinichiro Hamaji | c5d2905 | 2015-12-18 15:51:51 +0900 | [diff] [blame] | 205 | @echo "target dex2oat: $$@" |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 206 | @mkdir -p $$(dir $$@) |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 207 | $$(hide) $$(DEX2OAT) \ |
| 208 | --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 209 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 210 | $$(addprefix --dex-file=,$$(TARGET_CORE_IMG_DEX_FILES)) \ |
| 211 | $$(addprefix --dex-location=,$$(TARGET_CORE_IMG_DEX_LOCATIONS)) \ |
| 212 | --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 213 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) \ |
| 214 | --image=$$(PRIVATE_CORE_IMG_NAME) \ |
| 215 | --base=$$(LIBART_IMG_TARGET_BASE_ADDRESS) \ |
| 216 | --instruction-set=$$($(2)TARGET_ARCH) \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 217 | --instruction-set-variant=$$($(2)DEX2OAT_TARGET_CPU_VARIANT) \ |
| 218 | --instruction-set-features=$$($(2)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ |
Richard Uhler | 556cba0 | 2017-02-28 17:06:29 +0000 | [diff] [blame] | 219 | --android-root=$$(PRODUCT_OUT)/system \ |
Vladimir Marko | a2da9b9 | 2018-10-10 14:21:55 +0100 | [diff] [blame] | 220 | --generate-debug-info --generate-build-id \ |
Andreas Gampe | e8f74ca | 2018-01-02 09:26:16 -0800 | [diff] [blame] | 221 | --runtime-arg -XX:SlowDebug=true \ |
Vladimir Marko | 2191069 | 2019-11-06 13:27:03 +0000 | [diff] [blame] | 222 | $$(PRIVATE_CORE_COMPILE_OPTIONS) && \ |
| 223 | $$(DEX2OAT) \ |
| 224 | --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
| 225 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
| 226 | --runtime-arg -Xbootclasspath:$$(subst $$(space),:,$$(strip \ |
| 227 | $$(TARGET_CORE_DEX_FILES))) \ |
| 228 | --runtime-arg -Xbootclasspath-locations:$$(subst $$(space),:,$$(strip \ |
| 229 | $$(TARGET_CORE_DEX_LOCATIONS))) \ |
| 230 | $$(addprefix --dex-file=, \ |
| 231 | $$(filter-out $$(TARGET_CORE_IMG_DEX_FILES),$$(TARGET_CORE_DEX_FILES))) \ |
| 232 | $$(addprefix --dex-location=, \ |
| 233 | $$(filter-out $$(TARGET_CORE_IMG_DEX_LOCATIONS),$$(TARGET_CORE_DEX_LOCATIONS))) \ |
| 234 | --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
| 235 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) \ |
| 236 | --boot-image=$$(PRIVATE_CORE_IMAGE_LOCATION) \ |
| 237 | --image=$$(PRIVATE_CORE_IMG_NAME) \ |
| 238 | --instruction-set=$$($(2)TARGET_ARCH) \ |
| 239 | --instruction-set-variant=$$($(2)DEX2OAT_TARGET_CPU_VARIANT) \ |
| 240 | --instruction-set-features=$$($(2)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ |
| 241 | --android-root=$$(PRODUCT_OUT)/system \ |
| 242 | --generate-debug-info --generate-build-id \ |
| 243 | --runtime-arg -XX:SlowDebug=true \ |
| 244 | $$(PRIVATE_CORE_COMPILE_OPTIONS) || \ |
| 245 | (rm $$(PRIVATE_CORE_OAT_NAME); exit 1) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 246 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 247 | $$(core_oat_name): $$(core_image_name) |
Andreas Gampe | 2fe0792 | 2014-04-21 07:50:39 -0700 | [diff] [blame] | 248 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 249 | # Clean up locally used variables. |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 250 | core_dex2oat_dependency := |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 251 | core_compile_options := |
| 252 | core_image_name := |
| 253 | core_oat_name := |
| 254 | core_infix := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 255 | endef # create-core-oat-target-rules |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 256 | |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 257 | # $(1): compiler - optimizing, interpreter or interp-ac (interpreter-access-checks). |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 258 | define create-core-oat-target-rule-combination |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 259 | $(call create-core-oat-target-rules,$(1),) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 260 | |
| 261 | ifdef TARGET_2ND_ARCH |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 262 | $(call create-core-oat-target-rules,$(1),2ND_) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 263 | endif |
| 264 | endef |
| 265 | |
Roland Levillain | 05e34f4 | 2018-05-24 13:19:05 +0000 | [diff] [blame] | 266 | $(eval $(call create-core-oat-target-rule-combination,optimizing)) |
| 267 | $(eval $(call create-core-oat-target-rule-combination,interpreter)) |
| 268 | $(eval $(call create-core-oat-target-rule-combination,interp-ac)) |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 269 | |
| 270 | # Define a default core image that can be used for things like gtests that |
| 271 | # need some image to run, but don't otherwise care which image is used. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 272 | HOST_CORE_IMAGE_DEFAULT_32 := $(HOST_CORE_IMAGE_optimizing_32) |
| 273 | HOST_CORE_IMAGE_DEFAULT_64 := $(HOST_CORE_IMAGE_optimizing_64) |
| 274 | TARGET_CORE_IMAGE_DEFAULT_32 := $(TARGET_CORE_IMAGE_optimizing_32) |
| 275 | TARGET_CORE_IMAGE_DEFAULT_64 := $(TARGET_CORE_IMAGE_optimizing_64) |