mirror of
https://github.com/partic2/libffi
synced 2026-11-09 17:47:19 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user