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/clang/config.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/clang/config.mk')
-rw-r--r-- | core/clang/config.mk | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/clang/config.mk b/core/clang/config.mk index e2a4c08..24c06b6 100644 --- a/core/clang/config.mk +++ b/core/clang/config.mk @@ -98,6 +98,32 @@ CLANG_CONFIG_TARGET_EXTRA_CFLAGS := -nostdlibinc CLANG_CONFIG_TARGET_EXTRA_CPPFLAGS := -nostdlibinc CLANG_CONFIG_TARGET_EXTRA_LDFLAGS := +CLANG_DEFAULT_UB_CHECKS := \ + bool \ + integer-divide-by-zero \ + return \ + returns-nonnull-attribute \ + shift-exponent \ + unreachable \ + vla-bound \ + +# TODO(danalbert): The following checks currently have compiler performance +# issues. +# CLANG_DEFAULT_UB_CHECKS += alignment +# CLANG_DEFAULT_UB_CHECKS += bounds +# CLANG_DEFAULT_UB_CHECKS += enum +# CLANG_DEFAULT_UB_CHECKS += float-cast-overflow +# CLANG_DEFAULT_UB_CHECKS += float-divide-by-zero +# CLANG_DEFAULT_UB_CHECKS += nonnull-attribute +# CLANG_DEFAULT_UB_CHECKS += null +# CLANG_DEFAULT_UB_CHECKS += shift-base +# CLANG_DEFAULT_UB_CHECKS += signed-integer-overflow + +# TODO(danalbert): Fix UB in libc++'s __tree so we can turn this on. +# https://llvm.org/PR19302 +# http://reviews.llvm.org/D6974 +# CLANG_DEFAULT_UB_CHECKS += object-size + # HOST config clang_2nd_arch_prefix := include $(BUILD_SYSTEM)/clang/HOST_$(HOST_ARCH).mk |