]> granicus.if.org Git - gc/commitdiff
Do not use tkill (Android)
authorIvan Maidanski <ivmai@mail.ru>
Thu, 20 Jul 2017 09:11:22 +0000 (12:11 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 20 Jul 2017 09:11:22 +0000 (12:11 +0300)
tkill() has been deprecated in Android.  Starting from NDK r11 (which
introduced android-23 API), the call exists only in libc.a (but not
in libc.so).  The comment in Bionic says that tkill exists only for
Mono clients (and only for 32-bit targets).

* include/private/gcconfig.h [PLATFORM_ANDROID && CPP_WORDSZ==32]
(USE_TKILL_ON_ANDROID): Do not define if __ANDROID_API__ >= 23; add
comment.

include/private/gcconfig.h

index 886ab9c0e0a6c25b58cfee2157eef27d72abacd4..39bc96a48e4fb088e5768b3596cd5952f9482ea2 100644 (file)
 # define GETPAGESIZE() (unsigned)getpagesize()
 #endif
 
-#if defined(PLATFORM_ANDROID) && ((defined(MIPS) && (CPP_WORDSZ == 32)) \
-                        || defined(ARM32) || defined(I386) /* but not x32 */)
+#if defined(PLATFORM_ANDROID) && !(__ANDROID_API__ >= 23) \
+    && ((defined(MIPS) && (CPP_WORDSZ == 32)) \
+        || defined(ARM32) || defined(I386) /* but not x32 */)
   /* tkill() exists only on arm32/mips(32)/x86. */
+  /* NDK r11+ deprecates tkill() but keeps it for Mono clients. */
 # define USE_TKILL_ON_ANDROID
 #endif