From owner-freebsd-toolchain@FreeBSD.ORG Sat Mar 21 23:26:08 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FFD0A2 for ; Sat, 21 Mar 2015 23:26:08 +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 BDF01A13 for ; Sat, 21 Mar 2015 23:26:06 +0000 (UTC) Received: (qmail 19860 invoked from network); 21 Mar 2015 23:25:59 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 21 Mar 2015 23:25:59 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v7.40.1) with SMTP; Sat, 21 Mar 2015 19:25:59 -0400 (EDT) Received: (qmail 8914 invoked from network); 21 Mar 2015 23:25:59 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (DHE-RSA-AES256-SHA encrypted) SMTP; 21 Mar 2015 23:25:59 -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.8] (c-67-189-19-145.hsd1.or.comcast.net [67.189.19.145]) by iron2.pdx.net (Postfix) with ESMTPSA id E174E1C439E; Sat, 21 Mar 2015 16:25:53 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: powerpc64 context for clang36 use: /usr/bin/ld too old(?) but is used by clang36 Date: Sat, 21 Mar 2015 16:25:56 -0700 Message-Id: <64205C7D-7DF3-44F0-85C2-3C49B4EE0A4C@dsl-only.net> To: freebsd-ports@freebsd.org, Brooks Davis Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) X-Mailer: Apple Mail (2.2070.6) Cc: freebsd-toolchain@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: Sat, 21 Mar 2015 23:26:08 -0000 Basic context: [I'm using an example taken from buildworld activity just for = illustration. Yes, I know that powerpc64 buildworld via clang is not yet supported. = buildworld is not the actual point here but does illustrate a = pre-existing build environment having the issue in question.] > # freebsd-version -ku; uname -apKU > 11.0-CURRENT > 11.0-CURRENT > FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279514M: Wed = Mar 18 20:11:15 PDT 2015 = root@FBSDG5C0:/usr/obj/usr/srcC/sys/GENERIC64vtsc-NODEBUG powerpc = powerpc64 1100062 1100062 > # which ld > /usr/bin/ld > # ld --version > GNU ld 2.17.50 [FreeBSD] 2007-07-03 > Copyright 2007 Free Software Foundation, Inc. > This program is free software; you may redistribute it under the terms = of > the GNU General Public License. This program has absolutely no = warranty. > export PATH=3D"/usr/local/powerpc64-freebsd/bin:$PATH" > make -j 8 \ > WITHOUT_CLANG_BOOTSTRAP=3D WITH_CLANG=3D WITH_CLANG_IS_CC=3D \ > WITH_LLDB=3D \ > WITH_GCC_BOOTSTRAP=3D WITH_GCC=3D WITHOUT_GNUCXX=3D \ > WITH_BOOT=3D WITH_LIB32=3D \ > buildworld buildkernel \ > KERNCONF=3DGENERIC64vtsc-NODEBUG \ > TARGET=3Dpowerpc TARGET_ARCH=3Dpowerpc64 > # more /etc/src.conf > NO_WERROR=3D > WITH_LIBCPLUSPLUS=3D > # > # For trying clang36... > # (I'm trying to use binutils from the powerpc64-xtoolchain-gcc = install.) > # > CC=3D/usr/local/bin/clang36 > CXX=3D/usr/local/bin/clang++36 > CPP=3D/usr/local/bin/clang-cpp36 > #CROSS_BINUTILS_PREFIX=3D/usr/local/powerpc64-freebsd/bin/ > AS=3D/usr/local/powerpc64-freebsd/bin/as > AR=3D/usr/local/powerpc64-freebsd/bin/ar > LD=3D/usr/local/powerpc64-freebsd/bin/ld > NM=3D/usr/local/powerpc64-freebsd/bin/nm > OBJCOPY=3D/usr/local/powerpc64-freebsd/bin/objcopy > OBJDUMP=3D/usr/local/powerpc64-freebsd/bin/objdump > RANLIB=3D/usr/local/powerpc64-freebsd/bin/ranlib > SIZE=3D/usr/local/powerpc64-freebsd/bin/size > STRINGS=3D/usr/local/powerpc64-freebsd/bin/strings > XAS=3D${AS} > XAR=3D${AR} > XLD=3D${LD} > XNM=3D${NM} > XOBJCOPY=3D${OBJCOPY} > XOBJDUMP=3D${OBJDUMP} > XRANLIB=3D${RANLIB} > XSIZE=3D${SIZE} > XSTRINGS=3D${STRINGS} ... The problem: When the clang36 driver program is used to (for example) link programs = it apparently automatically and always uses /usr/bin/ld. But for = powerpc64 /usr/bin/ld is BFD 2.17.50 vintage and reports an internal = error (see below). It seems likely that clang36 simply requires more recent binutils = programs, such as from binutils-2.25 currently. > /usr/local/bin/clang36 -O2 -pipe -DHAVE_CONFIG_H = -I/usr/srcC/kerberos5/tools/make-roken/../../include -DHAVE_CONFIG_H = -I/usr/srcC/kerberos5/tools/make-roken/../../include -std=3Dgnu99 = -Qunused-argumen > ts -I/usr/obj/usr/srcC/tmp/legacy/usr/include -static = -L/usr/obj/usr/srcC/tmp/legacy/usr/lib -o make-roken make-roken.o = -legacy > /usr/bin/ld: BFD 2.17.50 [FreeBSD] 2007-07-03 internal error, aborting = at = /usr/srcC/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/elf= 64-ppc.c line 11029 in ppc64_elf_relocate_section > /usr/bin/ld: Please report this bug. If the clang36 port allowed binding to binutils (currently = binutils-2.25) instead of /usr/bin/ tools it could then work in more = contexts. For all I know more than ld could also have vintage issues. I do not know if powerpc64 and powerpc have the only such = vintage-oddities around. Context details: # svnlite info /usr/ports/lang/clang36 Path: /usr/ports/lang/clang36 Working Copy Root Path: /usr/ports URL: https://svn0.us-west.freebsd.org/ports/head/lang/clang36 Relative URL: ^/head/lang/clang36 Repository Root: https://svn0.us-west.freebsd.org/ports Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 Revision: 381120 Node Kind: directory Schedule: normal Last Changed Author: brooks Last Changed Rev: 380295 Last Changed Date: 2015-03-02 12:21:38 -0800 (Mon, 02 Mar 2015) # more /etc/make.conf=20 WRKDIRPREFIX=3D/usr/obj/portswork #WITH_DEBUG=3D MALLOC_PRODUCTION=3D =3D=3D=3D Mark Millard markmi at dsl-only.net