godot-mono-builds/files/patches/fix-mono-android-tkill.diff
Ignacio Etcheverry c662ffd863 Remove boehm gc patch for android tkill
Mono's Boehm GC was replaced with a newer one on latest versions, and the new
one already has this patch.

This change won't be a problem for older versions as we don't build boehm anyway.
2020-04-06 14:52:11 +02:00

39 lines
1.4 KiB
Diff

diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
index ad9b8823f8f..3542b32b540 100644
--- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c
@@ -77,8 +77,12 @@ mono_native_thread_join_handle (HANDLE thread_handle, gboolean close_handle);
#include <zircon/syscalls.h>
#endif
-#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
-#define USE_TKILL_ON_ANDROID 1
+#if defined(HOST_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
#ifdef HOST_ANDROID
diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c
index 3e4bf93de5f..79c9f731fe7 100644
--- a/mono/utils/mono-threads-posix.c
+++ b/mono/utils/mono-threads-posix.c
@@ -31,8 +31,12 @@
#include <errno.h>
-#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
-#define USE_TKILL_ON_ANDROID 1
+#if defined(HOST_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
#ifdef USE_TKILL_ON_ANDROID