Skip to content

Commit

Permalink
pythongh-110820: Make sure processor specific defines are correct for…
Browse files Browse the repository at this point in the history
… Universal 2 build on macOS (python#112828)

* pythongh-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

(cherry picked from commit 15a80b1)
  • Loading branch information
ronaldoussoren committed Dec 8, 2023
1 parent 46f86f5 commit b11422b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Include/pymacconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
* only compile-time constant in these scenarios.
*/

#if defined(__APPLE__)
#ifdef __APPLE__

# undef SIZEOF_LONG
# undef SIZEOF_LONG_DOUBLE
# undef SIZEOF_PTHREAD_T
# undef SIZEOF_SIZE_T
# undef SIZEOF_TIME_T
Expand All @@ -23,6 +24,7 @@
# undef DOUBLE_IS_BIG_ENDIAN_IEEE754
# undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
# undef HAVE_GCC_ASM_FOR_X87
# undef HAVE_GCC_ASM_FOR_X64

# undef VA_LIST_IS_ARRAY
# if defined(__LP64__) && defined(__x86_64__)
Expand Down Expand Up @@ -80,8 +82,14 @@
#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
#endif /* __BIG_ENDIAN */

#ifdef __i386__
#if defined(__i386__) || defined(__x86_64__)
# define HAVE_GCC_ASM_FOR_X87
# define ALIGNOF_MAX_ALIGN_T 16
# define HAVE_GCC_ASM_FOR_X64 1
# define SIZEOF_LONG_DOUBLE 16
#else
# define ALIGNOF_MAX_ALIGN_T 8
# define SIZEOF_LONG_DOUBLE 8
#endif


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Make sure the preprocessor definitions for ``ALIGNOF_MAX_ALIGN_T``,
``SIZEOF_LONG_DOUBLE`` and ``HAVE_GCC_ASM_FOR_X64`` are correct for
Universal 2 builds on macOS.

0 comments on commit b11422b

Please sign in to comment.