diff options
author | Chih-Hung Hsieh <chh@google.com> | 2016-03-09 14:53:43 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2016-03-16 15:58:48 -0700 |
commit | 6817f4b36357f068cb0d83e1d577d7a393e68a03 (patch) | |
tree | 81f6435c1931b2445dabb6bec32912f5de1cb6fc | |
parent | 1e30dc0511c398b69cfee456881754054d515242 (diff) | |
download | android_art-6817f4b36357f068cb0d83e1d577d7a393e68a03.tar.gz android_art-6817f4b36357f068cb0d83e1d577d7a393e68a03.tar.bz2 android_art-6817f4b36357f068cb0d83e1d577d7a393e68a03.zip |
Build dex2oat without asan instrumentation.
Instead of a two pass build to use ASAN,
build dex2oat with LOCAL_SANITIZE:=never.
BUG: 22233158
Change-Id: Ic881dc10c386c7fa81329d465182a23eb2387e41
-rw-r--r-- | build/Android.executable.mk | 5 | ||||
-rw-r--r-- | dex2oat/Android.mk | 17 |
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 |