Build: Add module-level product configuration of sanitization
To allow special sanitizer settings for modules shared between
products, add product-specific module settings.
This was copied from the product-specific dexopt settings.
Bug: 29498013
Change-Id: I17a96b975bb6ac7f4ffb3d5b08e2f00b21bd97a1
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index f84a66f..dbcf276 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -24,6 +24,14 @@
my_sanitize := $(my_global_sanitize)
endif
+# The sanitizer specified in the product configuration wins over the previous.
+ifneq ($(SANITIZER.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG),)
+ my_sanitize := $(SANITIZER.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG)
+ ifeq ($(my_sanitize),never)
+ my_sanitize :=
+ endif
+endif
+
# Add a filter point for 32-bit vs 64-bit sanitization (to lighten the burden).
SANITIZE_ARCH ?= 32 64
ifeq ($(filter $(SANITIZE_ARCH),$(my_32_64_bit_suffix)),)