Enable ASan annotations in ART based on macro setting.

This is a quick hack to remove ASan annotations from SANITIZE_TARGET
build, because they are breaking everything - it looks like we forget
to clean redzones from a page before releasing it to the system, and
some unrelated code runs into them later.

We will add some way to control this from the build system later,
or just fix the underlying issue and re-enable by default.

Bug: 21785137
Change-Id: If79e2455e246dc39355f2758323b249ac20b6144
diff --git a/runtime/base/memory_tool.h b/runtime/base/memory_tool.h
index 31162a3..e0bdcfe 100644
--- a/runtime/base/memory_tool.h
+++ b/runtime/base/memory_tool.h
@@ -27,9 +27,17 @@
 
 #include <sanitizer/asan_interface.h>
 #define ADDRESS_SANITIZER
+
+#ifdef ART_ENABLE_ADDRESS_SANITIZER
 #define MEMORY_TOOL_MAKE_NOACCESS(p, s) __asan_poison_memory_region(p, s)
 #define MEMORY_TOOL_MAKE_UNDEFINED(p, s) __asan_unpoison_memory_region(p, s)
 #define MEMORY_TOOL_MAKE_DEFINED(p, s) __asan_unpoison_memory_region(p, s)
+#else
+#define MEMORY_TOOL_MAKE_NOACCESS(p, s) do { (void)(p); (void)(s); } while (0)
+#define MEMORY_TOOL_MAKE_UNDEFINED(p, s) do { (void)(p); (void)(s); } while (0)
+#define MEMORY_TOOL_MAKE_DEFINED(p, s) do { (void)(p); (void)(s); } while (0)
+#endif
+
 #define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
 #define RUNNING_ON_MEMORY_TOOL 1U
 constexpr bool kMemoryToolIsValgrind = false;