]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 28 Apr 2025 17:15:45 +0000 (19:15 +0200)
committerGitHub <noreply@github.com>
Mon, 28 Apr 2025 17:15:45 +0000 (12:15 -0500)
commit507b4fa7a4d7c68ff514de4f30f6e49d7fc9cfc8
treeede0445e4ac51ccfd5190de157634cb83b5af545
parent85882ca0e71c7ba65f4b5b88307b196791328724
[3.13] gh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison (GH-133092)

When built on a MIPS architecture, `_MIPS_SIM` is used to determine
architecture 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 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.
(cherry picked from commit 6985e2e6dea67630cf13fc02b7ca727af383207b)

Co-authored-by: Valters Jansons <sigv@users.noreply.github.com>
Misc/NEWS.d/next/Build/2025-04-02-21-08-36.gh-issue-132026.ptnR7T.rst [new file with mode: 0644]
Misc/platform_triplet.c