LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Possible Error in Book -- Adjusting Toolchain (https://www.linuxquestions.org/questions/linux-from-scratch-13/possible-error-in-book-adjusting-toolchain-370493/)

suma17 10-06-2005 10:41 PM

Possible Error in Book -- Adjusting Toolchain
 
Hi there.. I am installing LFS for the first time. I noticed what appears be an error in the book. However I'm guessing it's not an error in the book (surely somebody else would have noticed it first if it was).



SPECFILE=`gcc --print-file specs` &&
sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
$SPECFILE > tempspecfile &&
mv -f tempspecfile $SPECFILE &&
unset SPECFILE


When I type this command I get the help page of sed - the same as if I run sed with no arguments. In an attempt to determine the problem, I entered the commands one at a time. I believe I have located the problem at the first line:

SPECFILE='gcc --print-file specs'
echo $SPECFILE
> gcc --print-file specs


An alternative approach results in no error:

gcc --print-file specs
> /usr/lib/gcc/i486-pc-linux-gnu/3.4.3/specs
SPECFILE='/usr/lib/gcc/i486-pc-linux-gnu/3.4.3/specs'


I am just wondering if this is an error in the book, or if it is something wrong with my system.

Also, should I be concerned that there is a "i468-pc-linux-gnu" folder on my Pentium 3 (i686) computer.


Any suggestions would be greatly appreciated.
Cheers,
Suma

freakyg 10-06-2005 11:54 PM

No error in the book..........I had no probs with it.........some thing is wrong here..........did you adjust the linker from the binutils-build dir?? If you get an error adjusting the SPECFILE, you missed a step..........more than likely you did not adjust the linker from binutils pass 1..........

freakyg 10-06-2005 11:58 PM

Quote:


gcc --print-file specs
> /usr/lib/gcc/i486-pc-linux-gnu/3.4.3/specs
SPECFILE='/usr/lib/gcc/i486-pc-linux-gnu/3.4.3/specs'

this won't work.........you want the linker to use gcc from the /tools/lib NOT the gcc from your host system..........

suma17 10-07-2005 12:02 AM

hmmm... i deffinately remember adjusting the linker. im not getting an "error" as such, it just seems i'm passing an invalid parameter to sed.

just thought of something: /usr/lib/gcc/ would be the host system, which is what i'm supposed to avoid.

i'm going to start again from the beginning and see if i get the same problem. will post back with results.


-suma


EDIT: gotta love cross-posts

kagashe 10-07-2005 12:09 AM

deleted

Harmaa Kettu 10-07-2005 01:47 AM

Quote:

SPECFILE='gcc --print-file specs'
echo $SPECFILE
> gcc --print-file specs
This happens because you are using apostrophes instead of backticks.

suma17 10-07-2005 02:03 AM

Thanks Harmaa Kettu

I had just got up to the toolchain stage when I noticed this. Everything working fine now :D


I think they should warn people of this in the book. I know it says to copy-paste, but I for one have absolutely no idea how to copy and paste from links into bash.


Cheers,
Suma

shevegen 10-07-2005 05:22 AM

"I think they should warn people of this in the book."

I would like something like "user comments", something small, like on
php.net, you sometimes have folks paste their code, or give hints.
I think that would be a very neat idea, and the user could decide whether
he wants to see the pure book, or the book+user comments.

After all, people often do mistakes, and its good to point out at more
of these mistakes (i for example, managed to mess up with my host system
after I successfully built my first LFS two month or so ago...)

kundor 10-10-2005 01:30 PM

Quote:

Originally posted by suma17
Thanks Harmaa Kettu

I had just got up to the toolchain stage when I noticed this. Everything working fine now :D


I think they should warn people of this in the book. I know it says to copy-paste, but I for one have absolutely no idea how to copy and paste from links into bash.


Cheers,
Suma

Use your mouse and select the text in links. If that doesn't work, hold down shift and select the text in links. Use the middle button to paste. If you run links in a separate virtual terminal you can just switch back and forth with alt-f1 alt-f2. If your mouse doesn't work, install gpm.

kirtimaan_bkn 10-13-2005 04:06 AM

Hello,

I just reached at this point and faced same problem. Executing this command display help of sed. I tried after matching each character, I think there is a problem with command.

However, I made manual change ( as it was suggested in book) in spec file and replaced /lib/ld-linux.so.2 with /tools/lib/ld-linux.so.2.


Thanks,
Kirtimaan


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