summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/Android.executable.mk5
-rw-r--r--dex2oat/Android.mk17
2 files changed, 18 insertions, 4 deletions
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index dfea6e191e..978cd901c8 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -28,6 +28,7 @@ ART_EXECUTABLES_CFLAGS :=
# $(5): target or host
# $(6): ndebug or debug
# $(7): value for LOCAL_MULTILIB (empty means default)
+# $(8): value for LOCAL_SANITIZE (empty means default)
define build-art-executable
ifneq ($(5),target)
ifneq ($(5),host)
@@ -47,6 +48,7 @@ define build-art-executable
art_target_or_host := $(5)
art_ndebug_or_debug := $(6)
art_multilib := $(7)
+ art_local_sanitize := $(8)
art_out_binary_name :=
include $(CLEAR_VARS)
@@ -69,6 +71,8 @@ define build-art-executable
LOCAL_LDFLAGS := -Wl,--export-dynamic
endif
+ LOCAL_SANITIZE := $$(art_local_sanitize)
+
ifeq ($$(art_target_or_host),target)
$(call set-target-local-clang-vars)
$(call set-target-local-cflags-vars,$(6))
@@ -149,6 +153,7 @@ define build-art-executable
art_ndebug_or_debug :=
art_multilib :=
art_out_binary_name :=
+ art_local_sanitize :=
endef
diff --git a/dex2oat/Android.mk b/dex2oat/Android.mk
index 3783c2b4ba..a46ab9b5ed 100644
--- a/dex2oat/Android.mk
+++ b/dex2oat/Android.mk
@@ -18,6 +18,15 @@ LOCAL_PATH := $(call my-dir)
include art/build/Android.executable.mk
+# ASan slows down dex2oat by ~3.5x, which translates into extremely slow first
+# boot. Disabled to help speed up SANITIZE_TARGET mode.
+# Bug: 22233158
+ifneq (,$(filter address, $(SANITIZE_TARGET)))
+dex2oat_sanitize := never
+else
+dex2oat_sanitize :=
+endif
+
DEX2OAT_SRC_FILES := \
dex2oat.cc
@@ -42,16 +51,16 @@ else
endif
ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
- $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libart-compiler,art/compiler,target,ndebug,$(dex2oat_target_arch)))
+ $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libart-compiler,art/compiler,target,ndebug,$(dex2oat_target_arch),,$(dex2oat_sanitize)))
endif
ifeq ($(ART_BUILD_TARGET_DEBUG),true)
- $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libartd-compiler,art/compiler,target,debug,$(dex2oat_target_arch)))
+ $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libartd-compiler,art/compiler,target,debug,$(dex2oat_target_arch),,$(dex2oat_sanitize)))
endif
# We always build dex2oat and dependencies, even if the host build is otherwise disabled, since they are used to cross compile for the target.
ifeq ($(ART_BUILD_HOST_NDEBUG),true)
- $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libart-compiler libziparchive-host,art/compiler,host,ndebug,$(dex2oat_host_arch)))
+ $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libart-compiler libziparchive-host,art/compiler,host,ndebug,$(dex2oat_host_arch),,$(dex2oat_sanitize)))
endif
ifeq ($(ART_BUILD_HOST_DEBUG),true)
- $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libartd-compiler libziparchive-host,art/compiler,host,debug,$(dex2oat_host_arch)))
+ $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libartd-compiler libziparchive-host,art/compiler,host,debug,$(dex2oat_host_arch),,$(dex2oat_sanitize)))
endif