Disable sanitization of dex2oat on device.

Bug: 22233158
Change-Id: I54990bb167a65275ed28e0cbbab56b936eb70ca4
diff --git a/dex2oat/Android.mk b/dex2oat/Android.mk
index 321cd75..0f0a396 100644
--- a/dex2oat/Android.mk
+++ b/dex2oat/Android.mk
@@ -14,6 +14,15 @@
 # limitations under the License.
+# ASan slows down dex2oat by ~3.5x, which translates into extremely slow first
+# boot. Disabled to help speed up SANITIZE_TARGET mode.
+# The supported way of using SANITIZE_TARGET is by first running a normal build,
+# followed by a SANITIZE_TARGET=address build on top of it (in the same build
+# tree). By disabling this module in SANITIZE_TARGET build, we keep the regular,
+# uninstrumented version of it.
+# Bug: 22233158
+ifneq (address,$(strip $(SANITIZE_TARGET)))
 LOCAL_PATH := $(call my-dir)
 include art/build/Android.executable.mk
@@ -51,3 +60,5 @@
 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)))