Author: ericwf Date: Thu Sep 14 15:37:34 2017 New Revision: 313308 URL: http://llvm.org/viewvc/llvm-project?rev=313308&view=rev Log: 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. Modified: libcxxabi/trunk/src/cxa_exception.cpp Modified: libcxxabi/trunk/src/cxa_exception.cpp URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_exception.cpp?rev=313308&r1=313307&r2=313308&view=diff ============================================================================== --- libcxxabi/trunk/src/cxa_exception.cpp (original) +++ libcxxabi/trunk/src/cxa_exception.cpp Thu Sep 14 15:37:34 2017 @@ -20,7 +20,7 @@ #include "fallback_malloc.h" #if __has_feature(address_sanitizer) -#include <sanitizer/asan_interface.h> +extern "C" void __asan_handle_no_return(void); #endif // +---------------------------+-----------------------------+---------------+ @@ -222,8 +222,7 @@ __cxa_throw(void *thrown_object, std::ty 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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits