platform_build/target/product/runtime_libart.mk

181 lines
6.5 KiB
Makefile
Raw Normal View History

#
# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Provides a functioning ART environment without Android frameworks
$(call inherit-product, $(SRC_TARGET_DIR)/product/default_art_config.mk)
# Additional mixins to the boot classpath.
PRODUCT_PACKAGES += \
android.test.base \
# Why are we pulling in ext, which is frameworks/base, depending on tagsoup and nist-sip?
PRODUCT_PACKAGES += \
ext \
# Runtime (Bionic) APEX module.
PRODUCT_PACKAGES += com.android.runtime
# ART APEX module.
#
# Select either release (com.android.art) or debug (com.android.art.debug)
# variant of the ART APEX. By default, "user" build variants contain the release
# module, while the "eng" build variant contain the debug module. However, if
# `PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD` is defined, it overrides the previous
# logic:
# - if `PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD` is set to `false`, the
# build will include the release module (whatever the build
# variant);
# - if `PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD` is set to `true`, the
# build will include the debug module (whatever the build variant).
#
# Note that the ART APEX package includes the minimal boot classpath JARs
# (listed in ART_APEX_JARS), which should no longer be added directly to
# PRODUCT_PACKAGES.
art_target_include_debug_build := $(PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD)
ifneq (false,$(art_target_include_debug_build))
ifneq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
art_target_include_debug_build := true
endif
endif
ifeq (true,$(art_target_include_debug_build))
PRODUCT_PACKAGES += com.android.art.debug
apex_test_module := art-check-debug-apex-gen-fakebin
else
PRODUCT_PACKAGES += com.android.art
apex_test_module := art-check-release-apex-gen-fakebin
endif
ifeq (true,$(call soong_config_get,art_module,source_build))
PRODUCT_HOST_PACKAGES += $(apex_test_module)
endif
art_target_include_debug_build :=
apex_test_module :=
# Certificates.
PRODUCT_PACKAGES += \
cacerts \
PRODUCT_PACKAGES += \
hiddenapi-package-whitelist.xml \
Configure boot image profiles for platform and unbundled ART module builds (reland). - Use art/build/boot/boot-image-profile.txt for the primary boot image in the ART module, both when it's built from source in platform and as an unbundled module. - Use frameworks/base/boot/boot-image-profile.txt for the framework extension image in platform, but not in unbundled builds. This should obsolete the combined profile frameworks/base/config/boot-image-profile.txt. This relands https://r.android.com/1881863 with a fix to allow multiple values on PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION. Test: build/soong/soong_ui.bash --dumpvar-mode \ PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION and check that it prints both art/build/boot/boot-image-profile.txt and frameworks/base/boot/boot-image-profile.txt in a platform build on master. Test: build/soong/soong_ui.bash --dumpvar-mode \ PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION and check that it prints only art/build/boot/boot-image-profile.txt in an unbundled build on master-art. Test: banchan com.android.art && m on master-art and check that out/soong/.intermediates/art/build/apex/com.android.art/android_common_com.android.art_image/image.apex/javalib/x86_64/boot.oat shrinks from 14 MB to 4.7. Test: m droid on master together with https://r.android.com/1895131 and check that out/soong/.intermediates/art/build/apex/com.android.art/android_common_com.android.art_image/image.apex/javalib/x86_64/boot.oat and out/target/product/vsoc_x86_64/system/framework/x86_64/boot-framework.oat are identical. Test: lunch armv8-eng && art/tools/buildbot-build.sh on master-art Bug: 174746397 Change-Id: I9114271bc69cf0888150b2c778a086bc50b73045
2021-11-05 19:00:22 +01:00
ifeq (,$(TARGET_BUILD_UNBUNDLED))
# Don't depend on the framework boot image profile in unbundled builds where
# frameworks/base may not be present.
# TODO(b/179900989): We may not need this check once we stop using full
# platform products on the thin ART manifest branch.
PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION += frameworks/base/boot/boot-image-profile.txt
endif
# The dalvik.vm.dexopt.thermal-cutoff property must contain one of the values
# listed here:
#
# https://source.android.com/devices/architecture/hidl/thermal-mitigation#thermal-api
#
# If the thermal status of the device reaches or exceeds the value set here
# background dexopt will be terminated and rescheduled using an exponential
# backoff polcy.
#
# The thermal cutoff value is currently set to THERMAL_STATUS_MODERATE.
PRODUCT_SYSTEM_PROPERTIES += \
dalvik.vm.usejit=true \
dalvik.vm.dexopt.secondary=true \
dalvik.vm.dexopt.thermal-cutoff=2 \
dalvik.vm.appimageformat=lz4
PRODUCT_SYSTEM_PROPERTIES += \
ro.dalvik.vm.native.bridge?=0
# Different dexopt types for different package update/install times.
# On eng builds, make "boot" reasons only extract for faster turnaround.
ifeq (eng,$(TARGET_BUILD_VARIANT))
PRODUCT_SYSTEM_PROPERTIES += \
pm.dexopt.first-boot?=extract \
pm.dexopt.boot-after-ota?=extract
else
PRODUCT_SYSTEM_PROPERTIES += \
pm.dexopt.first-boot?=verify \
pm.dexopt.boot-after-ota?=verify
endif
# The install filter is speed-profile in order to enable the use of
# profiles from the dex metadata files. Note that if a profile is not provided
# or if it is empty speed-profile is equivalent to (quicken + empty app image).
# Note that `cmdline` is not strictly needed but it simplifies the management
# of compilation reason in the platform (as we have a unified, single path,
# without exceptions).
PRODUCT_SYSTEM_PROPERTIES += \
pm.dexopt.post-boot?=extract \
pm.dexopt.boot-after-mainline-update?=verify \
pm.dexopt.install?=speed-profile \
pm.dexopt.install-fast?=skip \
pm.dexopt.install-bulk?=speed-profile \
pm.dexopt.install-bulk-secondary?=verify \
pm.dexopt.install-bulk-downgraded?=verify \
pm.dexopt.install-bulk-secondary-downgraded?=extract \
pm.dexopt.bg-dexopt?=speed-profile \
pm.dexopt.ab-ota?=speed-profile \
pm.dexopt.inactive?=verify \
pm.dexopt.cmdline?=verify \
pm.dexopt.shared?=speed
# Enable resolution of startup const strings.
PRODUCT_SYSTEM_PROPERTIES += \
dalvik.vm.dex2oat-resolve-startup-strings=true
# Specify default block size of 512K to enable parallel image decompression.
PRODUCT_SYSTEM_PROPERTIES += \
dalvik.vm.dex2oat-max-image-block-size=524288
# Enable minidebuginfo generation unless overridden.
PRODUCT_SYSTEM_PROPERTIES += \
dalvik.vm.minidebuginfo=true \
dalvik.vm.dex2oat-minidebuginfo=true
# Enable Madvising of the whole art, odex and vdex files to MADV_WILLNEED.
# The size specified here is the size limit of how much of the file
# (in bytes) is madvised.
# We madvise the whole .art file to MADV_WILLNEED with UINT_MAX limit.
# For odex and vdex files, we limit madvising to 100MB.
PRODUCT_SYSTEM_PROPERTIES += \
dalvik.vm.madvise.vdexfile.size=104857600 \
dalvik.vm.madvise.odexfile.size=104857600 \
dalvik.vm.madvise.artfile.size=4294967295
# Properties for the Unspecialized App Process Pool
PRODUCT_SYSTEM_PROPERTIES += \
dalvik.vm.usap_pool_enabled?=false \
dalvik.vm.usap_refill_threshold?=1 \
dalvik.vm.usap_pool_size_max?=3 \
dalvik.vm.usap_pool_size_min?=1 \
dalvik.vm.usap_pool_refill_delay_ms?=3000
# Allow dexopt files that are side-effects of already allowlisted files.
# This is only necessary when ART is prebuilt.
ifeq (false,$(ART_MODULE_BUILD_FROM_SOURCE))
PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += \
system/framework/%.art \
system/framework/%.oat \
system/framework/%.odex \
system/framework/%.vdex
endif
PRODUCT_SYSTEM_PROPERTIES += \
dalvik.vm.useartservice=true