2

I'm stuck on chapter 6.20 of the current LFS book. I get:

$ readelf -l a.out | grep Requesting                                        
[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]

instead of the desired:

[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

The other tests lower down in the chapter all succeed.

This is my second time through the whole book being extremely careful and I got the same result last time around. Could there be some mistake?

For guidance it just said "The most likely reason is that something went wrong with the specs file adjustment.". That's a reference to 6.10 where it says "It is a good idea to visually inspect the specs file to verify the intended change was actually made" but there's no guidance as to what these intended changes are. But on this second go round I did check in /tools/lib/gcc/x86_64-pc-linux-gnu/7.2.0/specs that there was no mention of "tools" and the /usr paths were mentioned.

1 Answer 1

3

I seem to have solved it by making another specs file for the new compiler:

gcc -dumpspecs | sed -e 's@/tools@@g' > `dirname $(gcc --print-libgcc-file-name)`/specs

After that, I redo the test:

echo 'int main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
readelf -l a.out | grep ': /lib'

And all is well.

2
  • Same problem and this solution worked for me. Not sure why the gcc's specs included a hard-coded reference to '/tools' given I followed the book exactly, and checked bash's history to make sure I entered the commands the same as the book's. Dec 21, 2018 at 7:54
  • Had the same issue, pretty certain that I followed the steps correctly, but I'm always skeptical of saying that because I think the documentation for LFS is meticulous. Thanks for the solution though ;)
    – kingmilo
    Oct 31, 2019 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.