From owner-freebsd-toolchain@freebsd.org Mon Jan 25 01:00:11 2016 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0134A3133F for ; Mon, 25 Jan 2016 01:00:11 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-157.reflexion.net [208.70.211.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7C44617 for ; Mon, 25 Jan 2016 01:00:10 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 17692 invoked from network); 25 Jan 2016 01:00:21 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 25 Jan 2016 01:00:21 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Sun, 24 Jan 2016 20:00:06 -0500 (EST) Received: (qmail 4867 invoked from network); 25 Jan 2016 01:00:05 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 25 Jan 2016 01:00:05 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 6E5021C43AE; Sun, 24 Jan 2016 17:00:04 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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> Date: Sun, 24 Jan 2016 17:00:08 -0800 To: FreeBSD PowerPC ML , FreeBSD Toolchain Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 01:00:12 -0000 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