Merge changes I1b2e34d5,I75ae5b29
am: 9ffa786b56

Change-Id: I2cd8033fd8373c0d7e1f62dccc1ac472b44a6d66
diff --git a/Android.bp b/Android.bp
index 6eb3dab..3bb3912 100644
--- a/Android.bp
+++ b/Android.bp
@@ -276,4 +276,29 @@
     sdk_version: "28",
 }
 
+ndk_prebuilt_object {
+    name: "ndk_crtbegin_dynamic.29",
+    sdk_version: "29",
+}
+
+ndk_prebuilt_object {
+    name: "ndk_crtbegin_so.29",
+    sdk_version: "29",
+}
+
+ndk_prebuilt_object {
+    name: "ndk_crtbegin_static.29",
+    sdk_version: "29",
+}
+
+ndk_prebuilt_object {
+    name: "ndk_crtend_android.29",
+    sdk_version: "29",
+}
+
+ndk_prebuilt_object {
+    name: "ndk_crtend_so.29",
+    sdk_version: "29",
+}
+
 build = ["android_native_app_glue.bp", "cpufeatures.bp", "stl.bp"]
\ No newline at end of file
diff --git a/current b/current
index c32c322..e8a156f 120000
--- a/current
+++ b/current
@@ -1 +1 @@
-r18
\ No newline at end of file
+r21
\ No newline at end of file
diff --git a/r21/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h b/r21/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h
index 5b16071..0ca9c77 100644
--- a/r21/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h
+++ b/r21/sources/cxx-stl/llvm-libc++/include/support/android/locale_bionic.h
@@ -25,9 +25,20 @@
 
 #if defined(__ANDROID__)
 
+#include <support/xlocale/__posix_l_fallback.h>
+
+// HACK: Not in upstream NDK or libc++.
+// Upstream now supports using ToT libc++ with old NDKs, but as such it is now
+// *only* compatible with the NDK. That will need to be fixed both for the
+// platorm and for the NDK-in-platform use case since neither has
+// android/ndk-version.h.
+
+// If we do not have this header, we are in a platform build rather than an NDK
+// build, which will always be at least as new as the ToT NDK, in which case we
+// don't need any of the inlines below since libc provides them.
+#if __has_include(<android/ndk-version.h>)
 #include <android/api-level.h>
 #include <android/ndk-version.h>
-#include <support/xlocale/__posix_l_fallback.h>
 // In NDK versions later than 16, locale-aware functions are provided by
 // legacy_stdlib_inlines.h
 #if __NDK_MAJOR__ <= 16
@@ -61,6 +72,7 @@
 #endif // __ANDROID_API__ < 26
 
 #endif // __NDK_MAJOR__ <= 16
+#endif // __has_include(<android/ndk-version.h>)
 #endif // defined(__ANDROID__)
 
 #endif // defined(__BIONIC__)