Merge "Remove unused build code"
diff --git a/Android.mk b/Android.mk
index 3740ed8..cc18660 100644
--- a/Android.mk
+++ b/Android.mk
@@ -82,8 +82,6 @@
 include $(art_path)/tools/dexfuzz/Android.mk
 include $(art_path)/libart_fake/Android.mk
 
-
-# ART_HOST_DEPENDENCIES depends on Android.executable.mk above for ART_HOST_EXECUTABLES
 ART_HOST_DEPENDENCIES := \
   $(ART_HOST_EXECUTABLES) \
   $(ART_HOST_DEX_DEPENDENCIES) \
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 6befec5..b0fa124 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -26,7 +26,6 @@
   # Mac OS doesn't support low-4GB allocation in a 64-bit process. So we won't be able to create
   # our heaps.
   ART_HOST_SUPPORTED_ARCH := x86
-  ART_MULTILIB_OVERRIDE_host := 32
 endif
 
 ART_COVERAGE := false
@@ -59,27 +58,19 @@
   ifneq ($(filter %64,$(TARGET_ARCH)),)
     ART_PHONY_TEST_TARGET_SUFFIX := 64
     2ND_ART_PHONY_TEST_TARGET_SUFFIX := 32
-    ART_TARGET_ARCH_32 := $(TARGET_2ND_ARCH)
-    ART_TARGET_ARCH_64 := $(TARGET_ARCH)
   else
     # TODO: ???
     $(warning Do not know what to do with this multi-target configuration!)
     ART_PHONY_TEST_TARGET_SUFFIX := 32
     2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
-    ART_TARGET_ARCH_32 := $(TARGET_ARCH)
-    ART_TARGET_ARCH_64 :=
   endif
 else
   ifneq ($(filter %64,$(TARGET_ARCH)),)
     ART_PHONY_TEST_TARGET_SUFFIX := 64
     2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
-    ART_TARGET_ARCH_32 :=
-    ART_TARGET_ARCH_64 := $(TARGET_ARCH)
   else
     ART_PHONY_TEST_TARGET_SUFFIX := 32
     2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
-    ART_TARGET_ARCH_32 := $(TARGET_ARCH)
-    ART_TARGET_ARCH_64 :=
   endif
 endif
 
@@ -88,23 +79,17 @@
 ifeq ($(HOST_PREFER_32_BIT),true)
   ART_PHONY_TEST_HOST_SUFFIX := 32
   2ND_ART_PHONY_TEST_HOST_SUFFIX :=
-  ART_HOST_ARCH_32 := x86
-  ART_HOST_ARCH_64 :=
   ART_HOST_ARCH := x86
   2ND_ART_HOST_ARCH :=
   2ND_HOST_ARCH :=
-  ART_HOST_LIBRARY_PATH := $(HOST_LIBRARY_PATH)
   ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
   2ND_ART_HOST_OUT_SHARED_LIBRARIES :=
 else
   ART_PHONY_TEST_HOST_SUFFIX := 64
   2ND_ART_PHONY_TEST_HOST_SUFFIX := 32
-  ART_HOST_ARCH_32 := x86
-  ART_HOST_ARCH_64 := x86_64
   ART_HOST_ARCH := x86_64
   2ND_ART_HOST_ARCH := x86
   2ND_HOST_ARCH := x86
-  ART_HOST_LIBRARY_PATH := $(HOST_LIBRARY_PATH)
   ART_HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT_SHARED_LIBRARIES)
   2ND_ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
 endif
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk
index 7edc1cc..4c82506 100644
--- a/build/Android.common_build.mk
+++ b/build/Android.common_build.mk
@@ -18,7 +18,6 @@
 ART_ANDROID_COMMON_BUILD_MK = true
 
 include art/build/Android.common.mk
-include art/build/Android.common_utils.mk
 
 # These can be overridden via the environment or by editing to
 # enable/disable certain build configuration.
@@ -34,26 +33,6 @@
 ART_BUILD_HOST_NDEBUG ?= true
 ART_BUILD_HOST_DEBUG ?= true
 
-# Set this to change what opt level ART is built at.
-ART_DEBUG_OPT_FLAG ?= -O2
-ART_NDEBUG_OPT_FLAG ?= -O3
-
-# Enable the static builds only for checkbuilds.
-ifneq (,$(filter checkbuild,$(MAKECMDGOALS)))
-  ART_BUILD_HOST_STATIC ?= true
-else
-  ART_BUILD_HOST_STATIC ?= false
-endif
-
-# Asan does not support static linkage
-ifdef SANITIZE_HOST
-  ART_BUILD_HOST_STATIC := false
-endif
-
-ifneq ($(HOST_OS),linux)
-  ART_BUILD_HOST_STATIC := false
-endif
-
 ifeq ($(ART_BUILD_TARGET_NDEBUG),false)
 $(info Disabling ART_BUILD_TARGET_NDEBUG)
 endif
@@ -66,375 +45,31 @@
 ifeq ($(ART_BUILD_HOST_DEBUG),false)
 $(info Disabling ART_BUILD_HOST_DEBUG)
 endif
-ifeq ($(ART_BUILD_HOST_STATIC),true)
-$(info Enabling ART_BUILD_HOST_STATIC)
-endif
-
-ifeq ($(ART_TEST_DEBUG_GC),true)
-  ART_DEFAULT_GC_TYPE := SS
-  ART_USE_TLAB := true
-endif
-
-#
-# Used to change the default GC. Valid values are CMS, SS, GSS. The default is CMS.
-#
-ART_DEFAULT_GC_TYPE ?= CMS
-art_default_gc_type_cflags := -DART_DEFAULT_GC_TYPE_IS_$(ART_DEFAULT_GC_TYPE)
-
-ART_HOST_CLANG := true
-ART_TARGET_CLANG := true
 
 ART_CPP_EXTENSION := .cc
 
-ART_C_INCLUDES := \
-  external/icu/icu4c/source/common \
-  external/lz4/lib \
-  external/valgrind/include \
-  external/valgrind \
-  external/vixl/src \
-  external/zlib \
-
-# We optimize Thread::Current() with a direct TLS access. This requires access to a private
-# Bionic header.
-# Note: technically we only need this on device, but this avoids the duplication of the includes.
-ART_C_INCLUDES += bionic/libc/private
-
-art_cflags :=
-
-# Warn about thread safety violations with clang.
-art_cflags += -Wthread-safety -Wthread-safety-negative
-
-# Warn if switch fallthroughs aren't annotated.
-art_cflags += -Wimplicit-fallthrough
-
-# Enable float equality warnings.
-art_cflags += -Wfloat-equal
-
-# Enable warning of converting ints to void*.
-art_cflags += -Wint-to-void-pointer-cast
-
-# Enable warning of wrong unused annotations.
-art_cflags += -Wused-but-marked-unused
-
-# Enable warning for deprecated language features.
-art_cflags += -Wdeprecated
-
-# Enable warning for unreachable break & return.
-art_cflags += -Wunreachable-code-break -Wunreachable-code-return
-
-# Bug: http://b/29823425  Disable -Wconstant-conversion and
-# -Wundefined-var-template for Clang update to r271374
-art_cflags += -Wno-constant-conversion -Wno-undefined-var-template
-
-# Enable missing-noreturn only on non-Mac. As lots of things are not implemented for Apple, it's
-# a pain.
-ifneq ($(HOST_OS),darwin)
-  art_cflags += -Wmissing-noreturn
-endif
-
-# Base set of cflags used by all things ART.
-art_cflags += \
-  -fno-rtti \
-  -ggdb3 \
-  -Wall \
-  -Werror \
-  -Wextra \
-  -Wstrict-aliasing \
-  -fstrict-aliasing \
-  -Wunreachable-code \
-  -Wredundant-decls \
-  -Wshadow \
-  -Wunused \
-  -fvisibility=protected \
-  $(art_default_gc_type_cflags)
-
-# The architectures the compiled tools are able to run on. Setting this to 'all' will cause all
-# architectures to be included.
-ART_TARGET_CODEGEN_ARCHS ?= svelte
-ART_HOST_CODEGEN_ARCHS ?= all
-
-ifeq ($(ART_TARGET_CODEGEN_ARCHS),all)
-  ART_TARGET_CODEGEN_ARCHS := $(sort $(ART_TARGET_SUPPORTED_ARCH) $(ART_HOST_SUPPORTED_ARCH))
-else
-  ifeq ($(ART_TARGET_CODEGEN_ARCHS),svelte)
-    ART_TARGET_CODEGEN_ARCHS := $(sort $(ART_TARGET_ARCH_64) $(ART_TARGET_ARCH_32))
-  endif
-endif
-ifeq ($(ART_HOST_CODEGEN_ARCHS),all)
-  ART_HOST_CODEGEN_ARCHS := $(sort $(ART_TARGET_SUPPORTED_ARCH) $(ART_HOST_SUPPORTED_ARCH))
-else
-  ifeq ($(ART_HOST_CODEGEN_ARCHS),svelte)
-    ART_HOST_CODEGEN_ARCHS := $(sort $(ART_TARGET_CODEGEN_ARCHS) $(ART_HOST_ARCH_64) $(ART_HOST_ARCH_32))
-  endif
-endif
-
-ifneq (,$(filter arm64,$(ART_TARGET_CODEGEN_ARCHS)))
-  ART_TARGET_CODEGEN_ARCHS += arm
-endif
-ifneq (,$(filter mips64,$(ART_TARGET_CODEGEN_ARCHS)))
-  ART_TARGET_CODEGEN_ARCHS += mips
-endif
-ifneq (,$(filter x86_64,$(ART_TARGET_CODEGEN_ARCHS)))
-  ART_TARGET_CODEGEN_ARCHS += x86
-endif
-ART_TARGET_CODEGEN_ARCHS := $(sort $(ART_TARGET_CODEGEN_ARCHS))
-ifneq (,$(filter arm64,$(ART_HOST_CODEGEN_ARCHS)))
-  ART_HOST_CODEGEN_ARCHS += arm
-endif
-ifneq (,$(filter mips64,$(ART_HOST_CODEGEN_ARCHS)))
-  ART_HOST_CODEGEN_ARCHS += mips
-endif
-ifneq (,$(filter x86_64,$(ART_HOST_CODEGEN_ARCHS)))
-  ART_HOST_CODEGEN_ARCHS += x86
-endif
-ART_HOST_CODEGEN_ARCHS := $(sort $(ART_HOST_CODEGEN_ARCHS))
-
-# Base set of cflags used by target build only
-art_target_cflags := \
-  $(foreach target_arch,$(strip $(ART_TARGET_CODEGEN_ARCHS)), -DART_ENABLE_CODEGEN_$(target_arch))
-# Base set of cflags used by host build only
-art_host_cflags := \
-  $(foreach host_arch,$(strip $(ART_HOST_CODEGEN_ARCHS)), -DART_ENABLE_CODEGEN_$(host_arch))
-
-# Base set of asflags used by all things ART.
-art_asflags :=
-
-# Missing declarations: too many at the moment, as we use "extern" quite a bit.
-#  -Wmissing-declarations \
-
-
-
-ifdef ART_IMT_SIZE
-  art_cflags += -DIMT_SIZE=$(ART_IMT_SIZE)
-else
-  # Default is 43
-  art_cflags += -DIMT_SIZE=43
-endif
-
-ifeq ($(ART_HEAP_POISONING),true)
-  art_cflags += -DART_HEAP_POISONING=1
-  art_asflags += -DART_HEAP_POISONING=1
-endif
-
-#
-# Used to change the read barrier type. Valid values are BAKER, BROOKS, TABLELOOKUP.
-# The default is BAKER.
-#
-ART_READ_BARRIER_TYPE ?= BAKER
-
-ifeq ($(ART_USE_READ_BARRIER),true)
-  art_cflags += -DART_USE_READ_BARRIER=1
-  art_cflags += -DART_READ_BARRIER_TYPE_IS_$(ART_READ_BARRIER_TYPE)=1
-  art_asflags += -DART_USE_READ_BARRIER=1
-  art_asflags += -DART_READ_BARRIER_TYPE_IS_$(ART_READ_BARRIER_TYPE)=1
-
-  # Temporarily override -fstack-protector-strong with -fstack-protector to avoid a major
-  # slowdown with the read barrier config. b/26744236.
-  art_cflags += -fstack-protector
-endif
-
-ifeq ($(ART_USE_TLAB),true)
-  art_cflags += -DART_USE_TLAB=1
-endif
-
-# Are additional statically-linked ART host binaries (dex2oats,
-# oatdumps, etc.) getting built?
-ifeq ($(ART_BUILD_HOST_STATIC),true)
-  art_cflags += -DART_BUILD_HOST_STATIC=1
-endif
-
-# Temporary flag allowing to disable recent changes in oat file management.
-ifneq ($(ART_ENABLE_VDEX),false)
-  art_cflags += -DART_ENABLE_VDEX
-endif
-
-# Cflags for non-debug ART and ART tools.
-art_non_debug_cflags := \
-  $(ART_NDEBUG_OPT_FLAG)
-
-# Cflags for debug ART and ART tools.
-art_debug_cflags := \
-  $(ART_DEBUG_OPT_FLAG) \
-  -DDYNAMIC_ANNOTATIONS_ENABLED=1 \
-  -DVIXL_DEBUG \
-  -UNDEBUG
-
-# Assembler flags for non-debug ART and ART tools.
-art_non_debug_asflags :=
-
-# Assembler flags for debug ART and ART tools.
-art_debug_asflags := -UNDEBUG
-
-art_host_non_debug_cflags := $(art_non_debug_cflags)
-art_target_non_debug_cflags := $(art_non_debug_cflags)
-
-###
-# Frame size
-###
-
-# Size of the stack-overflow gap.
-ART_STACK_OVERFLOW_GAP_arm := 8192
-ART_STACK_OVERFLOW_GAP_arm64 := 8192
-ART_STACK_OVERFLOW_GAP_mips := 16384
-ART_STACK_OVERFLOW_GAP_mips64 := 16384
-ART_STACK_OVERFLOW_GAP_x86 := 8192
-ART_STACK_OVERFLOW_GAP_x86_64 := 8192
-ART_COMMON_STACK_OVERFLOW_DEFINES := \
-  -DART_STACK_OVERFLOW_GAP_arm=$(ART_STACK_OVERFLOW_GAP_arm) \
-  -DART_STACK_OVERFLOW_GAP_arm64=$(ART_STACK_OVERFLOW_GAP_arm64) \
-  -DART_STACK_OVERFLOW_GAP_mips=$(ART_STACK_OVERFLOW_GAP_mips) \
-  -DART_STACK_OVERFLOW_GAP_mips64=$(ART_STACK_OVERFLOW_GAP_mips64) \
-  -DART_STACK_OVERFLOW_GAP_x86=$(ART_STACK_OVERFLOW_GAP_x86) \
-  -DART_STACK_OVERFLOW_GAP_x86_64=$(ART_STACK_OVERFLOW_GAP_x86_64) \
-
-# Keep these as small as possible. We have separate values as we have some host vs target
-# specific code (and previously GCC vs Clang).
-ART_HOST_FRAME_SIZE_LIMIT := 1736
-ART_TARGET_FRAME_SIZE_LIMIT := 1736
-
-# Frame size adaptations for instrumented builds.
-ifdef SANITIZE_TARGET
-  ART_TARGET_FRAME_SIZE_LIMIT := 6400
-endif
-
-# Add frame-size checks for non-debug builds.
-ifeq ($(HOST_OS),linux)
-  ifneq ($(ART_COVERAGE),true)
-    ifneq ($(NATIVE_COVERAGE),true)
-      art_host_non_debug_cflags += -Wframe-larger-than=$(ART_HOST_FRAME_SIZE_LIMIT)
-      art_target_non_debug_cflags += -Wframe-larger-than=$(ART_TARGET_FRAME_SIZE_LIMIT)
-    endif
-  endif
-endif
-
-
-ART_HOST_CFLAGS := $(art_cflags)
-ART_TARGET_CFLAGS := $(art_cflags)
-
-ART_HOST_ASFLAGS := $(art_asflags)
-ART_TARGET_ASFLAGS := $(art_asflags)
-
-# Bug: 15446488. We don't omit the frame pointer to work around
-# clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress.
-ART_HOST_CFLAGS += -fno-omit-frame-pointer
-
 ifndef LIBART_IMG_HOST_BASE_ADDRESS
   $(error LIBART_IMG_HOST_BASE_ADDRESS unset)
 endif
-ART_HOST_CFLAGS += -DART_BASE_ADDRESS=$(LIBART_IMG_HOST_BASE_ADDRESS)
-ART_HOST_CFLAGS += $(art_host_cflags)
-
-ART_HOST_CFLAGS += -DART_FRAME_SIZE_LIMIT=$(ART_HOST_FRAME_SIZE_LIMIT) \
-                   $(ART_COMMON_STACK_OVERFLOW_DEFINES)
-
 
 ifndef LIBART_IMG_TARGET_BASE_ADDRESS
   $(error LIBART_IMG_TARGET_BASE_ADDRESS unset)
 endif
 
-ART_TARGET_CFLAGS += -DART_TARGET \
-                     -DART_BASE_ADDRESS=$(LIBART_IMG_TARGET_BASE_ADDRESS) \
-
-ART_TARGET_CFLAGS += -DART_FRAME_SIZE_LIMIT=$(ART_TARGET_FRAME_SIZE_LIMIT) \
-                     $(ART_COMMON_STACK_OVERFLOW_DEFINES)
-
-ifeq ($(ART_TARGET_LINUX),true)
-# Setting ART_TARGET_LINUX to true compiles art/ assuming that the target device
-# will be running linux rather than android.
-ART_TARGET_CFLAGS += -DART_TARGET_LINUX
-else
-# The ART_TARGET_ANDROID macro is passed to target builds, which check
-# against it instead of against __ANDROID__ (which is provided by target
-# toolchains).
-ART_TARGET_CFLAGS += -DART_TARGET_ANDROID
-endif
-
-ART_TARGET_CFLAGS += $(art_target_cflags)
-
-ART_HOST_NON_DEBUG_CFLAGS := $(art_host_non_debug_cflags)
-ART_TARGET_NON_DEBUG_CFLAGS := $(art_target_non_debug_cflags)
-ART_HOST_DEBUG_CFLAGS := $(art_debug_cflags)
-ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags)
-
-ART_HOST_NON_DEBUG_ASFLAGS := $(art_non_debug_asflags)
-ART_TARGET_NON_DEBUG_ASFLAGS := $(art_non_debug_asflags)
-ART_HOST_DEBUG_ASFLAGS := $(art_debug_asflags)
-ART_TARGET_DEBUG_ASFLAGS := $(art_debug_asflags)
-
-ifndef LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA
-  LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA=-0x1000000
-endif
-ifndef LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA
-  LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA=0x1000000
-endif
-ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA)
-ART_HOST_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA)
-
-ifndef LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA
-  LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA=-0x1000000
-endif
-ifndef LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA
-  LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA=0x1000000
-endif
-ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LIBART_IMG_TARGET_MIN_BASE_ADDRESS_DELTA)
-ART_TARGET_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LIBART_IMG_TARGET_MAX_BASE_ADDRESS_DELTA)
-
-# To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16"
-# ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
-
-# Clear locals now they've served their purpose.
-art_cflags :=
-art_asflags :=
-art_host_cflags :=
-art_target_cflags :=
-art_debug_cflags :=
-art_non_debug_cflags :=
-art_debug_asflags :=
-art_non_debug_asflags :=
-art_host_non_debug_cflags :=
-art_target_non_debug_cflags :=
-art_default_gc_type_cflags :=
-
-ART_TARGET_LDFLAGS :=
-
-# $(1): ndebug_or_debug
-define set-target-local-cflags-vars
-  LOCAL_CFLAGS += $(ART_TARGET_CFLAGS)
-  LOCAL_ASFLAGS += $(ART_TARGET_ASFLAGS)
-  LOCAL_LDFLAGS += $(ART_TARGET_LDFLAGS)
-  art_target_cflags_ndebug_or_debug := $(1)
-  ifeq ($$(art_target_cflags_ndebug_or_debug),debug)
-    LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS)
-    LOCAL_ASFLAGS += $(ART_TARGET_DEBUG_ASFLAGS)
-  else
-    LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS)
-    LOCAL_ASFLAGS += $(ART_TARGET_NON_DEBUG_ASFLAGS)
-  endif
-
-  # Clear locally used variables.
-  art_target_cflags_ndebug_or_debug :=
-endef
-
 # Support for disabling certain builds.
 ART_BUILD_TARGET := false
 ART_BUILD_HOST := false
-ART_BUILD_NDEBUG := false
-ART_BUILD_DEBUG := false
 ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
   ART_BUILD_TARGET := true
-  ART_BUILD_NDEBUG := true
 endif
 ifeq ($(ART_BUILD_TARGET_DEBUG),true)
   ART_BUILD_TARGET := true
-  ART_BUILD_DEBUG := true
 endif
 ifeq ($(ART_BUILD_HOST_NDEBUG),true)
   ART_BUILD_HOST := true
-  ART_BUILD_NDEBUG := true
 endif
 ifeq ($(ART_BUILD_HOST_DEBUG),true)
   ART_BUILD_HOST := true
-  ART_BUILD_DEBUG := true
 endif
 
 endif # ART_ANDROID_COMMON_BUILD_MK
diff --git a/build/Android.common_test.mk b/build/Android.common_test.mk
index 8124ca3..449502c 100644
--- a/build/Android.common_test.mk
+++ b/build/Android.common_test.mk
@@ -26,10 +26,6 @@
 ART_HOST_TEST_DIR := /tmp/$(USER)/test-art-$(shell echo $$PPID)
 endif
 
-# We need to set a define for the nativetest dir so that common_runtime_test will know the right
-# path. (The problem is being a 32b test on 64b device, which is still located in nativetest64).
-ART_TARGET_CFLAGS += -DART_TARGET_NATIVETEST_DIR=${ART_TARGET_NATIVETEST_DIR}
-
 # List of known broken tests that we won't attempt to execute. The test name must be the full
 # rule name such as test-art-host-oat-optimizing-HelloWorld64.
 ART_TEST_KNOWN_BROKEN :=
diff --git a/build/Android.common_utils.mk b/build/Android.common_utils.mk
deleted file mode 100644
index 8069c3a..0000000
--- a/build/Android.common_utils.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (C) 2014 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-ifndef ART_ANDROID_COMMON_UTILS_MK
-ART_ANDROID_COMMON_UTILS_MK = true
-
-#
-# Convert a string into an uppercase string.
-#
-# $(1): a string which should be made uppercase
-art-string-to-uppercase = $(shell echo $(1) | tr '[:lower:]' '[:upper:]')
-
-endif # ART_ANDROID_COMMON_UTILS_MK
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
deleted file mode 100644
index f38a14d..0000000
--- a/build/Android.executable.mk
+++ /dev/null
@@ -1,251 +0,0 @@
-#
-# Copyright (C) 2011 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-include art/build/Android.common_build.mk
-
-ART_EXECUTABLES_CFLAGS :=
-
-# $(1): executable ("d" will be appended for debug version, "s" will be appended for static version)
-# $(2): source
-# $(3): extra shared libraries
-# $(4): extra include directories
-# $(5): target or host
-# $(6): ndebug or debug
-# $(7): value for LOCAL_MULTILIB (empty means default)
-# $(8): static or shared (empty means shared, applies only for host)
-define build-art-executable
-  ifneq ($(5),target)
-    ifneq ($(5),host)
-      $$(error expected target or host for argument 5, received $(5))
-    endif
-  endif
-  ifneq ($(6),ndebug)
-    ifneq ($(6),debug)
-      $$(error expected ndebug or debug for argument 6, received $(6))
-    endif
-  endif
-
-  art_executable := $(1)
-  art_source := $(2)
-  art_libraries := $(3)
-  art_c_includes := $(4)
-  art_target_or_host := $(5)
-  art_ndebug_or_debug := $(6)
-  art_multilib := $(7)
-  art_static_or_shared := $(8)
-  art_out_binary_name :=
-
-  include $(CLEAR_VARS)
-  LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
-  LOCAL_MODULE_TAGS := optional
-  LOCAL_SRC_FILES := $$(art_source)
-  LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime art/cmdline $$(art_c_includes)
-
-  ifeq ($$(art_static_or_shared),static)
-    LOCAL_STATIC_LIBRARIES += $$(art_libraries)
-  else
-    LOCAL_SHARED_LIBRARIES += $$(art_libraries)
-  endif
-
-  ifeq ($$(art_ndebug_or_debug),ndebug)
-    LOCAL_MODULE := $$(art_executable)
-  else #debug
-    LOCAL_MODULE := $$(art_executable)d
-  endif
-
-  ifeq ($$(art_static_or_shared),static)
-    LOCAL_MODULE := $$(LOCAL_MODULE)s
-  endif
-
-  LOCAL_CFLAGS := $(ART_EXECUTABLES_CFLAGS)
-  # Mac OS linker doesn't understand --export-dynamic.
-  ifneq ($$(HOST_OS)-$$(art_target_or_host),darwin-host)
-    LOCAL_LDFLAGS := -Wl,--export-dynamic
-  endif
-
-  ifeq ($$(art_target_or_host),target)
-    LOCAL_CLANG := $(ART_TARGET_CLANG)
-    $(call set-target-local-cflags-vars,$(6))
-    LOCAL_SHARED_LIBRARIES += libdl
-  else # host
-    LOCAL_CLANG := $(ART_HOST_CLANG)
-    LOCAL_CFLAGS += $(ART_HOST_CFLAGS)
-    LOCAL_ASFLAGS += $(ART_HOST_ASFLAGS)
-    ifeq ($$(art_ndebug_or_debug),debug)
-      LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS)
-      LOCAL_ASFLAGS += $(ART_HOST_DEBUG_ASFLAGS)
-    else
-      LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS)
-      LOCAL_ASFLAGS += $(ART_HOST_NON_DEBUG_ASFLAGS)
-    endif
-    LOCAL_LDLIBS += -lpthread -ldl
-    ifeq ($$(art_static_or_shared),static)
-      LOCAL_LDFLAGS += -static
-      # We need this because GC stress mode makes use of _Unwind_GetIP and _Unwind_Backtrace and
-      # the symbols are also defined in libgcc_eh.a(unwind-dw2.o)
-      # TODO: Having this is not ideal as it might obscure errors. Try to get rid of it.
-      LOCAL_LDFLAGS += -z muldefs
-      ifeq ($$(HOST_OS),linux)
-        LOCAL_LDLIBS += -lrt -lncurses -ltinfo
-      endif
-      ifeq ($$(HOST_OS),darwin)
-        LOCAL_LDLIBS += -lncurses -ltinfo
-      endif
-    endif
-
-  endif
-
-  # If dynamically linked add libart by default. Statically linked executables
-  # needs to specify it in art_libraries to ensure proper ordering.
-  ifeq ($$(art_ndebug_or_debug),ndebug)
-    ifneq ($$(art_static_or_shared),static)
-      LOCAL_SHARED_LIBRARIES += libart
-    endif
-  else # debug
-    ifneq ($$(art_static_or_shared),static)
-      LOCAL_SHARED_LIBRARIES += libartd
-    endif
-  endif
-
-  LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
-  LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.common_utils.mk
-  LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.executable.mk
-
-  ifeq ($$(art_target_or_host),target)
-    LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH)
-  endif
-
-  ifdef ART_MULTILIB_OVERRIDE_$$(art_target_or_host)
-    art_multilib := $$(ART_MULTILIB_OVERRIDE_$$(art_target_or_host))
-  endif
-
-  LOCAL_MULTILIB := $$(art_multilib)
-  art_out_binary_name := $$(LOCAL_MODULE)
-
-  # If multilib=both (potentially building both 32-bit and 64-bit), need to provide stem.
-  ifeq ($$(art_multilib),both)
-    # Set up a 32-bit/64-bit stem if we are building both binaries.
-    # In this case, the 32-bit binary has an additional 32-bit suffix.
-    LOCAL_MODULE_STEM_32 := $$(LOCAL_MODULE)32
-    LOCAL_MODULE_STEM_64 := $$(LOCAL_MODULE)
-
-    # Remember the binary names so we can add them to the global art executables list later.
-    art_out_binary_name := $$(LOCAL_MODULE_STEM_32) $$(LOCAL_MODULE_STEM_64)
-
-    # For single-architecture targets, remove any binary name suffixes.
-    ifeq ($$(art_target_or_host),target)
-      ifeq (,$(TARGET_2ND_ARCH))
-        LOCAL_MODULE_STEM_32 := $$(LOCAL_MODULE)
-        art_out_binary_name := $$(LOCAL_MODULE)
-      endif
-    endif
-
-    # For single-architecture hosts, remove any binary name suffixes.
-    ifeq ($$(art_target_or_host),host)
-      ifeq (,$(HOST_2ND_ARCH))
-        LOCAL_MODULE_STEM_32 := $$(LOCAL_MODULE)
-        art_out_binary_name := $$(LOCAL_MODULE)
-      endif
-    endif
-  endif
-
-  LOCAL_NATIVE_COVERAGE := $(ART_COVERAGE)
-
-  ifeq ($$(art_target_or_host),target)
-    include $(BUILD_EXECUTABLE)
-  else # host
-    LOCAL_IS_HOST_MODULE := true
-    include $(BUILD_HOST_EXECUTABLE)
-  endif
-
-  # Clear out local variables now that we're done with them.
-  art_executable :=
-  art_source :=
-  art_libraries :=
-  art_c_includes :=
-  art_target_or_host :=
-  art_ndebug_or_debug :=
-  art_multilib :=
-  art_static_or_shared :=
-  art_out_binary_name :=
-
-endef
-
-#
-# Build many art executables from multiple variations (debug/ndebug, host/target, 32/64bit).
-# By default only either 32-bit or 64-bit is built (but not both -- see multilib arg).
-# All other variations are gated by ANDROID_BUILD_(TARGET|HOST)_[N]DEBUG.
-# The result must be eval-uated.
-#
-# $(1): executable name
-# $(2): source files
-# $(3): library dependencies (common); debug prefix is added on as necessary automatically.
-# $(4): library dependencies (target only)
-# $(5): library dependencies (host only)
-# $(6): extra include directories
-# $(7): multilib (default: empty), valid values: {,32,64,both})
-# $(8): host prefer 32-bit: {true, false} (default: false).  If argument
-#       `multilib` is explicitly set to 64, ignore the "host prefer 32-bit"
-#       setting and only build a 64-bit executable on host.
-define build-art-multi-executable
-  $(foreach debug_flavor,ndebug debug,
-    $(foreach target_flavor,host target,
-      art-multi-binary-name := $(1)
-      art-multi-source-files := $(2)
-      art-multi-lib-dependencies := $(3)
-      art-multi-lib-dependencies-target := $(4)
-      art-multi-lib-dependencies-host := $(5)
-      art-multi-include-extra := $(6)
-      art-multi-multilib := $(7)
-      art-multi-host-prefer-32-bit := $(8)
-
-      # Add either -host or -target specific lib dependencies to the lib dependencies.
-      art-multi-lib-dependencies += $$(art-multi-lib-dependencies-$(target_flavor))
-
-      # Replace libart- prefix with libartd- for debug flavor.
-      ifeq ($(debug_flavor),debug)
-        art-multi-lib-dependencies := $$(subst libart-,libartd-,$$(art-multi-lib-dependencies))
-      endif
-
-      # Build the env guard var name, e.g. ART_BUILD_HOST_NDEBUG.
-      art-multi-env-guard := $$(call art-string-to-uppercase,ART_BUILD_$(target_flavor)_$(debug_flavor))
-
-      ifeq ($(target_flavor),host)
-        ifeq ($$(art-multi-host-prefer-32-bit),true)
-          ifneq ($$(art-multi-multilib),64)
-            art-multi-multilib := 32
-          endif
-        endif
-      endif
-
-      # Build the art executable only if the corresponding env guard was set.
-      ifeq ($$($$(art-multi-env-guard)),true)
-        $$(eval $$(call build-art-executable,$$(art-multi-binary-name),$$(art-multi-source-files),$$(art-multi-lib-dependencies),$$(art-multi-include-extra),$(target_flavor),$(debug_flavor),$$(art-multi-multilib)))
-      endif
-
-      # Clear locals now they've served their purpose.
-      art-multi-binary-name :=
-      art-multi-source-files :=
-      art-multi-lib-dependencies :=
-      art-multi-lib-dependencies-target :=
-      art-multi-lib-dependencies-host :=
-      art-multi-include-extra :=
-      art-multi-multilib :=
-      art-multi-host-prefer-32-bit :=
-      art-multi-env-guard :=
-    )
-  )
-endef
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index c70f005..07ff611 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -223,8 +223,6 @@
     $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_$(m)))
 endif
 
-ART_TEST_CFLAGS :=
-
 # Variables holding collections of gtest pre-requisits used to run a number of gtests.
 ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
 ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
@@ -572,7 +570,6 @@
 RUNTIME_GTEST_HOST_SRC_FILES :=
 COMPILER_GTEST_TARGET_SRC_FILES :=
 COMPILER_GTEST_HOST_SRC_FILES :=
-ART_TEST_CFLAGS :=
 ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
 ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
 ART_TEST_HOST_GTEST_RULES :=