[llvm] a70f7a8 - Allow LLVM_USE_SANITIZER=Scudo on Linux.

Russell Gallop via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 04:22:45 PST 2021


Author: Russell Gallop
Date: 2021-01-07T17:37:18Z
New Revision: a70f7a805bcb790f799ec0589f0cff0cc834c688

URL: https://github.com/llvm/llvm-project/commit/a70f7a805bcb790f799ec0589f0cff0cc834c688
DIFF: https://github.com/llvm/llvm-project/commit/a70f7a805bcb790f799ec0589f0cff0cc834c688.diff

LOG: Allow LLVM_USE_SANITIZER=Scudo on Linux.

Will work on Linux but not on Windows as this uses the linker to do the link directly.

This won't work as LLVM cmake build system uses link.exe to link so
won't pick up the libraries, which are added by the compiler driver.

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 5d4d692a70ac..fdb8f30fffc7 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -790,6 +790,9 @@ if(LLVM_USE_SANITIZER)
     elseif (LLVM_USE_SANITIZER STREQUAL "Leaks")
       append_common_sanitizer_flags()
       append("-fsanitize=leak" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    elseif (LLVM_USE_SANITIZER STREQUAL "Scudo")
+      append_common_sanitizer_flags()
+      append("-fsanitize=scudo" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     else()
       message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
     endif()


        


More information about the llvm-commits mailing list