summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-08-29 00:50:36 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-08-29 00:50:36 +0000
commit79e9b30b111709761410f0b0a16860e3a7d0eef3 (patch)
tree465546efc3b2d6bdab20c725e5b7482081b348ae /cmake
parentcf45151b2c859e29f07ac1f77f69ac00f2ced4fc (diff)
Introduce -DLLVM_USE_SANITIZER=Undefined CMake option to build UBSan-ified version of LLVM/Clang.
I've fixed most of the simple bugs and currently "check-llvm" test suite has 26 failures, and "check-clang" suite has 5 failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index d17ce11fe9f..2fcdfbefd15 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -363,6 +363,10 @@ if(LLVM_USE_SANITIZER)
if(LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
append("-fsanitize-memory-track-origins" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()
+ elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
+ append_common_sanitizer_flags()
+ append("-fsanitize=undefined -fno-sanitize=vptr -fno-sanitize-recover"
+ CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
else()
message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
endif()