From: Michael Goffioul Date: Thu, 14 Nov 2019 17:47:27 +0000 (-0500) Subject: Compile in support for closures X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;p=android-x86%2Fexternal-libffi.git Compile in support for closures This is intended to support nb-qemu (QEMU-based native bridge for Android-x86). --- diff --git a/Android.bp b/Android.bp index 923cb10..bb99949 100644 --- a/Android.bp +++ b/Android.bp @@ -30,11 +30,13 @@ cc_library_static { "-Wno-pointer-arith", "-Wno-sign-compare", "-Wno-unused-parameter", + "-Wno-null-pointer-arithmetic", ], local_include_dirs: ["include"], generated_headers: ["ffi_header"], export_generated_headers: ["ffi_header"], srcs: [ + "src/closures.c", "src/debug.c", "src/java_raw_api.c", "src/prep_cif.c", diff --git a/linux-x86/fficonfig.h b/linux-x86/fficonfig.h index 939ef31..a3afa31 100644 --- a/linux-x86/fficonfig.h +++ b/linux-x86/fficonfig.h @@ -14,6 +14,9 @@ /* Define this if you want extra debugging. */ #undef FFI_DEBUG +/* Cannot use malloc on this target, so, we revert to alternative means */ +#define FFI_MMAP_EXEC_WRIT 1 + /* Define this is you do not want support for the raw API. */ #undef FFI_NO_RAW_API diff --git a/src/closures.c b/src/closures.c index 721ff00..bde8d7b 100644 --- a/src/closures.c +++ b/src/closures.c @@ -54,7 +54,7 @@ #endif #if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX -# ifdef __linux__ +# if defined(__linux__) && !defined(__ANDROID__) /* When defined to 1 check for SELinux and if SELinux is active, don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that might cause audit messages. */