diff options
author | Evgenii Stepanov <eugenis@google.com> | 2016-05-19 17:45:21 -0700 |
---|---|---|
committer | Evgenii Stepanov <eugenis@google.com> | 2016-07-01 20:06:34 +0000 |
commit | 71faa1990bd543ab72fda9faa97e0f8fc9bcd75f (patch) | |
tree | a7a55fa8140a9e7ff879d681555d34730664f25f | |
parent | 9d73af09346247352cd3eea8bbc857432ced6c32 (diff) | |
download | build-71faa1990bd543ab72fda9faa97e0f8fc9bcd75f.tar.gz |
Apply SANITIZE_TARGET and LOCAL_SANITIZE when both are present.
The idea is that targets with LOCAL_SANITIZE = signed-integer-overflow
and SANITIZE_TARGET=safe-stack should get both sanitizers.
This should work just fine for SANITIZE_TARGET=address, too.
Bug: 27729263
Change-Id: Ifee350da4877008fb061bc7f6c700e7fade405bc
-rw-r--r-- | core/config_sanitizers.mk | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 18b74783a5..41f0680bb7 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -19,9 +19,8 @@ ifeq ($(my_clang),true) endif endif -# The sanitizer specified by the environment wins over the module. ifneq ($(my_global_sanitize),) - my_sanitize := $(my_global_sanitize) + my_sanitize := $(my_global_sanitize) $(my_sanitize) endif # The sanitizer specified in the product configuration wins over the previous. @@ -118,11 +117,10 @@ ifneq ($(my_sanitize),) my_ldflags += -fsanitize=$(fsanitize_arg) my_ldlibs += -lrt -ldl else - ifeq ($(filter address,$(my_sanitize)),) - my_cflags += -fsanitize-trap=all - my_cflags += -ftrap-function=abort - endif + my_cflags += -fsanitize-trap=all + my_cflags += -ftrap-function=abort ifneq ($(filter address thread,$(my_sanitize)),) + my_cflags += -fno-sanitize-trap=address,thread my_shared_libraries += libdl endif endif |