LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 7.4 step 5.7 error (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-7-4-step-5-7-error-4175478014/)

Rodano 09-21-2013 12:07 PM

LFS 7.4 step 5.7 error
 
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.

So, help me please =)

Keith Hedger 09-21-2013 02:28 PM

Please post version check and some more of the error output just the error line doesn't give enough context

ReaperX7 09-21-2013 08:19 PM

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.

Rodano 09-21-2013 11:58 PM

Quote:

Originally Posted by Keith Hedger (Post 5032139)
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 (Post 5032246)
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


druuna 09-22-2013 02:25 AM

Can you post the correct version-check? The one in the above reply isn't from LFS 7.4 but from an earlier version.

The 7.4 version also checks for/needs g++, which might be missing on your box.

Rodano 09-22-2013 04:23 AM

Quote:

Originally Posted by druuna (Post 5032356)
Can you post the correct version-check? The one in the above reply isn't from LFS 7.4 but from an earlier version.

The 7.4 version also checks for/needs g++, which might be missing on your box.

I did it:

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
g++ (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
g++ compilation OK


druuna 09-22-2013 05:28 AM

Assuming that you checked ReaperX7's comments (post #3), can you post the following output (as root, from your host):
Code:

updatedb
locate /crti.o /crt1.o


druuna 09-22-2013 05:56 AM

I just noticed something in your version-check output that looks strange (glibc version check):
Quote:

(GNU libc) 2.18
Both my Debian squeeze and wheezy boxes show the following:
Code:

# squeeze:
(Debian EGLIBC 2.11.3-4) 2.11.3

# wheezy:
(Debian EGLIBC 2.13-38) 2.13


Rodano 09-22-2013 08:49 AM

Quote:

Originally Posted by druuna (Post 5032442)
Assuming that you checked ReaperX7's comments (post #3), can you post the following output (as root, from your host):
Code:

updatedb
locate /crti.o /crt1.o


Code:

root@Turaco:/mnt/lfs/tools/lib# updatedb && locate /crti.o /crt1.o
/mnt/lfs/sources/glibc-build/csu/crt1.o
/mnt/lfs/sources/glibc-build/csu/crti.o
/mnt/lfs/sources/glibc-build/csu/crti.o.d
/mnt/lfs/sources/glibc-build/nptl/crti.o
/mnt/lfs/tools/lib/crt1.o
/mnt/lfs/tools/lib/crti.o
/usr/lib/i386-linux-gnu/crt1.o
/usr/lib/i386-linux-gnu/crti.o

Quote:

Originally Posted by druuna (Post 5032458)
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:
Code:

# squeeze:
(Debian EGLIBC 2.11.3-4) 2.11.3

# wheezy:
(Debian EGLIBC 2.13-38) 2.13


i've installed new glibc library some time ago.

ReaperX7 09-22-2013 06:17 PM

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.

Rodano 09-22-2013 10:25 PM

Quote:

Originally Posted by ReaperX7 (Post 5032731)
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)).

druuna 09-23-2013 03:16 AM

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)?

Rodano 09-23-2013 03:38 AM

Quote:

Originally Posted by druuna (Post 5032997)
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"?

druuna 09-23-2013 03:53 AM

Quote:

Originally Posted by Rodano (Post 5033001)
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"?
No, you cannot. Re-read these:
- 4.4. Setting Up the Environment
- 5.2. Toolchain Technical Notes

Rodano 09-23-2013 05:28 AM

Quote:

Originally Posted by druuna (Post 5033009)
I'm not 100% sure, but I do have my doubts.
No, you cannot. Re-read these:
- 4.4. Setting Up the Environment
- 5.2. Toolchain Technical Notes

As i see i can do this to set another name on 4.4 step:
Code:

cat > ~/.bashrc << "EOF"
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m){the_new_name}
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH
EOF

Am i right?


All times are GMT -5. The time now is 09:57 PM.