Make missing DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES an error
Change-Id: I3ca23e4db80c8ab8a86da6408cf38daccd4cfaf1
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 0871884..a2c2e1a 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -149,11 +149,8 @@
IMG_TARGET_BASE_ADDRESS := 0x60000000
endif
-ART_HOST_CFLAGS := $(art_cflags) -DANDROID_SMP=1 -DART_BASE_ADDRESS=$(IMG_HOST_BASE_ADDRESS)
-
-ifeq ($(TARGET_ARCH),x86)
-ART_TARGET_CFLAGS += -msse2
-endif
+ART_HOST_CFLAGS := $(art_cflags) -DANDROID_SMP=1 -DART_BASE_ADDRESS=$(IMG_HOST_BASE_ADDRESS)
+ART_HOST_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES=default
ART_TARGET_CFLAGS := $(art_cflags) -DART_TARGET -DART_BASE_ADDRESS=$(IMG_TARGET_BASE_ADDRESS)
ifeq ($(TARGET_CPU_SMP),true)
@@ -162,6 +159,17 @@
ART_TARGET_CFLAGS += -DANDROID_SMP=0
endif
+# DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES is set in ../build/core/dex_preopt.mk based on
+# the TARGET_CPU_VARIANT
+ifeq ($(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES),)
+$(error Required DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES is not set)
+endif
+ART_TARGET_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
+
+ifeq ($(TARGET_ARCH),x86)
+ART_TARGET_CFLAGS += -msse2
+endif
+
# Enable thread-safety for GCC 4.6 on the target but not for GCC 4.7 where this feature was removed.
ifneq ($(filter 4.6 4.6.%, $(TARGET_GCC_VERSION)),)
ART_TARGET_CFLAGS += -Wthread-safety
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index b317d92..5cf15be 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -24,10 +24,6 @@
ART_EXECUTABLES_CFLAGS += -DART_USE_PORTABLE_COMPILER=1
endif
-# add the default instruction set features
-ART_EXECUTABLES_CFLAGS += \
- -DART_DEFAULT_INSTRUCTION_SET_FEATURES=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
-
# $(1): executable ("d" will be appended for debug version)
# $(2): source
# $(3): extra shared libraries
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 0d759ce..655c7dd 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -86,7 +86,6 @@
ifeq ($(ART_USE_PORTABLE_COMPILER),true)
ART_TEST_CFLAGS += -DART_USE_PORTABLE_COMPILER=1
endif
-ART_TEST_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES=$(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
# $(1): target or host
# $(2): file name
diff --git a/build/Android.oat.mk b/build/Android.oat.mk
index 5d355a6..f964346 100644
--- a/build/Android.oat.mk
+++ b/build/Android.oat.mk
@@ -57,9 +57,6 @@
HOST_CORE_IMG_OUT := $(HOST_OUT_JAVA_LIBRARIES)/core.art
TARGET_CORE_IMG_OUT := $(ART_TEST_OUT)/core.art
-# DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES is set in ../build/core/dex_preopt.mk based on
-# the TARGET_CPU_VARIANT
-
TARGET_INSTRUCTION_SET_FEATURES := $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
$(HOST_CORE_IMG_OUT): $(HOST_CORE_DEX_FILES) $(DEX2OAT_DEPENDENCY)
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 1472337..5b0653e 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -632,13 +632,9 @@
CompilerBackend compiler_backend = kQuick;
#endif
- // Take the default set of instruction features from the build if present.
+ // Take the default set of instruction features from the build.
InstructionSetFeatures instruction_set_features =
-#ifdef ART_DEFAULT_INSTRUCTION_SET_FEATURES
- ParseFeatureList(STRINGIFY(ART_DEFAULT_INSTRUCTION_SET_FEATURES));
-#else
- ParseFeatureList("default");
-#endif
+ ParseFeatureList(STRINGIFY(ART_DEFAULT_INSTRUCTION_SET_FEATURES));
#if defined(__arm__)
InstructionSet instruction_set = kThumb2;
diff --git a/runtime/common_test.h b/runtime/common_test.h
index 79fa680..643ed1d 100644
--- a/runtime/common_test.h
+++ b/runtime/common_test.h
@@ -423,13 +423,9 @@
InstructionSet instruction_set = kNone;
- // take the default set of instruction features from the build if present
+ // Take the default set of instruction features from the build.
InstructionSetFeatures instruction_set_features =
-#ifdef ART_DEFAULT_INSTRUCTION_SET_FEATURES
- ParseFeatureList(STRINGIFY(ART_DEFAULT_INSTRUCTION_SET_FEATURES));
-#else
- ParseFeatureList("default");
-#endif
+ ParseFeatureList(STRINGIFY(ART_DEFAULT_INSTRUCTION_SET_FEATURES));
#if defined(__arm__)
instruction_set = kThumb2;