Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ghost commentedApr 2, 2025 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
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 the |
sigv commentedApr 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Heads up: On Python 3.13 and older, this logic is not yet moved to |
f37099c
toda82bea
Compare…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.
There was a problem hiding this 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.
Misc/NEWS.d/next/Build/2025-04-02-21-08-36.gh-issue-132026.ptnR7T.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
6985e2e
intopython:mainUh oh!
There was an error while loading.Please reload this page.
sigv commentedApr 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@zware, thank you!
|
…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>
GH-133092 is a backport of this pull request to the3.13 branch. |
Uh oh!
There was an error while loading.Please reload this page.
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
.In
gcc
config/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.