Sergey Fedorov wrote: > > The needed information is, again, the set of compiler predefines. Like > > in the earlier mails. > > > > gcc 4.2 / 10.5.8 > > $ gcc -arch ppc -E -dM - < /dev/null | grep -i '\(ppc\|powerpc\)' | sort > #define _ARCH_PPC 1 > #define __POWERPC__ 1 > #define __ppc__ 1 > > $ gcc -arch ppc64 -E -dM - < /dev/null | grep -i '\(ppc\|powerpc\)' | sort > #define _ARCH_PPC 1 > #define _ARCH_PPC64 1 > #define __POWERPC__ 1 > #define __ppc64__ 1
Thanks for these info. As it is hard to remember these predefines per platform, I've added a wiki page about them here: https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib/maint-tools.git;a=blob;f=platforms/predefines.txt and am adjusting the code accordingly. > > Since macOS 10.5.x is the last release to support PowerPC natively [1][2], > > you may encounter wrong configure guesses when doing it on macOS 10.6.x > > with Rosetta (especially in areas like signals and floating-point > > operations). > > 10.6.8 runs natively now on PowerPC, though it is not an official release, > of course, as ppc was supported in developer builds only. > The official kernel of 10.6.8 can still run on PowerPC though. A few > secondary components had to be replaced/rebuilt. Oh, I see. That's why your story differs from what I read in Wikipedia... > I have a setup in a VM with Rosetta too, but do not use it for normal > builds. For the most part Rosetta is okay, may need explicit triple to be > specified, but I agree, it is not 100% reliable and some software will not > work at all in Rosetta (SBCL or GHC, for example, and surprisingly 3.x > versions of Ruby – don’t ask, I have no idea why, since they all work on > 10.4–10.6 ppc natively). SBCL has a JIT compiler. That means, it creates machine instructions dynamically and then invokes the equivalent of gnulib/lib/jit/cache.h. That's most likely why Rosetta does not work with it. 2025-10-31 Bruno Haible <[email protected]> Fix support for Mac OS X/PowerPC G5. Reported by Sergey Fedorov <[email protected]> in <https://lists.gnu.org/archive/html/bug-gnulib/2025-10/msg00149.html>. * lib/fenv.in.h: Test _ARCH_PPC instead of __powerpc__ or __ppc__. * lib/fenv-private.h: Likewise. * lib/fenv-env.c: Likewise. * lib/fenv-except-state-get.c: Likewise. * lib/fenv-except-state-set.c: Likewise. * lib/fenv-except-state-test.c: Likewise. * lib/fenv-except-tracking-clear.c: Likewise. * lib/fenv-except-tracking-raise.c: Likewise. * lib/fenv-except-tracking-set.c: Likewise. * lib/fenv-except-tracking-test.c: Likewise. * lib/fenv-except-trapping.c: Likewise. * lib/fenv-round.c: Likewise. * lib/float.in.h: Likewise. * lib/immutable.c: Likewise. * lib/jit/cache.h: Likewise. * lib/snan.h: Likewise. * m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise. * tests/qemu.h: Likewise. * tests/test-exp2.h: Likewise. * tests/test-fenv-except-state-3.c: Likewise. * tests/test-fenv-except-tracking-5.c: Likewise. * tests/test-fenv-except-trapping-2.c: Likewise. * tests/test-frexpl.c: Likewise. * tests/test-getpayloadl.c: Likewise. * tests/test-ilogbl.c: Likewise. * tests/test-logbl.c: Likewise. * tests/test-nonblocking-pipe.h: Likewise. * tests/test-printf-frexpl.c: Likewise. * tests/test-setpayloadl.c: Likewise. * tests/test-setpayloadsigl.c: Likewise. * tests/test-ssfmalloc.c: Likewise. diff --git a/lib/fenv-env.c b/lib/fenv-env.c index cba1fa9e92..b1819f94e9 100644 --- a/lib/fenv-env.c +++ b/lib/fenv-env.c @@ -37,7 +37,7 @@ previously saved environment, but not during an fesetenv (FE_DFL_ENV) invocation. */ -#if defined _AIX && defined __powerpc__ /* AIX */ +#if defined _AIX && defined _ARCH_PPC /* AIX */ /* On AIX, fenv_t is a struct { unsigned short rmode; unsigned int fpstat, trapstate; }. */ @@ -813,7 +813,7 @@ fesetenv (fenv_t const *envp) return 0; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC /* On all OSes except *BSD and AIX, fenv_t is a 'double'. On *BSD, it's an 'unsigned int'. diff --git a/lib/fenv-except-state-get.c b/lib/fenv-except-state-get.c index cc27ebc744..4b51fa201f 100644 --- a/lib/fenv-except-state-get.c +++ b/lib/fenv-except-state-get.c @@ -192,7 +192,7 @@ fegetexceptflag (fexcept_t *saved_flags, int exceptions) return 0; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC /* On all OSes, fexcept_t is binary-equivalent to an 'unsigned int'. */ @@ -313,7 +313,7 @@ fegetexceptflag (fexcept_t *saved_flags, int exceptions) return 0; } -# elif defined _AIX && defined __powerpc__ /* AIX */ +# elif defined _AIX && defined _ARCH_PPC /* AIX */ # include <float.h> # include <fpxcp.h> diff --git a/lib/fenv-except-state-set.c b/lib/fenv-except-state-set.c index 7ec74a3cfe..0c825a8b94 100644 --- a/lib/fenv-except-state-set.c +++ b/lib/fenv-except-state-set.c @@ -268,7 +268,7 @@ fesetexceptflag (fexcept_t const *saved_flags, int exceptions) return 0; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC /* On all OSes, fexcept_t is binary-equivalent to an 'unsigned int'. */ @@ -546,7 +546,7 @@ fesetexceptflag (fexcept_t const *saved_flags, int exceptions) return 0; } -# elif defined _AIX && defined __powerpc__ /* AIX */ +# elif defined _AIX && defined _ARCH_PPC /* AIX */ # include <float.h> # include <fpxcp.h> diff --git a/lib/fenv-except-state-test.c b/lib/fenv-except-state-test.c index 9dc61d08b6..a3372f06ef 100644 --- a/lib/fenv-except-state-test.c +++ b/lib/fenv-except-state-test.c @@ -103,7 +103,7 @@ fetestexceptflag (fexcept_t const *saved_flags, int exceptions) return flags & FE_ALL_EXCEPT & exceptions; } -#elif (defined __ppc__ || defined __powerpc__) +#elif defined _ARCH_PPC int fetestexceptflag (fexcept_t const *saved_flags, int exceptions) diff --git a/lib/fenv-except-tracking-clear.c b/lib/fenv-except-tracking-clear.c index 0b20c23c59..5a6c59e176 100644 --- a/lib/fenv-except-tracking-clear.c +++ b/lib/fenv-except-tracking-clear.c @@ -211,7 +211,7 @@ feclearexcept (int exceptions) return 0; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC int feclearexcept (int exceptions) @@ -343,7 +343,7 @@ feclearexcept (int exceptions) return 0; } -# elif defined _AIX && defined __powerpc__ /* AIX */ +# elif defined _AIX && defined _ARCH_PPC /* AIX */ # include <float.h> # include <fpxcp.h> diff --git a/lib/fenv-except-tracking-raise.c b/lib/fenv-except-tracking-raise.c index 0df878fe45..7d07017067 100644 --- a/lib/fenv-except-tracking-raise.c +++ b/lib/fenv-except-tracking-raise.c @@ -314,7 +314,7 @@ feraiseexcept (int exceptions) return 0; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC int feraiseexcept (int exceptions) diff --git a/lib/fenv-except-tracking-set.c b/lib/fenv-except-tracking-set.c index f56b813489..72741d191d 100644 --- a/lib/fenv-except-tracking-set.c +++ b/lib/fenv-except-tracking-set.c @@ -228,7 +228,7 @@ fesetexcept (int exceptions) return 0; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC int fesetexcept (int exceptions) @@ -434,7 +434,7 @@ fesetexcept (int exceptions) return 0; } -# elif defined _AIX && defined __powerpc__ /* AIX */ +# elif defined _AIX && defined _ARCH_PPC /* AIX */ # include <float.h> # include <fpxcp.h> diff --git a/lib/fenv-except-tracking-test.c b/lib/fenv-except-tracking-test.c index baa65de450..a4b51ff12b 100644 --- a/lib/fenv-except-tracking-test.c +++ b/lib/fenv-except-tracking-test.c @@ -24,7 +24,7 @@ #include "fenv-private.h" -#if defined _AIX && defined __powerpc__ /* AIX */ +#if defined _AIX && defined _ARCH_PPC /* AIX */ /* On AIX, the register fpscr is augmented with a 32-bit word named fpscrx in thread-local storage. Instead of accessing fpscr, we must access the @@ -158,7 +158,7 @@ fetestexcept (int exceptions) return fcsr & FE_ALL_EXCEPT & exceptions; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC int fetestexcept (int exceptions) diff --git a/lib/fenv-except-trapping.c b/lib/fenv-except-trapping.c index 82c50ca394..0506224bf5 100644 --- a/lib/fenv-except-trapping.c +++ b/lib/fenv-except-trapping.c @@ -487,7 +487,7 @@ fegetexcept (void) return FE_ALL_EXCEPT & (fcsr << 16); } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC # if defined __linux__ # include <sys/prctl.h> @@ -829,7 +829,7 @@ fegetexcept (void) return mask_to_exceptions (trapbits); } -# elif defined _AIX && defined __powerpc__ /* AIX */ +# elif defined _AIX && defined _ARCH_PPC /* AIX */ # include <fptrap.h> /* Documentation: diff --git a/lib/fenv-private.h b/lib/fenv-private.h index 5e44975ae6..1d180ba0ea 100644 --- a/lib/fenv-private.h +++ b/lib/fenv-private.h @@ -278,7 +278,7 @@ extern void __ieee_set_fp_control (unsigned long); # define _FPU_GETCW(cw) __asm__ __volatile__ ("movfcsr2gr %0,$r0" : "=r" (cw)) # define _FPU_SETCW(cw) __asm__ __volatile__ ("movgr2fcsr $r0,%0" : : "r" (cw)) -#elif (defined __ppc__ || defined __powerpc__) +#elif defined _ARCH_PPC /* fpscr bits 28..25 indicate which floating-point exceptions, other than FE_INVALID, have occurred since the respective bit was last set to zero. @@ -372,7 +372,7 @@ extern void __ieee_set_fp_control (unsigned long); #endif -#if defined _AIX && defined __powerpc__ /* AIX */ +#if defined _AIX && defined _ARCH_PPC /* AIX */ /* <fpxcp.h> defines a type fpflag_t and macros FP_*. */ diff --git a/lib/fenv-round.c b/lib/fenv-round.c index ff76713418..dbf8d277bc 100644 --- a/lib/fenv-round.c +++ b/lib/fenv-round.c @@ -315,7 +315,7 @@ fesetround (int rounding_direction) return 0; } -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC /* The AIX header files have different values for the rounding directions than all the other platforms: The values 0 and 1 are swapped. diff --git a/lib/fenv.in.h b/lib/fenv.in.h index 7f71ab5b9c..d4f68c8e07 100644 --- a/lib/fenv.in.h +++ b/lib/fenv.in.h @@ -125,7 +125,7 @@ typedef struct } fenv_t; -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC typedef double /* yuck! */ fenv_t; /* fpscr register */ @@ -328,7 +328,7 @@ _GL_CXXALIASWARN (feholdexcept); # define FE_UPWARD (2 << 8) # define FE_DOWNWARD (3 << 8) -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC /* Attention: AIX has different values for these macros! */ # define FE_TONEAREST 0 @@ -497,7 +497,7 @@ _GL_CXXALIASWARN (fesetround); # define FE_DIVBYZERO (1U << 19) # define FE_INVALID (1U << 20) -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC # define FE_INEXACT (1U << 25) # define FE_DIVBYZERO (1U << 26) @@ -764,7 +764,7 @@ typedef unsigned short fexcept_t; typedef unsigned int fexcept_t; -# elif (defined __ppc__ || defined __powerpc__) +# elif defined _ARCH_PPC typedef unsigned int fexcept_t; diff --git a/lib/float.in.h b/lib/float.in.h index c3f89b8b36..28f9967f6f 100644 --- a/lib/float.in.h +++ b/lib/float.in.h @@ -119,7 +119,7 @@ extern const union gl_long_double_union gl_LDBL_MAX; wrong. Assume these bugs are fixed in any GCC new enough to define __LDBL_NORM_MAX__. */ -#if ((defined __ppc__ || defined __powerpc__) && LDBL_MANT_DIG == 106 \ +#if (defined _ARCH_PPC && LDBL_MANT_DIG == 106 \ && defined __GNUC__ && !defined __LDBL_NORM_MAX__) # undef LDBL_MIN_EXP # define LDBL_MIN_EXP (-968) diff --git a/lib/immutable.c b/lib/immutable.c index d38419b374..e6cc3b71a6 100644 --- a/lib/immutable.c +++ b/lib/immutable.c @@ -267,7 +267,7 @@ free_pages (uintptr_t pages, size_t size) # define PAGESIZE pagesize /* On Cygwin and Linux/PowerPC, PAGESIZE is 65536. On macOS 11, it is 16384. On all other platforms, it is either 4096 or 8192. */ -# if defined __CYGWIN__ || (defined __linux__ && defined __powerpc__) +# if defined __CYGWIN__ || (defined __linux__ && defined _ARCH_PPC) # define PAGESIZE_MAX 65536 # else # define PAGESIZE_MAX 16384 diff --git a/lib/jit/cache.h b/lib/jit/cache.h index 5f8cb47326..051fdde969 100644 --- a/lib/jit/cache.h +++ b/lib/jit/cache.h @@ -79,7 +79,7 @@ clear_cache (void *start, void *end) sync_instruction_memory (start, (char *) end - (char *) start); /* No operating system provided function. Dispatch according to the CPU. */ -#elif (defined __GNUC__ || defined __clang__) && defined __powerpc__ +#elif (defined __GNUC__ || defined __clang__) && defined _ARCH_PPC /* XXX Is this enough, or do we also need the 'clf' instruction? */ uintptr_t addr = (uintptr_t) start & ~(intptr_t)3; uintptr_t end_addr = (uintptr_t) end; diff --git a/lib/snan.h b/lib/snan.h index 635201fa49..ca52ce5b18 100644 --- a/lib/snan.h +++ b/lib/snan.h @@ -216,7 +216,7 @@ construct_memory_SNaNl (long double quiet_value) { memory_long_double m; m.value = quiet_value; - #if (defined __ppc__ || defined __powerpc__) && LDBL_MANT_DIG == 106 + #if defined _ARCH_PPC && LDBL_MANT_DIG == 106 /* This is PowerPC "double double", a pair of two doubles. Inf and NaN are represented as the corresponding 64-bit IEEE values in the first double; the second is ignored. Manipulate only the first double. */ diff --git a/m4/isfinite.m4 b/m4/isfinite.m4 index 56abe8f49e..c5aee3e9ae 100644 --- a/m4/isfinite.m4 +++ b/m4/isfinite.m4 @@ -1,5 +1,5 @@ # isfinite.m4 -# serial 22 +# serial 23 dnl Copyright (C) 2007-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -84,7 +84,7 @@ AC_DEFUN([gl_ISFINITEL_WORKS] #if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT /* Another NaN, more precisely crafted. */ m.value = NaNl (); - #if (defined __ppc__ || defined __powerpc__) && LDBL_MANT_DIG == 106 + #if defined _ARCH_PPC && LDBL_MANT_DIG == 106 /* This is PowerPC "double double", a pair of two doubles. Inf and NaN are represented as the corresponding 64-bit IEEE values in the first double; the second is ignored. Manipulate only the first double. */ diff --git a/tests/qemu.h b/tests/qemu.h index 6188f796ee..ae0d6ae4e9 100644 --- a/tests/qemu.h +++ b/tests/qemu.h @@ -83,7 +83,7 @@ is_running_under_qemu_user (void) if (strcasestr (buf, "SPARC") != NULL) return true; # endif -# if !(defined __ppc__ || defined __powerpc__) +# if !defined _ARCH_PPC if (strstr (buf, "POWER") != NULL) return true; # endif diff --git a/tests/test-exp2.h b/tests/test-exp2.h index 7035b81078..04d3104a5b 100644 --- a/tests/test-exp2.h +++ b/tests/test-exp2.h @@ -36,7 +36,7 @@ test_function (void) ASSERT (y == L_(1.0)); } /* <https://sourceware.org/PR13824> */ -#if !(__GLIBC__ == 2 && __GLIBC_MINOR__ < 16 && (defined __sparc || defined __powerpc__)) +#if !(__GLIBC__ == 2 && __GLIBC_MINOR__ < 16 && (defined __sparc || defined _ARCH_PPC)) { int e; DOUBLE x; diff --git a/tests/test-fenv-except-state-3.c b/tests/test-fenv-except-state-3.c index 992f1f9123..0cc8fd023d 100644 --- a/tests/test-fenv-except-state-3.c +++ b/tests/test-fenv-except-state-3.c @@ -71,7 +71,7 @@ main () /* On older i386 and on PowerPC, there is no way to implement fesetexceptflag() such that it does not trigger a trap. fesetexceptflag() is expected to fail in this case. */ -# if !((defined __i386 || defined _M_IX86) || (defined __ppc__ || defined __powerpc__)) +# if !((defined __i386 || defined _M_IX86) || defined _ARCH_PPC) ASSERT (rc == 0); # endif diff --git a/tests/test-fenv-except-tracking-5.c b/tests/test-fenv-except-tracking-5.c index df9a989d35..b946dc3d7c 100644 --- a/tests/test-fenv-except-tracking-5.c +++ b/tests/test-fenv-except-tracking-5.c @@ -55,7 +55,7 @@ main () /* On older i386 and on PowerPC, there is no way to implement fesetexcept() such that it does not trigger a trap. fesetexcept() is expected to fail in this case. */ -# if !((defined __i386 || defined _M_IX86) || (defined __ppc__ || defined __powerpc__)) +# if !((defined __i386 || defined _M_IX86) || defined _ARCH_PPC) ASSERT (rc == 0); # endif diff --git a/tests/test-fenv-except-trapping-2.c b/tests/test-fenv-except-trapping-2.c index e1162bedb7..dce08e507f 100644 --- a/tests/test-fenv-except-trapping-2.c +++ b/tests/test-fenv-except-trapping-2.c @@ -455,15 +455,15 @@ main (int argc, char *argv[]) - gcc >= 8 generates 'com*' or 'fcom*' instructions and thus passes the test. */ #if (__GLIBC__ >= 2 && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86)) && (__GNUC__ < 8 || defined __clang__)) \ - || (__GLIBC__ >= 2 && (defined __powerpc__ || (defined __s390__ || defined __s390x__))) \ + || (__GLIBC__ >= 2 && (defined _ARCH_PPC || (defined __s390__ || defined __s390x__))) \ || (__GLIBC__ >= 2 && __FreeBSD_kernel__ && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86))) \ - || (defined MUSL_LIBC && ((defined __i386 || defined _M_IX86) || defined __powerpc__)) \ + || (defined MUSL_LIBC && ((defined __i386 || defined _M_IX86) || defined _ARCH_PPC)) \ || ((defined __APPLE__ && defined __MACH__) && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86) || defined __aarch64__)) \ || ((defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__) && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86))) \ - || ((defined __FreeBSD__ || defined __NetBSD__) && defined __powerpc__) \ + || ((defined __FreeBSD__ || defined __NetBSD__) && defined _ARCH_PPC) \ || (defined __OpenBSD__ && defined __mips64) \ || (defined __minix && (defined __i386 || defined _M_IX86)) \ - || (defined _AIX && defined __powerpc__) \ + || (defined _AIX && defined _ARCH_PPC) \ || (defined __sun && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86))) \ || (defined __CYGWIN__ && (defined __x86_64__ || defined _M_X64)) \ || (defined _WIN32 && ((defined __x86_64__ || defined _M_X64) || (defined __i386 || defined _M_IX86))) \ diff --git a/tests/test-frexpl.c b/tests/test-frexpl.c index 550648b623..0f39d54544 100644 --- a/tests/test-frexpl.c +++ b/tests/test-frexpl.c @@ -52,7 +52,7 @@ SIGNATURE_CHECK (frexpl, long double, (long double, int *)); /* On PowerPC machines, LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double' is -968. For exponents below that, the precision may be truncated to the precision used for 'double'. */ -#if defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__ +#if defined _ARCH_PPC # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53) #else # define MIN_NORMAL_EXP LDBL_MIN_EXP diff --git a/tests/test-getpayloadl.c b/tests/test-getpayloadl.c index 6c83a18d1a..b35f405de9 100644 --- a/tests/test-getpayloadl.c +++ b/tests/test-getpayloadl.c @@ -28,7 +28,7 @@ SIGNATURE_CHECK (getpayloadl, long double, (const long double *)); #include "signed-snan.h" #include "macros.h" -#if (defined __ppc__ || defined __powerpc__) && LDBL_MANT_DIG == 106 +#if defined _ARCH_PPC && LDBL_MANT_DIG == 106 /* This is PowerPC "double double", a pair of two doubles. NaN is represented as the corresponding 64-bit IEEE value in the first double; the second is irrelevant and therefore does not contain a payload. */ diff --git a/tests/test-ilogbl.c b/tests/test-ilogbl.c index 3b274fa197..27fd3506fb 100644 --- a/tests/test-ilogbl.c +++ b/tests/test-ilogbl.c @@ -45,7 +45,7 @@ SIGNATURE_CHECK (ilogbl, int, (long double)); /* On PowerPC machines, LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double' is -968. For exponents below that, the precision may be truncated to the precision used for 'double'. */ -#if defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__ +#if defined _ARCH_PPC # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53) #else # define MIN_NORMAL_EXP LDBL_MIN_EXP diff --git a/tests/test-logbl.c b/tests/test-logbl.c index 74ba4f53a2..b4c7c48bde 100644 --- a/tests/test-logbl.c +++ b/tests/test-logbl.c @@ -38,7 +38,7 @@ SIGNATURE_CHECK (logbl, long double, (long double)); /* On PowerPC machines, LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double' is -968. For exponents below that, the precision may be truncated to the precision used for 'double'. */ -#if defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__ +#if defined _ARCH_PPC # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53) #else # define MIN_NORMAL_EXP LDBL_MIN_EXP diff --git a/tests/test-nonblocking-pipe.h b/tests/test-nonblocking-pipe.h index 95b8c48f1e..5ad17a97aa 100644 --- a/tests/test-nonblocking-pipe.h +++ b/tests/test-nonblocking-pipe.h @@ -37,7 +37,7 @@ # define PIPE_DATA_BLOCK_SIZE 270000 #elif defined __linux__ && defined __sparc # define PIPE_DATA_BLOCK_SIZE 140000 -#elif defined __linux__ && defined __powerpc__ +#elif defined __linux__ && defined _ARCH_PPC # define PIPE_DATA_BLOCK_SIZE 1100000 #elif defined _WIN32 && !defined __CYGWIN__ # define PIPE_DATA_BLOCK_SIZE 10000 diff --git a/tests/test-printf-frexpl.c b/tests/test-printf-frexpl.c index f64f16d53d..7f113b8d9e 100644 --- a/tests/test-printf-frexpl.c +++ b/tests/test-printf-frexpl.c @@ -28,7 +28,7 @@ /* On PowerPC machines, LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double' is -968. For exponents below that, the precision may be truncated to the precision used for 'double'. */ -#if defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__ +#if defined _ARCH_PPC # define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53) # define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP #else diff --git a/tests/test-setpayloadl.c b/tests/test-setpayloadl.c index bd990f2852..785de2ccd5 100644 --- a/tests/test-setpayloadl.c +++ b/tests/test-setpayloadl.c @@ -28,7 +28,7 @@ SIGNATURE_CHECK (setpayloadl, int, (long double *, long double)); #include "isnanl-nolibm.h" #include "macros.h" -#if (defined __ppc__ || defined __powerpc__) && LDBL_MANT_DIG == 106 +#if defined _ARCH_PPC && LDBL_MANT_DIG == 106 /* This is PowerPC "double double", a pair of two doubles. NaN is represented as the corresponding 64-bit IEEE value in the first double; the second is irrelevant and therefore does not contain a payload. */ diff --git a/tests/test-setpayloadsigl.c b/tests/test-setpayloadsigl.c index 678fdf1c1a..c67dc8d1e3 100644 --- a/tests/test-setpayloadsigl.c +++ b/tests/test-setpayloadsigl.c @@ -28,7 +28,7 @@ SIGNATURE_CHECK (setpayloadsigl, int, (long double *, long double)); #include "isnanl-nolibm.h" #include "macros.h" -#if (defined __ppc__ || defined __powerpc__) && LDBL_MANT_DIG == 106 +#if defined _ARCH_PPC && LDBL_MANT_DIG == 106 /* This is PowerPC "double double", a pair of two doubles. NaN is represented as the corresponding 64-bit IEEE value in the first double; the second is irrelevant and therefore does not contain a payload. */ diff --git a/tests/test-ssfmalloc.c b/tests/test-ssfmalloc.c index 99691f83e0..2c597eab0e 100644 --- a/tests/test-ssfmalloc.c +++ b/tests/test-ssfmalloc.c @@ -117,7 +117,7 @@ free_pages (uintptr_t pages, size_t size) #define PAGESIZE pagesize /* On Cygwin and Linux/PowerPC, PAGESIZE is 65536. On macOS 11, it is 16384. On all other platforms, it is either 4096 or 8192. */ -#if defined __CYGWIN__ || (defined __linux__ && defined __powerpc__) +#if defined __CYGWIN__ || (defined __linux__ && defined _ARCH_PPC) # define PAGESIZE_MAX 65536 #else # define PAGESIZE_MAX 16384
