OSDN Git Service

Compile in support for closures q-x86
authorMichael Goffioul <michael.goffioul@lincor.com>
Thu, 14 Nov 2019 17:47:27 +0000 (12:47 -0500)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 23 Nov 2019 01:46:58 +0000 (09:46 +0800)
This is intended to support nb-qemu (QEMU-based native bridge for
Android-x86).

Android.bp
linux-x86/fficonfig.h
src/closures.c

index 923cb10..bb99949 100644 (file)
@@ -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",
index 939ef31..a3afa31 100644 (file)
@@ -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
 
index 721ff00..bde8d7b 100644 (file)
@@ -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.  */