[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
host-cpu-c-abi: Update comment, working around FreeBSD breakage
From: |
Bruno Haible |
Subject: |
host-cpu-c-abi: Update comment, working around FreeBSD breakage |
Date: |
Fri, 23 Aug 2024 19:02:27 +0200 |
For many years, the standard way to determine the endianness on powerpc64
at compile-time was
- either to test the macros _BIG_ENDIAN or _LITTLE_ENDIAN (predefined
by the compiler),
- or to test for the ELFv2 ABI: _CALL_ELF == 2.
The port of FreeBSD 14 to powerpc64 breaks *both* ways:
- When <sys/_endian.h> happens to be included, for example through
<sys/types.h>, both _BIG_ENDIAN and _LITTLE_ENDIAN get defined!
This is voluntary breakage, see
<https://cgit.freebsd.org/src/commit/?id=6f23df1ae7f6ec3cd06a15c87f0aaaa770b2941b>.
- FreeBSD uses the ELFv2 ABI also on big-endian powerpc64. Which is
allowed by
https://ftp.rtems.org/pub/rtems/people/sebh/ABI64BitOpenPOWERv1.1_16July2015_pub.pdf
— but still it's the first OS to do so.
2024-08-23 Bruno Haible <bruno@clisp.org>
host-cpu-c-abi: Update comment, working around FreeBSD breakage.
* m4/host-cpu-c-abi.m4: For powerpc64, recommend to test
__BIG_ENDIAN__ or __LITTLE_ENDIAN__, not _BIG_ENDIAN or _LITTLE_ENDIAN,
as FreeBSD 14 breaks the latter.
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
index 6053930288..80a8366855 100644
--- a/m4/host-cpu-c-abi.m4
+++ b/m4/host-cpu-c-abi.m4
@@ -1,5 +1,5 @@
# host-cpu-c-abi.m4
-# serial 17
+# serial 18
dnl Copyright (C) 2002-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,7 +36,7 @@
dnl determine the endianness through preprocessor symbols:
dnl - 'arm': test __ARMEL__.
dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
-dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl - 'powerpc64': test __BIG_ENDIAN__ vs. __LITTLE_ENDIAN__.
dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- host-cpu-c-abi: Update comment, working around FreeBSD breakage,
Bruno Haible <=