Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jan 2016 17:00:08 -0800
From:      Mark Millard <markmi@dsl-only.net>
To:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   Bug 206588: devel/powerpc64-gcc on amd64 defines _LITTLE_ENDIAN, __NO_STRICT_ALIGNMENT, etc.
Message-ID:  <4C4E36E4-AE8C-4409-826A-4C4BE4980F00@dsl-only.net>

next in thread | raw e-mail | index | archive | help
I've submitted Bug 206588 from which the below is quoted (but is not all =
the text). First I list my later comment then the beginning of the =
description.

> This is likely more an issue of not having a proper set of headers to =
use with powerpc64-gcc when cross compiling from other architectures, =
such as little endian ones.
>=20
> It is still a cross compiler usage difficulty that is not handled or =
documented.


> I used the following program and compiler command line options to dump =
macro definitions from devel/powerpc64-gcc and discovered some nasty =
ones: LITTLE_ENDIAN usage on amd64 despite targeting a big endian =
powerpc64. Differing __NO_STRICT_ALIGNMENT status and =
__GCC_HAVE_DWARF2_CFI_ASM status as well. The details follow.
>=20
> # more with_libc++__config.cpp=20
> #include <__config>
> int main(void)
> { return 0; }
>=20
> used via:
>=20
> /usr/local/bin/powerpc64-portbld-freebsd11.0-g++ -std=3Dc++11 =
-I/usr/include -I/usr/include/c++/v1/ -dM -E func.cpp | sort > =
~/powerpc64-gcc_52_macros.txt
>=20
> on a native powerpc64 (Powermac G5) context and on a amd64 context =
(inside Virtual Box on Mac OS X). The "<"'s below are from the G5 =
context and the ">" below are from the amd64 context.
>=20
> There is also a related __NO_STRICT_ALIGNMENT difference and a =
__GCC_HAVE_DWARF2_CFI_ASM difference.
>=20
> # diff /media/root/powerpc64_gcc_52_macros.txt =
~/powerpc64_gcc_52_macros.txt | more
> 16c16
> < #define _BYTE_ORDER _BIG_ENDIAN
> ---
>=20
> > #define _BYTE_ORDER _LITTLE_ENDIAN
>=20
> 27c27
> < #define _LIBCPP_BIG_ENDIAN 1
> ---
>=20
> > #define _LIBCPP_BIG_ENDIAN 0
>=20
> 60c60
> < #define _LIBCPP_LITTLE_ENDIAN 0
> ---
>=20
> > #define _LIBCPP_LITTLE_ENDIAN 1
>=20
> 84,85c84,85
> < #define _QUAD_HIGHWORD 0
> < #define _QUAD_LOWWORD 1
> ---
>=20
> > #define _QUAD_HIGHWORD 1
> > #define _QUAD_LOWWORD 0
>=20
>=20
> 200d199
> < #define __GCC_HAVE_DWARF2_CFI_ASM 1
> 289a289
>=20
> > #define __NO_STRICT_ALIGNMENT=20
. . .

=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C4E36E4-AE8C-4409-826A-4C4BE4980F00>