Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.8] bpo-41100: Support macOS 11 Big Sur and Apple Silicon Macs #25806

Merged
merged 11 commits into from
May 2, 2021

Conversation

ned-deily
Copy link
Member

@ned-deily ned-deily commented May 2, 2021

This is a partial backport of changes in Python 3.9.1 to support building and running on macOS 11 (Big Sur) and on Apple Silicon (arm64) Macs. Besides building native single-architecture binaries on either Intel or Apple Silicon Macs, a new universal2 build option is added with arm64 and x86_64 fat binaries that run natively on either CPU type.

Note that support for "weaklinking" - building binaries targeted for newer
versions of macOS that will also run correctly on older versions by
testing at runtime for missing features - is not included in this backport
from Python 3.9. To support a range of macOS versions on 3.8, continue to target
for and build on the oldest version in the range.

(Originally contributed by Ronald Oussoren and Lawrence D'Anna in bpo-41100,
with fixes by FX Coudert (bpo-42504) and Eli Rykoff (bpo-42688), and backported
to 3.8 by Maxime Bélanger and Ned Deily)

https://bugs.python.org/issue41100

maxbelanger and others added 11 commits April 29, 2021 02:10
This is a partial backport of bpo-41100 changes `e8b1c038b14b5fc8120aab62c9bf5fb840274cb6` and `96d906b144e6e6aa96c5ffebecbcc5d38034bbda` for Python 3.8. We introduce the ability to build Python from source for `arm64` on macOS, but we do not make a promise of support. This allows us to omit support for Universal2 binaries as well as weak-linking of symbols from the macOS SDK based on the deployment target, which are larger changes much more difficult to merge.

This also includes a backport of subsequent bpo-42688 change `7e729978fa08a360cbf936dc215ba7dd25a06a08` to fix build errors with external `libffi`.
…thonGH-23301) (pythonGH-23455)

On macOS system provided libraries are in a shared library cache
and not at their usual location. This PR teaches distutils to search
in the SDK, even if there was no "-sysroot" argument in
the compiler flags.
(cherry picked from commit 404a719)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
macOS releases numbering has changed as of macOS 11 Big Sur.  Previously, major releases were of the form 10.x, 10.x+1, 10.x+2, etc; as of Big Sur, they are now x, x+1, etc, so, for example, 10.15, 10.15.1, ..., 10.15.7, 11, 11.0.1, 11.1, ..., 12, 12.1, etc. Allow Python to build with single-digit deployment target values. Patch provided by FX Coudert.
(cherry picked from commit 5291639)

Co-authored-by: FX Coudert <fxcoudert@gmail.com>
…a string (pythonGH-24341) (pythonGH-24410)

* bpo-42504: Ensure that get_config_var('MACOSX_DEPLOYMENT_TARGET') is a string
(cherry picked from commit 49926cf)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
@bedevere-bot
Copy link

@ambv: Please replace # with GH- in the commit message next time. Thanks!

isuruf added a commit to isuruf/cpython that referenced this pull request May 31, 2021
pythonGH-25806 was a python 3.8 backport of pythonGH-22855 to support macOS 11,
but didn't backport the changes that enabled building python
with a new macOS SDK and target an older macOS version.
This commit adds support for that.
@ned-deily ned-deily deleted the bpo-41100-3.8 branch October 28, 2021 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants