Add autoconf check for W^X platforms that require a trampoline table.

This adds the FFI_EXEC_TRAMPOLINE_TABLE. The flag is enabled for
arm-apple-darwin, where PROT_EXEC on writable (or formerly writable) pages is
not permitted for sandboxed binaries.
This commit is contained in:
Landon Fuller
2010-09-18 18:08:14 -07:00
parent be72fbab29
commit 1ac92cca9b
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -316,6 +316,11 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64
fi
case "$target" in
*arm*-apple-darwin*)
AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1,
[Cannot use PROT_EXEC on this target, so, we revert to
alternative means])
;;
*-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
[Cannot use malloc on this target, so, we revert to
+3
View File
@@ -17,6 +17,9 @@
/* Define this if you want extra debugging. */
#undef FFI_DEBUG
/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */
#undef FFI_EXEC_TRAMPOLINE_TABLE
/* Cannot use malloc on this target, so, we revert to alternative means */
#undef FFI_MMAP_EXEC_WRIT