From cec4461c47a8490d84cd2fb78abf02dcfb1e9790 Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Wed, 4 Feb 2015 22:33:31 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228219 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/HandleLLVMOptions.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index d38a4953abb..de785d5bb59 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/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()