From owner-freebsd-toolchain@FreeBSD.ORG Wed Mar 18 21:39:09 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 4AA2CF3F for ; Wed, 18 Mar 2015 21:39:09 +0000 (UTC) Received: from asp.reflexion.net (outbound-241.asp.reflexion.net [69.84.129.241]) (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 DC163EB5 for ; Wed, 18 Mar 2015 21:39:08 +0000 (UTC) Received: (qmail 11574 invoked from network); 18 Mar 2015 21:39:01 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 18 Mar 2015 21:39:01 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.40.1) with SMTP; Wed, 18 Mar 2015 17:39:01 -0400 (EDT) Received: (qmail 26815 invoked from network); 18 Mar 2015 21:39:01 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (DHE-RSA-AES256-SHA encrypted) SMTP; 18 Mar 2015 21:39:01 -0000 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.8] (c-67-189-19-145.hsd1.or.comcast.net [67.189.19.145]) by iron2.pdx.net (Postfix) with ESMTPSA id 12A131C4052; Wed, 18 Mar 2015 14:38:56 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: powerpc64 11.0-CURRENT: CROSS_TOOLCHAIN=powerpc64-gcc rejects -m elf32ppc_fbsd for linking boot1.elf Date: Wed, 18 Mar 2015 14:38:58 -0700 Message-Id: <122C9C88-24F9-4FA7-BCAC-293ED0DB946A@dsl-only.net> To: freebsd-toolchain@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-ports@freebsd.org, 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: Wed, 18 Mar 2015 21:39:09 -0000 Basic context (more details given later): > # freebsd-version -ku; uname -apKU > 11.0-CURRENT > 11.0-CURRENT > FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279514M: Wed = Mar 11 19:23:14 PDT 2015 = root@FBSDG4C0:/usr/obj/powerpc.powerpc64/usr/srcC/sys/GENERIC64vtsc-NODEBU= G powerpc powerpc64 1100062 1100062 No clang is built or installed. The problem: > make -j 8 CROSS_TOOLCHAIN=3Dpowerpc64-gcc WITHOUT_CLANG_BOOTSTRAP=3D = WITHOUT_CLANG_IS_CC=3D WITHOUT_CLANG=3D WITHOUT_CLANG_EXTRAS=3D = WITHOUT_CLANG_FULL=3D WITHOUT_LLDB=3D WITHOUT_GCC_BOOTSTRAP=3D = WITHOUT_GCC=3D buildworld buildkernel KERNCONF=3DGENERIC64vtsc-NODEBUG = TARGET=3Dpowerpc TARGET_ARCH=3Dpowerpc64 processes up to: > /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc -ffreestanding = -msoft-float -Os -I/usr/srcC/sys/boot/powerpc/boot1.chrp/../../common = -I/usr/srcC/sys/boot/powerpc/boot1.chrp/../../../ -D_STANDALONE=20 > -m32 -mcpu=3Dpowerpc -m32 -mcpu=3Dpowerpc -std=3Dgnu99 -nostdlib = -static -Wl,-N -m elf32ppc_fbsd -m elf32ppc_fbsd -o boot1.elf boot1.o = ashldi3.o syncicache.o -L/usr/obj/usr/srcC/usr/lib/libc++ -lc++ and then gets for the above command... > powerpc64-portbld-freebsd11.0-gcc: error: elf32ppc_fbsd: No such file = or directory > powerpc64-portbld-freebsd11.0-gcc: error: elf32ppc_fbsd: No such file = or directory > powerpc64-portbld-freebsd11.0-gcc: error: unrecognized command line = option '-m' > powerpc64-portbld-freebsd11.0-gcc: error: unrecognized command line = option '-m' >=20 > *** [boot1.elf] Error code 1 >=20 > make[6]: stopped in /usr/srcC/sys/boot/powerpc/boot1.chrp > 1 error The -m options seems to be from the likes of... > # $FreeBSD: head/sys/boot/powerpc/Makefile.inc 227739 2011-11-19 = 19:25:57Z andreast $ >=20 > .if ${MACHINE_ARCH} =3D=3D "powerpc64" > CFLAGS+=3D -m32 -mcpu=3Dpowerpc > LDFLAGS+=3D -m elf32ppc_fbsd > .endif >=20 > .include "../Makefile.inc" and (extracted from using find ... -print): > LDFLAGS+=3D -m elf32ppc_fbsd > /usr/srcC/sys/boot/ofw/Makefile.inc > LDFLAGS+=3D -m elf32ppc_fbsd > /usr/srcC/sys/boot/uboot/Makefile.inc > LD=3D"${LD} -m elf32ppc_fbsd" > /usr/srcC/Makefile.inc1 When I looked at "man gcc" I did not find any "-m text" options = or any -melf32ppc_fbsd option. It would suggest that "-m elf32ppc_fbsd" = is not normally valid --matching the complaints by = powerpc64-portbld-freebsd11.0-gcc. Is there a FreeBSD-specific addition to gcc missing in powerpc64-gcc? Context details: WITHOUT_CLANG=3D (bootstrap too) is important to getting this far in my = context. (It was in the make command shown earlier.) # more /etc/src.conf CC=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-gcc CXX=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-g++ CPP=3D/usr/local/bin/powerpc64-portbld-freebsd11.0-cpp CROSS_BINUTILS_PREFIX=3D/usr/local/powerpc64-freebsd/bin/ X_COMPILER_TYPE=3Dgcc CXXFLAGS+=3D-I/usr/obj/usr/srcC/tmp/usr/include/c++/v1 LDADD+=3D-L/usr/obj/usr/srcC/usr/lib/libc++ -lc++ NO_WERROR=3D The CC=3D, CXX=3D, CPP=3D assignments matching the XCC, XCXX, and XCPP = assignments for CROSS_TOOLCHAIN=3Dpowerpc64-gcc are important to getting = this far: otherwise gcc 4.2.1 is used for some things. I also listed = CROSS_BINUTILS_PREFIX and X_COMPILER_TYPE when I added the assignments. = I do not know if they are needed. libc++ include and library path handling did not automatically work so I = added the explicit CXXFLAGS+=3D and LDADD+=3D. If there had been a CXX = specific LDADDCXX I would have used it instead. NO_WERROR=3D is for avoiding stopping for the warnings: I'm not trying = to clean up the status relative to compiler warnings. # svnlite info /usr/srcC/ Path: /usr/srcC Working Copy Root Path: /usr/srcC URL: https://svn0.us-west.freebsd.org/base/head Relative URL: ^/head Repository Root: https://svn0.us-west.freebsd.org/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 279514 Node Kind: directory Schedule: normal Last Changed Author: adrian Last Changed Rev: 279514 Last Changed Date: 2015-03-01 18:27:25 -0800 (Sun, 01 Mar 2015) # svnlite status /usr/srcC/ --no-ignore ? /usr/srcC/.snap M /usr/srcC/Makefile M /usr/srcC/contrib/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h ? /usr/srcC/restoresymtable M /usr/srcC/sys/ddb/db_main.c M /usr/srcC/sys/ddb/db_script.c ? /usr/srcC/sys/powerpc/conf/GENERIC64vtsc ? /usr/srcC/sys/powerpc/conf/GENERIC64vtsc-NODEBUG ? /usr/srcC/sys/powerpc/conf/GENERICvtsc ? /usr/srcC/sys/powerpc/conf/GENERICvtsc-NODEBUG M /usr/srcC/sys/powerpc/ofw/ofw_machdep.c M /usr/srcC/sys/powerpc/ofw/ofwcall64.S IntrusiveRefCntPtr.h needed an internal friend status established across = typename parameters in order to compile. I have a PowerMac G5 specific change to make booting reliable and some = changes for getting information from early boot failures in case I get = any more of them. I build without ps3 in order to allow having both vt = and sc in the build. # ls -FPal /usr/local/include/iconv* -rw-r--r-- 1 root wheel 9348 Mar 12 02:47 = /usr/local/include/iconv.h_alt powerpc64-gcc automatically finds files in /usr/local/include/ such that = they can be used when others with different content but the same name = are appropriate. I renamed /usr/local/include/iconv.h to avoid it being = an example of that. I will not list how I got powerpc64-xtoolchain-gcc (and so = powerpc64-gcc) to finish installing on a powerpc64 11.0-CURRENT. =3D=3D=3D Mark Millard markmi at dsl-only.net