summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-09-14 22:19:28 +0000
committerEric Fiselier <eric@efcs.ca>2017-09-14 22:19:28 +0000
commit6b4fee29c8a12e05201d5823c67ef91429e57369 (patch)
tree404d69f076de7fdc437e16fbac588c8529186812 /src
parent05e2ac5c83553f9678f018bd8032357f40882a80 (diff)
[libc++abi] Fix ASAN build with older compiler-rt versions.
Summary: compiler-rt recently added the `__asan_handle_no_return()` function that libc++abi needs to use, however older versions of compiler-rt don't provide this interface and that breaks the libc++abi build. This patch attempts to fix the issues by using a macro to detect if `asan_interface.h` is new enough to provide the function. See D37871 Reviewers: phosek, vitalybuka Reviewed By: phosek, vitalybuka Subscribers: dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D37872 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@313304 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src')
-rw-r--r--src/cxa_exception.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp
index 204ea2d..4662ccd 100644
--- a/src/cxa_exception.cpp
+++ b/src/cxa_exception.cpp
@@ -222,7 +222,8 @@ __cxa_throw(void *thrown_object, std::type_info *tinfo, void (*dest)(void *)) {
exception_header->unwindHeader.exception_cleanup = exception_cleanup_func;
-#if __has_feature(address_sanitizer)
+#if __has_feature(address_sanitizer) && \
+ defined(SANITIZER_ASAN_INTERFACE_HAS_HANDLE_NO_RETURN)
// Inform the ASan runtime that now might be a good time to clean stuff up.
__asan_handle_no_return();
#endif