Issues with ld: "bootstrap with --static" rearing its ugly head

Erik Postma epostma at
Tue Nov 11 12:25:23 PST 2003

Hi all,

Working on LFS 5.0 from SuSE 7.0. I had the following issues:

1) In make check of glibc, something failed. Well, it didn't exactly fail,
it just threw an error, complaining that DT_FLAGS and DF_TEXTREL were
undeclared in check-textrel.c in the functions handle_file32 and

I checked it on and found one guy with the
same issue who had seemingly resolved it by disabling the test and
continuing regardless. I did the same and found no other errors; so I
decided I'd continue. See
for the original post (url wrapped!)

2) During make check of binutils pass 2 in chap. 5, one test failed

 ld/testsuite/ld-bootstrap/bootstrap.exp "bootstrap with --static"

Now I wish I had read more carefully the text saying "There should be no
unexpected fails here." Having grown bold by the "solution" to the
previous failure I decided I'd just continue again. I now realise that
was _not_ a wise thing.

3) In chapter 6 section Re-adjusting the toolchain I ran (just like the
book says) make -C ld install in the binutils-build directory, then
removed the binutils-build directory, and subsequently applied the sed
script. Then the 'make a trivial C program, compile it and readelf it'
test. This failed horribly:

# gcc dummy.c
bin/ld: error while loading shared libraries: cannot open
shared object file: No such file or directory collect2: ld returned 127
exit status

After some backtracking, ld turned out to be
the problem:

# ldd /tools/bin/ld => not found => /tools/lib/ (0x40017000)
        /tools/lib/ => /tools/lib/ (0x40000000)

Upon receiving this distress call, I again turned to asking for pages having to do with libbfd and
approximately the fiftieth of those was a message in this thread:
(url wrapped again!)
where in the end, a temporary fix is suggested having to do with nls by
Greg (hi!). I am very open to poking around stuff to find a real solution.

Currently thinking about how I could repair the current situation, seeing
that I can't compile anything now. I'd have to do binutils pass 1, then
gcc, lock it in, binutils pass 2 and on from there at the very least, I
guess. But I am more seriously expecting instructions to start over...:(

Thanks for any help!

Erik Postma (Email: reverse the order of nl, tue and win.)

More information about the lfs-support mailing list