LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Adjusting toolchain problem (in temport system) (https://www.linuxquestions.org/questions/linux-from-scratch-13/adjusting-toolchain-problem-in-temport-system-519607/)

ChrisScott 01-15-2007 05:43 PM

Adjusting toolchain problem (in temport system)
 
Hi all,

This is the first time I have attemped LFS. I am following the LFS project page guide.

I have installed glibc into $LFS/tools (whilst making tempory system) and so far everything seems fine. The first problem comes with the command:
Code:

mv /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
as i386-pc-linux-gnu does not exist. I looked in /tools and found i686-pc-linux-gnu so used that instead, ie
Code:

mv /tools/1686-pc-linux-gnu/bin/{ld,ld-old}
this didn't return any errors so I assume it worked although maybe this problem is a symptom of an earlier mistake?

There was also an ambiguous redirect error for
Code:

gcc -dumpspecs > $SPECFILE
I got around this by using a file SPECFILE not a variable - again this did not return any errors so I assumed it worked! (you know what they say about assumptions!!!)

The final error - the one I can't get around - is when I use
Code:

find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \: &&
rm

which returns
Code:

find: invalid predicate '-print-libgcc-file-name)/include/*'
I am using a HP omnibook notebook with P3 processor.
I have tried from scratch four times now with the same errors.

Any help would be appreciated.

Cheers

Daws 01-16-2007 01:15 AM

Quote:

I have installed glibc into $LFS/tools (whilst making tempory system) and so far everything seems fine. The first problem comes with the command:

Code:

mv /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}

This usually means that you $PATH is wrong, and you are using the hosts gcc. Try "which gcc" if the reply is not /tools/bin/gcc then you have a problem.

The rest of your issues usually arise from typos, mistaking 's for `s etc. But for now you really want to get the first problem sorted. If PATH is wrong then you probably want to double check everything you did when setting up the lfs user, and if this does turn out to be the problem then you probably want to start over (thankfully you are not too far in).

Hope you get it sorted.

ChrisScott 01-16-2007 05:13 AM

Cheers Daws

Yeah, your right: I'm using /usr/bin/gcc!
How can I change that? As I said I've started again a number of times so I'm sure I've been following the guide correctly. I was using --prefix=/tools and --with-local-prefix=/tools when I configured gcc, is that right?

Thanks!

Daws 01-16-2007 06:57 AM

Yup that sounds right but that is not where PATH is set. After you have downloaded the packages you have to create an "lfs" user, and you should remember something like this (as lfs):

Code:

cat > ~/.bash_profile << "EOF"
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
EOF

and this:

Code:

cat > ~/.bashrc << "EOF"
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
EOF

This part is very important. This ensures you have a clean environment in which to build, it also means every time you login as "lfs" your PATH should, in theory, be set to /tools/bin:/bin:/usr/bin.

My guess is that something went wrong here. Maybe you didn't create the lfs user properly or maybe something weird is going on the host system. When you are logged in you can always check it with "echo $PATH" though.

Anyway good luck with it. It took me more than 5 retries before I got it to work so don't worry about that. If you have any more problems people around here are always willing to help.

ChrisScott 01-16-2007 05:07 PM

Yeah I did that as you said so that's probably not the problem! I've been using the LFS live cd as the host so I'll give it a go with SUSE or Fedora (Any personal preferences?). Thanks for all the help.

Daws 01-16-2007 05:12 PM

I quite like Debian actually, but it shouldn't make much difference distro to distro.

manwichmakesameal 01-21-2007 09:26 AM

Gentoo
 
Gentoo works pretty well too. I'm currently doing LFS through ssh to another comp on my network using the Gentoo live cd.


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