diff options
author | Dan Albert <danalbert@google.com> | 2015-04-16 18:07:07 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-04-17 11:37:03 -0700 |
commit | b5b2ffe3be103325db681e671cbbde7c7d89e768 (patch) | |
tree | da1b843b6aea9f87128ad0afdad9c1e5dcbe34a5 /core/config_sanitizers.mk | |
parent | 1d8f780c7d15441ad6582fc32447d9409c39f31a (diff) | |
download | build-b5b2ffe3be103325db681e671cbbde7c7d89e768.zip build-b5b2ffe3be103325db681e671cbbde7c7d89e768.tar.gz build-b5b2ffe3be103325db681e671cbbde7c7d89e768.tar.bz2 |
Add support for a partial ubsan build.
Some of the ubsan checks expose a few pathological performance cases
in clang, and thus aren't suited to be used in SANITIZE_HOST.
This mode is also supported on the target despite not having the
target runtime libraries for ubsan by generating traps.
Change-Id: I0b0f0a08ca84d72e44e2174a66726b1c5e5cad7e
Diffstat (limited to 'core/config_sanitizers.mk')
-rw-r--r-- | core/config_sanitizers.mk | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index b433712..210d442 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -50,11 +50,15 @@ ifneq ($(my_clang),true) endif endif -unknown_sanitizers := $(filter-out address, \ - $(filter-out undefined,$(my_sanitize))) +ifneq ($(filter default-ub,$(my_sanitize)),) + my_sanitize := $(CLANG_DEFAULT_UB_CHECKS) + my_ldlibs += -ldl -ifneq ($(unknown_sanitizers),) - $(error Unknown sanitizers: $(unknown_sanitizers)) + ifdef LOCAL_IS_HOST_MODULE + my_cflags += -fno-sanitize-recover=all + else + my_cflags += -fsanitize-undefined-trap-on-error + endif endif ifneq ($(my_sanitize),) |