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

Properly link against functions introduced in macOS 10.12 #350

Closed
wants to merge 1 commit into from

Conversation

maxbelanger
Copy link
Contributor

macOS Sierra/10.12 introduced new functions that are problematic to link against (i.e. getentropy, clock_gettime, etc) because autoconf detecting their presence isn't sufficient to guarantee they will be available downlevel. Building Python using Xcode 8 and the macOS 10.12 SDK and following Apple's recommended practices (see https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html), to set MACOSX_DEPLOYMENT_TARGET to the minimum version to be supported (e.g. 10.8) will result in these functions being weakly linked. While testing on macOS 10.12 works properly, running Python on an older (yet declared supported) version will trigger a crash when the symbol is used, as the code doesn't appear to support the symbol being weakly defined (who would). Essentially, AC_CHECK_FUNCS is not sufficient for these functions on macOS, so we need to do extra work.

This patch alters configure not to check when building for Darwin and MACOSX_DEPLOYMENT_TARGET is defined to a version below 10.12, allowing proper down-level support.

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow these steps to help rectify the issue:

  1. If you don't have an account on b.p.o, please create one
  2. Make sure your GitHub username is listed in "Your Details" at b.p.o
  3. If you have not already done so, please sign the PSF contributor agreement. The "bugs.python.org username " requested by the form is the "Login name" field under "Your Details".
  4. If you just signed the CLA, please wait at least one US business day and then check "Your Details" on bugs.python.org to see if your account has been marked as having signed the CLA (the delay is due to a person having to manually check your signed CLA)
  5. Reply here saying you have completed the above steps

Thanks again to your contribution and we look forward to looking at it!

@ned-deily
Copy link
Member

Please open an issue on bugs.python.org for this. But, note that in general, we do not claim to support building Python for an older OS X version with a newer SDK using weak links.

@ned-deily ned-deily self-requested a review February 27, 2017 18:28
@maxbelanger
Copy link
Contributor Author

maxbelanger commented Feb 27, 2017

Hey Ned, this is following up on http://bugs.python.org/issue27596. I took a closer look at the changes made in http://bugs.python.org/issue29057 but we don't think they solve the fundamental issue for our scenario (we deploy on 10.6-10.12 using the latest SDK, as Apple recommends), particularly when using Python 3.

akruis pushed a commit to stackless-dev/stackless that referenced this pull request Nov 1, 2017
akruis pushed a commit to stackless-dev/stackless that referenced this pull request Nov 1, 2017
jaraco pushed a commit that referenced this pull request Dec 2, 2022
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.12.0 to 0.14.0.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.12.0...v0.14.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
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.

4 participants