Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison#132027

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
zware merged 2 commits intopython:mainfromsigv:gh-132026
Apr 27, 2025

Conversation

sigv
Copy link
Contributor

@sigvsigv commentedApr 2, 2025
edited
Loading

When building C code on a MIPS architecture,_MIPS_SIM is used to determinearchitecture specifics. The value is expected to match either_ABIO32,_ABIN32 or_ABI64.

Ingccconfig/mips/mips.h these values are defined as compilerbuiltin_define inside of a switch/case. That means, mips64el and mips64 architectures know about_ABI64 but don't know about_ABIO32 and_ABIN32. In turn, when CPython tries to use them in comparison, they may be undefined identifiers.

In default compiler behavior, the undefined identifier will be evaluated as zero, and it will not match_MIPS_SIM. However, the issues pop up when-Wundef (or, even worse,-Werror=undef) compiler flag is enabled. Then suddenly it's visible as a warning or error.

@ghost
Copy link

ghost commentedApr 2, 2025
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@sigv
Copy link
ContributorAuthor

sigv commentedApr 2, 2025
edited
Loading

Heads up: On Python 3.13 and older, this logic is not yet moved toMisc/platform_triplet.c. Instead it's inconfigure andconfigure.ac, which results in the comparison being directly inpyconfig.h. Can provide a backport there, if this is accepted.

@python-cla-bot
Copy link

All commit authors signed the Contributor License Agreement.

CLA signed

@sigvsigvforce-pushed thegh-132026 branch 3 times, most recently fromf37099c toda82beaCompareApril 6, 2025 16:58
…mparisonWhen built on a MIPS architecture, `_MIPS_SIM` is used to determinearchitecture specifics. The value is expected to match either`_ABIO32`, `_ABIN32` or `_ABI64`.In `gcc` config/mips/mips.h these values are defined as compiler`builtin_define` inside of a switch/case. That means, mips64el andmips64 architectures know about `_ABI64` but don't know about `_ABIO32`and `_ABIN32`. In turn, when CPython tries to use them in comparison,they may be undefined identifiers.In default compiler behavior, the undefined identifier will beevaluated as zero, and it will not match `_MIPS_SIM`. However, theissues pop up when `-Wundef` (or, even worse, `-Werror=undef`) compilerflag is enabled. Then suddenly it's visible as a warning or error.
Copy link
Member

@zwarezware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM with a rewording of the NEWS entry.

@zwarezwareenabled auto-merge (squash)April 27, 2025 21:33
@zwarezware merged commit6985e2e intopython:mainApr 27, 2025
27 checks passed
@sigvsigv deleted the gh-132026 branchApril 28, 2025 15:54
@sigv
Copy link
ContributorAuthor

sigv commentedApr 28, 2025
edited
Loading

@zware, thank you!

Would it be possible for me to manually backport this to 3.13'sconfigure?
I must have been looking at the tree wrong previously. This applies cleanly to 3.13 as a cherry-pick.

zware reacted with thumbs up emoji

@zwarezware added the needs backport to 3.13bugs and security fixes labelApr 28, 2025
@miss-islington-app
Copy link

Thanks@sigv for the PR, and@zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestApr 28, 2025
…mparison (pythonGH-132027)When built on a MIPS architecture, `_MIPS_SIM` is used to determinearchitecture specifics. The value is expected to match either`_ABIO32`, `_ABIN32` or `_ABI64`.In `gcc` config/mips/mips.h these values are defined as compiler`builtin_define` inside of a switch/case. That means, mips64el andmips64 architectures know about `_ABI64` but don't know about `_ABIO32`and `_ABIN32`. In turn, when CPython tries to use them in comparison,they may be undefined identifiers.In default compiler behavior, the undefined identifier will beevaluated as zero, and it will not match `_MIPS_SIM`. However, theissues pop up when `-Wundef` (or, even worse, `-Werror=undef`) compilerflag is enabled. Then suddenly it's visible as a warning or error.(cherry picked from commit6985e2e)Co-authored-by: Valters Jansons <sigv@users.noreply.github.com>
@bedevere-app
Copy link

GH-133092 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelApr 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zwarezwarezware approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@sigv@zware

[8]ページ先頭

©2009-2025 Movatter.jp