From owner-freebsd-toolchain@FreeBSD.ORG Wed Apr 1 21:44:50 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75340991 for ; Wed, 1 Apr 2015 21:44:50 +0000 (UTC) Received: from asp.reflexion.net (outbound-242.asp.reflexion.net [69.84.129.242]) (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 1D151E9A for ; Wed, 1 Apr 2015 21:44:49 +0000 (UTC) Received: (qmail 22225 invoked from network); 1 Apr 2015 21:44:47 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 1 Apr 2015 21:44:47 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.40.1) with SMTP; Wed, 01 Apr 2015 17:44:47 -0400 (EDT) Received: (qmail 9767 invoked from network); 1 Apr 2015 21:44:47 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (DHE-RSA-AES256-SHA encrypted) SMTP; 1 Apr 2015 21:44:47 -0000 X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-67-189-19-145.hsd1.or.comcast.net [67.189.19.145]) by iron2.pdx.net (Postfix) with ESMTPSA id B52DA1C43A2; Wed, 1 Apr 2015 14:44:42 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Shorter report: powerpc64-xtoolchain-gcc use fails from powerpc (non-64) Message-Id: Date: Wed, 1 Apr 2015 14:44:46 -0700 To: FreeBSD Toolchain , FreeBSD PowerPC ML Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) X-Mailer: Apple Mail (2.2070.6) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 21:44:50 -0000 Attempting to use CROSS_TOOLCHAIN=3Dpowerpc64-gcc on powerpc (non-64) = 11.0-CURRENT with TARGET_ARCH=3Dpowerpc64 gets: > --- crti.o --- > gcc -O2 -pipe -I/usr/srcC/lib/csu/powerpc64/../common = -I/usr/srcC/lib/csu/powerpc64/../../libc/include -mlongcall -std=3Dgnu99 = -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter = -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type = -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter = -Wcast-align -Wchar-subscripts -Winline -Wnested-externs = -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c = /usr/srcC/lib/csu/powerpc64/crti.S > ... > /usr/srcC/lib/csu/powerpc64/crti.S: Assembler messages: > /usr/srcC/lib/csu/powerpc64/crti.S:35: Error: junk at end of line, = first unrecognized character is `@' > /usr/srcC/lib/csu/powerpc64/crti.S:51: Error: junk at end of line, = first unrecognized character is `@' > *** [crti.o] Error code 1 >=20 Read below only for analysis. First I'll deal with the error messages. Then I'll deal with the "gcc". The lines of crti.S in question are: > .quad .L._init,.TOC.@tocbase,0 > ... > .quad .L._fini,.TOC.@tocbase,0 The error messages are because __powerpc64__ is not defined when = machine/asm.h is included so the wrong definition is used for = _ENTRY(...): > #ifdef __powerpc64__ > ... > #define _ENTRY(name) \ > .section ".text"; \ > .p2align 2; \ > .globl name; \ > .section ".opd","aw"; \ > .p2align 3; \ > name: \ > .quad DOT_LABEL(name),.TOC.@tocbase,0; \ > .previous; \ > .p2align 4; \ > TYPE_ENTRY(name) \ > DOT_LABEL(name): > ... > #else /* !__powerpc64__ */ > #define _ENTRY(name) \ > .text; \ > .p2align 4; \ > .globl name; \ > .type name,@function; \ > name: > #define _END(name) > #endif /* __powerpc64__ */ The (powerpc64 specific) Makefile may need to force a 64-bit usage (-m64 = ?), presuming that such is supported from the 32 bit environment. But the below may also/instead be involved for = CROSS_TOOLCHAIN=3Dpowerpc64-gcc. As for why the "gcc" despite the CROSS_TOOLCHAIN=3Dpowerpc64-gcc = context... The head/lib/csu/powerpc64/Makefile always attempts to force the use of = "gcc": > # XXX: See the log for r232932 as to why the above -mlongcall is = needed. Since > # clang doesn't support -mlongcall, and testing shows a clang linked = with a > # clang-built csu segfaults, this must currently be compiled with gcc. = Once > # clang supports -mlongcall, or we get a fixed ld, this can be = revisited. > CC:=3D gcc > COMPILER_TYPE:=3D gcc So if gcc 4.2.1 is present then by default the old gcc's assembler is = used instead of the CROSS_TOOLCHAIN=3Dpowerpc64-gcc one. Otherwise gcc = may not be found. The gcc 4.2.1 behavior need not match the CROSS_TOOLCHAIN=3Dpowerpc64-gcc = behavior for an otherwise-the-same command line. =3D=3D=3D Mark Millard markmi at dsl-only.net