LFS 6.3, chapter 6.12.1 GCC-4.1.2

Chris Staub chris at beaker67.com
Sat Oct 6 20:26:52 PDT 2007

Elias Carlos Zoby wrote:

I can't really follow what you're doing here...

> Until chapter 5.31 changing ownership, all ok.
> $ readelf -l /tools/bin/gcc | grep interpreter
>       [Requesting program interpreter: /tools/lib/ld-linux.so.2]
> After it
> lfs:/mnt/lfs/sources$ su
> Password:
> root:/mnt/lfs/sources# echo $LFS
> /mnt/lfs
> root:/mnt/lfs/sources# chown -R root:root $LFS/tools
> root:/mnt/lfs/sources# echo 'main(){}' > dummy.c
> root:/mnt/lfs/sources# cc dummy.c
> root:/mnt/lfs/sources# readelf -l a.out | grep ': /tools'
> root:/mnt/lfs/sources#
Uh, why would you expect any results as root on the host system? root 
does not, and is not supposed to, have /tools/bin first in the PATH - 
that's what the lfs user is for.

> I again
> root:/mnt/lfs/sources# su - lfs
> /dev/pts/3: Operation not permitted
> lfs:~$ echo 'main(){}' > dummy.c
> lfs:~$ cc dummy.c
> lfs:~$ readelf -l a.out | grep ': /tools'
>       [Requesting program interpreter: /tools/lib/ld-linux.so.2]
> lfs:~$

I don't quite follow the insistence on repeating the toolchain sanity 
check over and over, but, well, that is at least the right result...

> I followed ahead as lfs user although.
> lfs:/mnt/lfs$
> But using root (su -c 'command') when permission denied to lfs, as to mknod,
> mount, chroot ...

That's why the first thing on the last page of chapter 5 is a note 
saying that the rest of the book is to bo done as root.

> And so I came to chapter 6.5 with
> I have no name!:/# echo 'main(){}' > dummy.c
> I have no name!:/# cc dummy.c
> I have no name!:/# readelf -l a.out | grep ': /tools'
>       [Requesting program interpreter: /tools/lib/ld-linux.so.2]
> I have no name!:/#
> After several pages, command su
> root:/#
> Still [Requesting program interpreter: /tools/lib/ld-linux.so.2]
> I set locales only to en_US and pt_BR, both to 8859-1 and UTF-8.
> Everything going until chapter 6.12.1 GCC-4.1.2
> The book says to give several sed commands before to say to mkdir ../gcc-build.
> But without umpacked gcc-4.1.2 the sed commands are impossible, give a error
> some as "no such ... file".

This makes me wonder how you possibly got through chapter 5. All of the 
same assumptions that were true in chapter 5 are also true for chapter 6 
- including the assumption that you are already in the unpacked source 
dir before starting to follow the package installation instructions.

> I then made ../gcc-build, as lfs user on a konqueror session of host system, and
> unpacked gcc-4...bz2 into. After this sed commands was ok, into gcc-build.
> Perhaps even into gcc-4.1.2, I don't remember.
> "make" command on /gcc-build seemed ok, but make -k check stops at:

If you do not know how to untar on the command line from within chroot, 
you should ask yourself whether you should be attempting LFS in the 
first place.
> root:/gcc-build# make -k check
> How is this?
> Is the book split?
> And how I return to LFS enviromment after reboot here?

It looks to me like there are large sections of the book you are not 
paying attention to. I would suggest you go back to the very beginning 
and read every word again, starting with the "Prerequisites" page.

More information about the lfs-support mailing list