From ae7f543b7c95715f9df80671d4a89b90d48c108e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 21 Feb 2023 11:38:30 -0800 Subject: [PATCH 1/2] Disable dexpreopt for aosp_riscv64 dex2oat isn't supported for riscv64 yet, disable dexpreopt. For aosp_riscv64-user and -userdebug builds it is also necessary to relax the requirement that dexpreopt is enabled. Test: lunch aosp_riscv64-userdebug && m Change-Id: I3b66304cedf55f734f8aa1d3ad3ed594a7b9a122 --- core/board_config.mk | 5 ++++- core/dex_preopt_config.mk | 9 ++++++--- target/board/generic_riscv64/BoardConfig.mk | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/core/board_config.mk b/core/board_config.mk index b1b7b81ca9..16acddec9e 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -204,7 +204,10 @@ _board_strip_readonly_list += $(_build_broken_var_list) \ # Conditional to building on linux, as dex2oat currently does not work on darwin. ifeq ($(HOST_OS),linux) - WITH_DEXPREOPT := true + # TODO(riscv64) add compiler support and enable dexpreopt on RISC-V. + ifneq ($(TARGET_ARCH),riscv64) + WITH_DEXPREOPT := true + endif endif # ############################################################### diff --git a/core/dex_preopt_config.mk b/core/dex_preopt_config.mk index e36e2ebb6f..0bb47d10a3 100644 --- a/core/dex_preopt_config.mk +++ b/core/dex_preopt_config.mk @@ -65,9 +65,12 @@ ifeq ($(HOST_OS),linux) # Non eng linux builds must have preopt enabled so that system server doesn't run as interpreter # only. b/74209329 ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT))) - ifneq (true,$(WITH_DEXPREOPT)) - ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)) - $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds) + # TODO(riscv64) add compiler support and enable dexpreopt on RISC-V. + ifeq (,$(filter riscv64, $(TARGET_ARCH))) + ifneq (true,$(WITH_DEXPREOPT)) + ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY)) + $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds) + endif endif endif endif diff --git a/target/board/generic_riscv64/BoardConfig.mk b/target/board/generic_riscv64/BoardConfig.mk index 906f7f0cb5..53379bbb57 100644 --- a/target/board/generic_riscv64/BoardConfig.mk +++ b/target/board/generic_riscv64/BoardConfig.mk @@ -26,3 +26,6 @@ include build/make/target/board/BoardConfigGsiCommon.mk # Temporary hack while prebuilt modules are missing riscv64. ALLOW_MISSING_DEPENDENCIES := true + +# Temporary until dex2oat works when targeting riscv64 +WITH_DEXPREOPT := false From c9cb74d25772b166f542b1fa3f190a24ead1790c Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 21 Feb 2023 11:37:57 -0800 Subject: [PATCH 2/2] Build the whole platform for aosp_riscv64 Remove the hacks that prevent building the rest of the platform for aosp_riscv64. Test: lunch aosp_riscv64-userdebug && m Change-Id: Id8b48c8c456e76624647f153c7dd9612569fc7a1 --- target/product/aosp_riscv64.mk | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/target/product/aosp_riscv64.mk b/target/product/aosp_riscv64.mk index a6784cb544..bc35b95129 100644 --- a/target/product/aosp_riscv64.mk +++ b/target/product/aosp_riscv64.mk @@ -30,8 +30,7 @@ PRODUCT_USE_DYNAMIC_PARTITIONS := true # GSI for system/product & support 64-bit apps only $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) -#$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) -TARGET_FLATTEN_APEX := false +$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk) # # All components inherited here go to system_ext image @@ -58,24 +57,6 @@ ifeq (aosp_riscv64,$(TARGET_PRODUCT)) $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk) endif -# TODO: this list should come via mainline_system.mk, but for now list -# just the modules that work for riscv64. -PRODUCT_PACKAGES := \ - init.environ.rc \ - init_first_stage \ - init_system \ - linker \ - shell_and_utilities \ - com.android.art \ - com.android.conscrypt \ - com.android.i18n \ - com.android.runtime \ - com.android.tzdata \ - com.android.os.statsd \ - -$(call inherit-product, $(SRC_TARGET_DIR)/product/default_art_config.mk) -PRODUCT_USES_DEFAULT_ART_CONFIG := false - PRODUCT_ARTIFACT_PATH_REQUIREMENT_ALLOWED_LIST += \ root/init.zygote64.rc