Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So this is my first time making LFS. Everything's gone smoothly up until now. I did the install of GCC-9.2.0 pass 2 and everything seemed fine. All commands copy and pasted from the site itself. However when I ran the sanity check, I got this:
Code:
lfs@ksawer-Aspire-A315-21:/mnt/lfs/sources/gcc-9.2.0/build$ echo 'int main(){}' > dummy.c
lfs@ksawer-Aspire-A315-21:/mnt/lfs/sources/gcc-9.2.0/build$ cc dummy.c
/usr/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/crti.o: unable to initialize decompress status for section .debug_aranges
/usr/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/crti.o: unable to initialize decompress status for section .debug_aranges
/usr/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/crti.o: unable to initialize decompress status for section .debug_aranges
/usr/bin/ld: /mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/crti.o: unable to initialize decompress status for section .debug_aranges
/mnt/lfs/tools/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/crti.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
lfs@ksawer-Aspire-A315-21:/mnt/lfs/sources/gcc-9.2.0/build$ readelf -l a.out | grep ': /tools'
readelf: Error: 'a.out': No such file
I'm not quite sure what went wrong or how to fix this. Any help and an explanation would be nice! (Link to where I am in the booklet)
EDIT: Was missing ld in tools/bin. Ran cp /tools/bin/ld-new /tools/bin/ld and it worked. Solved by someone on Facebook.
Last edited by dopaseraoxy; 11-28-2019 at 01:57 PM.
Reason: SOLVED
It's trying to link your dummy file with the ld from /usr/bin. That's the host system's ld and it's definitely wrong; it should be using /tools/bin/ld.
My guess is that you didn't carry out the edit specified in this chapter to "Once again, change the location of GCC's default dynamic linker to use the one installed in /tools".
It's trying to link your dummy file with the ld from /usr/bin. That's the host system's ld and it's definitely wrong; it should be using /tools/bin/ld.
My guess is that you didn't carry out the edit specified in this chapter to "Once again, change the location of GCC's default dynamic linker to use the one installed in /tools".
Do you mean the symlink? I did that, and then re-did it because I thought it messed up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.