aboutsummaryrefslogtreecommitdiff
path: root/libffi
diff options
context:
space:
mode:
authorAndreas Tobler <a.tobler@schweiz.org>2009-12-26 18:49:55 +0000
committerAndreas Tobler <andreast@gcc.gnu.org>2009-12-26 19:49:55 +0100
commit99fba2c42aac9edb23f2848e8378cf9138b25a16 (patch)
tree1662bd43280fd0c940233f8e229b9a2eaec7361e /libffi
parent302486f4fb52bf49b2a3b581e24c30b9a680da91 (diff)
downloadgcc-99fba2c42aac9edb23f2848e8378cf9138b25a16.zip
gcc-99fba2c42aac9edb23f2848e8378cf9138b25a16.tar.gz
gcc-99fba2c42aac9edb23f2848e8378cf9138b25a16.tar.bz2
configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
2009-12-26 Andreas Tobler <a.tobler@schweiz.org> * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets. * configure: Regenerate. * fficonfig.h.in: Likewise. * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for Solaris/x86. From-SVN: r155475
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ChangeLog8
-rwxr-xr-xlibffi/configure8
-rw-r--r--libffi/configure.ac8
-rw-r--r--libffi/fficonfig.h.in3
-rw-r--r--libffi/src/closures.c5
5 files changed, 27 insertions, 5 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index cf360501..9d06305 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
+ * configure: Regenerate.
+ * fficonfig.h.in: Likewise.
+ * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for
+ Solaris/x86.
+
2009-12-26 Andreas Schwab <schwab@linux-m68k.org>
* src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
diff --git a/libffi/configure b/libffi/configure
index f8456c9..aa40a01 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -12405,6 +12405,14 @@ $as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h
fi
fi
+case "$target" in
+ *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
+
+$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
+
+ ;;
+esac
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5
$as_echo_n "checking whether .eh_frame section should be read-only... " >&6; }
if test "${libffi_cv_ro_eh_frame+set}" = set; then :
diff --git a/libffi/configure.ac b/libffi/configure.ac
index a1a016c..f101f49 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -271,6 +271,14 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64
fi
fi
+case "$target" in
+ *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
+ AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
+ [Cannot use malloc on this target, so, we revert to
+ alternative means])
+ ;;
+esac
+
AC_CACHE_CHECK([whether .eh_frame section should be read-only],
libffi_cv_ro_eh_frame, [
libffi_cv_ro_eh_frame=no
diff --git a/libffi/fficonfig.h.in b/libffi/fficonfig.h.in
index 9fce46b..e03bbf9 100644
--- a/libffi/fficonfig.h.in
+++ b/libffi/fficonfig.h.in
@@ -17,6 +17,9 @@
/* Define this if you want extra debugging. */
#undef FFI_DEBUG
+/* Cannot use malloc on this target, so, we revert to alternative means */
+#undef FFI_MMAP_EXEC_WRIT
+
/* Define this is you do not want support for the raw API. */
#undef FFI_NO_RAW_API
diff --git a/libffi/src/closures.c b/libffi/src/closures.c
index 48cb415..0b156e0 100644
--- a/libffi/src/closures.c
+++ b/libffi/src/closures.c
@@ -50,11 +50,6 @@
executable memory. */
# define FFI_MMAP_EXEC_WRIT 1
# endif
-# if defined(X86_64) && defined(__sun__) && defined(__svr4__)
-/* The data segment on 64-bit Solaris/x86 isn't executable, so use mmap
- instead. */
-# define FFI_MMAP_EXEC_WRIT 1
-# endif
#endif
#if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX