lfs-book, version 6.4, chapter 6.7, "make: gcc: Command not found"

Aaron Schawalder mygcc at gmx.ch
Fri Feb 13 14:35:52 PST 2009

(I apologize for sending this mail again. I have sent the last mail with 
wrong return address. I am sorry.)


I am new to lfs and have successfully built the toolchain. At the end 
oft chapter "5.12 GCC-4.3.2 - Pass 2" the output of readelf was correct:

lfs at esprit:/mnt/lfs/tools$ echo 'main(){}' > dummy.c
lfs at esprit:/mnt/lfs/tools$ cc dummy.c
lfs at esprit:/mnt/lfs/tools$ readelf -l a.out | grep ': /tools'
     [Requesting program interpreter: /tools/lib/ld-linux.so.2]

All went fine and I was very careful to always strictly follow the 
commands of the lfs-book.

I entered the chapter 6, entered the chroot environment with

lfs at esprit:~$ su                Password:
... [chapter 6.2 and 6.3]
esprit:/home/lfs# chroot "$LFS" /tools/bin/env -i \
 > HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
 > PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
 > /tools/bin/bash --login +h
I have no name!:/#

I followed chapter 6.5 and 6.6.

I entered chapter 6.7 and I performed the following commands:
root:/sources# tar jxf linux-
root:/sources# cd linux-
root:/sources/linux- make mrproper
make: gcc: Command not found
root:/sources/linux- gcc --version
bash: /tools/bin/gcc: No such file or directory

Something is wrong ...

I performed the following tests:
/home/lfs is the home directory of user "lfs"

root:/sources/linux- exit
esprit:/home/lfs# echo $LFS
esprit:/home/lfs# readelf -l /tools/bin/gcc | grep interpret
     [Requesting program interpreter: /lib/ld-linux.so.2]

esprit:/home/lfs# echo 'main(){}' > dummy.c
esprit:/home/lfs# cc dummy.c
bash: cc: command not found
esprit:/home/lfs# cd /tools/bin
esprit:/tools/bin# vdir ./cc
lrwxrwxrwx 1 root root 3 Jan  4 07:57 ./cc -> gcc

/mnt/lfs is the mounted partition corresponding to chapter 2:

esprit:/mnt/lfs# echo 'main(){}' > dummy.c
esprit:/mnt/lfs# cc dummy.c
bash: cc: command not found
esprit:/mnt/lfs# echo $PATH

New login as user "lfs" just as in chapter 5:
lfs at esprit:~$ cd /mnt/lfs/tools/
lfs at esprit:/mnt/lfs/tools$ ls
bin  etc  i686-pc-linux-gnu  include  lib  libexec  sbin  share  var
lfs at esprit:/mnt/lfs/tools$ echo 'main(){}' > dummy.c
bash: dummy.c: Permission denied
lfs at esprit:/mnt/lfs/tools$ su
Password: esprit:/mnt/lfs/tools# echo $PATH
esprit:/mnt/lfs/tools# echo 'main(){}' > dummy.c
esprit:/mnt/lfs/tools# ls
bin  dummy.c  etc  i686-pc-linux-gnu  include  lib  libexec  sbin  
share  var
esprit:/mnt/lfs/tools# ./bin/cc dummy.c esprit:/mnt/lfs/tools# readelf 
-l a.out | grep interpret
     [Requesting program interpreter: /tools/lib/ld-linux.so.2]
I don't understand why this failure occurs. I would be pleased if 
somebody could give me advise in this issue.

Kind regards


More information about the lfs-support mailing list