From: Gregory P. Smith Date: Tue, 19 Mar 2013 21:59:02 +0000 (-0700) Subject: Fixes Issue #17192: Update the ctypes module's libffi to v3.0.13. This X-Git-Tag: v3.3.1rc1~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0408bf9cfb0dac07bf378f10af771fab41ba0d52;p=thirdparty%2FPython%2Fcpython.git Fixes Issue #17192: Update the ctypes module's libffi to v3.0.13. This specifically addresses a stack misalignment issue on x86 and issues on some more recent platforms. --- 0408bf9cfb0dac07bf378f10af771fab41ba0d52 diff --cc Misc/NEWS index 725c723b6c5c,482ffea47e21..243c4da68aca --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -193,8 -233,6 +193,12 @@@ Core and Builtin Library ------- - Issue #16880: Do not assume _imp.load_dynamic() is defined in the imp module. ++- Issue #17192: Update the ctypes module's libffi to v3.0.13. This ++ specifically addresses a stack misalignment issue on x86 and issues on ++ some more recent platforms. ++ ++- Issue #16880: Do not assume _imp.load_dynamic() is defined in the imp module. + - Issue #16389: Fixed a performance regression relative to Python 3.1 in the caching of compiled regular expressions. diff --cc Modules/_ctypes/libffi.diff index 357d0ee8e8e7,828a2779b736..71b1aa83eabd --- a/Modules/_ctypes/libffi.diff +++ b/Modules/_ctypes/libffi.diff @@@ -51,70 -114,3 +114,56 @@@ diff -r -N -u libffi.orig/configure.ac +AC_CONFIG_FILES(fficonfig.py) + AC_OUTPUT +--- libffi-3.0.11/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100 ++++ libffi/fficonfig.py.in 2012-03-15 01:04:27.000000000 +0100 +@@ -0,0 +1,35 @@ ++ffi_sources = """ ++src/prep_cif.c ++src/closures.c ++src/dlmalloc.c ++""".split() ++ ++ffi_platforms = { ++ 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'], ++ 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'], ++ 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'], ++ 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'], ++ 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'], ++ 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'], ++ 'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'], ++ 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'], ++ 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'], ++ 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'], ++ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], ++ 'POWERPC_AIX': ['src/powerpc/ffi.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], ++ 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], ++ 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'], ++ 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'], ++ 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'], ++ 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'], ++ 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'], ++ 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'], ++ 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'], ++ 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'], ++ 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'], ++ 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'], ++} ++ ++ffi_sources += ffi_platforms['@TARGET@'] ++ ++ffi_cflags = '@CFLAGS@' +diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c +--- libffi-3.0.11/src/dlmalloc.c 2012-04-12 04:46:06.000000000 +0200 ++++ libffi/src/dlmalloc.c 2012-06-26 15:15:58.949547461 +0200 +@@ -457,6 +457,11 @@ + #define LACKS_ERRNO_H + #define MALLOC_FAILURE_ACTION + #define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ ++#elif !defined _GNU_SOURCE ++/* mremap() on Linux requires this via sys/mman.h ++ * See roundup issue 10309 ++ */ ++#define _GNU_SOURCE 1 + #endif /* WIN32 */ + + #ifdef __OS2__ - diff -urN libffi-3.0.11/src/sparc/v8.S libffi/src/sparc/v8.S - --- libffi-3.0.11/src/sparc/v8.S 2012-04-12 04:46:06.000000000 +0200 - +++ libffi/src/sparc/v8.S 2011-03-13 05:15:04.000000000 +0100 - @@ -213,6 +213,10 @@ - be,a done1 - ldd [%fp-8], %i0 - - + cmp %o0, FFI_TYPE_UINT64 - + be,a done1 - + ldd [%fp-8], %i0 - + - ld [%fp-8], %i0 - done1: - jmp %i7+8 diff --cc Modules/_ctypes/libffi/testsuite/libffi.call/a.out index 93ee85b0daaf,000000000000..e69de29bb2d1 mode 100755,000000..100644 Binary files differ