[libcxx] Fix build with GLIBC
authorVitaly Buka <vitalybuka@google.com>
Wed, 4 Jan 2023 03:30:43 +0000 (19:30 -0800)
committerVitaly Buka <vitalybuka@google.com>
Wed, 4 Jan 2023 07:55:55 +0000 (23:55 -0800)
Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D140946

libcxx/include/__verbose_abort

index fddef49..3559c52 100644 (file)
 // dependency-free (this is included everywhere else in the library).
 #if defined(_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY) && !defined(_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED)
 
-extern "C" void abort();
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 _LIBCPP_NORETURN _LIBCPP_ATTRIBUTE_FORMAT(__printf__, 1, 2) _LIBCPP_HIDE_FROM_ABI inline
 void __libcpp_verbose_abort(const char *, ...) {
-  ::abort();
-  __builtin_unreachable(); // never reached, but needed to tell the compiler that the function never returns
+  __builtin_abort();
 }
 
 _LIBCPP_END_NAMESPACE_STD