[PATCH] D23376: [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration

Francis Ricci via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 14:48:33 PDT 2016


fjricci created this revision.
fjricci added reviewers: samsonov, beanz, rnk, pcc.
fjricci added subscribers: compnerd, llvm-commits.
Herald added subscribers: dberris, kubabrecka.

This will allow for the sanitizers to be used when c++ abi is unavailable.

https://reviews.llvm.org/D23376

Files:
  CMakeLists.txt
  lib/ubsan/ubsan_type_hash_itanium.cc

Index: lib/ubsan/ubsan_type_hash_itanium.cc
===================================================================
--- lib/ubsan/ubsan_type_hash_itanium.cc
+++ lib/ubsan/ubsan_type_hash_itanium.cc
@@ -13,7 +13,7 @@
 
 #include "sanitizer_common/sanitizer_platform.h"
 #include "ubsan_platform.h"
-#if CAN_SANITIZE_UB && !SANITIZER_WINDOWS
+#if CAN_SANITIZE_UB && UBSAN_CAN_USE_CXXABI
 #include "ubsan_type_hash.h"
 
 #include "sanitizer_common/sanitizer_common.h"
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -204,14 +204,16 @@
 # Warnings to turn off for all libraries, not just sanitizers.
 append_string_if(COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG -Wno-unused-parameter CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 
-if(APPLE AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9")
-  # Mac OS X prior to 10.9 had problems with exporting symbols from
-  # libc++/libc++abi.
-  set(SANITIZER_CAN_USE_CXXABI FALSE)
-elseif(MSVC)
-  set(SANITIZER_CAN_USE_CXXABI FALSE)
-else()
-  set(SANITIZER_CAN_USE_CXXABI TRUE)
+if (NOT DEFINED SANITIZER_CAN_USE_CXXABI)
+  if(APPLE AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9")
+    # Mac OS X prior to 10.9 had problems with exporting symbols from
+    # libc++/libc++abi.
+    set(SANITIZER_CAN_USE_CXXABI FALSE)
+  elseif(MSVC)
+    set(SANITIZER_CAN_USE_CXXABI FALSE)
+  else()
+    set(SANITIZER_CAN_USE_CXXABI TRUE)
+  endif()
 endif()
 pythonize_bool(SANITIZER_CAN_USE_CXXABI)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23376.67611.patch
Type: text/x-patch
Size: 1492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160810/9266d16c/attachment.bin>


More information about the llvm-commits mailing list