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.
Hi.
I've a problem with glibc on 5.7 lfs step.
The test "echo 'main(){}' > dummy.c $LFS_TGT-gcc dummy.c" gives an error:
"/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.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.8.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory.
collect2: error: ld returned 1 exit status.
Binutils, gcc, glibc compiled without any errors(I use Debian Wheezy).
I checked symlinks, but the seems to be correct.
It's actually from not correctly mounting the partition and setting the environment paths.
Did you hand mount the LFS partition or let udev mount it for you? This usually happens if you use udev to mount the LFS partition and try build the first few sections without the paths set properly.
Run command:
Code:
echo $LFS
and make sure it actually outputs
Code:
/mnt/lfs
If it does then you may have an environment error within Debian and you should do what Keith says and run the version-check script.
If it doesn't output, then you should go back and run this command with <> edits made for your partition:
Code:
export $LFS=/mnt/lfs &&
mount -v -t <ext?> /dev/<sda?> $LFS
And rebuild. I won't say if you will have to rebuild the other packages, but you might do well to start over.
Please post version check and some more of the error output just the error line doesn't give enough context
Quote:
Originally Posted by ReaperX7
I've had that same error before.
It's actually from not correctly mounting the partition and setting the environment paths.
Did you hand mount the LFS partition or let udev mount it for you? This usually happens if you use udev to mount the LFS partition and try build the first few sections without the paths set properly.
Run command:
Code:
echo $LFS
and make sure it actually outputs
Code:
/mnt/lfs
If it does then you may have an environment error within Debian and you should do what Keith says and run the version-check script.
If it doesn't output, then you should go back and run this command with <> edits made for your partition:
Code:
export $LFS=/mnt/lfs &&
mount -v -t <ext?> /dev/<sda?> $LFS
And rebuild. I won't say if you will have to rebuild the other packages, but you might do well to start over.
i've read some threads here with the same problem and even began to make from step 1 again, but it wasn't helpful.
Code:
lfs@Turaco:/mnt/lfs/sources/glibc-build$ echo 'main(){}' > dummy.c; $LFS_TGT-gcc -v dummy.c; readelf -l a.out | grep ': /tools'
Using built-in specs.
COLLECT_GCC=i686-lfs-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.8.1/lto-wrapper
Target: i686-lfs-linux-gnu
Configured with: ../gcc-4.8.1/configure --target=i686-lfs-linux-gnu --prefix=/tools --with-sysroot=/mnt/lfs --with-newlib --without-headers --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libitm --disable-libmudflap --disable-libquadmath --disable-libsanitizer --disable-libssp --disable-libstdc++-v3 --enable-languages=c,c++ --with-mpfr-include=/mnt/lfs/sources/gcc-build/../gcc-4.8.1/mpfr/src --with-mpfr-lib=/mnt/lfs/sources/gcc-build/mpfr/src/.libs
Thread model: single
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.8.1/cc1 -quiet -v -iprefix /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/ dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=pentiumpro -auxbase dummy -version -o /tmp/ccGGan4i.s
GNU C (GCC) version 4.8.1 (i686-lfs-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/../../../../i686-lfs-linux-gnu/include"
ignoring duplicate directory "/mnt/lfs/tools/bin/../lib/gcc/../../lib/gcc/i686-lfs-linux-gnu/4.8.1/include"
ignoring duplicate directory "/mnt/lfs/tools/bin/../lib/gcc/../../lib/gcc/i686-lfs-linux-gnu/4.8.1/include-fixed"
ignoring nonexistent directory "/mnt/lfs/tools/bin/../lib/gcc/../../lib/gcc/i686-lfs-linux-gnu/4.8.1/../../../../i686-lfs-linux-gnu/include"
ignoring duplicate directory "/mnt/lfs/tools/include"
#include "..." search starts here:
#include <...> search starts here:
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/include
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/include-fixed
/mnt/lfs/tools/include
End of search list.
GNU C (GCC) version 4.8.1 (i686-lfs-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0cda90e27ea5c17418f0e073e8cd0b73
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/../../../../i686-lfs-linux-gnu/bin/as -v --32 -o /tmp/ccmYuRK4.o /tmp/ccGGan4i.s
GNU assembler version 2.23.2 (i686-lfs-linux-gnu) using BFD version (GNU Binutils) 2.23.2
COMPILER_PATH=/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.8.1/:/mnt/lfs/tools/bin/../libexec/gcc/:/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/../../../../i686-lfs-linux-gnu/bin/
LIBRARY_PATH=/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/:/mnt/lfs/tools/bin/../lib/gcc/:/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/../../../../i686-lfs-linux-gnu/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.8.1/collect2 --sysroot=/mnt/lfs --eh-frame-hdr -m elf_i386 -dynamic-linker /tools/lib/ld-linux.so.2 crt1.o crti.o /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/crtbegin.o -L/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1 -L/mnt/lfs/tools/bin/../lib/gcc -L/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/../../../../i686-lfs-linux-gnu/lib /tmp/ccmYuRK4.o -lgcc -lc -lgcc /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.1/crtend.o crtn.o
/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.8.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.8.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
readelf: Error: 'a.out': No such file
Also:
Code:
lfs@Turaco:/mnt/lfs/sources/glibc-build$ bash ../version-check.sh
bash, version 4.2.37(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Debian) 2.22
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Debian 4.7.2-5) 4.7.2
(GNU libc) 2.18
grep (GNU grep) 2.12
gzip 1.5
Linux version 3.2.0-4-686-pae (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.46-1+deb7u1
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
PERL version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
gcc compilation OK
Code:
lfs@Turaco:/mnt/lfs/sources/glibc-build$ echo $LFS
/mnt/lfs
lfs@Turaco:/mnt/lfs/sources/glibc-build$ ls -l /tools
lrwxrwxrwx 1 root root 14 Sep 21 11:07 /tools -> /mnt/lfs/tools
lfs@Turaco:/mnt/lfs/sources/glibc-build$ set | grep PATH
PATH=/tools/bin:/bin:/usr/bin
WINDOWPATH=7 <!--This string appears only in xterminal, there isn't in bash-->
lfs@Turaco:/mnt/lfs/sources/glibc-build$ set | grep LFS_TGT
LFS_TGT=i686-lfs-linux-gnu
lfs@Turaco:/mnt/lfs/sources/glibc-build$ set | grep SHELLOPTS
SHELLOPTS=braceexpand:emacs:histexpand:history:interactive-comments:monitor
I just noticed something in your version-check output that looks strange (glibc version check):
Both my Debian squeeze and wheezy boxes show the following:
Okay, just another question but have you deviated from ANYTHING in the book, such as skipped any commands?
Did you exit and re-enter the environment while making LFS up to this point?
This error is only generated from an improperly mounted partition and set environment path such as allowing udev to mount your drive, rather than follow the mounting instructions in the book.
Okay, just another question but have you deviated from ANYTHING in the book, such as skipped any commands?
Did you exit and re-enter the environment while making LFS up to this point?
This error is only generated from an improperly mounted partition and set environment path such as allowing udev to mount your drive, rather than follow the mounting instructions in the book.
i tryed to make it twice step by step, no skipped commands. i havn't re-entered lfs acc. (login as root in the other terminal window (ctr+alt+F2)).
I agree with ReaperX7's doubt. You must have done something wrong.....
I'm still wondering about the EGLIBC vs GNU libc issue. You mention that you installed GNU libc, but glibc is one of the core packages of a distro and isn't replaced easily (if at all). Have you tried with a clean Debian install (+needed extras for LFS)?
I agree with ReaperX7's doubt. You must have done something wrong.....
I'm still wondering about the EGLIBC vs GNU libc issue. You mention that you installed GNU libc, but glibc is one of the core packages of a distro and isn't replaced easily (if at all). Have you tried with a clean Debian install (+needed extras for LFS)?
I'll try to install on my netbook with clean debian wheezy. Here i installed new glibc from source and it was succesfull. Another packages made and installed succesfull after that. U think it's because of new glibc?
Also i have anothe questions - can i rename "i686-lfs-linux-gnu" with "i686-gnu" or something like that without "lfs"?
I'll try to install on my netbook with clean debian wheezy. Here i installed new glibc from source and it was succesfull. Another packages made and installed succesfull after that. U think it's because of new glibc?
I'm not 100% sure, but I do have my doubts.
Quote:
Also i have anothe questions - can i rename "i686-lfs-linux-gnu" with "i686-gnu" or something like that without "lfs"?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.