platform_build/core/dex_preopt.mk

165 lines
8.3 KiB
Makefile
Raw Normal View History

####################################
# dexpreopt support - typically used on user builds to run dexopt (for Dalvik) or dex2oat (for ART) ahead of time
#
####################################
include $(BUILD_SYSTEM)/dex_preopt_config.mk
# Method returning whether the install path $(1) should be for system_other.
# Under SANITIZE_LITE, we do not want system_other. Just put things under /data/asan.
ifeq ($(SANITIZE_LITE),true)
install-on-system-other =
else
install-on-system-other = $(filter-out $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(basename $(notdir $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(1)))))
endif
# We want to install the profile even if we are not using preopt since it is required to generate
# the image on the device.
ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED),$(PRODUCT_OUT))
# Install boot images. Note that there can be multiple.
my_boot_image_arch := TARGET_ARCH
my_boot_image_out := $(PRODUCT_OUT)
my_boot_image_syms := $(TARGET_OUT_UNSTRIPPED)
DEFAULT_DEX_PREOPT_INSTALLED_IMAGE_MODULE := \
$(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(strip \
$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
$(my_boot_image_module)))
ifdef TARGET_2ND_ARCH
my_boot_image_arch := TARGET_2ND_ARCH
2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE_MODULE := \
$(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(strip \
$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
$(my_boot_image_module)))
endif
# Install boot images for testing on host. We exclude framework image as it is not part of art manifest.
my_boot_image_arch := HOST_ARCH
my_boot_image_out := $(HOST_OUT)
my_boot_image_syms := $(HOST_OUT)/symbols
HOST_BOOT_IMAGE_MODULE := \
$(foreach my_boot_image_name,art_host,$(strip \
$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
$(my_boot_image_module)))
HOST_BOOT_IMAGE := $(call module-installed-files,$(HOST_BOOT_IMAGE_MODULE))
ifdef HOST_2ND_ARCH
my_boot_image_arch := HOST_2ND_ARCH
2ND_HOST_BOOT_IMAGE_MODULE := \
$(foreach my_boot_image_name,art_host,$(strip \
$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
$(my_boot_image_module)))
2ND_HOST_BOOT_IMAGE := $(call module-installed-files,$(2ND_HOST_BOOT_IMAGE_MODULE))
endif
my_boot_image_arch :=
my_boot_image_out :=
my_boot_image_syms :=
my_boot_image_module :=
# Build the boot.zip which contains the boot jars and their compilation output
# We can do this only if preopt is enabled and if the product uses libart config (which sets the
# default properties for preopting).
Determine GC type based on BUILT_KERNEL_VERSION_FILE. How it works: 1. build/make/core/Makefile generates a txt file with the kernel version, which is taken from an explicit BOARD_KERNEL_VERSION value, or extracted from the kernel image on the source tree, or extracted from the kernel image extracted from the prebuilt boot.img. The file is saved at $ANDROID_PRODUCT_OUT/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt. 2. If PRODUCT_ENABLE_UFFD_GC is "default", meaning the GC type needs to be determined by the kernel version, build/make/core/Makefile copies kernel_version.txt to out/soong/dexpreopt/kernel_version_for_uffd_gc.txt. 3. build/soong/dexpreopt/config.go writes the the UFFD GC flag to out/soong/dexpreopt/uffd_gc_flag.txt. The flag is determined by an explicit PRODUCT_ENABLE_UFFD_GC value or by contruct_uffd_gc_flag.py, which reads kernel_version_for_uffd_gc.txt and determines the flag accordingly. 4. dex2oat takes the UFFD GC flag from uffd_gc_flag.txt. 5. post_process_props.py mangles ro.dalvik.vm.enable_uffd_gc based on the same logic. Bug: 321751629 Bug: 319554951 Bug: 318763448 Bug: 319648491 Test: m --no-skip-soong-tests nothing Test: atest uffd_gc_utils_test Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with no UFFD support - 1. Check the existence of `-Xgc:CMC` in out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.invocation (dex2oat invocation for a boot image) 2. Check the existence of `-Xgc:CMC` in out/soong/.intermediates/packages/apps/Settings/Settings/android_common/dexpreopt/Settings/oat/arm64/package.invocation (dex2oat invocation for an app defined in .bp) 3. Check the existence of `-Xgc:CMC` in $ANDROID_PRODUCT_OUT/obj/APPS/Dialer_intermediates/oat/arm64/package.invocation (dex2oat invocation for an app defined in .mk) 4. Check the value of ro.dalvik.vm.enable_uffd_gc in $ANDROID_PRODUCT_OUT/product/etc/build.prop Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with UFFD support, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=true m`, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=false m`, and do the steps above. Change-Id: I8df6e5be1644da05d2d5c57b3520f29601dfd7a4
2024-01-18 18:22:13 +01:00
# At the time of writing, this is only for ART Cloud.
ifeq ($(WITH_DEXPREOPT), true)
ifneq ($(WITH_DEXPREOPT_ART_BOOT_IMG_ONLY), true)
ifeq ($(PRODUCT_USES_DEFAULT_ART_CONFIG), true)
boot_zip := $(PRODUCT_OUT)/boot.zip
bootclasspath_jars := $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)
# TODO remove system_server_jars usages from boot.zip and depend directly on system_server.zip file.
# Use "/system" path for JARs with "platform:" prefix.
# These JARs counterintuitively use "platform" prefix but they will
# be actually installed to /system partition.
platform_system_server_jars = $(filter platform:%, $(PRODUCT_SYSTEM_SERVER_JARS))
system_server_jars := \
$(foreach m,$(platform_system_server_jars),\
$(PRODUCT_OUT)/system/framework/$(call word-colon,2,$(m)).jar)
# For the remaining system server JARs use the partition signified by the prefix.
# For example, prefix "system_ext:" will use "/system_ext" path.
other_system_server_jars = $(filter-out $(platform_system_server_jars), $(PRODUCT_SYSTEM_SERVER_JARS))
system_server_jars += \
$(foreach m,$(other_system_server_jars),\
$(PRODUCT_OUT)/$(call word-colon,1,$(m))/framework/$(call word-colon,2,$(m)).jar)
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
# Infix can be 'art' (ART image for testing), 'boot' (primary), or 'mainline' (mainline extension).
# Soong creates a set of variables for Make, one or each boot image. The only reason why the ART
# image is exposed to Make is testing (art gtests) and benchmarking (art golem benchmarks). Install
# rules that use those variables are in dex_preopt_libart.mk. Here for dexpreopt purposes the infix
# is always 'boot' or 'mainline'.
DEXPREOPT_INFIX := $(if $(filter true,$(DEX_PREOPT_WITH_UPDATABLE_BCP)),mainline,boot)
# The input variables are written by build/soong/java/dexpreopt_bootjars.go. Examples can be found
# at the bottom of build/soong/java/dexpreopt_config_testing.go.
dexpreopt_root_dir := $(dir $(patsubst %/,%,$(dir $(firstword $(bootclasspath_jars)))))
bootclasspath_arg := $(subst $(space),:,$(patsubst $(dexpreopt_root_dir)%,%,$(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)))
bootclasspath_locations_arg := $(subst $(space),:,$(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS))
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
boot_images := $(subst :,$(space),$(DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE$(DEXPREOPT_INFIX)))
boot_image_arg := $(subst $(space),:,$(patsubst /%,%,$(boot_images)))
Determine GC type based on BUILT_KERNEL_VERSION_FILE. How it works: 1. build/make/core/Makefile generates a txt file with the kernel version, which is taken from an explicit BOARD_KERNEL_VERSION value, or extracted from the kernel image on the source tree, or extracted from the kernel image extracted from the prebuilt boot.img. The file is saved at $ANDROID_PRODUCT_OUT/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt. 2. If PRODUCT_ENABLE_UFFD_GC is "default", meaning the GC type needs to be determined by the kernel version, build/make/core/Makefile copies kernel_version.txt to out/soong/dexpreopt/kernel_version_for_uffd_gc.txt. 3. build/soong/dexpreopt/config.go writes the the UFFD GC flag to out/soong/dexpreopt/uffd_gc_flag.txt. The flag is determined by an explicit PRODUCT_ENABLE_UFFD_GC value or by contruct_uffd_gc_flag.py, which reads kernel_version_for_uffd_gc.txt and determines the flag accordingly. 4. dex2oat takes the UFFD GC flag from uffd_gc_flag.txt. 5. post_process_props.py mangles ro.dalvik.vm.enable_uffd_gc based on the same logic. Bug: 321751629 Bug: 319554951 Bug: 318763448 Bug: 319648491 Test: m --no-skip-soong-tests nothing Test: atest uffd_gc_utils_test Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with no UFFD support - 1. Check the existence of `-Xgc:CMC` in out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.invocation (dex2oat invocation for a boot image) 2. Check the existence of `-Xgc:CMC` in out/soong/.intermediates/packages/apps/Settings/Settings/android_common/dexpreopt/Settings/oat/arm64/package.invocation (dex2oat invocation for an app defined in .bp) 3. Check the existence of `-Xgc:CMC` in $ANDROID_PRODUCT_OUT/obj/APPS/Dialer_intermediates/oat/arm64/package.invocation (dex2oat invocation for an app defined in .mk) 4. Check the value of ro.dalvik.vm.enable_uffd_gc in $ANDROID_PRODUCT_OUT/product/etc/build.prop Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with UFFD support, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=true m`, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=false m`, and do the steps above. Change-Id: I8df6e5be1644da05d2d5c57b3520f29601dfd7a4
2024-01-18 18:22:13 +01:00
uffd_gc_flag_txt := $(OUT_DIR)/soong/dexpreopt/uffd_gc_flag.txt
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
boot_zip_metadata_txt := $(dir $(boot_zip))boot_zip/METADATA.txt
Determine GC type based on BUILT_KERNEL_VERSION_FILE. How it works: 1. build/make/core/Makefile generates a txt file with the kernel version, which is taken from an explicit BOARD_KERNEL_VERSION value, or extracted from the kernel image on the source tree, or extracted from the kernel image extracted from the prebuilt boot.img. The file is saved at $ANDROID_PRODUCT_OUT/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt. 2. If PRODUCT_ENABLE_UFFD_GC is "default", meaning the GC type needs to be determined by the kernel version, build/make/core/Makefile copies kernel_version.txt to out/soong/dexpreopt/kernel_version_for_uffd_gc.txt. 3. build/soong/dexpreopt/config.go writes the the UFFD GC flag to out/soong/dexpreopt/uffd_gc_flag.txt. The flag is determined by an explicit PRODUCT_ENABLE_UFFD_GC value or by contruct_uffd_gc_flag.py, which reads kernel_version_for_uffd_gc.txt and determines the flag accordingly. 4. dex2oat takes the UFFD GC flag from uffd_gc_flag.txt. 5. post_process_props.py mangles ro.dalvik.vm.enable_uffd_gc based on the same logic. Bug: 321751629 Bug: 319554951 Bug: 318763448 Bug: 319648491 Test: m --no-skip-soong-tests nothing Test: atest uffd_gc_utils_test Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with no UFFD support - 1. Check the existence of `-Xgc:CMC` in out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.invocation (dex2oat invocation for a boot image) 2. Check the existence of `-Xgc:CMC` in out/soong/.intermediates/packages/apps/Settings/Settings/android_common/dexpreopt/Settings/oat/arm64/package.invocation (dex2oat invocation for an app defined in .bp) 3. Check the existence of `-Xgc:CMC` in $ANDROID_PRODUCT_OUT/obj/APPS/Dialer_intermediates/oat/arm64/package.invocation (dex2oat invocation for an app defined in .mk) 4. Check the value of ro.dalvik.vm.enable_uffd_gc in $ANDROID_PRODUCT_OUT/product/etc/build.prop Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with UFFD support, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=true m`, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=false m`, and do the steps above. Change-Id: I8df6e5be1644da05d2d5c57b3520f29601dfd7a4
2024-01-18 18:22:13 +01:00
$(boot_zip_metadata_txt): $(uffd_gc_flag_txt)
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
$(boot_zip_metadata_txt):
rm -f $@
echo "bootclasspath = $(bootclasspath_arg)" >> $@
echo "bootclasspath-locations = $(bootclasspath_locations_arg)" >> $@
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
echo "boot-image = $(boot_image_arg)" >> $@
Determine GC type based on BUILT_KERNEL_VERSION_FILE. How it works: 1. build/make/core/Makefile generates a txt file with the kernel version, which is taken from an explicit BOARD_KERNEL_VERSION value, or extracted from the kernel image on the source tree, or extracted from the kernel image extracted from the prebuilt boot.img. The file is saved at $ANDROID_PRODUCT_OUT/obj/PACKAGING/check_vintf_all_intermediates/kernel_version.txt. 2. If PRODUCT_ENABLE_UFFD_GC is "default", meaning the GC type needs to be determined by the kernel version, build/make/core/Makefile copies kernel_version.txt to out/soong/dexpreopt/kernel_version_for_uffd_gc.txt. 3. build/soong/dexpreopt/config.go writes the the UFFD GC flag to out/soong/dexpreopt/uffd_gc_flag.txt. The flag is determined by an explicit PRODUCT_ENABLE_UFFD_GC value or by contruct_uffd_gc_flag.py, which reads kernel_version_for_uffd_gc.txt and determines the flag accordingly. 4. dex2oat takes the UFFD GC flag from uffd_gc_flag.txt. 5. post_process_props.py mangles ro.dalvik.vm.enable_uffd_gc based on the same logic. Bug: 321751629 Bug: 319554951 Bug: 318763448 Bug: 319648491 Test: m --no-skip-soong-tests nothing Test: atest uffd_gc_utils_test Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with no UFFD support - 1. Check the existence of `-Xgc:CMC` in out/soong/dexpreopt_arm64/dex_bootjars/android/system/framework/arm64/boot.invocation (dex2oat invocation for a boot image) 2. Check the existence of `-Xgc:CMC` in out/soong/.intermediates/packages/apps/Settings/Settings/android_common/dexpreopt/Settings/oat/arm64/package.invocation (dex2oat invocation for an app defined in .bp) 3. Check the existence of `-Xgc:CMC` in $ANDROID_PRODUCT_OUT/obj/APPS/Dialer_intermediates/oat/arm64/package.invocation (dex2oat invocation for an app defined in .mk) 4. Check the value of ro.dalvik.vm.enable_uffd_gc in $ANDROID_PRODUCT_OUT/product/etc/build.prop Test: Build with `OVERRIDE_ENABLE_UFFD_GC=default m` for device with UFFD support, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=true m`, and do the steps above. Test: Build with `OVERRIDE_ENABLE_UFFD_GC=false m`, and do the steps above. Change-Id: I8df6e5be1644da05d2d5c57b3520f29601dfd7a4
2024-01-18 18:22:13 +01:00
echo "extra-args = `cat $(uffd_gc_flag_txt)`" >> $@
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
$(call dist-for-goals, droidcore, $(boot_zip_metadata_txt))
$(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars)
$(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars)
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline) $(boot_zip_metadata_txt)
@echo "Create boot package: $@"
rm -f $@
$(SOONG_ZIP) -o $@.tmp \
-C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
-C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) \
-j -f $(boot_zip_metadata_txt)
Add mainline extension and METADATA.txt to boot.zip. Contents of METADATA.txt: booclasspath = dex_bootjars_input/core-oj.jar:dex_bootjars_input/core-libart.jar:dex_bootjars_input/okhttp.jar:dex_bootjars_input/bouncycastle.jar:dex_bootjars_input/apache-xml.jar:dex_bootjars_input/framework.jar:dex_bootjars_input/framework-graphics.jar:dex_bootjars_input/ext.jar:dex_bootjars_input/telephony-common.jar:dex_bootjars_input/voip-common.jar:dex_bootjars_input/ims-common.jar:dex_bootjars_input/core-icu4j.jar:apex_bootjars/framework-adservices.jar:apex_bootjars/framework-sdksandbox.jar:apex_bootjars/framework-appsearch.jar:apex_bootjars/framework-bluetooth.jar:apex_bootjars/conscrypt.jar:apex_bootjars/android.net.ipsec.ike.jar:apex_bootjars/updatable-media.jar:apex_bootjars/framework-mediaprovider.jar:apex_bootjars/framework-ondevicepersonalization.jar:apex_bootjars/framework-statsd.jar:apex_bootjars/framework-permission.jar:apex_bootjars/framework-permission-s.jar:apex_bootjars/framework-scheduling.jar:apex_bootjars/framework-sdkextensions.jar:apex_bootjars/framework-connectivity.jar:apex_bootjars/framework-connectivity-t.jar:apex_bootjars/framework-tethering.jar:apex_bootjars/framework-uwb.jar:apex_bootjars/framework-virtualization.jar:apex_bootjars/framework-wifi.jar booclasspath-locations = /apex/com.android.art/javalib/core-oj.jar:/apex/com.android.art/javalib/core-libart.jar:/apex/com.android.art/javalib/okhttp.jar:/apex/com.android.art/javalib/bouncycastle.jar:/apex/com.android.art/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/framework-graphics.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/apex/com.android.i18n/javalib/core-icu4j.jar:/apex/com.android.adservices/javalib/framework-adservices.jar:/apex/com.android.adservices/javalib/framework-sdksandbox.jar:/apex/com.android.appsearch/javalib/framework-appsearch.jar:/apex/com.android.btservices/javalib/framework-bluetooth.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.ipsec/javalib/android.net.ipsec.ike.jar:/apex/com.android.media/javalib/updatable-media.jar:/apex/com.android.mediaprovider/javalib/framework-mediaprovider.jar:/apex/com.android.ondevicepersonalization/javalib/framework-ondevicepersonalization.jar:/apex/com.android.os.statsd/javalib/framework-statsd.jar:/apex/com.android.permission/javalib/framework-permission.jar:/apex/com.android.permission/javalib/framework-permission-s.jar:/apex/com.android.scheduling/javalib/framework-scheduling.jar:/apex/com.android.sdkext/javalib/framework-sdkextensions.jar:/apex/com.android.tethering/javalib/framework-connectivity.jar:/apex/com.android.tethering/javalib/framework-connectivity-t.jar:/apex/com.android.tethering/javalib/framework-tethering.jar:/apex/com.android.uwb/javalib/framework-uwb.jar:/apex/com.android.virt/javalib/framework-virtualization.jar:/apex/com.android.wifi/javalib/framework-wifi.jar boot-image = system/framework/boot.art:system/framework/boot-framework-adservices.art Bug: 286381070 Test: m dist out/dist/boot.zip Change-Id: I258479ffbdf199091290b074329ff1b43db2e669
2023-06-09 18:44:50 +02:00
$(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline)
rm -f $@.tmp
$(call dist-for-goals, droidcore, $(boot_zip))
# Build the system_server.zip which contains the Apex system server jars and standalone system server jars
Make system_server.zip compatible with prebuilt apex builds This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
2024-04-25 19:12:49 +02:00
system_server_dex2oat_dir := $(SOONG_OUT_DIR)/system_server_dexjars
system_server_zip := $(PRODUCT_OUT)/system_server.zip
Make system_server.zip compatible with prebuilt apex builds This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
2024-04-25 19:12:49 +02:00
# non_updatable_system_server_jars contains jars in /system and /system_ext that are not part of an apex.
non_updatable_system_server_jars := \
$(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),\
$(system_server_dex2oat_dir)/$(call word-colon,2,$(m)).jar)
apex_system_server_jars := \
$(foreach m,$(PRODUCT_APEX_SYSTEM_SERVER_JARS),\
Make system_server.zip compatible with prebuilt apex builds This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
2024-04-25 19:12:49 +02:00
$(system_server_dex2oat_dir)/$(call word-colon,2,$(m)).jar)
apex_standalone_system_server_jars := \
$(foreach m,$(PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS),\
Make system_server.zip compatible with prebuilt apex builds This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
2024-04-25 19:12:49 +02:00
$(system_server_dex2oat_dir)/$(call word-colon,2,$(m)).jar)
standalone_system_server_jars := \
$(foreach m,$(PRODUCT_STANDALONE_SYSTEM_SERVER_JARS),\
Make system_server.zip compatible with prebuilt apex builds This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
2024-04-25 19:12:49 +02:00
$(system_server_dex2oat_dir)/$(call word-colon,2,$(m)).jar)
Make system_server.zip compatible with prebuilt apex builds This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
2024-04-25 19:12:49 +02:00
$(system_server_zip): PRIVATE_SYSTEM_SERVER_DEX2OAT_DIR := $(system_server_dex2oat_dir)
$(system_server_zip): PRIVATE_SYSTEM_SERVER_JARS := $(non_updatable_system_server_jars)
$(system_server_zip): PRIVATE_APEX_SYSTEM_SERVER_JARS := $(apex_system_server_jars)
$(system_server_zip): PRIVATE_APEX_STANDALONE_SYSTEM_SERVER_JARS := $(apex_standalone_system_server_jars)
$(system_server_zip): PRIVATE_STANDALONE_SYSTEM_SERVER_JARS := $(standalone_system_server_jars)
$(system_server_zip): $(system_server_jars) $(apex_system_server_jars) $(apex_standalone_system_server_jars) $(standalone_system_server_jars) $(SOONG_ZIP)
@echo "Create system server package: $@"
rm -f $@
$(SOONG_ZIP) -o $@ \
Make system_server.zip compatible with prebuilt apex builds This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
2024-04-25 19:12:49 +02:00
-C $(PRIVATE_SYSTEM_SERVER_DEX2OAT_DIR) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) \
-C $(PRIVATE_SYSTEM_SERVER_DEX2OAT_DIR) $(addprefix -f ,$(PRIVATE_APEX_SYSTEM_SERVER_JARS)) \
-C $(PRIVATE_SYSTEM_SERVER_DEX2OAT_DIR) $(addprefix -f ,$(PRIVATE_APEX_STANDALONE_SYSTEM_SERVER_JARS)) \
-C $(PRIVATE_SYSTEM_SERVER_DEX2OAT_DIR) $(addprefix -f ,$(PRIVATE_STANDALONE_SYSTEM_SERVER_JARS))
$(call dist-for-goals, droidcore, $(system_server_zip))
endif #PRODUCT_USES_DEFAULT_ART_CONFIG
endif #WITH_DEXPREOPT_ART_BOOT_IMG_ONLY
endif #WITH_DEXPREOPT