From owner-freebsd-toolchain@freebsd.org Tue Oct 13 11:36:23 2015 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 A02B2A1166C for ; Tue, 13 Oct 2015 11:36:23 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-1.reflexion.net [208.70.210.1]) (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 4C43E987 for ; Tue, 13 Oct 2015 11:36:22 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 2324 invoked from network); 13 Oct 2015 11:36:14 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 13 Oct 2015 11:36:14 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.70.2) with SMTP; Tue, 13 Oct 2015 07:36:14 -0400 (EDT) Received: (qmail 17463 invoked from network); 13 Oct 2015 11:36:14 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 13 Oct 2015 11:36:14 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.106] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 7CB281C43AF; Tue, 13 Oct 2015 04:36:12 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: powerpc64-xtoolchain-gcc/powerpc64-gcc gets libcxxrt/guard.cc:104:15: error: expected constructor, destructor, . . . for lib32 (clang 3.6.1 context) From: Mark Millard In-Reply-To: Date: Tue, 13 Oct 2015 04:36:13 -0700 Cc: FreeBSD PowerPC ML , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <15CF1760-66B9-477B-B382-7F0C41D7C699@dsl-only.net> References: To: David Chisnall , Baptiste Daroussin 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: Tue, 13 Oct 2015 11:36:23 -0000 On 2015-Oct-12, at 01:21 AM, David Chisnall = wrote: > On 12 Oct 2015, at 03:17, Mark Millard wrote: >>=20 >> /usr/src/lib/libcxxrt/../../contrib/libcxxrt/guard.cc:104:15: error: = expected constructor, destructor, or type conversion before '(' token >> _Static_assert(sizeof(guard_t) =3D=3D sizeof(uint64_t), ""); >=20 > I think that this is the error that you get with old gcc when a static = assert fails. What is the type of guard_t on PPC64? It may simply be = that gcc isn=E2=80=99t providing the correct #defines to let the file = know that it=E2=80=99s a 64-bit target. >=20 > David Turns out that _Static_assert is a C11 keyword (not before), and not a = C++ keyword at all, not c++11 nor c++14 nor c++17 that I=E2=80=99ve = found. So far I=E2=80=99ve not found any FreeBSD specific definition = that effectively adds it to c++ for FreeBSD. lines 100 through 104 of guard.cc (from -r276417, 2014-Dec-30 by bapt) = are: typedef struct { uint32_t init_half; uint32_t lock_half; } guard_t; _Static_assert(sizeof(guard_t) =3D=3D sizeof(uint64_t), ""); which would seem to be unlikely to have sizeof(guard_t) =3D=3D = sizeof(uint64_t) be false unless there was unusual padding. This is for a not __LITTLE_ENDIAN__, not __arm__, not _LP64 context = (following the #if. . . structure those lines are contained in). powerpc = code (lib32 code under powerpc64) fits that. The compiler in use was a c++ one (well, g++, 5.2 vintage) in use for = c++ source code (.cc) compiled with -m32: > /usr/local/bin/powerpc64-portbld-freebsd11.0-g++ -m32 -mcpu=3Dpowerpc = -DCOMPAT_32BIT -isystem = /usr/obj/powerpc.powerpc64/usr/src/lib32/usr/include/ = -L/usr/obj/powerpc.powerpc64/usr/src/lib32/usr/lib32 = -B/usr/obj/powerpc.powerpc64/usr/src/lib32/usr/lib32 = --sysroot=3D/usr/obj/powerpc.powerpc64/usr/src/tmp -pg -O2 -pipe = -I/usr/src/lib/libcxxrt/../../contrib/libcxxrt -fstack-protector -c = /usr/src/lib/libcxxrt/../../contrib/libcxxrt/guard.cc -o guard.po > /usr/src/lib/libcxxrt/../../contrib/libcxxrt/guard.cc:104:15: error: = expected constructor, destructor, or type conversion before '(' token > _Static_assert(sizeof(guard_t) =3D=3D sizeof(uint64_t), ""); > ^ > *** [guard.po] Error code 1 I will note that no 4.2.1 or other old gcc for compiling to = powerpc/powerpc64 from amd64 was present. As near as I can tell, for FreeBSD as it is, _Static_assert should not = be used for a c++ context such as guard.cc. But 32 bit powerpc contexts = may be the primary examples with _Static_assert in use that way. =3D=3D=3D Mark Millard markmi at dsl-only.net