[libcxx-commits] [libcxxabi] 6af5f87 - Revert "[libcxxabi] Rename abort_message to __abort_message (#108887)"
Thurston Dang via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Sep 20 13:14:10 PDT 2024
Author: Thurston Dang
Date: 2024-09-20T20:13:48Z
New Revision: 6af5f87d8d5889888ac27b768652efafb5bb9e40
URL: https://github.com/llvm/llvm-project/commit/6af5f87d8d5889888ac27b768652efafb5bb9e40
DIFF: https://github.com/llvm/llvm-project/commit/6af5f87d8d5889888ac27b768652efafb5bb9e40.diff
LOG: Revert "[libcxxabi] Rename abort_message to __abort_message (#108887)"
This reverts commit 33bc6cf619ac8d49232b1bc29ac7d38951583221.
Reason: broke Android buildbot (https://lab.llvm.org/buildbot/#/builders/186/builds/2517)
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang++ -DHAVE___CXA_THREAD_ATEXIT_IMPL -DLIBCXX_BUILDING_LIBCXXABI -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS="" -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_LINK_PTHREAD_LIB -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/libcxxabi/../libcxx/src -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/lib/fuzzer/libcxx_fuzzer_aarch64/include/c++/v1 -I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/libcxxabi/include --target=aarch64-linux-android24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++23 -fPIC -nostdinc++ -fstrict-aliasing -fno-exceptions -D_DEBUG -UNDEBUG -Wall -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-error -fvisibility=hidden -fvisibility-global-new-delete=force-hidden -MD -MT libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/abort_message.cpp.o -MF libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/abort_message.cpp.o.d -o libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/abort_message.cpp.o -c /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/libcxxabi/src/abort_message.cpp
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/libcxxabi/src/abort_message.cpp:64:5: error: use of undeclared identifier 'android_set___abort_message'; did you mean 'android_set_abort_message'?
64 | android_set___abort_message(buffer);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| android_set_abort_message
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/libcxxabi/src/abort_message.cpp:18:25: note: 'android_set_abort_message' declared here
18 | extern "C" void android_set_abort_message(const char* msg);
| ^
1 error generated.
Added:
Modified:
libcxxabi/src/abort_message.cpp
libcxxabi/src/abort_message.h
libcxxabi/src/cxa_default_handlers.cpp
libcxxabi/src/cxa_exception_storage.cpp
libcxxabi/src/cxa_guard_impl.h
libcxxabi/src/cxa_handlers.cpp
libcxxabi/src/cxa_thread_atexit.cpp
libcxxabi/src/cxa_vector.cpp
libcxxabi/src/cxa_virtual.cpp
libcxxabi/src/demangle/DemangleConfig.h
libcxxabi/src/stdlib_new_delete.cpp
Removed:
################################################################################
diff --git a/libcxxabi/src/abort_message.cpp b/libcxxabi/src/abort_message.cpp
index 299994266e26a8..859a5031b93fec 100644
--- a/libcxxabi/src/abort_message.cpp
+++ b/libcxxabi/src/abort_message.cpp
@@ -26,7 +26,7 @@
# define _LIBCXXABI_USE_CRASHREPORTER_CLIENT
#endif
-void __abort_message(const char* format, ...)
+void abort_message(const char* format, ...)
{
// Write message to stderr. We do this before formatting into a
// variable-size buffer so that we still get some information if
@@ -61,7 +61,7 @@ void __abort_message(const char* format, ...)
# if __ANDROID_API__ >= 21
// Show error in tombstone.
- android_set___abort_message(buffer);
+ android_set_abort_message(buffer);
// Show error in logcat.
openlog("libc++abi", 0, 0);
diff --git a/libcxxabi/src/abort_message.h b/libcxxabi/src/abort_message.h
index 2c12c429569d34..97641777801919 100644
--- a/libcxxabi/src/abort_message.h
+++ b/libcxxabi/src/abort_message.h
@@ -12,14 +12,14 @@
#include "cxxabi.h"
extern "C" _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void
-__abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
+abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
#ifndef _LIBCXXABI_ASSERT
# define _LIBCXXABI_ASSERT(expr, msg) \
do { \
if (!(expr)) { \
char const* __msg = (msg); \
- ::__abort_message("%s:%d: %s", __FILE__, __LINE__, __msg); \
+ ::abort_message("%s:%d: %s", __FILE__, __LINE__, __msg); \
} \
} while (false)
diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp
index 52b1aacae9932f..60e402c55b395b 100644
--- a/libcxxabi/src/cxa_default_handlers.cpp
+++ b/libcxxabi/src/cxa_default_handlers.cpp
@@ -30,18 +30,18 @@ static void demangling_terminate_handler()
// If there is no uncaught exception, just note that we're terminating
if (!globals)
- __abort_message("terminating");
+ abort_message("terminating");
__cxa_exception* exception_header = globals->caughtExceptions;
if (!exception_header)
- __abort_message("terminating");
+ abort_message("terminating");
_Unwind_Exception* unwind_exception =
reinterpret_cast<_Unwind_Exception*>(exception_header + 1) - 1;
// If we're terminating due to a foreign exception
if (!__isOurExceptionClass(unwind_exception))
- __abort_message("terminating due to %s foreign exception", cause);
+ abort_message("terminating due to %s foreign exception", cause);
void* thrown_object =
__getExceptionClass(unwind_exception) == kOurDependentExceptionClass ?
@@ -67,19 +67,19 @@ static void demangling_terminate_handler()
{
// Include the what() message from the exception
const std::exception* e = static_cast<const std::exception*>(thrown_object);
- __abort_message("terminating due to %s exception of type %s: %s", cause, name, e->what());
+ abort_message("terminating due to %s exception of type %s: %s", cause, name, e->what());
}
else
{
// Else just note that we're terminating due to an exception
- __abort_message("terminating due to %s exception of type %s", cause, name);
+ abort_message("terminating due to %s exception of type %s", cause, name);
}
}
#else // !_LIBCXXABI_NO_EXCEPTIONS
__attribute__((noreturn))
static void demangling_terminate_handler()
{
- __abort_message("terminating");
+ abort_message("terminating");
}
#endif // !_LIBCXXABI_NO_EXCEPTIONS
diff --git a/libcxxabi/src/cxa_exception_storage.cpp b/libcxxabi/src/cxa_exception_storage.cpp
index 733f0d470569a2..c842da195accbd 100644
--- a/libcxxabi/src/cxa_exception_storage.cpp
+++ b/libcxxabi/src/cxa_exception_storage.cpp
@@ -61,12 +61,12 @@ namespace {
void _LIBCPP_TLS_DESTRUCTOR_CC destruct_(void *p) {
__free_with_fallback(p);
if (0 != std::__libcpp_tls_set(key_, NULL))
- __abort_message("cannot zero out thread value for __cxa_get_globals()");
+ abort_message("cannot zero out thread value for __cxa_get_globals()");
}
void construct_() {
if (0 != std::__libcpp_tls_create(&key_, destruct_))
- __abort_message("cannot create thread specific key for __cxa_get_globals()");
+ abort_message("cannot create thread specific key for __cxa_get_globals()");
}
} // namespace
@@ -80,9 +80,9 @@ extern "C" {
retVal = static_cast<__cxa_eh_globals*>(
__calloc_with_fallback(1, sizeof(__cxa_eh_globals)));
if (NULL == retVal)
- __abort_message("cannot allocate __cxa_eh_globals");
+ abort_message("cannot allocate __cxa_eh_globals");
if (0 != std::__libcpp_tls_set(key_, retVal))
- __abort_message("std::__libcpp_tls_set failure in __cxa_get_globals()");
+ abort_message("std::__libcpp_tls_set failure in __cxa_get_globals()");
}
return retVal;
}
@@ -94,7 +94,7 @@ extern "C" {
__cxa_eh_globals *__cxa_get_globals_fast() {
// First time through, create the key.
if (0 != std::__libcpp_execute_once(&flag_, construct_))
- __abort_message("execute once failure in __cxa_get_globals_fast()");
+ abort_message("execute once failure in __cxa_get_globals_fast()");
return static_cast<__cxa_eh_globals*>(std::__libcpp_tls_get(key_));
}
} // extern "C"
diff --git a/libcxxabi/src/cxa_guard_impl.h b/libcxxabi/src/cxa_guard_impl.h
index 7b05bf32f3eda7..3e533054098e20 100644
--- a/libcxxabi/src/cxa_guard_impl.h
+++ b/libcxxabi/src/cxa_guard_impl.h
@@ -91,7 +91,7 @@
// the former.
#ifdef BUILDING_CXA_GUARD
# include "abort_message.h"
-# define ABORT_WITH_MESSAGE(...) ::__abort_message(__VA_ARGS__)
+# define ABORT_WITH_MESSAGE(...) ::abort_message(__VA_ARGS__)
#elif defined(TESTING_CXA_GUARD)
# define ABORT_WITH_MESSAGE(...) ::abort()
#else
diff --git a/libcxxabi/src/cxa_handlers.cpp b/libcxxabi/src/cxa_handlers.cpp
index f879ff0d8ff186..344250dde0c7e1 100644
--- a/libcxxabi/src/cxa_handlers.cpp
+++ b/libcxxabi/src/cxa_handlers.cpp
@@ -33,7 +33,7 @@ __unexpected(unexpected_handler func)
{
func();
// unexpected handler should not return
- __abort_message("unexpected_handler unexpectedly returned");
+ abort_message("unexpected_handler unexpectedly returned");
}
__attribute__((noreturn))
@@ -58,13 +58,13 @@ __terminate(terminate_handler func) noexcept
#endif // _LIBCXXABI_NO_EXCEPTIONS
func();
// handler should not return
- __abort_message("terminate_handler unexpectedly returned");
+ abort_message("terminate_handler unexpectedly returned");
#ifndef _LIBCXXABI_NO_EXCEPTIONS
}
catch (...)
{
// handler should not throw exception
- __abort_message("terminate_handler unexpectedly threw an exception");
+ abort_message("terminate_handler unexpectedly threw an exception");
}
#endif // _LIBCXXABI_NO_EXCEPTIONS
}
diff --git a/libcxxabi/src/cxa_thread_atexit.cpp b/libcxxabi/src/cxa_thread_atexit.cpp
index 8546cfe48c3976..c6bd0aa323f2e1 100644
--- a/libcxxabi/src/cxa_thread_atexit.cpp
+++ b/libcxxabi/src/cxa_thread_atexit.cpp
@@ -89,7 +89,7 @@ namespace {
// __cxa_thread_atexit() may be called arbitrarily late (for example, from
// global destructors or atexit() handlers).
if (std::__libcpp_tls_create(&dtors_key, run_dtors) != 0) {
- __abort_message("std::__libcpp_tls_create() failed in __cxa_thread_atexit()");
+ abort_message("std::__libcpp_tls_create() failed in __cxa_thread_atexit()");
}
}
diff --git a/libcxxabi/src/cxa_vector.cpp b/libcxxabi/src/cxa_vector.cpp
index 857ee27d065c31..17d942a6e61c79 100644
--- a/libcxxabi/src/cxa_vector.cpp
+++ b/libcxxabi/src/cxa_vector.cpp
@@ -121,7 +121,7 @@ void throw_bad_array_new_length() {
#ifndef _LIBCXXABI_NO_EXCEPTIONS
throw std::bad_array_new_length();
#else
- __abort_message("__cxa_vec_new failed to allocate memory");
+ abort_message("__cxa_vec_new failed to allocate memory");
#endif
}
diff --git a/libcxxabi/src/cxa_virtual.cpp b/libcxxabi/src/cxa_virtual.cpp
index 8f4fdd0919f0e2..c868672e00af90 100644
--- a/libcxxabi/src/cxa_virtual.cpp
+++ b/libcxxabi/src/cxa_virtual.cpp
@@ -13,12 +13,12 @@ namespace __cxxabiv1 {
extern "C" {
_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
void __cxa_pure_virtual(void) {
- __abort_message("Pure virtual function called!");
+ abort_message("Pure virtual function called!");
}
_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
void __cxa_deleted_virtual(void) {
- __abort_message("Deleted virtual function called!");
+ abort_message("Deleted virtual function called!");
}
} // extern "C"
} // abi
diff --git a/libcxxabi/src/demangle/DemangleConfig.h b/libcxxabi/src/demangle/DemangleConfig.h
index 06fd223f5553f9..d67d89bdb06927 100644
--- a/libcxxabi/src/demangle/DemangleConfig.h
+++ b/libcxxabi/src/demangle/DemangleConfig.h
@@ -15,7 +15,7 @@
// build systems to override this value.
// https://libcxx.llvm.org/UsingLibcxx.html#enabling-the-safe-libc-mode
#ifndef _LIBCPP_VERBOSE_ABORT
-#define _LIBCPP_VERBOSE_ABORT(...) __abort_message(__VA_ARGS__)
+#define _LIBCPP_VERBOSE_ABORT(...) abort_message(__VA_ARGS__)
#include "../abort_message.h"
#endif
diff --git a/libcxxabi/src/stdlib_new_delete.cpp b/libcxxabi/src/stdlib_new_delete.cpp
index bd576e6aeed744..b802559d479e2c 100644
--- a/libcxxabi/src/stdlib_new_delete.cpp
+++ b/libcxxabi/src/stdlib_new_delete.cpp
@@ -32,14 +32,14 @@ inline void __throw_bad_alloc_shim() {
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
throw std::bad_alloc();
#else
- __abort_message("bad_alloc was thrown in -fno-exceptions mode");
+ abort_message("bad_alloc was thrown in -fno-exceptions mode");
#endif
}
#define _LIBCPP_ASSERT_SHIM(expr, str) \
do { \
if (!expr) \
- __abort_message(str); \
+ abort_message(str); \
} while (false)
// ------------------ BEGIN COPY ------------------
More information about the libcxx-commits
mailing list