blob: ffa7bafe0e097ae2113a4af0265dcc2a5a5a3b25 [file] [log] [blame]
doko@ubuntu.com736a9132014-08-09 22:36:35 +02001diff -urN libffi-3.1/configure libffi/configure
2--- libffi-3.1/configure 2014-05-19 15:44:03.000000000 +0200
3+++ libffi/configure 2014-08-09 21:51:07.877871443 +0200
4@@ -17236,6 +17236,10 @@
Gregory P. Smith029273f2013-03-18 17:11:20 -07005 fi
Benjamin Peterson25c95f12009-05-08 20:42:26 +00006 ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -07007
Benjamin Peterson25c95f12009-05-08 20:42:26 +00008+ i*86-*-nto-qnx*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +00009+ TARGET=X86; TARGETDIR=x86
10+ ;;
Gregory P. Smith029273f2013-03-18 17:11:20 -070011+
12 x86_64-*-darwin*)
13 TARGET=X86_DARWIN; TARGETDIR=x86
Benjamin Peterson25c95f12009-05-08 20:42:26 +000014 ;;
doko@ubuntu.com736a9132014-08-09 22:36:35 +020015@@ -17298,12 +17302,12 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000016 ;;
17
doko@ubuntu.com2a918762012-06-26 17:56:44 +020018 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000019- TARGET=MIPS; TARGETDIR=mips
20+ TARGET=MIPS_IRIX; TARGETDIR=mips
21 ;;
doko@ubuntu.com736a9132014-08-09 22:36:35 +020022 mips*-*linux* | mips*-*-openbsd*)
Matthias Klosea8349752010-03-15 13:25:28 +000023 # Support 128-bit long double for NewABI.
24 HAVE_LONG_DOUBLE='defined(__mips64)'
Benjamin Peterson25c95f12009-05-08 20:42:26 +000025- TARGET=MIPS; TARGETDIR=mips
doko@ubuntu.com736a9132014-08-09 22:36:35 +020026+ TARGET=MIPS_LINUX; TARGETDIR=mips
Benjamin Peterson25c95f12009-05-08 20:42:26 +000027 ;;
28
doko@ubuntu.com736a9132014-08-09 22:36:35 +020029 nios2*-linux*)
30@@ -17373,7 +17377,7 @@
Gregory P. Smith029273f2013-03-18 17:11:20 -070031 as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
Benjamin Peterson25c95f12009-05-08 20:42:26 +000032 fi
33
34- if test x$TARGET = xMIPS; then
35+ if expr x$TARGET : 'xMIPS' > /dev/null; then
36 MIPS_TRUE=
37 MIPS_FALSE='#'
38 else
doko@ubuntu.com736a9132014-08-09 22:36:35 +020039@@ -18814,6 +18818,12 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000040 ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
41
42
43+ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
44+
45+
46+ac_config_files="$ac_config_files fficonfig.py"
47+
48+
49 cat >confcache <<\_ACEOF
50 # This file is a shell script that caches the results of configure
51 # tests run on this system so they can be shared between configure
doko@ubuntu.com736a9132014-08-09 22:36:35 +020052@@ -20126,6 +20136,8 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000053 "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
54 "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
55 "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
56+ "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
57+ "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
58
Gregory P. Smith029273f2013-03-18 17:11:20 -070059 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
Benjamin Peterson25c95f12009-05-08 20:42:26 +000060 esac
doko@ubuntu.com736a9132014-08-09 22:36:35 +020061diff -urN libffi-3.1/configure.ac libffi/configure.ac
62--- libffi-3.1/configure.ac 2014-05-11 15:57:49.000000000 +0200
63+++ libffi/configure.ac 2014-08-09 21:51:07.877871443 +0200
Benjamin Peterson25c95f12009-05-08 20:42:26 +000064@@ -1,4 +1,7 @@
65 dnl Process this with autoconf to create configure
66+#
Gregory P. Smith029273f2013-03-18 17:11:20 -070067+# file from libffi - slightly patched for Python's ctypes
Benjamin Peterson25c95f12009-05-08 20:42:26 +000068+#
69
Gregory P. Smith029273f2013-03-18 17:11:20 -070070 AC_PREREQ(2.68)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000071
doko@ubuntu.com736a9132014-08-09 22:36:35 +020072@@ -144,6 +147,9 @@
73 AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
74 fi
Benjamin Peterson25c95f12009-05-08 20:42:26 +000075 ;;
76+ i*86-*-nto-qnx*)
77+ TARGET=X86; TARGETDIR=x86
78+ ;;
doko@ubuntu.com736a9132014-08-09 22:36:35 +020079 i?86-*-darwin*)
Gregory P. Smith029273f2013-03-18 17:11:20 -070080 TARGET=X86_DARWIN; TARGETDIR=x86
Benjamin Peterson25c95f12009-05-08 20:42:26 +000081 ;;
doko@ubuntu.com736a9132014-08-09 22:36:35 +020082@@ -218,12 +224,12 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000083 ;;
84
Gregory P. Smith029273f2013-03-18 17:11:20 -070085 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000086- TARGET=MIPS; TARGETDIR=mips
87+ TARGET=MIPS_IRIX; TARGETDIR=mips
88 ;;
doko@ubuntu.com736a9132014-08-09 22:36:35 +020089 mips*-*linux* | mips*-*-openbsd*)
Benjamin Peterson25c95f12009-05-08 20:42:26 +000090 # Support 128-bit long double for NewABI.
91 HAVE_LONG_DOUBLE='defined(__mips64)'
92- TARGET=MIPS; TARGETDIR=mips
doko@ubuntu.com736a9132014-08-09 22:36:35 +020093+ TARGET=MIPS_LINUX; TARGETDIR=mips
Benjamin Peterson25c95f12009-05-08 20:42:26 +000094 ;;
95
doko@ubuntu.com736a9132014-08-09 22:36:35 +020096 nios2*-linux*)
97@@ -293,7 +299,7 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +000098 AC_MSG_ERROR(["libffi has not been ported to $host."])
99 fi
100
101-AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
102+AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null])
Gregory P. Smith029273f2013-03-18 17:11:20 -0700103 AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000104 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
105 AM_CONDITIONAL(X86, test x$TARGET = xX86)
doko@ubuntu.com736a9132014-08-09 22:36:35 +0200106@@ -617,4 +623,8 @@
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000107
Matthias Klosefb60f802010-03-19 17:47:21 +0000108 AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000109
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000110+AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
111+
112+AC_CONFIG_FILES(fficonfig.py)
Matthias Klosefb60f802010-03-19 17:47:21 +0000113+
Benjamin Peterson25c95f12009-05-08 20:42:26 +0000114 AC_OUTPUT
doko@ubuntu.com736a9132014-08-09 22:36:35 +0200115diff -urN libffi-3.1/fficonfig.py.in libffi/fficonfig.py.in
116--- libffi-3.1/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100
117+++ libffi/fficonfig.py.in 2014-08-09 21:43:25.229871827 +0200
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200118@@ -0,0 +1,35 @@
119+ffi_sources = """
120+src/prep_cif.c
121+src/closures.c
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200122+""".split()
123+
124+ffi_platforms = {
125+ 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'],
126+ 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'],
doko@ubuntu.com6a66f152014-08-09 23:52:34 +0200127+ 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'],
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200128+ 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'],
129+ 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'],
130+ 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'],
131+ 'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'],
132+ 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
133+ 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
134+ 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
doko@ubuntu.com736a9132014-08-09 22:36:35 +0200135+ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.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 -0700136+ 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200137+ 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
doko@ubuntu.com736a9132014-08-09 22:36:35 +0200138+ 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200139+ 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
140+ 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
141+ 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
142+ 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'],
143+ 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'],
144+ 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'],
145+ 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'],
146+ 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'],
147+ 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'],
148+ 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'],
149+}
150+
151+ffi_sources += ffi_platforms['@TARGET@']
152+
153+ffi_cflags = '@CFLAGS@'
doko@ubuntu.com736a9132014-08-09 22:36:35 +0200154diff -urN libffi-3.1/src/dlmalloc.c libffi/src/dlmalloc.c
155--- libffi-3.1/src/dlmalloc.c 2014-04-25 19:45:13.000000000 +0200
156+++ libffi/src/dlmalloc.c 2014-08-09 21:51:07.881871443 +0200
doko@ubuntu.com2a918762012-06-26 17:56:44 +0200157@@ -457,6 +457,11 @@
158 #define LACKS_ERRNO_H
159 #define MALLOC_FAILURE_ACTION
160 #define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
161+#elif !defined _GNU_SOURCE
162+/* mremap() on Linux requires this via sys/mman.h
163+ * See roundup issue 10309
164+ */
165+#define _GNU_SOURCE 1
166 #endif /* WIN32 */
167
168 #ifdef __OS2__
doko@ubuntu.com736a9132014-08-09 22:36:35 +0200169@@ -4497,7 +4502,7 @@
Christian Heimesbd306db2013-12-04 09:43:21 +0100170 char* tbase = (char*)(CALL_MMAP(tsize));
171 if (tbase != CMFAIL) {
172 m = init_user_mstate(tbase, tsize);
173- set_segment_flags(&m->seg, IS_MMAPPED_BIT);
174+ (void)set_segment_flags(&m->seg, IS_MMAPPED_BIT);
175 set_lock(m, locked);
176 }
177 }
doko@ubuntu.com736a9132014-08-09 22:36:35 +0200178@@ -4512,7 +4517,7 @@
Christian Heimesbd306db2013-12-04 09:43:21 +0100179 if (capacity > msize + TOP_FOOT_SIZE &&
180 capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
181 m = init_user_mstate((char*)base, capacity);
182- set_segment_flags(&m->seg, EXTERN_BIT);
183+ (void)set_segment_flags(&m->seg, EXTERN_BIT);
184 set_lock(m, locked);
185 }
186 return (mspace)m;
doko@ubuntu.com3b48af02014-08-10 00:01:04 +0200187diff -urN libffi-3.1/src/arm/ffi.c libffi/src/arm/ffi.c
188--- libffi-3.1/src/arm/ffi.c Sat Aug 09 23:52:34 2014 +0200
189+++ libffi/src/arm/ffi.c Sat Aug 09 23:58:38 2014 +0200
190@@ -154,9 +154,6 @@
191
192 int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
193 {
194- // make sure we are using FFI_VFP
195- FFI_ASSERT(ecif->cif->abi == FFI_VFP);
196-
197 register unsigned int i, vi = 0;
198 register void **p_argv;
199 register char *argp, *regp, *eo_regp;
200@@ -165,6 +162,9 @@
201 char done_with_regs = 0;
202 char is_vfp_type;
203
204+ // make sure we are using FFI_VFP
205+ FFI_ASSERT(ecif->cif->abi == FFI_VFP);
206+
207 /* the first 4 words on the stack are used for values passed in core
208 * registers. */
209 regp = stack;