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

Commit507b4fa

Browse files
[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 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>
1 parent85882ca commit507b4fa

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix use of undefined identifiers in platform triplet detection on MIPS Linux platforms.

‎Misc/platform_triplet.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ PLATFORM_TRIPLET=arm-linux-androideabi
5757
# endif
5858
# if defined(_MIPS_SIM)
5959
# if defined(__mips_hard_float)
60-
# if_MIPS_SIM==_ABIO32
60+
# ifdefined(_ABIO32)&&_MIPS_SIM==_ABIO32
6161
# defineLIBC_MIPS gnu
62-
# elif_MIPS_SIM==_ABIN32
62+
# elifdefined(_ABIN32)&&_MIPS_SIM==_ABIN32
6363
# defineLIBC_MIPS gnuabin32
64-
# elif_MIPS_SIM==_ABI64
64+
# elifdefined(_ABI64)&&_MIPS_SIM==_ABI64
6565
# defineLIBC_MIPS gnuabi64
6666
# else
6767
# error unknown mips sim value
6868
# endif
6969
# else
70-
# if_MIPS_SIM==_ABIO32
70+
# ifdefined(_ABIO32)&&_MIPS_SIM==_ABIO32
7171
# defineLIBC_MIPS gnusf
72-
# elif_MIPS_SIM==_ABIN32
72+
# elifdefined(_ABIN32)&&_MIPS_SIM==_ABIN32
7373
# defineLIBC_MIPS gnuabin32sf
74-
# elif_MIPS_SIM==_ABI64
74+
# elifdefined(_ABI64)&&_MIPS_SIM==_ABI64
7575
# defineLIBC_MIPS gnuabi64sf
7676
# else
7777
# error unknown mips sim value
@@ -107,21 +107,21 @@ PLATFORM_TRIPLET=arm-linux-androideabi
107107
# endif
108108
# if defined(_MIPS_SIM)
109109
# if defined(__mips_hard_float)
110-
# if_MIPS_SIM==_ABIO32
110+
# ifdefined(_ABIO32)&&_MIPS_SIM==_ABIO32
111111
# defineLIBC_MIPS musl
112-
# elif_MIPS_SIM==_ABIN32
112+
# elifdefined(_ABIN32)&&_MIPS_SIM==_ABIN32
113113
# defineLIBC_MIPS musln32
114-
# elif_MIPS_SIM==_ABI64
114+
# elifdefined(_ABI64)&&_MIPS_SIM==_ABI64
115115
# defineLIBC_MIPS musl
116116
# else
117117
# error unknown mips sim value
118118
# endif
119119
# else
120-
# if_MIPS_SIM==_ABIO32
120+
# ifdefined(_ABIO32)&&_MIPS_SIM==_ABIO32
121121
# defineLIBC_MIPS muslsf
122-
# elif_MIPS_SIM==_ABIN32
122+
# elifdefined(_ABIN32)&&_MIPS_SIM==_ABIN32
123123
# defineLIBC_MIPS musln32sf
124-
# elif_MIPS_SIM==_ABI64
124+
# elifdefined(_ABI64)&&_MIPS_SIM==_ABI64
125125
# defineLIBC_MIPS muslsf
126126
# else
127127
# error unknown mips sim value

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp