summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorNed Deily <nad@python.org>2021-05-02 08:48:29 (GMT)
committerGitHub <noreply@github.com>2021-05-02 08:48:29 (GMT)
commit0cb33da1cc9cebb9b2d67d446feb1cfd36fe7f55 (patch)
treebce5eb56ba2ad215b3bf57422b4c08de8f9c3e1e /Mac
parent91554e4c5ca3c762998296522f854a7166ba84f0 (diff)
downloadcpython-0cb33da1cc9cebb9b2d67d446feb1cfd36fe7f55.zip
cpython-0cb33da1cc9cebb9b2d67d446feb1cfd36fe7f55.tar.gz
cpython-0cb33da1cc9cebb9b2d67d446feb1cfd36fe7f55.tar.bz2
bpo-44009: Provide "python3.x-intel64" for Apple Silicon Macs (GH-25804)
This allows reliably forcing macOS universal2 framework builds to run under Rosetta 2 Intel-64 emulation on Apple Silicon Macs if needed for testing or when universal2 wheels are not yet available.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Makefile.in21
-rw-r--r--Mac/README.rst6
2 files changed, 27 insertions, 0 deletions
diff --git a/Mac/Makefile.in b/Mac/Makefile.in
index 0b32673..f969128 100644
--- a/Mac/Makefile.in
+++ b/Mac/Makefile.in
@@ -20,6 +20,7 @@ FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@
LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
+LIPO_INTEL64_FLAGS=@LIPO_INTEL64_FLAGS@
CC=@CC@
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
export MACOSX_DEPLOYMENT_TARGET
@@ -92,6 +93,16 @@ installunixtools:
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
done ;\
fi
+ -if test "x$(LIPO_INTEL64_FLAGS)" != "x"; then \
+ cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+ for fn in \
+ python3-intel64 \
+ ; \
+ do \
+ rm -f $${fn} ;\
+ $(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+ done ;\
+ fi
-if test "x$(ENSUREPIP)" != "xno" ; then \
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
for fn in \
@@ -142,6 +153,16 @@ altinstallunixtools:
$(LN) -s $(BINDIR)/$${fn} $${fn} ;\
done ;\
fi
+ -if test "x$(LIPO_INTEL64_FLAGS)" != "x"; then \
+ cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
+ for fn in \
+ python$(VERSION)-intel64 \
+ ; \
+ do \
+ rm -f $${fn} ;\
+ $(LN) -s $(BINDIR)/$${fn} $${fn} ;\
+ done ;\
+ fi
-if test "x$(ENSUREPIP)" != "xno" ; then \
cd "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" && \
for fn in \
diff --git a/Mac/README.rst b/Mac/README.rst
index 29093e9..35bbfde 100644
--- a/Mac/README.rst
+++ b/Mac/README.rst
@@ -162,6 +162,9 @@ following combinations of SDKs and universal-archs flavors are available:
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``).
+It will also install ``python3.x-intel64`` binaries in the ``universal2``
+case to allow easy execution with the Rosetta 2 Intel emulator on Apple
+Silicon Macs.
Running a specific architecture
...............................
@@ -181,6 +184,9 @@ subprocesses also run in 32-bit-mode if the main interpreter does, use
a ``python3.x-32`` binary and use the value of ``sys.executable`` as the
``subprocess`` ``Popen`` executable value.
+Likewise, use ``python3.x-intel64`` to force execution in ``x86_64`` mode
+with ``universal2`` binaries.
+
Building and using a framework-based Python on macOS
====================================================