LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-04-2012, 04:14 PM   #1
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Rep: Reputation: Disabled
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!
 
Old 06-04-2012, 04:33 PM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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?
 
Old 06-04-2012, 04:46 PM   #3
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-04-2012, 04:55 PM   #4
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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).
 
Old 06-04-2012, 05:12 PM   #5
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.

Last edited by anakletor; 06-04-2012 at 05:24 PM.
 
Old 06-05-2012, 01:37 AM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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.
 
Old 06-06-2012, 11:10 AM   #7
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-06-2012, 12:07 PM   #8
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

Something must of gone wrong somewhere tho, Have you physically check it,s not there.
 
Old 06-06-2012, 03:23 PM   #9
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-06-2012, 03:38 PM   #10
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
if you cd into /tools/bin just to check if it,s there if it,s not then gcc went wrong
 
Old 06-06-2012, 03:45 PM   #11
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Code:
root /tools/bin # ls -al gcc
-rwxr-xr-x 3 root root 1027014 Jun  3 22:53 gcc
 
Old 06-06-2012, 03:55 PM   #12
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
When you rebooted/restarted did you mount the partition in chapter 2.4 Then do 6.2.2 -6.2.3 before chroot
 
Old 06-06-2012, 04:00 PM   #13
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-06-2012, 04:04 PM   #14
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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
 
Old 06-06-2012, 04:09 PM   #15
anakletor
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
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.
 
  


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
make: CC: Command not found make: *** [main.o] Error 127 on opensuse 11.3 Leo89 Linux - Newbie 6 11-30-2012 05:13 PM
gcc-4.5.2 - Pass 1 error -gcc command not found ?? adi_30stm Linux From Scratch 20 11-17-2011 12:23 PM
make fail with: gcc-3.4 command not found andy101 Ubuntu 3 11-27-2005 01:45 AM
VSFTPD make: gcc: Command not found Exutable Linux - Software 4 04-06-2005 02:15 PM

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

All times are GMT -5. The time now is 04:35 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