doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 1 | diff -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. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 5 | fi |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 6 | ;; |
Gregory P. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 7 | |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 8 | + i*86-*-nto-qnx*) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 9 | + TARGET=X86; TARGETDIR=x86 |
| 10 | + ;; |
Gregory P. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 11 | + |
| 12 | x86_64-*-darwin*) |
| 13 | TARGET=X86_DARWIN; TARGETDIR=x86 |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 14 | ;; |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 15 | @@ -17298,12 +17302,12 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 16 | ;; |
| 17 | |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 18 | mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 19 | - TARGET=MIPS; TARGETDIR=mips |
| 20 | + TARGET=MIPS_IRIX; TARGETDIR=mips |
| 21 | ;; |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 22 | mips*-*linux* | mips*-*-openbsd*) |
Matthias Klose | a834975 | 2010-03-15 13:25:28 +0000 | [diff] [blame] | 23 | # Support 128-bit long double for NewABI. |
| 24 | HAVE_LONG_DOUBLE='defined(__mips64)' |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 25 | - TARGET=MIPS; TARGETDIR=mips |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 26 | + TARGET=MIPS_LINUX; TARGETDIR=mips |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 27 | ;; |
| 28 | |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 29 | nios2*-linux*) |
| 30 | @@ -17373,7 +17377,7 @@ |
Gregory P. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 31 | as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5 |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 32 | 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.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 39 | @@ -18814,6 +18818,12 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 40 | 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.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 52 | @@ -20126,6 +20136,8 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 53 | "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. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 59 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 60 | esac |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 61 | diff -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 Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 64 | @@ -1,4 +1,7 @@ |
| 65 | dnl Process this with autoconf to create configure |
| 66 | +# |
Gregory P. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 67 | +# file from libffi - slightly patched for Python's ctypes |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 68 | +# |
| 69 | |
Gregory P. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 70 | AC_PREREQ(2.68) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 71 | |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 72 | @@ -144,6 +147,9 @@ |
| 73 | AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"'; |
| 74 | fi |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 75 | ;; |
| 76 | + i*86-*-nto-qnx*) |
| 77 | + TARGET=X86; TARGETDIR=x86 |
| 78 | + ;; |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 79 | i?86-*-darwin*) |
Gregory P. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 80 | TARGET=X86_DARWIN; TARGETDIR=x86 |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 81 | ;; |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 82 | @@ -218,12 +224,12 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 83 | ;; |
| 84 | |
Gregory P. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 85 | mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 86 | - TARGET=MIPS; TARGETDIR=mips |
| 87 | + TARGET=MIPS_IRIX; TARGETDIR=mips |
| 88 | ;; |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 89 | mips*-*linux* | mips*-*-openbsd*) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 90 | # Support 128-bit long double for NewABI. |
| 91 | HAVE_LONG_DOUBLE='defined(__mips64)' |
| 92 | - TARGET=MIPS; TARGETDIR=mips |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 93 | + TARGET=MIPS_LINUX; TARGETDIR=mips |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 94 | ;; |
| 95 | |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 96 | nios2*-linux*) |
| 97 | @@ -293,7 +299,7 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 98 | 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. Smith | 029273f | 2013-03-18 17:11:20 -0700 | [diff] [blame] | 103 | AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 104 | AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) |
| 105 | AM_CONDITIONAL(X86, test x$TARGET = xX86) |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 106 | @@ -617,4 +623,8 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 107 | |
Matthias Klose | fb60f80 | 2010-03-19 17:47:21 +0000 | [diff] [blame] | 108 | AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 109 | |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 110 | +AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h) |
| 111 | + |
| 112 | +AC_CONFIG_FILES(fficonfig.py) |
Matthias Klose | fb60f80 | 2010-03-19 17:47:21 +0000 | [diff] [blame] | 113 | + |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 114 | AC_OUTPUT |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 115 | diff -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.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 118 | @@ -0,0 +1,35 @@ |
| 119 | +ffi_sources = """ |
| 120 | +src/prep_cif.c |
| 121 | +src/closures.c |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 122 | +""".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.com | 6a66f15 | 2014-08-09 23:52:34 +0200 | [diff] [blame] | 127 | + 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'], |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 128 | + '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.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 135 | + '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 Peterson | 19886b8 | 2013-06-19 09:01:42 -0700 | [diff] [blame] | 136 | + 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 137 | + 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], |
doko@ubuntu.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 138 | + 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'], |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 139 | + '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.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 154 | diff -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.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 157 | @@ -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.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 169 | @@ -4497,7 +4502,7 @@ |
Christian Heimes | bd306db | 2013-12-04 09:43:21 +0100 | [diff] [blame] | 170 | 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.com | 736a913 | 2014-08-09 22:36:35 +0200 | [diff] [blame] | 178 | @@ -4512,7 +4517,7 @@ |
Christian Heimes | bd306db | 2013-12-04 09:43:21 +0100 | [diff] [blame] | 179 | 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.com | 3b48af0 | 2014-08-10 00:01:04 +0200 | [diff] [blame] | 187 | diff -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; |