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 11-01-2007, 07:18 PM   #1
Michael Fearon
LQ Newbie
 
Registered: Oct 2007
Posts: 8

Rep: Reputation: 0
live cd 6.2 section 5.7 adjusting the toolchain problems replacing the linker


Hey all,

I'm having trouble with the toolchain adjustment in section 5.7 of the live -cd 6.2. I've googled my problem but the only site that had the same problem was on a chinese forum and it was unresolved. And so I come to you for help (get on with it! -ed.)

This is the section I'm having trouble with:

Quote:

First, backup the original linker, then replace it with the adjusted linker. We'll also create a link to its counterpart
in /tools/$(gcc -dumpmachine)/bin:

mv -v /tools/bin/{ld,ld-old}
mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
Everything has gone well up to now and as far as I am aware I've followed the book to letter.

However, when I input the second line:

Quote:
mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
I get the following error:

Quote:
mv: cannot stat '/tools/i486-pc-linux-gnu/bin/ld': No such file or directory
I've been to check out the 'missing' directory and find that instead of i486-pc-linux-gnu. I have one called i686-pc-linux-gnu. Checking the contents of the directory reveals that it is the one the command is looking for (it contains the bin/ld file). So where have I gone wrong. My suspicion, and I could be way off with this, is that I've not compiled gcc properly. I made no changes to the configuration or make files allowing it to set up how it wanted. Should I have??

PS. I've been through the earlier section 5.3.1 and prepared the adjuster for preperation. so I don't think this is the place of my error?

Thanks for taking the time to read. I await your help with anticipation
 
Old 11-03-2007, 06:04 AM   #2
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Rep: Reputation: 37
My guess is you are using the wrong gcc. Double check the path is set properly with "echo $PATH".

It should be /tools/bin:/bin:/usr/bin
 
Old 11-03-2007, 08:44 AM   #3
Michael Fearon
LQ Newbie
 
Registered: Oct 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks Daws, this does seem to be where the problem was.
I rebooted and double checked to make sure the $PATH was correct. Re-issued the commands and this time it worked

However I'm not sure why? You suggest I'm using the wrong gcc. But I'm using the live cd. Does this too have it's own gcc? If so where? I checked the CD $PATH directories but couldn't find it.

Anyway at least I'm up and running again. And who knows? One day I may be a linux guru just like you

Thanks again!!!
 
Old 11-03-2007, 10:16 AM   #4
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Rep: Reputation: 37
Quote:
I rebooted and double checked to make sure the $PATH was correct. Re-issued the commands and this time it worked
Good good, I'm glad its working. Now we have to hope that it hasn't botched the entire build (eek!). There is a chance that it has (depending on when the original error occured), but you will soon find out once you get to the gcc sanity checks.
If it were me, I would start over, but it's up to you.

I've said it many times before: If this is your first attempt at building LFS, do NOT expect it to get it right this time. My first working LFS system was my third or fourth attempt. But don't let this get you down!

Quote:
However I'm not sure why?
It was most likely a typo or an omission on your part (It happens).

Quote:
You suggest I'm using the wrong gcc. But I'm using the live cd. Does this too have it's own gcc? If so where? I checked the CD $PATH directories but couldn't find it.
The whole procedure will make lot more sense when you learn more about how a Linux system works. Coincidentally, Linux From Scratch is a very good way to learn.

Yes, the Live CD (or the host), has its own gcc (it should be in /usr/bin). The hosts gcc is used to build the toolchain binutils and the toolchain gcc.
After you have built and installed the toolchain gcc (make install at end of chapter 5.4), the toolchain gcc (/tools/bin/gcc) should be used from then on (until chapter 6.12).

Two things may have occurred that would cause you to use the wrong gcc:

$PATH should be set to "/tools/bin:/bin:/usr/bin"
this means your shell would use /tools/bin/gcc in favour of /bin/gcc (if it existed, which it doesn't), in favour of /usr/bin/gcc. If $PATH is incorrect, you could end up using any old gcc from god knows where.

Or:

You didn't turn off hashing. (Look back to when you created the lfs user / set up the environment, chapter 4. More specifically set +h in ~/.bashrc)
If hashing is not turned off, your shell "remembers" /usr/bin/gcc and will blithely ignore $PATH and use it anyway.

Quote:
One day I may be a linux guru just like you
Aww shucks . I really don't consider myself a guru, I just know alot about LFS. I think Phyrexicaid put it best:

Quote:
Originally Posted by Phyrexicaid
i've recompiled my kernel, installed gentoo from source, edited my fstab, broken and fixed my system numerous times, compiled programs, written programs (bad ones).

after all that.

I'm still a newbie

Last edited by Daws; 11-03-2007 at 10:18 AM. Reason: typo (it happens,lol)
 
Old 11-03-2007, 05:25 PM   #5
Michael Fearon
LQ Newbie
 
Registered: Oct 2007
Posts: 8

Original Poster
Rep: Reputation: 0
I pre-empted your good advice and started again. I passed the sanity checks but still didn't feel confident that there wasn't a hidden bug there somewhere. So I started afresh and everything seems to be going well. I suppose the key to it all is to make sure you follow the instructions to the letter (at least until you know what your're doing).

Note to Self: Read more carefully!!
 
Old 11-03-2007, 05:52 PM   #6
Daws
Member
 
Registered: May 2006
Location: UK
Distribution: Debian
Posts: 448

Rep: Reputation: 37
Quote:
I suppose the key to it all is to make sure you follow the instructions to the letter (at least until you know what your're doing).
That's it exactly. You will be surprised how much you pick up along the way.
 
Old 11-14-2008, 07:56 AM   #7
pinknyunyu
LQ Newbie
 
Registered: Nov 2008
Posts: 17

Rep: Reputation: 0
I got the same error as Michael, and I'm planning on starting over as well. I just have one question: I changed to root instead of lfs because I couldn't get the commands to work--I didn't have permission. (This explains why my $PATH was /sbin:/bin:/usr/sbin:/usr/bin and not what it should have been.) I'm using the LiveCD. What should I do differently next time around to avoid that problem? P.S. I put everything I was working on in $LFS.

<3 Kelli
 
Old 11-16-2008, 08:26 AM   #8
Vxplus
LQ Newbie
 
Registered: Nov 2008
Posts: 13

Rep: Reputation: 0
Quote:
Originally Posted by pinknyunyu View Post
I got the same error as Michael, and I'm planning on starting over as well. I just have one question: I changed to root instead of lfs because I couldn't get the commands to work--I didn't have permission. (This explains why my $PATH was /sbin:/bin:/usr/sbin:/usr/bin and not what it should have been.) I'm using the LiveCD. What should I do differently next time around to avoid that problem? P.S. I put everything I was working on in $LFS.

<3 Kelli
I've been doing the same but i put it on sources does somebody knows if i could have problems for that?
 
Old 02-21-2009, 10:13 AM   #9
phanvanduc
LQ Newbie
 
Registered: Feb 2009
Posts: 1

Rep: Reputation: 0
I'm having trouble with the toolchain adjustment in section 5.8 of the live-cd 6.4
when I type
gcc -dumpspecs | sed 's@/lib/ld-linux.so.2@/tools&@g' \
> `dirname $(gcc -print-libgcc-file-name)`/specs
the error :
sed: can't read /mnt/lfs/tools/bin/../lib/gcc/i686-pc-linux-gnu/4.3.2/specs: No such file or directory
help me why?
 
  


Reply

Tags
toolchain


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
5.7 Adjusting the Toolchain Problem g3neration Linux From Scratch 2 09-08-2007 10:41 AM
5.7 adjusting the toolchain echnat0n Linux From Scratch 1 03-19-2007 08:09 AM
adjusting the toolchain bourbonstreet Linux From Scratch 5 11-05-2006 11:43 AM
5.9. Adjusting the Toolchain - Error Spudds Linux From Scratch 6 02-23-2005 09:22 AM
6.12. Re-adjusting the Toolchain jobesd Linux From Scratch 2 01-16-2005 01:50 PM

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

All times are GMT -5. The time now is 04:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration