Pre-M and GCC compatibility for crtbegin.

We're going to start using the bionic sources for the NDK CRT
objects, so we need to avoid using symbols that weren't around in
early versions of Android. The NDK is currently building the CRT
objects with GCC as well (there were some segfaults that have yet to
be diagnosed), so move `__used` to the GCC compatible location.

Test: treehugger
Bug: None
Change-Id: I1f5c23eafadc2e3bc0b84bc3305f79a04d35c7d8
diff --git a/libc/arch-common/bionic/pthread_atfork.h b/libc/arch-common/bionic/pthread_atfork.h
index 0c48a12..c6a33ff 100644
--- a/libc/arch-common/bionic/pthread_atfork.h
+++ b/libc/arch-common/bionic/pthread_atfork.h
@@ -14,6 +14,12 @@
  * limitations under the License.
  */
 
+#include <android/api-level.h>
+
+// __register_atfork wasn't available until android-23. We need to build a
+// pre-23 and 23+ version of crtbegin.
+#if __ANDROID_API__ >= __ANDROID_API_M__
+
 extern void* __dso_handle;
 
 extern int __register_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void), void* dso);
@@ -27,3 +33,4 @@
   return __register_atfork(prepare, parent, child, &__dso_handle);
 }
 
+#endif  /* __ANDROID_API__ >= __ANDROID_API_M__ */