ART: Add ART_ENABLE_ADDRESS_SANITIZER as env variable

Accept ART_ENABLE_ADDRESS_SANITIZER in art.go.

Bug: 31098551
Test: ART_ENABLE_ADDRESS_SANITIZER=true SANITIZE_HOST=address m test-art-host
Change-Id: I7602a7b4c1d9a8cd4e08ba764769dc194f611fd5
diff --git a/build/art.go b/build/art.go
index 1b9c646..c06be0a 100644
--- a/build/art.go
+++ b/build/art.go
@@ -97,6 +97,12 @@
 			"-DART_STACK_OVERFLOW_GAP_x86_64=8192")
 	}
 
+	if envTrue(ctx, "ART_ENABLE_ADDRESS_SANITIZER") {
+		// Used to enable full sanitization, i.e., user poisoning, under ASAN.
+		cflags = append(cflags, "-DART_ENABLE_ADDRESS_SANITIZER=1")
+		asflags = append(asflags, "-DART_ENABLE_ADDRESS_SANITIZER=1")
+	}
+
 	return cflags, asflags
 }