From e325f61525ccf56ef4e4ae60b56d9626de88f5f1 Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Wed, 22 Feb 2023 12:49:28 +0000 Subject: [PATCH] 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: trehugger Change-Id: Ib84f1b40675783d286f4ff89d3c1daa9c7be710a --- core/board_config.mk | 2 +- core/dex_preopt_config.mk | 9 ++++++--- target/board/generic_riscv64/BoardConfig.mk | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/board_config.mk b/core/board_config.mk index 70c91a80b3..bffaf2a904 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -203,7 +203,7 @@ _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 + WITH_DEXPREOPT ?= true 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