From 722f4bb8c9c6b32a7221e4813058cbb5c3989c10 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 20 Nov 2025 17:30:35 +0100 Subject: [PATCH] gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux (#141796) Include Python.h before system headers to make sure that _remote_debugging_module.c uses the same types (ABI) than Python. --- ...-11-20-17-01-05.gh-issue-141784.LkYI2n.rst | 4 ++++ Modules/_remote_debugging_module.c | 21 +++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst diff --git a/Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst b/Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst new file mode 100644 index 000000000000..f20d84094162 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst @@ -0,0 +1,4 @@ +Fix ``_remote_debugging_module.c`` compilation on 32-bit Linux. Include +Python.h before system headers to make sure that +``_remote_debugging_module.c`` uses the same types (ABI) than Python. Patch +by Victor Stinner. diff --git a/Modules/_remote_debugging_module.c b/Modules/_remote_debugging_module.c index 6544e3a0ce68..928bc9ff47a3 100644 --- a/Modules/_remote_debugging_module.c +++ b/Modules/_remote_debugging_module.c @@ -11,15 +11,6 @@ * HEADERS AND INCLUDES * ============================================================================ */ -#include -#include -#include -#include -#include -#include -#include -#include - #ifndef Py_BUILD_CORE_BUILTIN # define Py_BUILD_CORE_MODULE 1 #endif @@ -32,6 +23,18 @@ #include // Py_TAG_BITS #include "../Python/remote_debug.h" +// gh-141784: Python.h header must be included first, before system headers. +// Otherwise, some types such as ino_t can be defined differently, causing ABI +// issues. +#include +#include +#include +#include +#include +#include +#include +#include + #ifndef HAVE_PROCESS_VM_READV # define HAVE_PROCESS_VM_READV 0 #endif -- 2.47.3