From: Matas Kaminskas Date: Tue, 24 Mar 2026 01:47:53 +0000 (+0200) Subject: [3.13] gh-129259: Fix AIX build failures caused by incorrect struct alignment (GH... X-Git-Tag: v3.13.13~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=793a86f8a022136978ebc37c60024cd9224fb43e;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-129259: Fix AIX build failures caused by incorrect struct alignment (GH-144917) --- diff --git a/Include/internal/pycore_backoff.h b/Include/internal/pycore_backoff.h index 0bcca1e769b3..b8b1dcc59c78 100644 --- a/Include/internal/pycore_backoff.h +++ b/Include/internal/pycore_backoff.h @@ -14,6 +14,9 @@ extern "C" { #include +#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 efb97dd871fb..6048d8714c5a 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 000000000000..26db8ed8d34f --- /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.