Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 2015 16:25:56 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        freebsd-ports@freebsd.org, Brooks Davis <brooks@freebsd.org>
Cc:        freebsd-toolchain@freebsd.org, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   powerpc64 context for clang36 use: /usr/bin/ld too old(?) but is used by clang36
Message-ID:  <64205C7D-7DF3-44F0-85C2-3C49B4EE0A4C@dsl-only.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64205C7D-7DF3-44F0-85C2-3C49B4EE0A4C>