LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   adjusting tool chain section 5.8 i686-lfs-linux-gnu-gcc: command not found (https://www.linuxquestions.org/questions/linux-from-scratch-13/adjusting-tool-chain-section-5-8-i686-lfs-linux-gnu-gcc-command-not-found-832830/)

rlaybourn 09-17-2010 09:59 AM

adjusting tool chain section 5.8 i686-lfs-linux-gnu-gcc: command not found
 
I have go to section 5.8 adjusting the tool chain. I copy and past from the section

SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs
$LFS_TGT-gcc -dumpspecs | sed \
-e 's@/lib\(64\)\?/ld@/tools&@g' \
-e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
echo "New specs file is: $SPECS"
unset SPECS

this is the output


lfs@richard-laptop:/mnt/lfs$ SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs
i686-lfs-linux-gnu-gcc: command not found
dirname: missing operand
Try `dirname --help' for more information.
lfs@richard-laptop:/mnt/lfs$ $LFS_TGT-gcc -dumpspecs | sed \
> -e 's@/lib\(64\)\?/ld@/tools&@g' \
> -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
bash: /specs: Permission denied
i686-lfs-linux-gnu-gcc: command not found
lfs@richard-laptop:/mnt/lfs$ echo "New specs file is: $SPECS"
New specs file is: /specs

I am using ubuntu 10.04

druuna 09-17-2010 10:15 AM

Hi,

Did you make Ubuntu suitable to be host for LFS as stated here: vii. Host System Requirements

BTW: Do tell us what version of LFS you are building. I do assume it is LFS 6.6 stable (the link given is from the development package, due to an error in the 6.6 stable version, as mentioned here: Errata for the 6.6 Version of the LFS Book)

Hope this helps.

rlaybourn 09-17-2010 11:46 AM

yes it is version 6.6 i am trying to work through
Well i did double check and somehow i did notice that i was missing bison all the other programs are installed with acceptable versions. I have installed bison and given it another try but the result is still the same.
Strangely i have noticed the gcc compiler in tools/bin is not named i686-lfs-linux-gnu-gcc but it is named i686-pc-linux-gnu-gcc, i dont know if that will be derailing things.

Thanks for the help

druuna 09-17-2010 12:12 PM

Hi,
Quote:

Originally Posted by rlaybourn (Post 4100823)
Well i did double check and somehow i did notice that i was missing bison all the other programs are installed with acceptable versions.

Did you also create the link to yacc?

Was bison the only thing you needed to do to make Ubuntu compliant? I really doubt that, Ubuntu isn't an easy distro to make compliant (search this sub forum and be amazed...). Can you post the output of the version-check.sh script.

Quote:

Strangely i have noticed the gcc compiler in tools/bin is not named i686-lfs-linux-gnu-gcc but it is named i686-pc-linux-gnu-gcc, i dont know if that will be derailing things.
No it won't, as explained here: chapter 4.4 (bottom of the page) and here: chapter 5.2 (the important box and the first "dot" under it)

I would suggest you use the LFS liveCD as a host. It was created just for that and will also make sure you don't have to change the host (ubuntu) you are normally working with. A much safer approach. If you take this advise, posting the output of the i]version-check.sh[/i] script isn't needed.

Hope this helps.

rlaybourn 09-17-2010 01:08 PM

well i replaced the "$LFS_TGT-gcc" parts with a full path to the compiler file and it worked, compiled the dummy program ok. It is worrying that i have to make such manual hacks i guess it suggests i have done something a bit wrong somewhere. I am downloading the live cd now . I did try to do the second pass on the binutils but it would not go through the configuration according to the config.log it appears to try to compile a file but no output is produced and so it fails

druuna 09-17-2010 01:16 PM

Quote:

Originally Posted by rlaybourn (Post 4100911)
well i replaced the "$LFS_TGT-gcc" parts with a full path to the compiler file and it worked, compiled the dummy program ok. It is worrying that i have to make such manual hacks i guess it suggests i have done something a bit wrong somewhere.

If you need to change any of the commands in the book to make it work, then there is definitely something wrong! Continuing would be useless.

Quote:

I am downloading the live cd now.
Good choice!

Don't use the packages and book that are (possibly) on the liveCD. Those are from an older LFS version (6.3 from the top of my head). Download the Book and the packages (LFS tarballs) and use those.

Have fun!

rlaybourn 09-17-2010 01:39 PM

Thanks for the help , i was starting to suspect it was time to wipe it out and start round 2, a project for tomorrow then. At least on the next try i should have more of an idea what i am doing.

nocountryman 10-14-2010 08:23 AM

You know , it could be not the case here, but i got the same error message :)

well, i deleted all related to gcc and started over with the step and by the end of MAKE i realized that the previous time i forgot to do MAKE INSTALL. and what do you know, doing that last bit resolved the issue :D


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