LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 09-21-2013, 12:07 PM   #1
Rodano
Member
 
Registered: Sep 2013
Distribution: Debian Wheezy
Posts: 47

Rep: Reputation: Disabled
Post 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 =)
 
Old 09-21-2013, 02:28 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Please post version check and some more of the error output just the error line doesn't give enough context
 
Old 09-21-2013, 08:19 PM   #3
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
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.
 
Old 09-21-2013, 11:58 PM   #4
Rodano
Member
 
Registered: Sep 2013
Distribution: Debian Wheezy
Posts: 47

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by Keith Hedger View Post
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 View Post
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
 
Old 09-22-2013, 02:25 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
Old 09-22-2013, 04:23 AM   #6
Rodano
Member
 
Registered: Sep 2013
Distribution: Debian Wheezy
Posts: 47

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by druuna View Post
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
 
Old 09-22-2013, 05:28 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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
 
Old 09-22-2013, 05:56 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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
 
Old 09-22-2013, 08:49 AM   #9
Rodano
Member
 
Registered: Sep 2013
Distribution: Debian Wheezy
Posts: 47

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by druuna View Post
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 View Post
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.
 
Old 09-22-2013, 06:17 PM   #10
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
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.

Last edited by ReaperX7; 09-22-2013 at 06:21 PM.
 
1 members found this post helpful.
Old 09-22-2013, 10:25 PM   #11
Rodano
Member
 
Registered: Sep 2013
Distribution: Debian Wheezy
Posts: 47

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by ReaperX7 View Post
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)).
 
Old 09-23-2013, 03:16 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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)?
 
1 members found this post helpful.
Old 09-23-2013, 03:38 AM   #13
Rodano
Member
 
Registered: Sep 2013
Distribution: Debian Wheezy
Posts: 47

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by druuna View Post
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"?

Last edited by Rodano; 09-23-2013 at 03:42 AM.
 
Old 09-23-2013, 03:53 AM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by Rodano View Post
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

Last edited by druuna; 09-23-2013 at 03:54 AM. Reason: typo: re-red -> re-read
 
1 members found this post helpful.
Old 09-23-2013, 05:28 AM   #15
Rodano
Member
 
Registered: Sep 2013
Distribution: Debian Wheezy
Posts: 47

Original Poster
Rep: Reputation: Disabled
Post

Quote:
Originally Posted by druuna View Post
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS 6.5 : Step 6.7 Installing Linux API headers : make headers_check/install error tsong99 Linux From Scratch 12 12-25-2012 04:26 PM
step by step guide for installing LFS 6.6 on kubuntu 9.10 smkh Linux From Scratch 6 04-07-2010 03:34 PM
LFS newbie stuck in Linux API headers step 5.5 LFS book 6.3 Vxplus Linux From Scratch 2 11-10-2008 08:13 PM
LFS step 5.7 Shadows91 Linux From Scratch 2 01-01-2007 10:12 PM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration