aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ubsan_minimal
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:06:48 +0000
commit93c1b73a09a52d4a265f683bf1954b08bb430049 (patch)
tree5543464d74945196cc890e9d9099e5d0660df7eb /lib/ubsan_minimal
parent0d8e7490d6e8a13a8f0977d9b7771803b9f64ea0 (diff)
downloadsrc-93c1b73a09a52d4a265f683bf1954b08bb430049.tar.gz
src-93c1b73a09a52d4a265f683bf1954b08bb430049.zip
Vendor import of compiler-rt trunk r338150:vendor/compiler-rt/compiler-rt-trunk-r338150
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=336817 svn path=/vendor/compiler-rt/compiler-rt-trunk-r338150/; revision=336818; tag=vendor/compiler-rt/compiler-rt-trunk-r338150
Diffstat (limited to 'lib/ubsan_minimal')
-rw-r--r--lib/ubsan_minimal/CMakeLists.txt2
-rw-r--r--lib/ubsan_minimal/ubsan_minimal_handlers.cc13
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/ubsan_minimal/CMakeLists.txt b/lib/ubsan_minimal/CMakeLists.txt
index 54860a3d2764..b70246845f84 100644
--- a/lib/ubsan_minimal/CMakeLists.txt
+++ b/lib/ubsan_minimal/CMakeLists.txt
@@ -44,7 +44,7 @@ if(COMPILER_RT_HAS_UBSAN_MINIMAL)
LINK_LIBS ${UBSAN_DYNAMIC_LIBS}
PARENT_TARGET ubsan-minimal)
- if (UNIX AND NOT APPLE)
+ if (SANITIZER_USE_SYMBOLS AND NOT APPLE)
set(ARCHS_FOR_SYMBOLS ${UBSAN_SUPPORTED_ARCH})
list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386 i686)
add_sanitizer_rt_symbols(clang_rt.ubsan_minimal
diff --git a/lib/ubsan_minimal/ubsan_minimal_handlers.cc b/lib/ubsan_minimal/ubsan_minimal_handlers.cc
index 5a5675c983fe..f25a75a863c4 100644
--- a/lib/ubsan_minimal/ubsan_minimal_handlers.cc
+++ b/lib/ubsan_minimal/ubsan_minimal_handlers.cc
@@ -61,6 +61,19 @@ static void abort_with_message(const char *msg) {
static void abort_with_message(const char *) { abort(); }
#endif
+#if SANITIZER_DEBUG
+namespace __sanitizer {
+// The DCHECK macro needs this symbol to be defined.
+void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) {
+ message("Sanitizer CHECK failed: ");
+ message(file);
+ message(":?? : "); // FIXME: Show line number.
+ message(cond);
+ abort();
+}
+} // namespace __sanitizer
+#endif
+
#define INTERFACE extern "C" __attribute__((visibility("default")))
// FIXME: add caller pc to the error message (possibly as "ubsan: error-type