diff --git a/core/config.mk b/core/config.mk index 2b67d6b0e..848a4625c 100644 --- a/core/config.mk +++ b/core/config.mk @@ -660,21 +660,14 @@ ifeq ($(TARGET_DEFAULT_JAVA_LIBRARIES),) endif # Flags for DEX2OAT +first_non_empty_of_three = $(if $(1),$(1),$(if $(2),$(2),$(3))) DEX2OAT_TARGET_ARCH := $(TARGET_ARCH) -ifeq ($(TARGET_CPU_VARIANT),) -ifeq ($(TARGET_ARCH_VARIANT),) -DEX2OAT_TARGET_CPU_VARIANT := default -else -DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_ARCH_VARIANT) -endif -else -DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_CPU_VARIANT) -endif +DEX2OAT_TARGET_CPU_VARIANT := $(call first_non_empty_of_three,$(TARGET_CPU_VARIANT),$(TARGET_ARCH_VARIANT),default) DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default ifdef TARGET_2ND_ARCH $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH := $(TARGET_2ND_ARCH) -$(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_2ND_CPU_VARIANT) +$(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT := $(call first_non_empty_of_three,$(TARGET_2ND_CPU_VARIANT),$(TARGET_2ND_ARCH_VARIANT),default) $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default endif