summaryrefslogtreecommitdiffstats
path: root/compiler-rt/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-09-15 20:24:12 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-09-15 20:24:12 +0000
commitd13d61fdb4166236c77893e08a5c60c0bfa0dc0c (patch)
treea713022ae86723e19954df563192b66bf60e662a /compiler-rt/CMakeLists.txt
parentb5ab895e2a62486d29e3bc564cc3f2edde3ff719 (diff)
downloadbcm5719-llvm-d13d61fdb4166236c77893e08a5c60c0bfa0dc0c.tar.gz
bcm5719-llvm-d13d61fdb4166236c77893e08a5c60c0bfa0dc0c.zip
ubsan: Unbreak ubsan_cxx runtime library on Windows.
This was originally broken by r258744 which introduced a weak reference from ubsan to ubsan_cxx. This reference does not work directly on Windows because COFF has no direct concept of weak symbols. The fix is to use /alternatename to create a weak external reference to ubsan_cxx. Also fix the definition (and the name, so that we drop cached values) of the cmake flag that controls whether to build ubsan_cxx. Now the user-controllable flag is always on, and we turn it off internally depending on whether we support building it. Differential Revision: https://reviews.llvm.org/D37882 llvm-svn: 313391
Diffstat (limited to 'compiler-rt/CMakeLists.txt')
-rw-r--r--compiler-rt/CMakeLists.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 51842809272..90cdac73a33 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -94,14 +94,17 @@ include(config-ix)
if(APPLE AND SANITIZER_MIN_OSX_VERSION 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(use_cxxabi_default OFF)
-elseif(MSVC)
- set(use_cxxabi_default OFF)
+ set(cxxabi_supported OFF)
else()
- set(use_cxxabi_default ON)
+ set(cxxabi_supported ON)
endif()
-option(SANITIZER_CAN_USE_CXXABI "Sanitizers can use cxxabi" ${use_cxxabi_default})
+option(SANITIZER_ALLOW_CXXABI "Allow use of C++ ABI details in ubsan" ON)
+
+set(SANITIZE_CAN_USE_CXXABI OFF)
+if (cxxabi_supported AND SANITIZER_ALLOW_CXXABI)
+ set(SANITIZER_CAN_USE_CXXABI ON)
+endif()
pythonize_bool(SANITIZER_CAN_USE_CXXABI)
set(SANITIZER_CXX_ABI "default" CACHE STRING
OpenPOWER on IntegriCloud