diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2020-11-08 09:05:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-08 09:05:27 (GMT) |
commit | 41761933c1c30bb6003b65eef1ba23a83db4eae4 (patch) | |
tree | 0a8fa35d890b61bc2c688bb966773f7aa026f3b1 /Mac/README.rst | |
parent | fd6f6fa403789c8877b1099cc6fcc437d2e54634 (diff) | |
download | cpython-41761933c1c30bb6003b65eef1ba23a83db4eae4.zip cpython-41761933c1c30bb6003b65eef1ba23a83db4eae4.tar.gz cpython-41761933c1c30bb6003b65eef1ba23a83db4eae4.tar.bz2 |
bpo-41100: Support macOS 11 and Apple Silicon (GH-22855)
Co-authored-by: Lawrence D’Anna <lawrence_danna@apple.com>
* Add support for macOS 11 and Apple Silicon (aka arm64)
As a side effect of this work use the system copy of libffi on macOS, and remove the vendored copy
* Support building on recent versions of macOS while deploying to older versions
This allows building installers on macOS 11 while still supporting macOS 10.9.
Diffstat (limited to 'Mac/README.rst')
-rw-r--r-- | Mac/README.rst | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Mac/README.rst b/Mac/README.rst index ec7d873..f3638aa 100644 --- a/Mac/README.rst +++ b/Mac/README.rst @@ -120,6 +120,8 @@ support ppc (Xcode 4 on 10.6 and later systems). The flavor can be specified using the configure option ``--with-universal-archs=VALUE``. The following values are available: + * ``universal2``: ``arm64``, ``x86_64`` + * ``intel``: ``i386``, ``x86_64`` * ``intel-32``: ``i386`` @@ -155,6 +157,8 @@ following combinations of SDKs and universal-archs flavors are available: * 10.15 and later SDKs support ``intel-64`` only + * 11.0 and later SDKs support ``universal2`` + The makefile for a framework build will also install ``python3.x-32`` binaries when the universal architecture includes at least one 32-bit architecture (that is, for all flavors but ``64-bit`` and ``intel-64``). @@ -352,6 +356,39 @@ A framework install also installs some applications in ``/Applications/Python X. And lastly a framework installation installs files in ``/usr/local/bin``, all of them symbolic links to files in ``/Library/Frameworks/Python.framework/Versions/X.Y/bin``. +Weak linking support +==================== + +The CPython sources support building with the latest SDK while targetting deployment +to macOS 10.9. This is done through weak linking of symbols introduced in macOS +10.10 or later and checking for their availability at runtime. + +This requires the use of Apple's compiler toolchain on macOS 10.13 or later. + +The basic implementation pattern is: + +* ``HAVE_<FUNCTION>`` is a macro defined (or not) by the configure script + +* ``HAVE_<FUNCTION>_RUNTIME`` is a macro defined in the relevant source + files. This expands to a call to ``__builtin_available`` when using + a new enough Apple compiler, and to a true value otherwise. + +* Use ``HAVE_<FUNCTION>_RUNTIME`` before calling ``<function>``. This macro + *must* be used a the sole expression in an if statement:: + + if (HAVE_<FUNCTION>_RUNTIME) { + /* <function> is available */ + } + + Or: + + if (HAVE_<FUNCTION>_RUNTIME) {} else { + /* <function> is not available */ + } + + Using other patterns (such as ``!HAVE_<FUNCTION>_RUNTIME``) is not supported + by Apple's compilers. + Resources ========= |