From e63be2a7244f5fb54df5b04e0185f86b7f916823 Mon Sep 17 00:00:00 2001 From: Nelson Li Date: Fri, 19 Jul 2024 15:41:50 +0800 Subject: [PATCH] Add HOST_PREFER_32_BIT to Soong Config and move art-tools to product configuration. This change accomplishes two things: Adds `HOST_PREFER_32_BIT` to Soong config variables: The `HOST_PREFER_32_BIT` environment variable is frequently used in Android.mk files within the art/ directory. By adding it to soong_config_variable, we make it accessible to the Soong build system, which will be essential when converting art modules to Android.bp. Moves `art-tools` to product configuration: Originally, `art-tools` was a phony target added to PRODUCT_HOST_PACKAGES. This approach is incorrect because PRODUCT_HOST_PACKAGES should only contain actual modules, not phony targets. We are addressing this by converting the dependencies and conditional statements (ifeq) within `art-tools` into PRODUCT_HOST_PACKAGES entries in base_system.mk. Bug: 346702835 Test: m -j; Then, check related dependencies build in the system. Change-Id: Iab252dea71c9df9d75f2701b33d3cd4d391e7f5d --- core/android_soong_config_vars.mk | 2 ++ target/product/base_system.mk | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index 0f925a7835..461b28403d 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -44,6 +44,8 @@ $(call soong_config_set_bool,ANDROID,SANITIZE_TARGET_SYSTEM_ENABLED,$(if $(filte # PRODUCT_PRECOMPILED_SEPOLICY defaults to true. Explicitly check if it's "false" or not. $(call soong_config_set_bool,ANDROID,PRODUCT_PRECOMPILED_SEPOLICY,$(if $(filter false,$(PRODUCT_PRECOMPILED_SEPOLICY)),false,true)) +# For art modules +$(call soong_config_set_bool,art_module,host_prefer_32_bit,$(if $(filter true,$(HOST_PREFER_32_BIT)),true,false)) ifdef ART_DEBUG_OPT_FLAG $(call soong_config_set,art_module,art_debug_opt_flag,$(ART_DEBUG_OPT_FLAG)) endif diff --git a/target/product/base_system.mk b/target/product/base_system.mk index 9728cc0bee..2b726c15f6 100644 --- a/target/product/base_system.mk +++ b/target/product/base_system.mk @@ -403,7 +403,6 @@ PRODUCT_HOST_PACKAGES += \ BugReport \ adb \ adevice \ - art-tools \ atest \ bcc \ bit \ @@ -434,6 +433,21 @@ PRODUCT_HOST_PACKAGES += \ tz_version_host \ tz_version_host_tzdata_apex \ +# For art-tools, if the dependencies have changed, please sync them to art/Android.bp as well. +PRODUCT_HOST_PACKAGES += \ + ahat \ + dexdump \ + hprof-conv +# A subset of the tools are disabled when HOST_PREFER_32_BIT is defined as make reports that +# they are not supported on host (b/129323791). This is likely due to art_apex disabling host +# APEX builds when HOST_PREFER_32_BIT is set (b/120617876). +ifneq ($(HOST_PREFER_32_BIT),true) +PRODUCT_HOST_PACKAGES += \ + dexlist \ + oatdump +endif + + PRODUCT_PACKAGES += init.usb.rc init.usb.configfs.rc PRODUCT_PACKAGES += etc_hosts