https://github.com/python/cpython/commit/793a86f8a022136978ebc37c60024cd9224fb43e
commit: 793a86f8a022136978ebc37c60024cd9224fb43e
branch: 3.13
author: Matas Kaminskas <[email protected]>
committer: ambv <[email protected]>
date: 2026-03-24T02:47:53+01:00
summary:
[3.13] gh-129259: Fix AIX build failures caused by incorrect struct alignment
(GH-144917)
files:
A Misc/NEWS.d/next/Build/2026-02-17-14-57-47.gh-issue-129259.aix8k3.rst
M Include/internal/pycore_backoff.h
M Include/internal/pycore_code.h
diff --git a/Include/internal/pycore_backoff.h
b/Include/internal/pycore_backoff.h
index 0bcca1e769b341..b8b1dcc59c7865 100644
--- a/Include/internal/pycore_backoff.h
+++ b/Include/internal/pycore_backoff.h
@@ -14,6 +14,9 @@ extern "C" {
#include <stdint.h>
+#ifdef _AIX
+#pragma pack(push, 1)
+#endif
typedef struct {
union {
struct {
@@ -23,6 +26,9 @@ typedef struct {
uint16_t as_counter; // For printf("%#x", ...)
};
} _Py_BackoffCounter;
+#ifdef _AIX
+#pragma pack(pop)
+#endif
/* 16-bit countdown counters using exponential backoff.
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index efb97dd871fb48..6048d8714c5ac4 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -21,6 +21,9 @@ extern "C" {
* 2**32 - 1, rather than INT_MAX.
*/
+#ifdef _AIX
+#pragma pack(push, 1)
+#endif
typedef union {
uint16_t cache;
struct {
@@ -29,6 +32,9 @@ typedef union {
} op;
_Py_BackoffCounter counter; // First cache entry of specializable op
} _Py_CODEUNIT;
+#ifdef _AIX
+#pragma pack(pop)
+#endif
#define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive)
#define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT))
diff --git
a/Misc/NEWS.d/next/Build/2026-02-17-14-57-47.gh-issue-129259.aix8k3.rst
b/Misc/NEWS.d/next/Build/2026-02-17-14-57-47.gh-issue-129259.aix8k3.rst
new file mode 100644
index 00000000000000..26db8ed8d34f4d
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2026-02-17-14-57-47.gh-issue-129259.aix8k3.rst
@@ -0,0 +1,2 @@
+Fix AIX build failures caused by incorrect struct alignment in ``_Py_CODEUNIT``
+and ``_Py_BackoffCounter`` by adding AIX-specific ``#pragma pack`` directives.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]