Skip to content

Commit adfb23a

Browse files
committed
gh-141784: 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.
1 parent b1558b6 commit adfb23a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Modules/_remote_debugging_module.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@
1111
* HEADERS AND INCLUDES
1212
* ============================================================================ */
1313

14-
#include <assert.h>
15-
#include <errno.h>
16-
#include <fcntl.h>
17-
#include <stddef.h>
18-
#include <stdint.h>
19-
#include <stdio.h>
20-
#include <stdlib.h>
21-
#include <string.h>
22-
2314
#ifndef Py_BUILD_CORE_BUILTIN
2415
# define Py_BUILD_CORE_MODULE 1
2516
#endif
@@ -32,6 +23,18 @@
3223
#include <internal/pycore_stackref.h> // Py_TAG_BITS
3324
#include "../Python/remote_debug.h"
3425

26+
// gh-141784: Python.h header must be included first, before system headers.
27+
// Otherwise, some types such as ino_t can be defined differently, causing ABI
28+
// issues.
29+
#include <assert.h>
30+
#include <errno.h>
31+
#include <fcntl.h>
32+
#include <stddef.h>
33+
#include <stdint.h>
34+
#include <stdio.h>
35+
#include <stdlib.h>
36+
#include <string.h>
37+
3538
#ifndef HAVE_PROCESS_VM_READV
3639
# define HAVE_PROCESS_VM_READV 0
3740
#endif

0 commit comments

Comments
 (0)