doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 1 | --- libffi.orig/configure.ac 2012-04-12 05:10:51.000000000 +0200 |
| 2 | +++ libffi/configure.ac 2012-06-26 15:42:42.477498938 +0200 |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 3 | @@ -1,4 +1,7 @@ |
| 4 | dnl Process this with autoconf to create configure |
| 5 | +# |
| 6 | +# file from libffi - slightly patched for ctypes |
| 7 | +# |
| 8 | |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 9 | AC_PREREQ(2.68) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 10 | |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 11 | @@ -114,6 +117,9 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 12 | i?86-*-solaris2.1[[0-9]]*) |
| 13 | TARGET=X86_64; TARGETDIR=x86 |
| 14 | ;; |
| 15 | + i*86-*-nto-qnx*) |
| 16 | + TARGET=X86; TARGETDIR=x86 |
| 17 | + ;; |
| 18 | i?86-*-*) |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 19 | TARGET=X86_64; TARGETDIR=x86 |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 20 | ;; |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 21 | @@ -131,12 +137,12 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 22 | ;; |
| 23 | |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 24 | mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 25 | - TARGET=MIPS; TARGETDIR=mips |
| 26 | + TARGET=MIPS_IRIX; TARGETDIR=mips |
| 27 | ;; |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 28 | mips*-*-linux* | mips*-*-openbsd*) |
Matthias Klose | a834975 | 2010-03-15 13:25:28 +0000 | [diff] [blame] | 29 | # Support 128-bit long double for NewABI. |
| 30 | HAVE_LONG_DOUBLE='defined(__mips64)' |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 31 | - TARGET=MIPS; TARGETDIR=mips |
Matthias Klose | a834975 | 2010-03-15 13:25:28 +0000 | [diff] [blame] | 32 | + TARGET=MIPS_IRIX; TARGETDIR=mips |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 33 | ;; |
| 34 | |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 35 | moxie-*-*) |
| 36 | @@ -212,7 +218,7 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 37 | AC_MSG_ERROR(["libffi has not been ported to $host."]) |
| 38 | fi |
| 39 | |
| 40 | -AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS) |
| 41 | +AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null]) |
| 42 | AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) |
| 43 | AM_CONDITIONAL(X86, test x$TARGET = xX86) |
| 44 | AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD) |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 45 | @@ -499,4 +505,8 @@ |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 46 | |
Matthias Klose | fb60f80 | 2010-03-19 17:47:21 +0000 | [diff] [blame] | 47 | 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] | 48 | |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 49 | +AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h) |
| 50 | + |
| 51 | +AC_CONFIG_FILES(fficonfig.py) |
Matthias Klose | fb60f80 | 2010-03-19 17:47:21 +0000 | [diff] [blame] | 52 | + |
Benjamin Peterson | 25c95f1 | 2009-05-08 20:42:26 +0000 | [diff] [blame] | 53 | AC_OUTPUT |
doko@ubuntu.com | 2a91876 | 2012-06-26 17:56:44 +0200 | [diff] [blame] | 54 | --- libffi-3.0.11/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100 |
| 55 | +++ libffi/fficonfig.py.in 2012-03-15 01:04:27.000000000 +0100 |
| 56 | @@ -0,0 +1,35 @@ |
| 57 | +ffi_sources = """ |
| 58 | +src/prep_cif.c |
| 59 | +src/closures.c |
| 60 | +src/dlmalloc.c |
| 61 | +""".split() |
| 62 | + |
| 63 | +ffi_platforms = { |
| 64 | + 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'], |
| 65 | + 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'], |
| 66 | + 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'], |
| 67 | + 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'], |
| 68 | + 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'], |
| 69 | + 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'], |
| 70 | + 'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'], |
| 71 | + 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'], |
| 72 | + 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'], |
| 73 | + 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'], |
| 74 | + 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], |
| 75 | + 'POWERPC_AIX': ['src/powerpc/ffi.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], |
| 76 | + 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], |
| 77 | + 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'], |
| 78 | + 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'], |
| 79 | + 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'], |
| 80 | + 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'], |
| 81 | + 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'], |
| 82 | + 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'], |
| 83 | + 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'], |
| 84 | + 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], |
| 85 | + 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'], |
| 86 | + 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'], |
| 87 | +} |
| 88 | + |
| 89 | +ffi_sources += ffi_platforms['@TARGET@'] |
| 90 | + |
| 91 | +ffi_cflags = '@CFLAGS@' |
| 92 | diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c |
| 93 | --- libffi-3.0.11/src/dlmalloc.c 2012-04-12 04:46:06.000000000 +0200 |
| 94 | +++ libffi/src/dlmalloc.c 2012-06-26 15:15:58.949547461 +0200 |
| 95 | @@ -457,6 +457,11 @@ |
| 96 | #define LACKS_ERRNO_H |
| 97 | #define MALLOC_FAILURE_ACTION |
| 98 | #define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ |
| 99 | +#elif !defined _GNU_SOURCE |
| 100 | +/* mremap() on Linux requires this via sys/mman.h |
| 101 | + * See roundup issue 10309 |
| 102 | + */ |
| 103 | +#define _GNU_SOURCE 1 |
| 104 | #endif /* WIN32 */ |
| 105 | |
| 106 | #ifdef __OS2__ |
| 107 | diff -urN libffi-3.0.11/src/sparc/v8.S libffi/src/sparc/v8.S |
| 108 | --- libffi-3.0.11/src/sparc/v8.S 2012-04-12 04:46:06.000000000 +0200 |
| 109 | +++ libffi/src/sparc/v8.S 2011-03-13 05:15:04.000000000 +0100 |
| 110 | @@ -213,6 +213,10 @@ |
| 111 | be,a done1 |
| 112 | ldd [%fp-8], %i0 |
| 113 | |
| 114 | + cmp %o0, FFI_TYPE_UINT64 |
| 115 | + be,a done1 |
| 116 | + ldd [%fp-8], %i0 |
| 117 | + |
| 118 | ld [%fp-8], %i0 |
| 119 | done1: |
| 120 | jmp %i7+8 |