<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/80629e53eba13efb75e4685b553f93bd491592a5">https://github.com/macports/macports-ports/commit/80629e53eba13efb75e4685b553f93bd491592a5</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 80629e53eba python27: backport upstream arm64 fixes
</span>80629e53eba is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 80629e53eba13efb75e4685b553f93bd491592a5
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Mon Sep 21 07:41:33 2020 +1000
<span style='display:block; white-space:pre;color:#404040;'> python27: backport upstream arm64 fixes
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://github.com/macports/macports-ports/pull/8328
</span>---
lang/python27/Portfile | 3 +-
lang/python27/files/arm.patch | 273 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 275 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python27/Portfile b/lang/python27/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 521d2bcc060..ea18d68371b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/python27/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python27/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,7 +41,8 @@ patchfiles patch-Makefile.pre.in.diff \
</span> patch-libedit.diff \
enable-loadable-sqlite-extensions.patch \
patch-_osx_support.py.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- darwin20.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ darwin20.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ arm.patch
</span>
depends_build port:pkgconfig
depends_lib port:bzip2 \
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/python27/files/arm.patch b/lang/python27/files/arm.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..f1587014b4e
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/python27/files/arm.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,273 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://bugs.python.org/issue41100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/python/cpython/pull/21249
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/python/cpython/pull/21268
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/python/cpython/pull/21564
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- configure.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ configure 2020-09-10 19:51:43.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -8474,6 +8474,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ppc)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MACOSX_DEFAULT_ARCH="ppc64"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ arm64)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MACOSX_DEFAULT_ARCH="arm64"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ;;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Mac/Tools/pythonw.c.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Mac/Tools/pythonw.c 2020-09-10 20:22:45.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -114,6 +114,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__x86_64__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cpu_types[0] = CPU_TYPE_X86_64;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(__arm64__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cpu_types[0] = CPU_TYPE_ARM64;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__ppc__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cpu_types[0] = CPU_TYPE_POWERPC;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__i386__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Lib/test/test_platform.py.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Lib/test/test_platform.py 2020-09-10 20:26:40.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -220,7 +220,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ self.assertEqual(res[1], ('', '', ''))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if sys.byteorder == 'little':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- self.assertIn(res[2], ('i386', 'x86_64'))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ self.assertIn(res[2], ('i386', 'x86_64', 'arm64'))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ self.assertEqual(res[2], 'PowerPC')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Lib/_osx_support.py.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Lib/_osx_support.py 2020-09-10 20:38:30.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -470,6 +470,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if len(archs) == 1:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ machine = archs[0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif archs == ('arm64', 'x86_64'):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ machine = 'universal2'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elif archs == ('i386', 'ppc'):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ machine = 'fat'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elif archs == ('i386', 'x86_64'):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -484,6 +486,10 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise ValueError(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "Don't know machine value for archs=%r" % (archs,))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ elif machine == 'arm':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # No 32-bit arm support on macOS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ machine = 'arm64'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elif machine == 'i386':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # On OSX the machine type returned by uname is always the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # 32-bit variant, even if the executable architecture is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Lib/test/test_unicode.py.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Lib/test/test_unicode.py 2020-09-18 01:42:41.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1676,6 +1676,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def test_from_format(self):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test_support.import_module('ctypes')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes import (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c_char_p,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pythonapi, py_object, sizeof,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ c_int, c_long, c_longlong, c_ssize_t,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1684,6 +1685,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ name = "PyUnicodeUCS4_FromFormat"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _PyUnicode_FromFormat = getattr(pythonapi, name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ _PyUnicode_FromFormat.argtypes = (c_char_p,)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _PyUnicode_FromFormat.restype = py_object
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def PyUnicode_FromFormat(format, *args):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Modules/_ctypes/callbacks.c.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Modules/_ctypes/callbacks.c 2020-09-18 02:26:42.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -24,7 +24,7 @@ CThunkObject_dealloc(PyObject *_self)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Py_XDECREF(self->callable);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Py_XDECREF(self->restype);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (self->pcl_write)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ffi_closure_free(self->pcl_write);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Py_ffi_closure_free(self->pcl_write);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyObject_GC_Del(self);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -426,7 +426,7 @@ CThunkObject *_ctypes_alloc_callback(PyO
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ assert(CThunk_CheckExact(p));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p->pcl_write = Py_ffi_closure_alloc(sizeof(ffi_closure),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &p->pcl_exec);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (p->pcl_write == NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyErr_NoMemory();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -473,12 +473,15 @@ CThunkObject *_ctypes_alloc_callback(PyO
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "ffi_prep_cif failed with %d", result);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto error;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(X86_DARWIN) || defined(POWERPC_DARWIN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FFI_PREP_CLOSURE_LOC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p->pcl_exec);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif defined(__APPLE__) && defined(__arm64__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ goto error;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (result != FFI_OK) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyErr_Format(PyExc_RuntimeError,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Modules/_ctypes/callproc.c.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Modules/_ctypes/callproc.c 2020-09-21 06:08:56.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -773,7 +773,8 @@ static int _call_function_pointer(int fl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ffi_type **atypes,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ffi_type *restype,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void *resmem,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int argcount)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int argcount,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int argtypecount)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef WITH_THREAD
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -801,6 +802,37 @@ static int _call_function_pointer(int fl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((flags & FUNCFLAG_CDECL) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cc = FFI_STDCALL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Even on Apple-arm64 the calling convention for variadic functions conincides
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * with the standard calling convention in the case that the function called
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * only with its fixed arguments. Thus, we do not need a special flag to be
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * set on variadic functions. We treat a function as variadic if it is called
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * with a nonzero number of variadic arguments */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int is_variadic = (argtypecount != 0 && argcount > argtypecount);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void) is_variadic;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && defined(__arm64__) && !defined(HAVE_FFI_PREP_CIF_VAR)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (is_variadic) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ PyErr_SetString(PyExc_NotImplementedError, "ffi_prep_cif_var() is missing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FFI_PREP_CIF_VAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (is_variadic) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (FFI_OK != ffi_prep_cif_var(&cif,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cc,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ argtypecount,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ argcount,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ restype,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ atypes)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ PyErr_SetString(PyExc_RuntimeError,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ffi_prep_cif_var failed");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (FFI_OK != ffi_prep_cif(&cif,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cc,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ argcount,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -810,6 +842,7 @@ static int _call_function_pointer(int fl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "ffi_prep_cif failed");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error_object = _ctypes_get_errobj(&space);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1183,6 +1216,9 @@ PyObject *_ctypes_callproc(PPROC pProc,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rtype, resbuf,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Py_SAFE_DOWNCAST(argcount,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Py_ssize_t,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Py_SAFE_DOWNCAST(argtype_count,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Py_ssize_t,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int)))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ goto cleanup;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Modules/_ctypes/ctypes.h.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Modules/_ctypes/ctypes.h 2020-09-21 06:14:07.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -481,6 +481,13 @@ static void capsule_destructor_ ## name(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif /* PY_VERSION_HEX >= 0x020700A4 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if USING_MALLOC_CLOSURE_DOT_C
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void Py_ffi_closure_free(void *p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void *Py_ffi_closure_alloc(size_t size, void** codeloc);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define Py_ffi_closure_free ffi_closure_free
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define Py_ffi_closure_alloc ffi_closure_alloc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Local Variables:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- Modules/_ctypes/malloc_closure.c.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ Modules/_ctypes/malloc_closure.c 2020-09-21 06:22:52.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -89,16 +89,24 @@ static void more_core(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /******************************************************************/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* put the item back into the free list */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void ffi_closure_free(void *p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void Py_ffi_closure_free(void *p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FFI_CLOSURE_ALLOC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi_closure_free(p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ITEM *item = (ITEM *)p;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ item->next = free_list;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free_list = item;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* return one item from the free list, allocating more if needed */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-void *ffi_closure_alloc(size_t ignored, void** codeloc)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void *Py_ffi_closure_alloc(size_t size, void** codeloc)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if HAVE_FFI_CLOSURE_ALLOC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return ffi_closure_alloc(size, codeloc);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ITEM *item;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!free_list)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ more_core();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -108,4 +116,5 @@ void *ffi_closure_alloc(size_t ignored,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free_list = item->next;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *codeloc = (void *)item;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (void *)item;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- setup.py.orig 2020-04-20 07:13:39.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ setup.py 2020-09-21 07:32:43.000000000 +1000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -16,6 +16,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from distutils.command.install import install
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from distutils.command.install_lib import install_lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from distutils.spawn import find_executable
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import distutils.command.config
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2129,6 +2130,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if host_platform == 'darwin':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sources.append('_ctypes/malloc_closure.c')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ extra_compile_args.append('-DUSING_MALLOC_CLOSURE_DOT_C=1')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sources.append('_ctypes/darwin/dlfcn_simple.c')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extra_compile_args.append('-DMACOSX')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ include_dirs.append('_ctypes/darwin')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2191,6 +2193,16 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ffi_inc and ffi_lib:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ config = distutils.command.config.config(self.distribution)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ config._check_compiler()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if any(cc in config.compiler.compiler_so for cc in ('gcc', 'clang')):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ config.compiler.compiler_so += ["-Wno-unguarded-availability-new", "-Wno-unused-value"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if config.check_func("ffi_prep_closure_loc", headers=['ffi.h'], include_dirs=[ffi_inc]):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CLOSURE_LOC=1")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if config.check_func("ffi_prep_cif_var", headers=['ffi.h'], include_dirs=[ffi_inc]):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if host_platform == 'darwin' and config.check_func("ffi_closure_alloc", headers=['ffi.h'], include_dirs=[ffi_inc]):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ext.extra_compile_args.append("-DHAVE_FFI_CLOSURE_ALLOC=1")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ext.include_dirs.extend(ffi_inc)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ext.libraries.append(ffi_lib)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ self.use_system_libffi = True
</span></pre><pre style='margin:0'>
</pre>