summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2015-02-04 22:33:31 +0000
committerFilipe Cabecinhas <me@filcab.net>2015-02-04 22:33:31 +0000
commitb36685ee85d1b563c5c79c7ca3b7f17275dc2d50 (patch)
treeab5b26f37d9c6be0a36ab059fbdbd179c6da0bfb
parentcd540c095a3c3e09e1dad9d922b8de6155f9ee63 (diff)
downloadbcm5719-llvm-b36685ee85d1b563c5c79c7ca3b7f17275dc2d50.tar.gz
bcm5719-llvm-b36685ee85d1b563c5c79c7ca3b7f17275dc2d50.zip
Handle LLVM_USE_SANITIZER=Address;Undefined (and the other way around)
Summary: Handle LLVM_USE_SANITIZER=Address;Undefined to enable ASan and UBSan If UBSan is compatible with more of the other sanitizers, maybe we should deal with this in a better way where we allow combining UBSan with any of the other sanitizers. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7024 llvm-svn: 228219
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index d38a4953abb..de785d5bb59 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -404,6 +404,11 @@ if(LLVM_USE_SANITIZER)
elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
append_common_sanitizer_flags()
append("-fsanitize=thread" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+ elseif (LLVM_USE_SANITIZER STREQUAL "Address;Undefined" OR
+ LLVM_USE_SANITIZER STREQUAL "Undefined;Address")
+ append_common_sanitizer_flags()
+ append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover"
+ CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
else()
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
endif()
OpenPOWER on IntegriCloud