LinuxQuestions.org
Help answer threads with 0 replies.
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 07-17-2011, 12:59 PM   #1
adi_30stm
Member
 
Registered: Jul 2011
Posts: 38

Rep: Reputation: Disabled
gcc-4.5.2 - Pass 1 error -gcc command not found ??


Hi I am having trouble getting past chapter 5.5 of Linux From Scratch 6.8 book in which we have to install GCC-4.5.2.
After make and install of GCC-4.5.2 when we have to execute this below command for linking :

ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \
sed 's/libgcc/&_eh/'`

i get an error :

bash: -gcc : command not found

What does this above error mean ..please help ?
Or atleast guide what exactly $LFS_TGT-gcc is doing maybe then i can figure it out ?
It does link libgcc.a despise the above error ...
Is this an issue to be ignored ?
BTW i am using VirtualBox to build the LFS n LFS LiveCD


Thank you
 
Old 07-17-2011, 01:08 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,755
Blog Entries: 1

Rep: Reputation: 238Reputation: 238Reputation: 238
It means you haven't set the variable LFS_TGT or it somehow got unset. You were supposed to do that in chapter 4.4. It also means your binutils build is probably not correct either.
 
Old 07-17-2011, 01:08 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

This $LFS_TGT-gcc should expand to the value that $LFS_TGT holds and -gcc (example: i686-lfs-linux-gnu-gcc)

LFS_TGT is set in this chapter: 4.4. Setting Up the Environment

Hope this helps.
 
Old 07-17-2011, 01:09 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097Reputation: 4097
If you get that error you must have made a mistake earlier. Seems to me that the variable $LFS_TGT is not set.
 
Old 07-17-2011, 01:49 PM   #5
adi_30stm
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
I checked .bash_profile and .bashrc content using cat command ... and they are the same in both according to the book ...

.bash_profile ...content :

exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash

.bashrc ....content :

set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH

I hope that is correct unless i am supposed to replace the uname -m with i686 ??

And binutils compiled fine ..at least i think coz i checked the log file i didn't notice any errors even the tools section contains a folder called i686-lfs-linux-gnu

Even the gcc-4.5.2 compile and install went without any errors. Should i try recompiling them again ..for reinstall do we first remove the directory files ?

---------- Post added 07-17-11 at 11:19 PM ----------

Btw thank you for the quick reply
 
Old 07-17-2011, 02:00 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,
Quote:
Originally Posted by adi_30stm View Post
I checked .bash_profile and .bashrc content using cat command ... and they are the same in both according to the book ...
Did you check if the LFS_TGT variable is set?

Quote:
I hope that is correct unless i am supposed to replace the uname -m with i686 ??
No, you do not need to do that by hand. uname -m is a command that is executed and will do it for you.

Quote:
And binutils compiled fine ..at least i think coz i checked the log file i didn't notice any errors even the tools section contains a folder called i686-lfs-linux-gnu

Even the gcc-4.5.2 compile and install went without any errors. Should i try recompiling them again
If LFS_TGT was not set correctly then you need to start from scratch.

Quote:
..for reinstall do we first remove the directory files ?
If you redo a package you always need to remove the source directory (as stated in the LFS book: 5.3. General Compilation Instructions - Last important block.......)
 
Old 07-17-2011, 02:06 PM   #7
adi_30stm
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
Is there a way to tell if it was set correctly ...because i went back checked .bash_profile and .bashrc both are correct according to the book . I know uname -m is a command i ran it just to make sure and the out i received was i686

So my only option is from scratch ?
 
Old 07-17-2011, 02:14 PM   #8
adi_30stm
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
I tried recreating the .bashrc and bash_profile and then ran the "source ~/.bash_profile" command and i get an error :

bash: exec: env: not found
 
Old 07-17-2011, 02:19 PM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,
Quote:
Originally Posted by adi_30stm View Post
Is there a way to tell if it was set correctly
You don't know how to echo a variable? If that is the case then your level of experience is probably too little to build an LFS system (vi. Prerequisites).

Anyway: echo $LFS_TGT

Quote:
...because i went back checked .bash_profile and .bashrc both are correct according to the book . I know uname -m is a command i ran it just to make sure and the out i received was i686
If .bashrc was/is correct then you would not have had the error you originally posted. It shows that LFS_TGT was not set. Are you sure you are executing the commands as user lfs?

Quote:
So my only option is from scratch ?
You're still very early in the process of building, I would start from scratch (but also keep in mind what the Prerequisites says.....).

Hope this helps.
 
Old 07-17-2011, 02:25 PM   #10
adi_30stm
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
Umm.. I did run them as user lfs and yes i do know how echo a file ... that is why i mentioned if i were to replace it with i686 ... well thanks i anyway i will consider your idea of starting over

Thank you
 
Old 07-17-2011, 03:19 PM   #11
adi_30stm
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
Hey druuna,

Question is .bashrc supposed to be created as root or user lfs ??
 
Old 07-17-2011, 03:24 PM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

As stated in the book (4.3. Adding the LFS User. Last step): User lfs

Hope this helps.
 
Old 07-17-2011, 03:28 PM   #13
adi_30stm
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
Thanks i think i figured what is wrong thanks for the help
 
Old 07-17-2011, 04:04 PM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
You're welcome

Have fun with the build!
 
Old 07-27-2011, 04:10 PM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
You're welcome
 
  


Reply

Tags
gcc, lfs, lfs_tgt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] GCC-4.5.2 - Pass 2 / unsetting the multilib spec for GCC golarbol Linux From Scratch 2 07-11-2011 08:30 AM
GCC command not found error kallinux Linux - Newbie 5 09-23-2008 11:57 PM
gcc compile error (-lmysql: command not found) xface66 Programming 2 04-13-2007 10:00 AM
GCC pass 1 error mugwump84 Linux From Scratch 2 05-10-2005 06:21 PM
Error Message gcc: Command not found Schmurff Fedora 2 09-27-2004 01:23 PM


All times are GMT -5. The time now is 04:05 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration