summaryrefslogtreecommitdiffstats
path: root/Mac/README.rst
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2020-11-22 10:18:40 (GMT)
committerGitHub <noreply@github.com>2020-11-22 10:18:40 (GMT)
commite8b1c038b14b5fc8120aab62c9bf5fb840274cb6 (patch)
treee4b3ac9e3a17883c78d284c2f1552820ae098106 /Mac/README.rst
parent0aab3522b259c40abf1f070c71aa7b914c1239b5 (diff)
downloadcpython-e8b1c038b14b5fc8120aab62c9bf5fb840274cb6.zip
cpython-e8b1c038b14b5fc8120aab62c9bf5fb840274cb6.tar.gz
cpython-e8b1c038b14b5fc8120aab62c9bf5fb840274cb6.tar.bz2
[3.9] bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) (GH-23295)
* [3.9] 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.. (cherry picked from commit 41761933c1c30bb6003b65eef1ba23a83db4eae4) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> * Back port of changes to _decimal to support arm64 * temp_dir is in test.support in 3.9
Diffstat (limited to 'Mac/README.rst')
-rw-r--r--Mac/README.rst37
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
=========