[PATCH] D49558: [UBSan] Also use blacklist for 'Address; Undefined' setting

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 10:33:17 PDT 2018


fhahn created this revision.
fhahn added reviewers: eugenis, vitalybuka.
Herald added a subscriber: mgorny.

It looks like currently the UBSan blacklist is only applied when "Undefined" is selected.
This patch updates the cmake file to apply it whenever Undefined is selected
 (e.g. 'Address; Undefined' ). This  allows us to use the workaround added in
https://reviews.llvm.org/rL335525 when using AddressSan and UBSan together.


https://reviews.llvm.org/D49558

Files:
  cmake/modules/HandleLLVMOptions.cmake


Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -678,6 +678,11 @@
       append_common_sanitizer_flags()
       append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
               CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+      set(BLACKLIST_FILE "${CMAKE_SOURCE_DIR}/utils/sanitizers/ubsan_blacklist.txt")
+      if (EXISTS "${BLACKLIST_FILE}")
+        append("-fsanitize-blacklist=${BLACKLIST_FILE}"
+	              CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+      endif()
     elseif (LLVM_USE_SANITIZER STREQUAL "Leaks")
       append_common_sanitizer_flags()
       append("-fsanitize=leak" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49558.156296.patch
Type: text/x-patch
Size: 798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180719/7220ceb2/attachment.bin>


More information about the llvm-commits mailing list