]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux (#141796...
authorVictor Stinner <vstinner@python.org>
Thu, 20 Nov 2025 17:13:03 +0000 (18:13 +0100)
committerGitHub <noreply@github.com>
Thu, 20 Nov 2025 17:13:03 +0000 (18:13 +0100)
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.

(cherry picked from commit 722f4bb8c9c6b32a7221e4813058cbb5c3989c10)

Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst [new file with mode: 0644]
Modules/_remote_debugging_module.c

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 (file)
index 0000000..f20d840
--- /dev/null
@@ -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.
index f34f25a133854227a89ffd8d9c151501f7f18ceb..b46538b76df16e68a0cc475382f2fb5812d85528 100644 (file)
  * HEADERS AND INCLUDES
  * ============================================================================ */
 
-#include <errno.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
 #ifndef Py_BUILD_CORE_BUILTIN
 #    define Py_BUILD_CORE_MODULE 1
 #endif
 #include <internal/pycore_stackref.h>       // 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 <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
 #ifndef HAVE_PROCESS_VM_READV
 #    define HAVE_PROCESS_VM_READV 0
 #endif