aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiakai Zhang <jiakaiz@google.com>2023-06-19 20:16:21 +0100
committerJiakai Zhang <jiakaiz@google.com>2023-06-19 20:20:05 +0100
commit96b155c018789f9d926371b255b18f7996e7ebaf (patch)
tree75c28d0543534ca1596b29f344a17cc8f4c33958
parenta99ac90eb5e9893be95dfd0e7bf3314557e9d968 (diff)
downloadbuild-96b155c018789f9d926371b255b18f7996e7ebaf.tar.gz
Add an entry in METADATA.txt to determine whether to use the CMC GC.
If the device uses the CMC GC, the file will contain: extra-args = --runtime-arg -Xgc:CMC Otherwise, the file will contain an empty line: extra-args = Bug: 287652269 Test: - 1. m dist out/dist/boot.zip 2. unzip -p out/dist/boot.zip METADATA.txt Change-Id: I3d50367eb2a341e1c03286d7a2cd7ed44d59708f
-rw-r--r--core/dex_preopt.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 86ca7299b6..6ac169b701 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -94,6 +94,7 @@ booclasspath_arg := $(subst $(space),:,$(patsubst $(dexpreopt_root_dir)%,%,$(DEX
booclasspath_locations_arg := $(subst $(space),:,$(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS))
boot_images := $(subst :,$(space),$(DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE$(DEXPREOPT_INFIX)))
boot_image_arg := $(subst $(space),:,$(patsubst /%,%,$(boot_images)))
+dex2oat_extra_args := $(if $(filter true,$(ENABLE_UFFD_GC)),--runtime-arg -Xgc:CMC)
boot_zip_metadata_txt := $(dir $(boot_zip))boot_zip/METADATA.txt
$(boot_zip_metadata_txt):
@@ -101,6 +102,7 @@ $(boot_zip_metadata_txt):
echo "booclasspath = $(booclasspath_arg)" >> $@
echo "booclasspath-locations = $(booclasspath_locations_arg)" >> $@
echo "boot-image = $(boot_image_arg)" >> $@
+ echo "extra-args = $(dex2oat_extra_args)" >> $@
$(call dist-for-goals, droidcore, $(boot_zip_metadata_txt))