Skip to content

Commit 15a80b1

Browse files
gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS (#112828)
* gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS A number of processor specific defines are different for x86-64 and arm64, and need to be adjusted in pymacconfig.h. * remove debug stuf
1 parent 4ac1e8f commit 15a80b1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Include/pymacconfig.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#define PY_MACCONFIG_H
88
#ifdef __APPLE__
99

10+
#undef ALIGNOF_MAX_ALIGN_T
1011
#undef SIZEOF_LONG
12+
#undef SIZEOF_LONG_DOUBLE
1113
#undef SIZEOF_PTHREAD_T
1214
#undef SIZEOF_SIZE_T
1315
#undef SIZEOF_TIME_T
@@ -20,6 +22,7 @@
2022
#undef DOUBLE_IS_BIG_ENDIAN_IEEE754
2123
#undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
2224
#undef HAVE_GCC_ASM_FOR_X87
25+
#undef HAVE_GCC_ASM_FOR_X64
2326

2427
#undef VA_LIST_IS_ARRAY
2528
#if defined(__LP64__) && defined(__x86_64__)
@@ -74,8 +77,14 @@
7477
# define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
7578
#endif
7679

77-
#ifdef __i386__
80+
#if defined(__i386__) || defined(__x86_64__)
7881
# define HAVE_GCC_ASM_FOR_X87
82+
# define ALIGNOF_MAX_ALIGN_T 16
83+
# define HAVE_GCC_ASM_FOR_X64 1
84+
# define SIZEOF_LONG_DOUBLE 16
85+
#else
86+
# define ALIGNOF_MAX_ALIGN_T 8
87+
# define SIZEOF_LONG_DOUBLE 8
7988
#endif
8089

8190
#endif // __APPLE__
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Make sure the preprocessor definitions for ``ALIGNOF_MAX_ALIGN_T``,
2+
``SIZEOF_LONG_DOUBLE`` and ``HAVE_GCC_ASM_FOR_X64`` are correct for
3+
Universal 2 builds on macOS.

0 commit comments

Comments
 (0)