Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 736a913

Browse files
committed
- Issue #22176: Update the ctypes module's libffi to v3.1. This release
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian architectures.
1 parent 4f06d60 commit 736a913

136 files changed

Lines changed: 28440 additions & 13895 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Misc/NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ Library
196196
- Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
197197
broken by the fix for security issue #19435. Patch by Zach Byrne.
198198

199+
Extension Modules
200+
-----------------
201+
202+
- Issue #22176: Update the ctypes module's libffi to v3.1. This release
203+
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
204+
architectures.
205+
199206
Build
200207
-----
201208

Modules/_ctypes/libffi.diff

Lines changed: 34 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
diff -r -N -u libffi.orig/autom4te.cache/output.0 libffi/autom4te.cache/output.0
2-
diff -r -N -u libffi.orig/configure libffi/configure
3-
--- libffi.orig/configure 2013-03-17 15:37:50.000000000 -0700
4-
+++ libffi/configure 2013-03-18 15:11:39.611575163 -0700
5-
@@ -13368,6 +13368,10 @@
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 @@
65
fi
76
;;
87

@@ -13,22 +12,22 @@ diff -r -N -u libffi.orig/configure libffi/configure
1312
x86_64-*-darwin*)
1413
TARGET=X86_DARWIN; TARGETDIR=x86
1514
;;
16-
@@ -13426,12 +13430,12 @@
15+
@@ -17298,12 +17302,12 @@
1716
;;
1817

1918
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
2019
- TARGET=MIPS; TARGETDIR=mips
2120
+ TARGET=MIPS_IRIX; TARGETDIR=mips
2221
;;
23-
mips*-*-linux* | mips*-*-openbsd*)
22+
mips*-*linux* | mips*-*-openbsd*)
2423
# Support 128-bit long double for NewABI.
2524
HAVE_LONG_DOUBLE='defined(__mips64)'
2625
- TARGET=MIPS; TARGETDIR=mips
27-
+ TARGET=MIPS_IRIX; TARGETDIR=mips
26+
+ TARGET=MIPS_LINUX; TARGETDIR=mips
2827
;;
2928

30-
powerpc*-*-linux* | powerpc-*-sysv*)
31-
@@ -13491,7 +13495,7 @@
29+
nios2*-linux*)
30+
@@ -17373,7 +17377,7 @@
3231
as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
3332
fi
3433

@@ -37,7 +36,7 @@ diff -r -N -u libffi.orig/configure libffi/configure
3736
MIPS_TRUE=
3837
MIPS_FALSE='#'
3938
else
40-
@@ -14862,6 +14866,12 @@
39+
@@ -18814,6 +18818,12 @@
4140
ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
4241

4342

@@ -50,7 +49,7 @@ diff -r -N -u libffi.orig/configure libffi/configure
5049
cat >confcache <<\_ACEOF
5150
# This file is a shell script that caches the results of configure
5251
# tests run on this system so they can be shared between configure
53-
@@ -16047,6 +16057,8 @@
52+
@@ -20126,6 +20136,8 @@
5453
"testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
5554
"man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
5655
"libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
@@ -59,9 +58,9 @@ diff -r -N -u libffi.orig/configure libffi/configure
5958

6059
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
6160
esac
62-
diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
63-
--- libffi.orig/configure.ac 2013-03-17 15:37:50.000000000 -0700
64-
+++ libffi/configure.ac 2013-03-18 15:11:11.392989136 -0700
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
6564
@@ -1,4 +1,7 @@
6665
dnl Process this with autoconf to create configure
6766
+#
@@ -70,33 +69,32 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
7069

7170
AC_PREREQ(2.68)
7271

73-
@@ -146,6 +149,10 @@
74-
fi
72+
@@ -144,6 +147,9 @@
73+
AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
74+
fi
7575
;;
76-
7776
+ i*86-*-nto-qnx*)
7877
+ TARGET=X86; TARGETDIR=x86
7978
+ ;;
80-
+
81-
x86_64-*-darwin*)
79+
i?86-*-darwin*)
8280
TARGET=X86_DARWIN; TARGETDIR=x86
8381
;;
84-
@@ -204,12 +211,12 @@
82+
@@ -218,12 +224,12 @@
8583
;;
8684

8785
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
8886
- TARGET=MIPS; TARGETDIR=mips
8987
+ TARGET=MIPS_IRIX; TARGETDIR=mips
9088
;;
91-
mips*-*-linux* | mips*-*-openbsd*)
89+
mips*-*linux* | mips*-*-openbsd*)
9290
# Support 128-bit long double for NewABI.
9391
HAVE_LONG_DOUBLE='defined(__mips64)'
9492
- TARGET=MIPS; TARGETDIR=mips
95-
+ TARGET=MIPS_IRIX; TARGETDIR=mips
93+
+ TARGET=MIPS_LINUX; TARGETDIR=mips
9694
;;
9795

98-
powerpc*-*-linux* | powerpc-*-sysv*)
99-
@@ -269,7 +276,7 @@
96+
nios2*-linux*)
97+
@@ -293,7 +299,7 @@
10098
AC_MSG_ERROR(["libffi has not been ported to $host."])
10199
fi
102100

@@ -105,7 +103,7 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
105103
AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
106104
AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
107105
AM_CONDITIONAL(X86, test x$TARGET = xX86)
108-
@@ -567,4 +574,8 @@
106+
@@ -617,4 +623,8 @@
109107

110108
AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
111109

@@ -114,13 +112,13 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
114112
+AC_CONFIG_FILES(fficonfig.py)
115113
+
116114
AC_OUTPUT
117-
--- libffi-3.0.11/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100
118-
+++ libffi/fficonfig.py.in 2012-03-15 01:04:27.000000000 +0100
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
119118
@@ -0,0 +1,35 @@
120119
+ffi_sources = """
121120
+src/prep_cif.c
122121
+src/closures.c
123-
+src/dlmalloc.c
124122
+""".split()
125123
+
126124
+ffi_platforms = {
@@ -134,9 +132,10 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
134132
+ 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
135133
+ 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
136134
+ 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
137-
+ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.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'],
138136
+ 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
139137
+ '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'],
140139
+ 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
141140
+ 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
142141
+ 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
@@ -152,9 +151,9 @@ diff -r -N -u libffi.orig/configure.ac libffi/configure.ac
152151
+ffi_sources += ffi_platforms['@TARGET@']
153152
+
154153
+ffi_cflags = '@CFLAGS@'
155-
diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
156-
--- libffi-3.0.11/src/dlmalloc.c 2012-04-12 04:46:06.000000000 +0200
157-
+++ libffi/src/dlmalloc.c 2012-06-26 15:15:58.949547461 +0200
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
158157
@@ -457,6 +457,11 @@
159158
#define LACKS_ERRNO_H
160159
#define MALLOC_FAILURE_ACTION
@@ -167,25 +166,7 @@ diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
167166
#endif /* WIN32 */
168167

169168
#ifdef __OS2__
170-
@@ -3393,7 +3393,7 @@
171-
*ss = m->seg; /* Push current record */
172-
m->seg.base = tbase;
173-
m->seg.size = tsize;
174-
- set_segment_flags(&m->seg, mmapped);
175-
+ (void)set_segment_flags(&m->seg, mmapped);
176-
m->seg.next = ss;
177-
178-
/* Insert trailing fenceposts */
179-
@@ -3553,7 +3553,7 @@
180-
if (!is_initialized(m)) { /* first-time initialization */
181-
m->seg.base = m->least_addr = tbase;
182-
m->seg.size = tsize;
183-
- set_segment_flags(&m->seg, mmap_flag);
184-
+ (void)set_segment_flags(&m->seg, mmap_flag);
185-
m->magic = mparams.magic;
186-
init_bins(m);
187-
if (is_global(m))
188-
@@ -4502,7 +4502,7 @@
169+
@@ -4497,7 +4502,7 @@
189170
char* tbase = (char*)(CALL_MMAP(tsize));
190171
if (tbase != CMFAIL) {
191172
m = init_user_mstate(tbase, tsize);
@@ -194,7 +175,7 @@ diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
194175
set_lock(m, locked);
195176
}
196177
}
197-
@@ -4517,7 +4517,7 @@
178+
@@ -4512,7 +4517,7 @@
198179
if (capacity > msize + TOP_FOOT_SIZE &&
199180
capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
200181
m = init_user_mstate((char*)base, capacity);

Modules/_ctypes/libffi/.gitignore

Lines changed: 0 additions & 21 deletions
This file was deleted.

Modules/_ctypes/libffi/.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)