From 05ba3281482304ae8de31123a594972a495da06d Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Thu, 14 Sep 2017 22:37:34 +0000 Subject: Fix ASAN build with older compiler-rt versions. compiler-rt recently added the __asan_handle_no_return() function that libc++abi needs to use, however older versions of compiler-rt don't declare this interface publicly and that breaks the libc++abi build. This patch attempts to fix the issues by declaring the asan function explicitly, so we don't depend on compiler-rt to provide the declaration. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@313308 91177308-0d34-0410-b5e6-96231b3b80d8 --- src/cxa_exception.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp index 4662ccd..e6ed093 100644 --- a/src/cxa_exception.cpp +++ b/src/cxa_exception.cpp @@ -20,7 +20,7 @@ #include "fallback_malloc.h" #if __has_feature(address_sanitizer) -#include +extern "C" void __asan_handle_no_return(void); #endif // +---------------------------+-----------------------------+---------------+ @@ -222,8 +222,7 @@ __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) && \ - defined(SANITIZER_ASAN_INTERFACE_HAS_HANDLE_NO_RETURN) +#if __has_feature(address_sanitizer) // Inform the ASan runtime that now might be a good time to clean stuff up. __asan_handle_no_return(); #endif -- cgit v1.2.3