|
| 1 | +diff --git a/libgc/include/private/gcconfig.h b/libgc/include/private/gcconfig.h |
| 2 | +index e2bdf13ac3e..f962200ba4e 100644 |
| 3 | +--- a/libgc/include/private/gcconfig.h |
| 4 | ++++ b/libgc/include/private/gcconfig.h |
| 5 | +@@ -2255,6 +2255,14 @@ |
| 6 | + # define GETPAGESIZE() getpagesize() |
| 7 | + # endif |
| 8 | + |
| 9 | ++#if defined(HOST_ANDROID) && !(__ANDROID_API__ >= 23) \ |
| 10 | ++ && ((defined(MIPS) && (CPP_WORDSZ == 32)) \ |
| 11 | ++ || defined(ARM32) || defined(I386) /* but not x32 */) |
| 12 | ++ /* tkill() exists only on arm32/mips(32)/x86. */ |
| 13 | ++ /* NDK r11+ deprecates tkill() but keeps it for Mono clients. */ |
| 14 | ++# define USE_TKILL_ON_ANDROID |
| 15 | ++#endif |
| 16 | ++ |
| 17 | + # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4) |
| 18 | + /* OS has SVR4 generic features. Probably others also qualify. */ |
| 19 | + # define SVR4 |
| 20 | +diff --git a/libgc/pthread_stop_world.c b/libgc/pthread_stop_world.c |
| 21 | +index f93ce26b562..4a49a6d578c 100644 |
| 22 | +--- a/libgc/pthread_stop_world.c |
| 23 | ++++ b/libgc/pthread_stop_world.c |
| 24 | +@@ -336,7 +336,7 @@ void GC_push_all_stacks() |
| 25 | + pthread_t GC_stopping_thread; |
| 26 | + int GC_stopping_pid; |
| 27 | + |
| 28 | +-#ifdef HOST_ANDROID |
| 29 | ++#ifdef USE_TKILL_ON_ANDROID |
| 30 | + static |
| 31 | + int android_thread_kill(pid_t tid, int sig) |
| 32 | + { |
| 33 | +diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c |
| 34 | +index ad9b8823f8f..3542b32b540 100644 |
| 35 | +--- a/mono/metadata/threads.c |
| 36 | ++++ b/mono/metadata/threads.c |
| 37 | +@@ -77,8 +77,12 @@ mono_native_thread_join_handle (HANDLE thread_handle, gboolean close_handle); |
| 38 | + #include <zircon/syscalls.h> |
| 39 | + #endif |
| 40 | + |
| 41 | +-#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64) |
| 42 | +-#define USE_TKILL_ON_ANDROID 1 |
| 43 | ++#if defined(HOST_ANDROID) && !(__ANDROID_API__ >= 23) \ |
| 44 | ++ && ((defined(MIPS) && (CPP_WORDSZ == 32)) \ |
| 45 | ++ || defined(ARM32) || defined(I386) /* but not x32 */) |
| 46 | ++ /* tkill() exists only on arm32/mips(32)/x86. */ |
| 47 | ++ /* NDK r11+ deprecates tkill() but keeps it for Mono clients. */ |
| 48 | ++# define USE_TKILL_ON_ANDROID |
| 49 | + #endif |
| 50 | + |
| 51 | + #ifdef HOST_ANDROID |
| 52 | +diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c |
| 53 | +index 3e4bf93de5f..79c9f731fe7 100644 |
| 54 | +--- a/mono/utils/mono-threads-posix.c |
| 55 | ++++ b/mono/utils/mono-threads-posix.c |
| 56 | +@@ -31,8 +31,12 @@ |
| 57 | + |
| 58 | + #include <errno.h> |
| 59 | + |
| 60 | +-#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64) |
| 61 | +-#define USE_TKILL_ON_ANDROID 1 |
| 62 | ++#if defined(HOST_ANDROID) && !(__ANDROID_API__ >= 23) \ |
| 63 | ++ && ((defined(MIPS) && (CPP_WORDSZ == 32)) \ |
| 64 | ++ || defined(ARM32) || defined(I386) /* but not x32 */) |
| 65 | ++ /* tkill() exists only on arm32/mips(32)/x86. */ |
| 66 | ++ /* NDK r11+ deprecates tkill() but keeps it for Mono clients. */ |
| 67 | ++# define USE_TKILL_ON_ANDROID |
| 68 | + #endif |
| 69 | + |
| 70 | + #ifdef USE_TKILL_ON_ANDROID |
0 commit comments