diff options
author | Dan Albert <danalbert@google.com> | 2015-04-17 09:48:33 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-04-17 11:06:24 -0700 |
commit | 94b579166fa9daabf5bfde579b2739a19975e872 (patch) | |
tree | 8bfb259061ed43316e74cf973f5482254379d0ba /core/config_sanitizers.mk | |
parent | 2717620873fa1936779662a96de05033b89ddb19 (diff) | |
download | build-94b579166fa9daabf5bfde579b2739a19975e872.zip build-94b579166fa9daabf5bfde579b2739a19975e872.tar.gz build-94b579166fa9daabf5bfde579b2739a19975e872.tar.bz2 |
Make use of sanitizers without clang an error.
Previously using a sanitizer would imply clang. It should be an error
instead so it's more obvious.
Change-Id: I67c949bfda3718a0d19da7e358b5fde447fce334
Diffstat (limited to 'core/config_sanitizers.mk')
-rw-r--r-- | core/config_sanitizers.mk | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index e7a516e..99dc55e 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -12,8 +12,10 @@ ifeq ($(my_sanitize_host),true) my_sanitize_host := address endif -# `LOCAL_CLANG := false` disables SANITIZE_HOST. -ifeq ($(my_clang),false) +# 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_host := endif @@ -43,6 +45,13 @@ ifeq ($(my_sanitize),never) my_sanitize := endif +# Sanitizers can only be used with clang. +ifneq ($(my_clang),true) + ifneq ($(my_sanitize),) + $(error $(LOCAL_PATH): $(LOCAL_MODULE): Use of sanitizers requires LOCAL_CLANG := true) + endif +endif + unknown_sanitizers := $(filter-out address, \ $(filter-out undefined,$(my_sanitize))) @@ -51,8 +60,6 @@ ifneq ($(unknown_sanitizers),) endif ifneq ($(my_sanitize),) - my_clang := true - fsanitize_arg := $(subst $(space),$(comma),$(my_sanitize)), my_cflags += -fsanitize=$(fsanitize_arg) |