X Tutup
The Wayback Machine - https://web.archive.org/web/20221223064231/https://github.com/python/cpython/pull/99470
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

gh-99337: Fix compile errors with gcc 12 on macOS #99470

Merged
merged 6 commits into from Nov 21, 2022

Conversation

ronaldoussoren
Copy link
Contributor

@ronaldoussoren ronaldoussoren commented Nov 14, 2022

When compiling with GCC 12 on a macOS 12 system I get three groups of errors:

  1. In pylifecycle.c the compile rejects _Pragma within a declaration
  2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
  3. _ctypes assumed that __builtin_available is always present on macOS

Modules/_ctypes/malloc_closure.c Outdated Show resolved Hide resolved
Python/pylifecycle.c Show resolved Hide resolved
The new form matches the way we test for other weak
symbols (for example in posixmodule.c)
I earlier moved the pragma, but not the comment that explains
why it is necessary.
@ronaldoussoren ronaldoussoren requested a review from vstinner Nov 17, 2022
Copy link
Member

@vstinner vstinner left a comment

LGTM.

Oh ok, now with the fixed test if (ffi_closure_free != NULL) {, I get it :-)

@ronaldoussoren ronaldoussoren merged commit cdde29d into python:main Nov 21, 2022
15 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Nov 21, 2022

Thanks @ronaldoussoren for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Nov 21, 2022

Sorry, @ronaldoussoren, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker cdde29dde90947df9bac39c1d19479914fb3db09 3.10

@bedevere-bot
Copy link

bedevere-bot commented Nov 21, 2022

GH-99638 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 21, 2022
Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
(cherry picked from commit cdde29d)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
ronaldoussoren added a commit that referenced this pull request Nov 21, 2022
…99638)

gh-99337: Fix compile errors with gcc 12 on macOS (GH-99470)

Fix a number of compile errors with GCC-12 on macOS:

1. In pylifecycle.c the compile rejects _Pragma within a declaration
2. posixmodule.c was missing a number of ..._RUNTIME macros for non-clang on macOS
3. _ctypes assumed that __builtin_available is always present on macOS
(cherry picked from commit cdde29d)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants
X Tutup