LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   make: gcc: Command not found (https://www.linuxquestions.org/questions/linux-from-scratch-13/make-gcc-command-not-found-948516/)

anakletor 06-04-2012 04:14 PM

make: gcc: Command not found
 
Hello,

My first question.

I have been installing LFS 7.1 on my system during the last 3 days. I am reading the book to the letter. Everything has gone very fine until today.

At 6.7 this happened:

Code:

root:/sources# cd linux-3.2.6
root:/sources/linux-3.2.6# make mrproper
make: gcc: Command not found
root:/sources/linux-3.2.6#

I have chrooted to as root following the instructions in the book. What have I done wrong?

Thanks in advance!

spiky0011 06-04-2012 04:33 PM

Hi

You do have a problem with gcc as you have posted http://www.linuxquestions.org/questi...5/#post4695491
Do you think this might be causing problems?

anakletor 06-04-2012 04:46 PM

Hi. Thanks for your answer. I don't think there is any problem with gcc itself, since I managed to build all packages in chapter 5 using gcc. It seems like there is broken link or something like that. gcc is there, in /tools/bin/ but it cannot be run.


Code:

root:/sources/linux-3.2.6# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin
root:/sources/linux-3.2.6# cd /tools/bin/
root:/tools/bin# ls -al gcc
-rwxr-xr-x 3 root root 1027014 Jun  3 20:53 gcc
root:/tools/bin# gcc
bash: /tools/bin/gcc: No such file or directory
root:/tools/bin#

I am totally stuck.

spiky0011 06-04-2012 04:55 PM

You should be building gcc-4.7.0
Did you reboot or leave chroot? Did you re enter correctly
Quote:

Note

It is important that all the commands throughout the remainder of this chapter and the following chapters are run from within the chroot environment. If you leave this environment for any reason (rebooting for example), ensure that the virtual kernel filesystems are mounted as explained in Section 6.2.2, “Mounting and Populating /dev” and Section 6.2.3, “Mounting Virtual Kernel File Systems” and enter chroot again before continuing with the installation.
did you use optimization to build?
Quote:

Even if the package does compile when using optimization, there is the risk it may have been compiled incorrectly because of the complex interactions between the code and build tools. Also note that the -march and -mtune options using values not specified in the book have not been tested. This may cause problems with the toolchain packages (Binutils, GCC and Glibc).

anakletor 06-04-2012 05:12 PM

Quote:

You should be building gcc-4.7.0
Yes, I could do that, but does that mean that the stable version of the book doesn't work?

Quote:

Did you reboot or leave chroot? Did you re enter correctly
Yes, I have tried exiting the chroot environment and then I ran

Code:

mount -v --bind /dev $LFS/dev

mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys

Quote:

did you use optimization to build?
Nope, no optimizations.

Something must have gone wrong after I started chapter 6. As I said the whole chapter 5 went smoothly and I have no reasons to believe that there is anything wrong with the toolchain. Last night I quit after building Xz-utils (chapter 5.33.1) and I had no problems at all. Today continued by changing ownership of /tools by

Code:

chown -R root:root $LFS/tools
and everything went well until I attempted to build linux-3.2.6 package.

spiky0011 06-05-2012 01:37 AM

Hi

The host system requirements for 7.1
Quote:

Gcc-4.1.2 (Versions greater than 4.6.2 are not recommended as they have not been tested)

Glibc-2.5.1 (Versions greater than 2.14.1 are not recommended as they have not been tested)


Here
Quote:

Gcc-4.1.2 (Versions greater than 4.7.0 are not recommended as they have not been tested)

Glibc-2.5.1 (Versions greater than 2.15 are not recommended as they have not been tested)
Now I dont know how to get round this.

anakletor 06-06-2012 11:10 AM

All commands in /tools/bin are available, except for gcc.

Code:

root:/tools/bin# ./gcc
bash: ./gcc: No such file or directory


I could start all over again from the beginning, but I know there is nothing I can do different. I followed the book to the letter.

spiky0011 06-06-2012 12:07 PM

Hi

Something must of gone wrong somewhere tho, Have you physically check it,s not there.

anakletor 06-06-2012 03:23 PM

Hi,

Quote:

Something must of gone wrong somewhere tho, Have you physically check it,s not there.
Sorry for my ignorance, but how do I physically check that it is not there? That is a good question, because I know it must be somewhere. I did all building in chapter 5 using that gcc. So I still believe that it has to do with some pathing or the linking done earlier in chapter 6.

spiky0011 06-06-2012 03:38 PM

if you cd into /tools/bin just to check if it,s there if it,s not then gcc went wrong

anakletor 06-06-2012 03:45 PM

Code:

root /tools/bin # ls -al gcc
-rwxr-xr-x 3 root root 1027014 Jun  3 22:53 gcc


spiky0011 06-06-2012 03:55 PM

When you rebooted/restarted did you mount the partition in chapter 2.4 Then do 6.2.2 -6.2.3 before chroot

anakletor 06-06-2012 04:00 PM

I did 6.2.2-6.2.3 and then chroot. I don't need to remount, since there is an entry for LFS in /etc/fstab. I would not be able to do the command above if the partition was not mounted.

spiky0011 06-06-2012 04:04 PM

Did your host pass the requriements test I know it failed on gcc can you just post the output . Others wise I,m at a loss

anakletor 06-06-2012 04:09 PM

Code:

bash version-check.sh
bash, version 4.2.29(2)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils) 2.22.0.20120323
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.17
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (GCC) 4.7.0 20120505 (prerelease)
(GNU libc) 2.15
grep (GNU grep) 2.12
gzip 1.4
Linux version 3.3.7-1-ARCH (tobias@T-POWA-LX) (gcc version 4.7.0 20120505 (prerelease) (GCC) ) #1 SMP PREEMPT Tue May 22 00:26:26 CEST 2012
m4 (GNU M4) 1.4.16
GNU Make 3.82
patch 2.6.1
Perl version='5.16.0';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.0.3
gcc compilation OK

That was the result of the test.

Np, thanks for your help. I am totally confused as well. Can't understand why I get the message "gcc not found". I assume that a fault in gcc would give an error when attempting to run gcc, but what it tells me is that gcc is not there! Even tho ls gcc is showing that the file is there.


All times are GMT -5. The time now is 07:48 PM.