blob: ade28e5f9e2772e90e2b381facc93f1c3bd29169 [file] [log] [blame]
Gregory P. Smith029273f2013-03-18 17:11:20 -07001diff -r -N -u libffi.orig/autom4te.cache/output.0 libffi/autom4te.cache/output.0
2diff -r -N -u libffi.orig/configure libffi/configure
3--- libffi.orig/configure 2013-03-17 15:37:50.000000000 -0700
4+++ libffi/configure 2013-03-18 15:11:39.611575163 -0700
5@@ -13368,6 +13368,10 @@
6 fi
Benjamin Peterson25c95f12009-05-08 20:42:26 +00007 ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -07008
Benjamin Peterson25c95f12009-05-08 20:42:26 +00009+ i*86-*-nto-qnx*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000010+ TARGET=X86; TARGETDIR=x86
11+ ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -070012+
13 x86_64-*-darwin*)
14 TARGET=X86_DARWIN; TARGETDIR=x86
Benjamin Peterson25c95f12009-05-08 20:42:26 +000015 ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -070016@@ -13426,12 +13430,12 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000017 ;;
18
doko@ubuntu.com2a918762012-06-26 17:56:44 +020019 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000020- TARGET=MIPS; TARGETDIR=mips
21+ TARGET=MIPS_IRIX; TARGETDIR=mips
22 ;;
doko@ubuntu.com2a918762012-06-26 17:56:44 +020023 mips*-*-linux* | mips*-*-openbsd*)
Matthias Klosea8349752010-03-15 13:25:28 +000024 # Support 128-bit long double for NewABI.
25 HAVE_LONG_DOUBLE='defined(__mips64)'
Benjamin Peterson25c95f12009-05-08 20:42:26 +000026- TARGET=MIPS; TARGETDIR=mips
Matthias Klosea8349752010-03-15 13:25:28 +000027+ TARGET=MIPS_IRIX; TARGETDIR=mips
Benjamin Peterson25c95f12009-05-08 20:42:26 +000028 ;;
29
Benjamin Peterson25c95f12009-05-08 20:42:26 +000030 powerpc*-*-linux* | powerpc-*-sysv*)
Gregory P. Smith029273f2013-03-18 17:11:20 -070031@@ -13491,7 +13495,7 @@
32 as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
Benjamin Peterson25c95f12009-05-08 20:42:26 +000033 fi
34
35- if test x$TARGET = xMIPS; then
36+ if expr x$TARGET : 'xMIPS' > /dev/null; then
37 MIPS_TRUE=
38 MIPS_FALSE='#'
39 else
Gregory P. Smith029273f2013-03-18 17:11:20 -070040@@ -14862,6 +14866,12 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000041 ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
42
43
44+ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
45+
46+
47+ac_config_files="$ac_config_files fficonfig.py"
48+
49+
50 cat >confcache <<\_ACEOF
51 # This file is a shell script that caches the results of configure
52 # tests run on this system so they can be shared between configure
Gregory P. Smith029273f2013-03-18 17:11:20 -070053@@ -16047,6 +16057,8 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000054 "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
55 "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
56 "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
57+ "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
58+ "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
59
Gregory P. Smith029273f2013-03-18 17:11:20 -070060 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
Benjamin Peterson25c95f12009-05-08 20:42:26 +000061 esac
Gregory P. Smith029273f2013-03-18 17:11:20 -070062diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
63--- libffi.orig/configure.ac 2013-03-17 15:37:50.000000000 -0700
64+++ libffi/configure.ac 2013-03-18 15:11:11.392989136 -0700
Benjamin Peterson25c95f12009-05-08 20:42:26 +000065@@ -1,4 +1,7 @@
66 dnl Process this with autoconf to create configure
67+#
Gregory P. Smith029273f2013-03-18 17:11:20 -070068+# file from libffi - slightly patched for Python's ctypes
Benjamin Peterson25c95f12009-05-08 20:42:26 +000069+#
70
Gregory P. Smith029273f2013-03-18 17:11:20 -070071 AC_PREREQ(2.68)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000072
Gregory P. Smith029273f2013-03-18 17:11:20 -070073@@ -146,6 +149,10 @@
74 fi
Benjamin Peterson25c95f12009-05-08 20:42:26 +000075 ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -070076
Benjamin Peterson25c95f12009-05-08 20:42:26 +000077+ i*86-*-nto-qnx*)
78+ TARGET=X86; TARGETDIR=x86
79+ ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -070080+
81 x86_64-*-darwin*)
82 TARGET=X86_DARWIN; TARGETDIR=x86
Benjamin Peterson25c95f12009-05-08 20:42:26 +000083 ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -070084@@ -204,12 +211,12 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000085 ;;
86
Gregory P. Smith029273f2013-03-18 17:11:20 -070087 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000088- TARGET=MIPS; TARGETDIR=mips
89+ TARGET=MIPS_IRIX; TARGETDIR=mips
90 ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -070091 mips*-*-linux* | mips*-*-openbsd*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000092 # Support 128-bit long double for NewABI.
93 HAVE_LONG_DOUBLE='defined(__mips64)'
94- TARGET=MIPS; TARGETDIR=mips
95+ TARGET=MIPS_IRIX; TARGETDIR=mips
96 ;;
97
98 powerpc*-*-linux* | powerpc-*-sysv*)
Gregory P. Smith029273f2013-03-18 17:11:20 -070099@@ -269,7 +276,7 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000100 AC_MSG_ERROR(["libffi has not been ported to $host."])
101 fi
102
103-AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
104+AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null])
Gregory P. Smith029273f2013-03-18 17:11:20 -0700105 AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000106 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
107 AM_CONDITIONAL(X86, test x$TARGET = xX86)
Gregory P. Smith029273f2013-03-18 17:11:20 -0700108@@ -567,4 +574,8 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000109
Matthias Klosefb60f802010-03-19 17:47:21 +0000110 AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000111
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000112+AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
113+
114+AC_CONFIG_FILES(fficonfig.py)
Matthias Klosefb60f802010-03-19 17:47:21 +0000115+
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000116 AC_OUTPUT
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200117--- libffi-3.0.11/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100
118+++ libffi/fficonfig.py.in 2012-03-15 01:04:27.000000000 +0100
119@@ -0,0 +1,35 @@
120+ffi_sources = """
121+src/prep_cif.c
122+src/closures.c
123+src/dlmalloc.c
124+""".split()
125+
126+ffi_platforms = {
127+ 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'],
128+ 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'],
129+ 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'],
130+ 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'],
131+ 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'],
132+ 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'],
133+ 'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'],
134+ 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
135+ 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
136+ 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
137+ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
Benjamin Peterson19886b82013-06-19 09:01:42 -0700138+ 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200139+ 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
140+ 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
141+ 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
142+ 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
143+ 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'],
144+ 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'],
145+ 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'],
146+ 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'],
147+ 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'],
148+ 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'],
149+ 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'],
150+}
151+
152+ffi_sources += ffi_platforms['@TARGET@']
153+
154+ffi_cflags = '@CFLAGS@'
155diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
156--- libffi-3.0.11/src/dlmalloc.c 2012-04-12 04:46:06.000000000 +0200
157+++ libffi/src/dlmalloc.c 2012-06-26 15:15:58.949547461 +0200
158@@ -457,6 +457,11 @@
159 #define LACKS_ERRNO_H
160 #define MALLOC_FAILURE_ACTION
161 #define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
162+#elif !defined _GNU_SOURCE
163+/* mremap() on Linux requires this via sys/mman.h
164+ * See roundup issue 10309
165+ */
166+#define _GNU_SOURCE 1
167 #endif /* WIN32 */
168
169 #ifdef __OS2__