Binutils doesn't configure in stage2

Jeremy Huntwork jhuntwork at linuxfromscratch.org
Wed Apr 5 13:31:03 PDT 2006


Jeremy Huntwork wrote:
> BTW, I'm fully prepared to take the blame for this one. I have a feeling 
> this is a remnant from my endeavoring to incorporate the new binutils 
> adjustments from LFS SVN. Still investigating...

CC'ing this to lfs-dev as someone not subscribed to the livecd might be 
able to help, and whatever foolish bug I've managed to create might be 
useful for the archives. (Not looking forward to the inevitable cluebat 
I'm sure I deserve. :/ )

In the current livecd Makefiles, there's definitely something screwy in 
the toolchain. I inserted a 'stop' dependency in the main Makefile just 
after 're-adjust-toolchain' which will cause the build to Error at that 
point. When that bails, it gives me a chance to see where we sit.

Here's what I get at that point (equivalent to just after section 6.13 
in the LFS book):

# chroot /mnt/lfs /tools/bin/env -i \
 >     HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
 >     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
 >     /tools/bin/bash --login +h
root:/# mkdir test
root:/# cd test
root:/test# echo 'main(){}' > dummy.c
root:/test# cc dummy.c -Wl,--verbose &> dummy.log
root:/test# readelf -l a.out | grep ': /lib'
readelf: Error: 'a.out': No such file
root:/test# cat dummy.log
/tools/lib/gcc/i486-pc-linux-gnu/4.0.2/../../../../i486-pc-linux-gnu/bin/ld: 
line 87: cd: /mnt/lfs/lfs-livecd/packages/binutils/binutils-build/ld: No 
such file or directory
gcc: ldgram.o: No such file or directory
gcc: ldlex.o: No such file or directory
gcc: lexsup.o: No such file or directory
gcc: ldlang.o: No such file or directory
gcc: mri.o: No such file or directory
gcc: ldctor.o: No such file or directory
gcc: ldmain.o: No such file or directory
gcc: ldwrite.o: No such file or directory
gcc: ldexp.o: No such file or directory
gcc: ldemul.o: No such file or directory
gcc: ldver.o: No such file or directory
gcc: ldmisc.o: No such file or directory
gcc: ldfile.o: No such file or directory
gcc: ldcref.o: No such file or directory
gcc: eelf_i386.o: No such file or directory
gcc: ei386linux.o: No such file or directory
gcc: ../bfd/.libs/libbfd.so: No such file or directory
gcc: ../libiberty/libiberty.a: No such file or directory
collect2: ld returned 1 exit status
root:/test# type -p ld
/tools/bin/ld
root:/test# ld
/tools/bin/ld: line 87: cd: 
/mnt/lfs/lfs-livecd/packages/binutils/binutils-build/ld: No such file or 
directory
gcc: ldgram.o: No such file or directory
gcc: ldlex.o: No such file or directory
gcc: lexsup.o: No such file or directory
gcc: ldlang.o: No such file or directory
gcc: mri.o: No such file or directory
gcc: ldctor.o: No such file or directory
gcc: ldmain.o: No such file or directory
gcc: ldwrite.o: No such file or directory
gcc: ldexp.o: No such file or directory
gcc: ldemul.o: No such file or directory
gcc: ldver.o: No such file or directory
gcc: ldmisc.o: No such file or directory
gcc: ldfile.o: No such file or directory
gcc: ldcref.o: No such file or directory
gcc: eelf_i386.o: No such file or directory
gcc: ei386linux.o: No such file or directory
gcc: ../bfd/.libs/libbfd.so: No such file or directory
gcc: ../libiberty/libiberty.a: No such file or directory
root:/test# type -p ld-old
/tools/bin/ld-old
root:/test# ld-old
ld-old: no input files
root:/test# exit
# file /tools/bin/ld
/tools/bin/ld: Bourne shell script text executable
# file /tools/bin/ld-old
/tools/bin/ld-old: ELF 32-bit LSB executable, Intel 80386, version 1 
(SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), stripped


So. For some reason which I haven't spotted yet, binutils in pass2 isn't 
creating the binary ld-new, but a bash script, which says in its header:

# ld-new - temporary wrapper script for .libs/ld-new
# Generated by ltmain.sh - GNU libtool 1.4a-GCC3.0 (1.641.2.256 
2001/05/28 20:09:07 with GCC-local changes)
#
# The ld-new program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.

Any ideas on what's going on? I've looked back and forth between the 
LiveCD scripts and the LFS SVN book (which I don't believe has this 
problem) and I can't spot the difference.

--
JH



More information about the livecd mailing list