<pre style='margin:0'>
Dan Villiom Podlaski Christiansen (danchr) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/2c32af7f11d8aa8366b3fe28dcd6ff18249d4db6">https://github.com/macports/macports-ports/commit/2c32af7f11d8aa8366b3fe28dcd6ff18249d4db6</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 2c32af7f11d pypy: upgrade to 7.3.3; fix big sur build
</span>2c32af7f11d is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 2c32af7f11d8aa8366b3fe28dcd6ff18249d4db6
</span>Author: Dan Villiom Podlaski Christiansen <danchr@macports.org>
AuthorDate: Fri Jan 15 01:48:29 2021 +0100
<span style='display:block; white-space:pre;color:#404040;'> pypy: upgrade to 7.3.3; fix big sur build
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The released version of PyPy does not build (or work) on Big Sur, due
</span><span style='display:block; white-space:pre;color:#404040;'> to changes in how dyld works. So, we use CPython instead for building
</span><span style='display:block; white-space:pre;color:#404040;'> PyPy 2.7 on Big Sur, and apply a back-ported merge request[1].
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> While at it, I've applied a patch to force Thin LTO[2] so the overhead
</span><span style='display:block; white-space:pre;color:#404040;'> isn't quite so large, suppressed building native modules during the
</span><span style='display:block; white-space:pre;color:#404040;'> `build` stage, and removed some hacks related to platforms other than
</span><span style='display:block; white-space:pre;color:#404040;'> x86-64.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (The port remains restricted to x86-64; I've added a note pointing to
</span><span style='display:block; white-space:pre;color:#404040;'> a blog requesting help for ARM64 support. A JIT targeting macOS on
</span><span style='display:block; white-space:pre;color:#404040;'> PowerPC isn't going to happen.)
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes #61659
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> [1] https://foss.heptapod.net/pypy/pypy/-/merge_requests/798
</span><span style='display:block; white-space:pre;color:#404040;'> [2] https://clang.llvm.org/docs/ThinLTO.html
</span>---
lang/pypy/Portfile | 66 +++++-----
lang/pypy/files/ncurses-build.diff | 12 --
lang/pypy/files/patch-big-sur-pypy27.diff | 153 ++++++++++++++++++++++
lang/pypy/files/patch-big-sur-pypy36.diff | 193 ++++++++++++++++++++++++++++
lang/pypy/files/patch-big-sur-pypy37.diff | 193 ++++++++++++++++++++++++++++
lang/pypy/files/patch-lto-thin.diff | 12 ++
lang/pypy/files/patch-no-cffi-at-build.diff | 11 ++
lang/pypy/files/pypy2-darwin.py.diff | 24 ++--
8 files changed, 603 insertions(+), 61 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/Portfile b/lang/pypy/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index e78aaace4cf..424ccbe9386 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/pypy/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/pypy/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortGroup gitlab 1.0
</span> PortGroup select 1.0
gitlab.instance https://foss.heptapod.net
<span style='display:block; white-space:pre;background:#ffe0e0;'>-gitlab.setup pypy pypy 7.3.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+gitlab.setup pypy pypy 7.3.3
</span> revision 0
categories lang python devel
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -30,15 +30,17 @@ depends_lib port:libffi \
</span> depends_run port:python_select
select.entries [list python python-$subport $subport]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles ncurses-build.diff \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- make_output.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles make_output.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-no-cffi-at-build.diff \
</span> ffiplatform.py.diff \
paths.diff
use_configure no
# no effort has been made to get the JIT working anywhere but x86-64,
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# and without that, PyPy has little or no benefit over CPython
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# and without that, PyPy has little or no benefit over CPython; if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# you're looking for support for Apple Silicon - or ARM64 - see
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://morepypy.blogspot.com/2020/12/mac-meets-arm64.html
</span> supported_archs x86_64
# a simple mapping from scripts to modules -- ideally, upstream
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -114,21 +116,21 @@ distname ${name}${python.branch}-v${version}-src
</span> if {${python.branch} == 2.7} {
patchfiles-append pypy2-darwin.py.diff
<span style='display:block; white-space:pre;background:#ffe0e0;'>- checksums rmd160 58d9a5a69d39fa993c459bfa1753465e6759f143 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 8189480d8350ad6364d05c2b39fd7d832644d4b1cd018f785126389df45928d1 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 21142873
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ checksums rmd160 d96834cd5b4db84ce9ecf79543478934ad25481d \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 f63488051ba877fd65840bf8d53822a9c6423d947839023b8720139f4b6e2336 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 20881821
</span> } elseif {${python.branch} == 3.6} {
patchfiles-append pypy3-darwin.py.diff
<span style='display:block; white-space:pre;background:#ffe0e0;'>- checksums rmd160 184f4c59a8fbe2cab6d523ed3b583b3d92850755 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 fd6175fed63ff9fccd7886068078853078948d98afae9bd4f5554c6f7873c10d \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 22736022
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ checksums rmd160 02e9c76e0b381d1bb7ea2f828f221a4d7cdd403a \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 a23d21ca0de0f613732af4b4abb0b0db1cc56134b5bf0e33614eca87ab8805af \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 22484684
</span> } elseif {${python.branch} == 3.7} {
patchfiles-append pypy3-darwin.py.diff
<span style='display:block; white-space:pre;background:#ffe0e0;'>- checksums rmd160 11dcea71d8ffec789a306533eac297be24499a29 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 9274186eb0c28716a8c6134803b1df857bc3f496e25e50e605c4d95201c8817d \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 25060911
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ checksums rmd160 2bdde7c11bee2ce9736effbc327abea22c410f46 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 f6c96401f76331e474cca2d14437eb3b2f68a0f27220a6dcbc537445fe9d5b78 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 24633503
</span> }
description A fast interpreter for Python ${python.branch}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -143,7 +145,7 @@ build.env PYPY_USESSION_DIR=${workpath} PYPY_LOCALBASE=${prefix} \
</span>
build.dir ${worksrcpath}/pypy/goal
build.args --batch --verbose \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- --cc=${configure.cc} --opt=jit --lto \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ --cc=${configure.cc} --opt=jit --lto --compile \
</span> --make-jobs=${build.jobs}
build.target ../../rpython/bin/rpython
build.post_args targetpypystandalone
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -195,25 +197,31 @@ if {$subport ne $name} {
</span> depends_build-append port:pypy
build.cmd ${prefix}/lib/pypy/bin/pypy
} else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${os.platform} eq "darwin" && ${os.arch} eq "i386" && ![catch {sysctl hw.cpu64bit_capable} is64bit] && $is64bit == 1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${os.platform} eq "darwin" && ${os.major} < 20} {
</span> # use a binary distribution of pypy itself
depends_build-append port:pypy-bootstrap
build.cmd ${prefix}/lib/pypy-bootstrap/bin/pypy
} else {
# fall back to good old CPython...
<span style='display:block; white-space:pre;background:#ffe0e0;'>- depends_build-append port:python27
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_build-append port:python27 port:py27-pycparser port:py27-cffi
</span> build.cmd ${prefix}/bin/python2.7
}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${os.platform} eq "darwin" && ${os.major} >= 20} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${python.branch} == 2.7} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-big-sur-pypy27.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {${python.branch} == 3.6} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-big-sur-pypy36.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-big-sur-pypy37.diff
</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> # a lot of memory is used before the C compiler even runs, so limit build.jobs
# according to available memory more tightly than the default
if {![catch {sysctl hw.memsize} memsize]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$build_arch eq "x86_64" || $build_arch eq "ppc64"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- incr memsize -4000000000
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- incr memsize -2000000000
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ incr memsize -4000000000
</span> if {$memsize <= 0} {
build.jobs 1
} elseif {${build.jobs} > $memsize / 1000000000 + 1} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -222,9 +230,7 @@ if {![catch {sysctl hw.memsize} memsize]} {
</span> }
# memory usage bug in gcc 4.2 on x86_64
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {$build_arch eq "x86_64"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- compiler.blacklist gcc-4.2
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+compiler.blacklist gcc-4.2
</span>
platform darwin {
# use arch -foo if available
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -235,20 +241,14 @@ platform darwin {
</span> # LTO causes the the buildbots to time out on older releases
if {${os.major} < 15} {
build.args-delete --lto
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # speed up the build by using thin LTO
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-lto-thin.diff
</span> }
}
# Install support files, but only if not in a proper subport
if {![regexp \- $subport]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- pre-destroot {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # PyPy invariably builds the CFFI modules during its main
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # build, but we may only want some of them -- in particular,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # we don't want it to pick up Tk from the system on systems
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # where this is available
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # https://trac.macports.org/ticket/61136
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- delete {*}[glob -nocomplain -directory ${worksrcpath}/lib_pypy *.so */*.so]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> post-destroot {
file delete ${destroot}${prefix}/lib/${subport}.tar.bz2
ln -s ../lib/${subport}/bin/${name} ${destroot}${prefix}/bin/${subport}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/files/ncurses-build.diff b/lang/pypy/files/ncurses-build.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0e6d8ed38e1..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/pypy/files/ncurses-build.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,12 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git lib_pypy/_curses_build.py lib_pypy/_curses_build.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- lib_pypy/_curses_build.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ lib_pypy/_curses_build.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -62,6 +62,8 @@ ffi.set_source("_curses_cffi", """
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #define NCURSES_OPAQUE 0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+/* explicitly opt into this, rather than relying on _XOPEN_SOURCE */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define NCURSES_WIDECHAR 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* ncurses 6 change behaviour and makes all pointers opaque,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lets define backward compatibility. It doesn't harm
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/files/patch-big-sur-pypy27.diff b/lang/pypy/files/patch-big-sur-pypy27.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..92ff51fe639
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/pypy/files/patch-big-sur-pypy27.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,153 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib-python/2.7/ctypes/macholib/dyld.py lib-python/2.7/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib-python/2.7/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib-python/2.7/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6,6 +6,11 @@ import os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from framework import framework_info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from dylib import dylib_info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from itertools import *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ from _ctypes import _dyld_shared_cache_contains_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ def _dyld_shared_cache_contains_path(*args):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ raise NotImplementedError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __all__ = [
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'dyld_find', 'framework_find',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -130,8 +135,15 @@ def dyld_find(name, executable_path=None
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dyld_executable_path_search(name, executable_path),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dyld_default_search(name, env),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ), env):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if os.path.isfile(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if _dyld_shared_cache_contains_path(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ except NotImplementedError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pass
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise ValueError("dylib %s could not be found" % (name,))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def framework_find(fn, executable_path=None, env=None):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/_ctypes/__init__.py lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -13,15 +13,15 @@ from _ctypes.builtin import (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _string_at_addr, _wstring_at_addr, set_conversion_mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _ctypes.union import Union
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++try: from __pypy__ import builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++except ImportError: builtinify = lambda f: f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import os as _os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import FormatError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import check_HRESULT as _check_HRESULT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try: from __pypy__ import builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except ImportError: builtinify = lambda f: f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def CopyComPointer(src, dst):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes import c_void_p, cast
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -32,8 +32,6 @@ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dst[0] = cast(src, c_void_p).value
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- del builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LoadLibrary = dlopen
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import FUNCFLAG_STDCALL, FUNCFLAG_CDECL, FUNCFLAG_PYTHONAPI
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -43,6 +41,20 @@ from _ctypes.builtin import get_errno, s
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _ctypes.builtin import get_last_error, set_last_error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import sys as _sys
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if _sys.platform == 'darwin':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ from ._ctypes_cffi import ffi as _ffi, lib as _lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ @builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ def _dyld_shared_cache_contains_path(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if not hasattr(_lib, '_dyld_shared_cache_contains_path'):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ raise NotImplementedError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return _lib._dyld_shared_cache_contains_path(path.encode())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pass
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++del builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __version__ = '1.1.0'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #XXX platform dependant?
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RTLD_LOCAL = 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/_ctypes/_ctypes_build.py lib_pypy/_ctypes/_ctypes_build.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/_ctypes/_ctypes_build.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,23 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import platform
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++from cffi import FFI
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ffi = FFI()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++def main():
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if platform.system() != 'Darwin':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ release, _, _ = platform.mac_ver()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ release = tuple(map(int, release.split('.')))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if release < (10, 16):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.cdef('bool _dyld_shared_cache_contains_path(const char* path);')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.set_source('_ctypes_cffi', '#include <mach-o/dyld.h>')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ os.chdir(os.path.dirname(__file__))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.compile()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if __name__ == '__main__':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/pypy_tools/build_cffi_imports.py lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from __future__ import print_function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-import sys, shutil, os, tempfile, hashlib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import sys, shutil, os, tempfile, hashlib, collections
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import sysconfig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from os.path import join
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -22,18 +22,19 @@ class MissingDependenciesError(Exception
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pass
</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;'>+-cffi_build_scripts = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_ssl": "_ssl_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "sqlite3": "_sqlite3_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "audioop": "_audioop_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_tkinter": "_tkinter/tklib_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "curses": "_curses_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "grp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "resource": "_resource_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "xx": None, # for testing: 'None' should be completely ignored
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++cffi_build_scripts = collections.OrderedDict([
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_ctypes._ctypes_cffi", "_ctypes/_ctypes_build.py" if sys.platform == "darwin" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_ssl", "_ssl_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("sqlite3", "_sqlite3_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("audioop", "_audioop_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_tkinter", "_tkinter/tklib_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("curses", "_curses_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("syslog", "_syslog_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("gdbm", "_gdbm_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("grp", "_pwdgrp_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("resource", "_resource_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("xx", None), # for testing: 'None' should be completely ignored
</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;'>+ # for distribution, we may want to fetch dependencies not provided by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # the OS, such as a recent openssl/libressl.
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/files/patch-big-sur-pypy36.diff b/lang/pypy/files/patch-big-sur-pypy36.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..6ec26b33482
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/pypy/files/patch-big-sur-pypy36.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,193 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib-python/3/ctypes/macholib/dyld.py lib-python/3/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib-python/3/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib-python/3/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6,6 +6,11 @@ import os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes.macholib.framework import framework_info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes.macholib.dylib import dylib_info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from itertools import *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ from _ctypes import _dyld_shared_cache_contains_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ def _dyld_shared_cache_contains_path(*args):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ raise NotImplementedError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __all__ = [
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'dyld_find', 'framework_find',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -122,8 +127,15 @@ def dyld_find(name, executable_path=None
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dyld_executable_path_search(name, executable_path),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dyld_default_search(name, env),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ), env):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if os.path.isfile(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if _dyld_shared_cache_contains_path(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ except NotImplementedError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pass
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise ValueError("dylib %s could not be found" % (name,))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def framework_find(fn, executable_path=None, env=None):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib-python/3/ctypes/test/test_macholib.py lib-python/3/ctypes/test/test_macholib.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib-python/3/ctypes/test/test_macholib.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib-python/3/ctypes/test/test_macholib.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -45,19 +45,22 @@ def find_lib(name):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ class MachOTest(unittest.TestCase):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def test_find(self):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- self.assertEqual(find_lib('pthread'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- '/usr/lib/libSystem.B.dylib')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # On Mac OS 11, system dylibs are only present in the shared cache,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # so symlinks like libpthread.dylib -> libSystem.B.dylib will not
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # be resolved by dyld_find
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ self.assertIn(find_lib('pthread'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ('/usr/lib/libSystem.B.dylib', '/usr/lib/libpthread.dylib'))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ result = find_lib('z')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Issue #21093: dyld default search path includes $HOME/lib and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # /usr/local/lib before /usr/lib, which caused test failures if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # a local copy of libz exists in one of them. Now ignore the head
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # of the path.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- self.assertRegex(result, r".*/lib/libz\..*.*\.dylib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ self.assertRegex(result, r".*/lib/libz.*\.dylib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- self.assertEqual(find_lib('IOKit'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ self.assertIn(find_lib('IOKit'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ('/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ '/System/Library/Frameworks/IOKit.framework/IOKit'))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if __name__ == "__main__":
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unittest.main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/_ctypes/__init__.py lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -13,15 +13,15 @@ from _ctypes.builtin import (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _string_at_addr, _wstring_at_addr, set_conversion_mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _ctypes.union import Union
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++try: from __pypy__ import builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++except ImportError: builtinify = lambda f: f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import os as _os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import FormatError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import check_HRESULT as _check_HRESULT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try: from __pypy__ import builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except ImportError: builtinify = lambda f: f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def CopyComPointer(src, dst):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes import c_void_p, cast
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -32,8 +32,6 @@ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dst[0] = cast(src, c_void_p).value
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- del builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LoadLibrary = dlopen
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import FUNCFLAG_STDCALL, FUNCFLAG_CDECL, FUNCFLAG_PYTHONAPI
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -43,6 +41,20 @@ from _ctypes.builtin import get_errno, s
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _ctypes.builtin import get_last_error, set_last_error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import sys as _sys
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if _sys.platform == 'darwin':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ from ._ctypes_cffi import ffi as _ffi, lib as _lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ @builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ def _dyld_shared_cache_contains_path(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if not hasattr(_lib, '_dyld_shared_cache_contains_path'):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ raise NotImplementedError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return _lib._dyld_shared_cache_contains_path(path.encode())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pass
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++del builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __version__ = '1.1.0'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #XXX platform dependant?
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RTLD_LOCAL = 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/_ctypes/_ctypes_build.py lib_pypy/_ctypes/_ctypes_build.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/_ctypes/_ctypes_build.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,23 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import platform
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++from cffi import FFI
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ffi = FFI()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++def main():
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if platform.system() != 'Darwin':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ release, _, _ = platform.mac_ver()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ release = tuple(map(int, release.split('.')))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if release < (10, 16):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.cdef('bool _dyld_shared_cache_contains_path(const char* path);')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.set_source('_ctypes_cffi', '#include <mach-o/dyld.h>')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ os.chdir(os.path.dirname(__file__))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.compile()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if __name__ == '__main__':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/pypy_tools/build_cffi_imports.py lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from __future__ import print_function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-import sys, shutil, os, tempfile, hashlib, time
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import sys, shutil, os, tempfile, hashlib, time, collections
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import sysconfig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from os.path import join
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -22,22 +22,23 @@ class MissingDependenciesError(Exception
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pass
</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;'>+-cffi_build_scripts = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_blake2": "_blake2/_blake2_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_ssl": "_ssl_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "sqlite3": "_sqlite3_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "audioop": "_audioop_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_tkinter": "_tkinter/tklib_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "curses": "_curses_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "grp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "resource": "_resource_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "lzma": "_lzma_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # "_decimal": "_decimal_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_sha3": "_sha3/_sha3_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "xx": None, # for testing: 'None' should be completely ignored
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++cffi_build_scripts = collections.OrderedDict([
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_ctypes._ctypes_cffi", "_ctypes/_ctypes_build.py" if sys.platform == "darwin" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_blake2", "_blake2/_blake2_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_ssl", "_ssl_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("sqlite3", "_sqlite3_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("audioop", "_audioop_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_tkinter", "_tkinter/tklib_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("curses", "_curses_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("syslog", "_syslog_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_gdbm", "_gdbm_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("grp", "_pwdgrp_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("resource", "_resource_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("lzma", "_lzma_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # "_decimal", "_decimal_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_sha3", "_sha3/_sha3_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("xx", None), # for testing: 'None' should be completely ignored
</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;'>+ # for distribution, we may want to fetch dependencies not provided by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # the OS, such as a recent openssl/libressl.
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/files/patch-big-sur-pypy37.diff b/lang/pypy/files/patch-big-sur-pypy37.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..617d5536a6f
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/pypy/files/patch-big-sur-pypy37.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,193 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib-python/3/ctypes/macholib/dyld.py lib-python/3/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib-python/3/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib-python/3/ctypes/macholib/dyld.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6,6 +6,11 @@ import os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes.macholib.framework import framework_info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes.macholib.dylib import dylib_info
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from itertools import *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ from _ctypes import _dyld_shared_cache_contains_path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ def _dyld_shared_cache_contains_path(*args):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ raise NotImplementedError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __all__ = [
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 'dyld_find', 'framework_find',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -122,8 +127,15 @@ def dyld_find(name, executable_path=None
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dyld_executable_path_search(name, executable_path),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dyld_default_search(name, env),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ), env):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if os.path.isfile(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if _dyld_shared_cache_contains_path(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ except NotImplementedError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pass
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ raise ValueError("dylib %s could not be found" % (name,))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def framework_find(fn, executable_path=None, env=None):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib-python/3/ctypes/test/test_macholib.py lib-python/3/ctypes/test/test_macholib.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib-python/3/ctypes/test/test_macholib.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib-python/3/ctypes/test/test_macholib.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -45,19 +45,22 @@ def find_lib(name):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ class MachOTest(unittest.TestCase):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def test_find(self):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- self.assertEqual(find_lib('pthread'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- '/usr/lib/libSystem.B.dylib')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # On Mac OS 11, system dylibs are only present in the shared cache,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # so symlinks like libpthread.dylib -> libSystem.B.dylib will not
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # be resolved by dyld_find
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ self.assertIn(find_lib('pthread'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ('/usr/lib/libSystem.B.dylib', '/usr/lib/libpthread.dylib'))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ result = find_lib('z')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Issue #21093: dyld default search path includes $HOME/lib and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # /usr/local/lib before /usr/lib, which caused test failures if
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # a local copy of libz exists in one of them. Now ignore the head
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # of the path.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- self.assertRegex(result, r".*/lib/libz\..*.*\.dylib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ self.assertRegex(result, r".*/lib/libz.*\.dylib")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- self.assertEqual(find_lib('IOKit'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ self.assertIn(find_lib('IOKit'),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ('/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit',
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ '/System/Library/Frameworks/IOKit.framework/IOKit'))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if __name__ == "__main__":
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unittest.main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/_ctypes/__init__.py lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/_ctypes/__init__.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -13,15 +13,15 @@ from _ctypes.builtin import (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ _string_at_addr, _wstring_at_addr, set_conversion_mode)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _ctypes.union import Union
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++try: from __pypy__ import builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++except ImportError: builtinify = lambda f: f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import os as _os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import FormatError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import check_HRESULT as _check_HRESULT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- try: from __pypy__ import builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- except ImportError: builtinify = lambda f: f
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def CopyComPointer(src, dst):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from ctypes import c_void_p, cast
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -32,8 +32,6 @@ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dst[0] = cast(src, c_void_p).value
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- del builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LoadLibrary = dlopen
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _rawffi import FUNCFLAG_STDCALL, FUNCFLAG_CDECL, FUNCFLAG_PYTHONAPI
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -43,6 +41,20 @@ from _ctypes.builtin import get_errno, s
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if _os.name in ("nt", "ce"):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from _ctypes.builtin import get_last_error, set_last_error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import sys as _sys
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if _sys.platform == 'darwin':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ try:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ from ._ctypes_cffi import ffi as _ffi, lib as _lib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ @builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ def _dyld_shared_cache_contains_path(path):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if not hasattr(_lib, '_dyld_shared_cache_contains_path'):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ raise NotImplementedError
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return _lib._dyld_shared_cache_contains_path(path.encode())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ except ImportError:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pass
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++del builtinify
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __version__ = '1.1.0'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #XXX platform dependant?
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ RTLD_LOCAL = 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/_ctypes/_ctypes_build.py lib_pypy/_ctypes/_ctypes_build.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+new file mode 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/_ctypes/_ctypes_build.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -0,0 +1,23 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import os
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import platform
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++from cffi import FFI
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ffi = FFI()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++def main():
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if platform.system() != 'Darwin':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ release, _, _ = platform.mac_ver()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ release = tuple(map(int, release.split('.')))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if release < (10, 16):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.cdef('bool _dyld_shared_cache_contains_path(const char* path);')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.set_source('_ctypes_cffi', '#include <mach-o/dyld.h>')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ os.chdir(os.path.dirname(__file__))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ffi.compile()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++if __name__ == '__main__':
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ main()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git lib_pypy/pypy_tools/build_cffi_imports.py lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ lib_pypy/pypy_tools/build_cffi_imports.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from __future__ import print_function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-import sys, shutil, os, tempfile, hashlib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++import sys, shutil, os, tempfile, hashlib, collections
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ import sysconfig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ from os.path import join
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -22,22 +22,23 @@ class MissingDependenciesError(Exception
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ pass
</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;'>+-cffi_build_scripts = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_blake2": "_blake2/_blake2_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_ssl": "_ssl_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "sqlite3": "_sqlite3_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "audioop": "_audioop_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_tkinter": "_tkinter/tklib_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "curses": "_curses_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "syslog": "_syslog_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_gdbm": "_gdbm_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "grp": "_pwdgrp_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "resource": "_resource_build.py" if sys.platform != "win32" else None,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "lzma": "_lzma_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- # "_decimal": "_decimal_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "_sha3": "_sha3/_sha3_build.py",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "xx": None, # for testing: 'None' should be completely ignored
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++cffi_build_scripts = collections.OrderedDict([
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_ctypes._ctypes_cffi", "_ctypes/_ctypes_build.py" if sys.platform == "darwin" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_blake2", "_blake2/_blake2_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_ssl", "_ssl_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("sqlite3", "_sqlite3_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("audioop", "_audioop_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_tkinter", "_tkinter/tklib_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("curses", "_curses_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("syslog", "_syslog_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_gdbm", "_gdbm_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("grp", "_pwdgrp_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("resource", "_resource_build.py" if sys.platform != "win32" else None),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("lzma", "_lzma_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ # "_decimal", "_decimal_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("_sha3", "_sha3/_sha3_build.py"),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ("xx", None), # for testing: 'None' should be completely ignored
</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;'>+ # for distribution, we may want to fetch dependencies not provided by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # the OS, such as a recent openssl/libressl.
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/files/patch-lto-thin.diff b/lang/pypy/files/patch-lto-thin.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..6e295c31daf
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/pypy/files/patch-lto-thin.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git rpython/translator/platform/posix.py rpython/translator/platform/posix.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- rpython/translator/platform/posix.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ rpython/translator/platform/posix.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -137,7 +137,7 @@ class BasePosix(Platform):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # xxx check which compilers accept this option or not
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if config and config.translation.lto:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cflags = ('-flto',) + cflags
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cflags = ('-flto=thin',) + cflags
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m = GnuMakefile(path)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m.exe_name = path.join(exe_name.basename)
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/files/patch-no-cffi-at-build.diff b/lang/pypy/files/patch-no-cffi-at-build.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..71b5d1b1830
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/pypy/files/patch-no-cffi-at-build.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,11 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git pypy/goal/targetpypystandalone.py pypy/goal/targetpypystandalone.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- pypy/goal/targetpypystandalone.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ pypy/goal/targetpypystandalone.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -365,7 +365,6 @@ class PyPyTarget(object):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # otherwise, ignore errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ driver.task_build_cffi_imports = types.MethodType(task_build_cffi_imports, driver)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ driver.tasks['build_cffi_imports'] = driver.task_build_cffi_imports, [compile_goal]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- driver.default_goal = 'build_cffi_imports'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # HACKHACKHACK end
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def jitpolicy(self, driver):
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/pypy/files/pypy2-darwin.py.diff b/lang/pypy/files/pypy2-darwin.py.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 8c074ddbe57..5145fff622b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/lang/pypy/files/pypy2-darwin.py.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/pypy/files/pypy2-darwin.py.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -10,21 +10,13 @@ diff --git rpython/translator/platform/darwin.py rpython/translator/platform/dar
</span>
class Darwin(posix.BasePosix):
name = "darwin"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -115,11 +115,15 @@ class Darwin(posix.BasePosix):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -23,7 +23,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DARWIN_VERSION_MIN,)
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- class Darwin_PowerPC(Darwin):#xxx fixme, mwp
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name = "darwin_powerpc"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ link_flags = ('-arch', 'ppc')
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cflags = ('-arch', 'ppc', '-O3')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ so_ext = 'dylib'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DEFAULT_CC = 'clang'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rpath_flags = ['-Wl,-rpath', '-Wl,@executable_path/']
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- class Darwin_i386(Darwin):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name = "darwin_i386"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- DEFAULT_CC = 'clang -arch i386'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ link_flags = ('-arch', 'i386')
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cflags = ('-arch', 'i386', '-O3', '-fomit-frame-pointer')
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- class Darwin_x86_64(Darwin):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- name = "darwin_x86_64"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- DEFAULT_CC = 'clang -arch x86_64'
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ link_flags = ('-arch', 'x86_64')
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cflags = ('-arch', 'x86_64', '-O3', '-fomit-frame-pointer')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ def get_rpath_flags(self, rel_libdirs):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Diff finished. Tue Dec 29 14:19:30 2020
</span></pre><pre style='margin:0'>
</pre>