Disable go closures on Android (#877)
authorzye2-sc <140619768+zye2-sc@users.noreply.github.com>
Fri, 31 Jan 2025 20:40:00 +0000 (21:40 +0100)
committerGitHub <noreply@github.com>
Fri, 31 Jan 2025 20:40:00 +0000 (15:40 -0500)
* x18 register shouldn't be used on Android due to the shadow call stack feature in llvm
* https://source.android.com/docs/security/test/shadow-call-stack

src/aarch64/ffitarget.h

index d5622e133625cac90c334476b41d7b6b1aee6f88..2ab95644a311d259e11d1910e7ac777559787c82 100644 (file)
@@ -83,8 +83,8 @@ typedef enum ffi_abi
 
 #if defined (__APPLE__)
 #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs
-#elif !defined(_WIN32)
-/* iOS and Windows reserve x18 for the system.  Disable Go closures until
+#elif !defined(_WIN32) && !defined(__ANDROID__)
+/* iOS, Windows and Android reserve x18 for the system.  Disable Go closures until
    a new static chain is chosen.  */
 #define FFI_GO_CLOSURES 1
 #endif