Fix abort_message.cpp for the NDK.

The NDK doesn't have access to `android/set_abort_message.h`, so use
an extern declaration instead for API 21. For older releases, just use
`__assert2`, which will report to logcat and/or the tombstone for some
older releases.


git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@226310 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/abort_message.cpp b/src/abort_message.cpp
index 3158ada..7702904 100644
--- a/src/abort_message.cpp
+++ b/src/abort_message.cpp
@@ -13,9 +13,14 @@
 #include "abort_message.h"
 
 #ifdef __BIONIC__
-#include <android/set_abort_message.h>
+#include <android/api-level.h>
+#if __ANDROID_API__ >= 21
 #include <syslog.h>
-#endif
+extern "C" void android_set_abort_message(const char* msg);
+#else
+#include <assert.h>
+#endif // __ANDROID_API__ >= 21
+#endif // __BIONIC__
 
 #pragma GCC visibility push(hidden)
 
@@ -54,6 +59,7 @@
     vasprintf(&buffer, format, list2);
     va_end(list2);
 
+#if __ANDROID_API__ >= 21
     // Show error in tombstone.
     android_set_abort_message(buffer);
 
@@ -61,7 +67,13 @@
     openlog("libc++abi", 0, 0);
     syslog(LOG_CRIT, "%s", buffer);
     closelog();
-#endif
+#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();
 }