[libcxx-commits] [libcxxabi] [libc++abi] Remove support for Android 4 and older (PR #124054)

Brad Smith via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 22 19:15:26 PST 2025


https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/124054

None

>From acac25875fcb01d5e900ba0be407ace3eb9217ac Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Wed, 22 Jan 2025 21:26:53 -0500
Subject: [PATCH] [libc++abi] Remove support for Android 4 and older

---
 libcxxabi/src/abort_message.cpp | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

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();



More information about the libcxx-commits mailing list