Commit 1f69787
committed
gh-157212: Fix _Py_ThreadId() on Windows ARM64 with MinGW
The __MINGW32__ && _M_ARM64 branch calls __getReg(18), mirroring the MSVC branch above it. The intrinsic is not available for MinGW ARM64: mingw-w64 declares __getReg only for Itanium, and GCC does not provide a corresponding builtin.
The branch is reached by AArch64 MinGW toolchains because mingw-w64 defines _M_ARM64 when __aarch64__ is defined.
Falling through to the generic __aarch64__ branch would not provide the Windows thread pointer. The Windows ARM64 ABI reserves x18 as the platform register pointing to the TEB, so read x18 directly.1 parent f715d25 commit 1f69787
2 files changed
Lines changed: 5 additions & 1 deletion
File tree
- Include/cpython
- Misc/NEWS.d/next/Windows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
| 527 | + | |
527 | 528 | | |
528 | 529 | | |
529 | 530 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments