Debian Codegraph @

cpython27/Modules/_ctypes/libffi.diff

raw
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 @@
5 fi
6 ;;
7
8 + i*86-*-nto-qnx*)
9 + TARGET=X86; TARGETDIR=x86
10 + ;;
11 +
12 x86_64-*-darwin*)
13 TARGET=X86_DARWIN; TARGETDIR=x86
14 ;;
15 @@ -17298,12 +17302,12 @@
16 ;;
17
18 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
19 - TARGET=MIPS; TARGETDIR=mips
20 + TARGET=MIPS_IRIX; TARGETDIR=mips
21 ;;
22 mips*-*linux* | mips*-*-openbsd*)
23 # Support 128-bit long double for NewABI.
24 HAVE_LONG_DOUBLE='defined(__mips64)'
25 - TARGET=MIPS; TARGETDIR=mips
26 + TARGET=MIPS_LINUX; TARGETDIR=mips
27 ;;
28
29 nios2*-linux*)
30 @@ -17373,7 +17377,7 @@
31 as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
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
39 @@ -18814,6 +18818,12 @@
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
52 @@ -20126,6 +20136,8 @@
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
59 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
60 esac
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
64 @@ -1,4 +1,7 @@
65 dnl Process this with autoconf to create configure
66 +#
67 +# file from libffi - slightly patched for Python's ctypes
68 +#
69
70 AC_PREREQ(2.68)
71
72 @@ -144,6 +147,9 @@
73 AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
74 fi
75 ;;
76 + i*86-*-nto-qnx*)
77 + TARGET=X86; TARGETDIR=x86
78 + ;;
79 i?86-*-darwin*)
80 TARGET=X86_DARWIN; TARGETDIR=x86
81 ;;
82 @@ -218,12 +224,12 @@
83 ;;
84
85 mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
86 - TARGET=MIPS; TARGETDIR=mips
87 + TARGET=MIPS_IRIX; TARGETDIR=mips
88 ;;
89 mips*-*linux* | mips*-*-openbsd*)
90 # Support 128-bit long double for NewABI.
91 HAVE_LONG_DOUBLE='defined(__mips64)'
92 - TARGET=MIPS; TARGETDIR=mips
93 + TARGET=MIPS_LINUX; TARGETDIR=mips
94 ;;
95
96 nios2*-linux*)
97 @@ -293,7 +299,7 @@
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])
103 AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
104 AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
105 AM_CONDITIONAL(X86, test x$TARGET = xX86)
106 @@ -617,4 +623,8 @@
107
108 AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
109
110 +AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
111 +
112 +AC_CONFIG_FILES(fficonfig.py)
113 +
114 AC_OUTPUT
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
118 @@ -0,0 +1,35 @@
119 +ffi_sources = """
120 +src/prep_cif.c
121 +src/closures.c
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'],
127 + 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'],
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'],
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'],
136 + 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
137 + 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
138 + 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
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@'
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
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__
169 @@ -4497,7 +4502,7 @@
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 }
178 @@ -4512,7 +4517,7 @@
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;
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;