From owner-freebsd-toolchain@FreeBSD.ORG Thu Apr 2 00:05:00 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 297D568D for ; Thu, 2 Apr 2015 00:05:00 +0000 (UTC) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E78BBFE7 for ; Thu, 2 Apr 2015 00:04:59 +0000 (UTC) Received: by pacgg7 with SMTP id gg7so66826641pac.0 for ; Wed, 01 Apr 2015 17:04:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=3wKLXYV6h7ix4e5hBnkc4of8pmP0i3yBHLVcvABxzE8=; b=gMJqNF3ubjRxd8kVC8pmXYbx5bbTUpTRgDCeE0ziHKUbfyzhwlFNh3Xuw65e9ZWJCU NaJBP0jNE+D5cFGQt7K8uy7AHOKPy1YOvaBD2qxTVyG3UzF3kqf7vAwRZ6raDL7JMtnX 7dRreEwwAQOsSmKaEiKfA88FbPN2dhxekf7FTpW8LvmQ3KPIYuhGiCzAOitVSmUb9sFT ye3h/x6er/8Lv4O2dz+EAQLCdXceniJbrn2QmOkyH37o64Ni3kdto4VJPQtbEhoE/ECw 2wRktqFYH1+Q2CWZ6SPhSYO3XGDo6vhXOw/5gZZA6OcJV/aGAxVm/PFijCeYTLPJVHZA CjkQ== X-Gm-Message-State: ALoCoQlflQ7rXGbqtNh3QRzGVBFKH2jiRpa8RvSc/nU+7wY32eTIraxBhigSZiZQKlmXsJ6z7AH3 X-Received: by 10.68.227.41 with SMTP id rx9mr13581234pbc.76.1427933098927; Wed, 01 Apr 2015 17:04:58 -0700 (PDT) Received: from lgmac-panastasopoulos-6.corp.netflix.com ([69.53.236.236]) by mx.google.com with ESMTPSA id pb2sm3261349pdb.33.2015.04.01.17.04.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Apr 2015 17:04:58 -0700 (PDT) Sender: Warner Losh Subject: Re: Shorter report: powerpc64-xtoolchain-gcc use fails from powerpc (non-64) Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_74D210E6-0D36-42FC-A42F-78A09CB89345"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <7AF12D5F-F4A0-429E-AEAE-4AEF2D35FE31@dsl-only.net> Date: Wed, 1 Apr 2015 17:04:54 -0700 Message-Id: <83AB15DC-4B96-489D-A74B-84A552050785@bsdimp.com> References: <7AF12D5F-F4A0-429E-AEAE-4AEF2D35FE31@dsl-only.net> To: Mark Millard X-Mailer: Apple Mail (2.2070.6) Cc: FreeBSD Toolchain , FreeBSD PowerPC ML 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: Thu, 02 Apr 2015 00:05:00 -0000 --Apple-Mail=_74D210E6-0D36-42FC-A42F-78A09CB89345 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 1, 2015, at 4:37 PM, Mark Millard wrote: >=20 >=20 > On 2015-Apr-1, at 02:49 PM, Warner Losh wrote: >=20 >=20 >>> On Apr 1, 2015, at 2:44 PM, Mark Millard = wrote: >>>=20 >>> Attempting to use CROSS_TOOLCHAIN=3Dpowerpc64-gcc on powerpc = (non-64) 11.0-CURRENT with TARGET_ARCH=3Dpowerpc64 gets: >>>=20 >>>> --- 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 >>>=20 >>>=20 >>>=20 >>> Read below only for analysis. >>>=20 >>>=20 >>>=20 >>> First I'll deal with the error messages. Then I'll deal with the = "gcc". >>>=20 >>> The lines of crti.S in question are: >>>=20 >>>> .quad .L._init,.TOC.@tocbase,0 >>>> ... >>>> .quad .L._fini,.TOC.@tocbase,0 >>>=20 >>> The error messages are because __powerpc64__ is not defined when = machine/asm.h is included so the wrong definition is used for = _ENTRY(=E2=80=A6): >>=20 >> The gcc port needs to be fixed, with changes fed upstream. >=20 > The head/lib/csu/powerpc64/Makefile generated "gcc" as the command = (see above). That in turn ended up as using: /usr/bin/gcc , which is the = FreeBSD 4.2.1 system gcc. >=20 > So no port was involved. That may be the (or a) problem: ${XCC} was = not being used. That=E2=80=99s an interesting hole. It should be. >>>> #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__ */ >>>=20 >>> The (powerpc64 specific) Makefile may need to force a 64-bit usage = (-m64 ?), presuming that such is supported from the 32 bit environment. >>=20 >> Generally, we=E2=80=99ve not added those kinds of flags to the = command line. There=E2=80=99s many subtle issues in the tree trying to = do that=E2=80=A6 >>=20 >> Warner >=20 > =46rom a powerpc (non-64) 11.0-CURRENT boot is the following supposed = to work by producing a powerpc64 appropriate result (no CROSS_TOOLCHAIN = for this question)? >=20 > make buildworld buildkernel KERNCONF=3DGENERIC64 TARGET=3Dpowerpc = TARGET_ARCH=3Dpowerpc64 This should work, modulo broken compilers. > The standard v4.2.1 /usr/bin/gcc in a powerpc context (non-64) for = that make command would produce files for TARGET_ARCH=3Dpowerpc unless = the command lines specified otherwise. Ah, so it is a =E2=80=98cross build=E2=80=99 situation... > Notably the build environment is picking powerpc64 specific paths when = appropriate, such as: >=20 > lib/csu/powerpc64/Makefile >=20 > so that specific Makefile is not likely to be used when powerpc64 = handling is inappropriate, even executed from from a powerpc (non-64) = context. A different path (and so a distinct Makefile) would be used for = KERNCONF=3DGENERIC TARGET_ARCH=3Dpowerpc . The hack in that Makefile likely needs to be revisited. Warner --Apple-Mail=_74D210E6-0D36-42FC-A42F-78A09CB89345 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVHIemAAoJEGwc0Sh9sBEAQOQQAKbYddNkWIRGpykQiDAEl8eh atc2rzxu+SLUh+KVKpphXf4VJaCaE6/ssj+ddwTFpVHUPRVFaqHoxSgZ5A3GYWZD /Fs2H4/4Bf0h4ztS9s2hgx169NGdvyzvRVFXS+Fwb2AKjU6ybm9eD8iMHfGrPv0D xwJvBWb5glCV7GzW0oO/ScUhpN2nzBzHi0tEnfvyR4ZT5l5n8vv5pJiH8jSnpb9i TaWNTKOuGiYIgEKaTlZHnGhE3IQk/Jpl05LsFMQNBbyPOr5gESe95lqssWeZi7IF 693cTdtX64hhxUOzL/V6HTSQYr6NDIpxs69tpUB2Y/r7Ay9s5clFv0uNWt/AmWVw g7wRMql4sIrtmmElXKtjihyuo8IAvouJccmoszDK3Oz4T9YHeFDnyHTrrUuFDjzp bMD8dypsLJen1+mxlhIa2Pfhp/HxUCcjhFoeVi+azyM6vpC3TqLP8x0xn94ZcIO5 AMjH8xDbBTtWJSB9WXezAUQ/mIZckAO9VJMmx+7hxEDEY4PgSK9/I/iXDLRleOwo 9mtmQlLEjPE2Vvi241jLI/6+pPHSywNG0goXBcZ4ZeyPUXAe8cF7Jv+M/zpxmAP2 ZFrSJyZWhjiErRBBwyaaDD9B0Zkh2FBNFAJ9a5okymrXBXvXZQ1XqvyvF6cIaKni ItEuzwV5pYnM6aPvhIMA =bo5E -----END PGP SIGNATURE----- --Apple-Mail=_74D210E6-0D36-42FC-A42F-78A09CB89345--