Enable SANITIZE_TARGET.

The same as SANITIZE_HOST, but for the target.
Also, skip all LOCAL_FORCE_STATIC_EXECUTABLE targets, as ASan does not
support static linking.

Bug: 21785137
Change-Id: Ief53ff8de1fee18f230d6c7dd31845db5bbd415c
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 9cff6ea..200d48f 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -9,22 +9,24 @@
   my_sanitize := never
 endif
 
-# Configure SANITIZE_HOST.
-ifdef LOCAL_IS_HOST_MODULE
-  ifeq ($(my_sanitize),)
+# Configure SANITIZE_HOST / SANITIZE_TARGET.
+ifeq ($(my_sanitize),)
+  ifdef LOCAL_IS_HOST_MODULE
     my_sanitize := $(strip $(SANITIZE_HOST))
+  else
+    my_sanitize := $(strip $(SANITIZE_TARGET))
+  endif
 
-    # SANTIZIZE_HOST=true is a deprecated way to say SANITIZE_HOST=address.
-    ifeq ($(my_sanitize),true)
-      my_sanitize := address
-    endif
+  # SANITIZE_HOST=true is a deprecated way to say SANITIZE_HOST=address.
+  ifeq ($(my_sanitize),true)
+    my_sanitize := address
+  endif
 
-    # SANITIZE_HOST is only in effect if the module is already using clang (host
-    # modules that haven't set `LOCAL_CLANG := false` and device modules that
-    # have set `LOCAL_CLANG := true`.
-    ifneq ($(my_clang),true)
-      my_sanitize :=
-    endif
+  # SANITIZE_HOST is only in effect if the module is already using clang (host
+  # modules that haven't set `LOCAL_CLANG := false` and device modules that
+  # have set `LOCAL_CLANG := true`.
+  ifneq ($(my_clang),true)
+    my_sanitize :=
   endif
 endif