aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2016-06-20 17:46:29 -0700
committerAndreas Gampe <agampe@google.com>2016-06-30 16:20:03 -0700
commit3d3b0c950d97d931de0b013e4ed70bb43c8162d3 (patch)
treebf959ed09eadf1de66f67474428b6a3d468df694
parentcd25740cba701f21a90f13fe084f2a5caf3bd596 (diff)
downloadbuild-3d3b0c950d97d931de0b013e4ed70bb43c8162d3.tar.gz
Build: Add option to restrict sanitization by owner
Add Make variable SANITIZE_NEVER_BY_OWNER to selectively sanitize modules. By default, both are being sanitized. The value of the variable is interpreted as a space or colon separated list of owner names. This can be used to create builds that lower the sanitization burden by not sanitizing parts of the platform. Bug: 29498013 Change-Id: Ib4412657fd38ff28a5c0863eddc2acde63c88ebb (cherry picked from commit ea38d8e95d7daea49cc2a528d69e06a0005b31a6)
-rw-r--r--core/config_sanitizers.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 62807aa8d9..f387f053a3 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -30,6 +30,17 @@ ifeq ($(filter $(SANITIZE_ARCH),$(my_32_64_bit_suffix)),)
my_sanitize :=
endif
+# Add a filter point based on module owner (to lighten the burden). The format is a space- or
+# colon-separated list of owner names.
+ifneq (,$(SANITIZE_NEVER_BY_OWNER))
+ ifneq (,$(LOCAL_MODULE_OWNER))
+ ifneq (,$(filter $(LOCAL_MODULE_OWNER),$(subst :, ,$(SANITIZE_NEVER_BY_OWNER))))
+ $(warning Not sanitizing $(LOCAL_MODULE) based on module owner.)
+ my_sanitize :=
+ endif
+ endif
+endif
+
# Don't apply sanitizers to NDK code.
ifdef LOCAL_SDK_VERSION
my_sanitize :=