]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-129259: Fix AIX build failures caused by incorrect struct alignment (GH...
authorMatas Kaminskas <mkaminskas@rocketsoftware.com>
Tue, 24 Mar 2026 01:47:53 +0000 (03:47 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Mar 2026 01:47:53 +0000 (02:47 +0100)
Include/internal/pycore_backoff.h
Include/internal/pycore_code.h
Misc/NEWS.d/next/Build/2026-02-17-14-57-47.gh-issue-129259.aix8k3.rst [new file with mode: 0644]

index 0bcca1e769b341f021f97aafb2a5a33512f5d47f..b8b1dcc59c7865ebdd3ad0de0a9fffa2bdda7d62 100644 (file)
@@ -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.
index efb97dd871fb4820a99e76e963f5d1966f86d323..6048d8714c5ac4da8429721278f8298db793a7a8 100644 (file)
@@ -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 (file)
index 0000000..26db8ed
--- /dev/null
@@ -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.