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.
I did the glibc test. "$LFS_TGT-gcc dummy.c" breaks with the issue:
Code:
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find -lc
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
My LFS installed these missing files in
"/mnt/tools/lib/"
It should have been installed in /tools/lib and because of symlink in /mnt/lfs/tools/lib.
This is my path too. But the problem does not disappear. I catched the issues of "$LFS_TGT-gcc dummy.c" by "strace"
Code:
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/i686-lfs-linux-gnu/4.9.1/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/lib/i686-lfs-linux-gnu/4.9.1/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/usr/lib/i686-lfs-linux-gnu/4.9.1/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/usr/lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/i686-lfs-linux-gnu/4.9.1/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/lib/i686-lfs-linux-gnu/4.9.1/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/lib/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/usr/lib/i686-lfs-linux-gnu/4.9.1/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/usr/lib/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/crtbegin.o", R_OK) = 0
stat64("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/mnt/lfs/tools/bin/../lib/gcc/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/i686-lfs-linux-gnu/4.9.1/.", 0xbfc0f960) = -1 ENOENT (No such file or directory)
stat64("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/mnt/lfs/lib/i686-lfs-linux-gnu/4.9.1/.", 0xbfc0f960) = -1 ENOENT (No such file or directory)
stat64("/mnt/lfs/lib/.", 0xbfc0f960) = -1 ENOENT (No such file or directory)
stat64("/mnt/lfs/usr/lib/i686-lfs-linux-gnu/4.9.1/.", 0xbfc0f960) = -1 ENOENT (No such file or directory)
stat64("/mnt/lfs/usr/lib/.", 0xbfc0f960) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/crtend.o", R_OK) = 0
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/i686-lfs-linux-gnu/4.9.1/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.9.1/../../../../i686-lfs-linux-gnu/lib/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/lib/i686-lfs-linux-gnu/4.9.1/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/lib/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/usr/lib/i686-lfs-linux-gnu/4.9.1/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/mnt/lfs/usr/lib/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
stat64("/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.9.1/collect2", {st_mode=S_IFREG|0755, st_size=1621545, ...}) = 0
access("/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.9.1/collect2", X_OK) = 0
It does not look to "/mnt/lfs/tools/lib/..". So I linked "/mnt/lfs/usr/lib" to "/mnt/lfs/tools/lib". Now all things works fine and I receive the message "[Requesting program interpreter: /tools/lib/ld-linux.so.2]"
This is not the way the LFS book describes it. Have you a hint to get out of this troubles?
You have given a wrong path. This might be the cause of problem.
Sorry, this is not the solution.
I am look for another trace. This Issue from above indicates this line:
Code:
access("/mnt/lfs/usr/lib/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
ch_ld-gcc
The "usr" should be a "tools".
This is the page on LFS book http://www.linuxfromscratch.org/lfs/...gcc-pass1.html
In this page there are words like this: "...while the second one replaces hard-coded instances of “/usr”." It deals of the sixth line in the following
file "ch_ld-gcc". Replacing "usr" by "tools".
Maybe there is a mistake in this or the "sed" function does not work. Path is "/bin/ch_ld-gcc" in Debian. Activating this file it only shows the copies of the first, second and third line.
How can I check the performance of the last lines?
The problems arises with use of 'ld' command; part of binutils. And you given wrong arguments while building it. Particulary the default library path it looks for.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.