Bug 11510 - broken 'ld' name in crosstoolchain installation.
Summary: broken 'ld' name in crosstoolchain installation.
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.20
: P2 normal
Target Milestone: ---
Assignee: H.J. Lu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-17 08:01 UTC by Pawel Sikora
Modified: 2010-04-27 16:28 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
A patch (961 bytes, patch)
2010-04-18 16:14 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2010-04-17 08:01:46 UTC
hi,

during building binutils for crosstoolchain with --sys-root option
i'm observing that binutils-2.20.51.0.8.20100412 installs 'ld'
as $sysroot/$target/bin/$target-ld. ar,as,nm and others are installed
without '$target-' prefix in that directory.
this prefixed ld binary causes error in gcc:
collect2: cannot find 'ld'

for older binutils-2.19.51.0.14.20090722 the 'ld' binary is installed
in $sysroot/$target/bin/ without prefix and works fine.
Comment 1 H.J. Lu 2010-04-18 14:06:16 UTC
Please provide the full configure option you used.
Comment 2 Pawel Sikora 2010-04-18 14:32:50 UTC
CONFIG_SHELL=/bin/bash \
./configure \
        --target=${TARGET} \
        --prefix=${TOOLDIR} \
        --with-sysroot=${TOOLDIR} \
        --libdir=${LIBDIR} \
        --libexecdir=${LIBDIR} \
        --disable-shared \
        --enable-static \
        --disable-nls \
        --disable-debug \
        --disable-werror

where:
TARGET=x86_64-gnu-linux
TOOLDIR=/local/devel/toolchain45/${TARGET}.host${HOST_BITS}
LIBDIR=${TOOLDIR}/${LIB}
Comment 3 H.J. Lu 2010-04-18 14:56:39 UTC
When I use --target=x86_64-gnu-linux, I got

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-gnu-linux-gnu

Since target != build, it was configured as cross-binutils.
"make install" gave me:

[hjl@gnu-6 release]$ ls ./local/devel/toolchain45/x86_64-gnu-linux.host/bin
x86_64-gnu-linux-addr2line  x86_64-gnu-linux-gprof    x86_64-gnu-linux-ranlib
x86_64-gnu-linux-ar         x86_64-gnu-linux-ld       x86_64-gnu-linux-readelf
x86_64-gnu-linux-as         x86_64-gnu-linux-nm       x86_64-gnu-linux-size
x86_64-gnu-linux-c++filt    x86_64-gnu-linux-objcopy  x86_64-gnu-linux-strings
x86_64-gnu-linux-elfedit    x86_64-gnu-linux-objdump  x86_64-gnu-linux-strip

Everything has the $target- prefix. Can you find out
why your are different?
Comment 4 Pawel Sikora 2010-04-18 15:03:50 UTC
(In reply to comment #3)
> When I use --target=x86_64-gnu-linux, I got
> 
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... x86_64-unknown-linux-gnu
> checking target system type... x86_64-gnu-linux-gnu
> 
> Since target != build, it was configured as cross-binutils.
> "make install" gave me:
> 
> [hjl@gnu-6 release]$ ls ./local/devel/toolchain45/x86_64-gnu-linux.host/bin

please look deeper at the
/local/devel/toolchain45/x86_64-gnu-linux.host/x86_64-gnu-linux/bin
                                               ^^^^^^^^^^^^^^^^^^^^
Comment 5 H.J. Lu 2010-04-18 16:14:38 UTC
Created attachment 4733 [details]
A patch

Please try it.
Comment 6 H.J. Lu 2010-04-18 16:17:19 UTC
It has nothing to do with --sys-root. It is when --target=XXX
configures binutils as cross binutils.
Comment 7 Pawel Sikora 2010-04-18 16:59:32 UTC
(In reply to comment #5)
> Created an attachment (id=4733)
> A patch
> 
> Please try it.

works fine.
Comment 8 H.J. Lu 2010-04-18 17:03:54 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > Created an attachment (id=4733)
> > A patch
> > 
> > Please try it.
> 
> works fine.

I will make a new release soon. Thanks.
Comment 9 H.J. Lu 2010-04-27 16:28:32 UTC
Fixed on trunk.