Skip to content

Conversation

@brad0
Copy link
Contributor

@brad0 brad0 commented Jan 23, 2025

No description provided.

@brad0 brad0 requested a review from a team as a code owner January 23, 2025 03:15
@llvmbot llvmbot added the libc++abi libc++abi C++ Runtime Library. Not libc++. label Jan 23, 2025
@brad0 brad0 requested a review from enh-google January 23, 2025 03:15
@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2025

@llvm/pr-subscribers-libcxxabi

Author: Brad Smith (brad0)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/124054.diff

1 Files Affected:

  • (modified) libcxxabi/src/abort_message.cpp (+2-14)
diff --git a/libcxxabi/src/abort_message.cpp b/libcxxabi/src/abort_message.cpp
index 9e5a984807e2c3..4d78fbd877c79c 100644
--- a/libcxxabi/src/abort_message.cpp
+++ b/libcxxabi/src/abort_message.cpp
@@ -12,13 +12,8 @@
 #include "abort_message.h"
 
 #ifdef __BIONIC__
-#   include <android/api-level.h>
-#   if __ANDROID_API__ >= 21
-#       include <syslog.h>
-        extern "C" void android_set_abort_message(const char* msg);
-#   else
-#       include <assert.h>
-#   endif // __ANDROID_API__ >= 21
+#   include <syslog.h>
+    extern "C" void android_set_abort_message(const char* msg);
 #endif // __BIONIC__
 
 #if defined(__APPLE__) && __has_include(<CrashReporterClient.h>)
@@ -59,7 +54,6 @@ void __abort_message(const char* format, ...)
     vasprintf(&buffer, format, list);
     va_end(list);
 
-#   if __ANDROID_API__ >= 21
     // Show error in tombstone.
     android_set_abort_message(buffer);
 
@@ -67,12 +61,6 @@ void __abort_message(const char* format, ...)
     openlog("libc++abi", 0, 0);
     syslog(LOG_CRIT, "%s", buffer);
     closelog();
-#   else
-    // The good error reporting wasn't available in Android until L. Since we're
-    // about to abort anyway, just call __assert2, which will log _somewhere_
-    // (tombstone and/or logcat) in older releases.
-    __assert2(__FILE__, __LINE__, __func__, buffer);
-#   endif // __ANDROID_API__ >= 21
 #endif // __BIONIC__
 
     abort();

@github-actions
Copy link

github-actions bot commented Jan 23, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@brad0 brad0 force-pushed the libcxxabi_remove_android branch from acac258 to 796ec16 Compare January 23, 2025 03:28
@philnik777 philnik777 merged commit 9fd9263 into llvm:main Jan 23, 2025
76 checks passed
Copy link
Contributor

@enh-google enh-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(lgtm. thanks!)

@brad0 brad0 deleted the libcxxabi_remove_android branch January 23, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++abi libc++abi C++ Runtime Library. Not libc++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants