LFS Version SVN-20060501 - GCC-4.0.3 - compilation fails

Mag. Leonhard Landrock 1977-Hamlet at gmx.at
Sat May 20 03:26:51 PDT 2006


Hi!

Sorry for the delay of my response. :-(

Am Donnerstag, 18. Mai 2006 23:37 schrieb Dan Nicholson:
> On 5/18/06, Mag. Leonhard Landrock <1977-Hamlet at gmx.at> wrote:
> > Sorry to ask, but what are the important symlinks?
>
> These guys:

OK. Obviously not a smart question 
(http://catb.org/~esr/faqs/smart-questions.html). A simple search 
for "essential symlinks" on "http://www.linuxfromscratch.org/search.html" and 
within "lfs-book Mailing List" and "lfs-support Mailing List" would have done 
the job. Almost compleatly.

Sorry.

> http://www.linuxfromscratch.org/lfs/view/development/chapter06/createfiles.
>html

Thanks for giving me the right answer. :-)

> > I did some kind of logging for _all_ steps within the LFS building. I
> > just wrote every single command to a text file.
>
> By this do you mean that you put all the commands in a script or that
> you logged all the commands to one file?

No, just a text file. That I wrote myself. It looks like this:

1.) Creating a New Partition 

2.) Creating a File System on the Partition

3.) Mounting the New Partition

    export LFS=/media/sdb3
    mkdir -pv $LFS
    mount -v /dev/[xxx] $LFS

4.) This chapter includes a list of packages that need to be downloaded for 
building a basic Linux system.

    Downloaded packages and patches will need to be stored somewhere that is 
conveniently available throughout the entire build.

    mkdir -v $LFS/sources

    Make this directory writable and sticky. ?Sticky? means that even if 
multiple users have write permission on a directory, only the owner of a file 
can delete the file within a sticky directory. The following command will 
enable the write and sticky modes: 

    chmod -v a+wt $LFS/sources

5.) mkdir -pv $LFS/sources/packages
     mkdir -pv $LFS/sources/patches

[...]

58.) GCC-4.0.3

    cd /sources
    cd ./gcc-4.0.3
    sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
    sed -i 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in
    sed -i 's@\./fixinc\.sh at -c true@' gcc/Makefile.in
    sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in
    cd ..
    mv ./gcc-build/ ./2-pass.gcc-build
    mkdir -v ./gcc-build
    cd ./gcc-build
    ../gcc-4.0.3/configure --prefix=/usr \
        --libexecdir=/usr/lib --enable-shared \
        --enable-threads=posix --enable-__cxa_atexit \
        --enable-clocale=gnu --enable-languages=c,c++
    make

> If you're scripting, you have to be very careful.  You need to know
> that the script will continue unless you have some sort of error
> handling scheme.  If you don't a crucial step might not have worked.
> This could lead to a bizarre error later like the one you're
> receiving.

I had some similar thoughts. But there is even one more important thing. One 
would not learn anything by just running a script.

> > export LFS=/media/sdb3
> > mount -v /dev/sdb3 $LFS
> > su - lfs
>
> If you're rebooting the machine, you must make sure that you remount
> /dev and enter the chroot correctly.  This is another step that can
> cause bizarre errors.  Read the note at the bottom of this page:
>
> http://www.linuxfromscratch.org/lfs/view/development/chapter06/chroot.html

That's what I do. After a reboot I follow my own log-file as follows:

47.) Mounting and Populating /dev

    The recommended method of populating the /dev directory with devices is to 
mount a virtual filesystem (such as tmpfs) on the /dev directory, and allow 
the devices to be created dynamically on that virtual filesystem as they are 
detected or accessed. This is generally done during the boot process by Udev. 
Since this new system does not yet have Udev and has not yet been booted, it 
is necessary to mount and populate /dev manually. This is accomplished by 
bind mounting the host system's /dev directory. A bind mount is a special 
type of mount that allows you to create a mirror of a directory or mount 
point to some other location. Use the following command to achieve this:

    mount --bind /dev $LFS/dev

48.) Mounting Virtual Kernel File Systems

    mount -vt devpts devpts $LFS/dev/pts
    mount -vt tmpfs shm $LFS/dev/shm
    mount -vt proc proc $LFS/proc
    mount -vt sysfs sysfs $LFS/sys

49.) Entering the Chroot Environment

    chroot "$LFS" /tools/bin/env -i \
        HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
        PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
        /tools/bin/bash --login +h

> > Might it be of any use to post this log?
>
> Not yet.  It would be beneficial for you to search through the log for
> "Error" or "ERROR" or some variant.  Make sure that your problem
> didn't actually start much earlier.

Well, there are only two things I can say. First, I obviuosly created the 
essential symlinks as my personla log says as follows:

51.) Creating Essential Files and Symlinks

    ln -sv /tools/bin/{bash,cat,grep,pwd,stty} /bin
    ln -sv /tools/bin/perl /usr/bin
    ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
    ln -sv bash /bin/sh

    touch /etc/mtab

Beside my log, I did now a listing for "/bin", /usr/bin", "/usr/lib" 
and "/bin/sh" within my chrrot. Here are the results:

root:/# ls /bin/ -dl
drwxr-xr-x 2 root root 4096 Apr 17 16:20 /bin/

root:/# ls /bin/ -l
total 0
lrwxrwxrwx 1 root root 15 Apr 17 16:20 bash -> /tools/bin/bash
lrwxrwxrwx 1 root root 14 Apr 17 16:20 cat -> /tools/bin/cat
lrwxrwxrwx 1 root root 15 Apr 17 16:20 grep -> /tools/bin/grep
lrwxrwxrwx 1 root root 14 Apr 17 16:20 pwd -> /tools/bin/pwd
lrwxrwxrwx 1 root root  4 Apr 17 16:20 sh -> bash
lrwxrwxrwx 1 root root 15 Apr 17 16:20 stty -> /tools/bin/stty

root:/# ls /usr/bin/ -dl
drwxr-xr-x 2 root root 4096 May 12 19:06 /usr/bin/

root:/# ls /usr/bin/ -l
total 8052
-rwxr-xr-x 1 root root  253254 May 12 19:06 addr2line
-rwxr-xr-x 1 root root  228316 May 12 19:06 ar
-rwxr-xr-x 1 root root 1019842 May 12 19:06 as
-rwxr-xr-x 1 root root  220354 May 12 19:06 c++filt
-rwxr-xr-x 1 root root    3369 May 12 17:34 catchsegv
-rwxr-xr-x 1 root root   48262 May 12 17:33 gencat
-rwxr-xr-x 1 root root   30285 May 12 17:34 getconf
-rwxr-xr-x 1 root root   46368 May 12 17:34 getent
-rwxr-xr-x 1 root root  543869 May 12 19:06 gprof
-rwxr-xr-x 1 root root  161176 May 12 17:33 iconv
-rwxr-xr-x 1 root root 1011744 May 12 19:06 ld
-rwxr-xr-x 1 root root    5786 May 12 17:35 ldd
-rwxr-xr-x 1 root root   16204 May 12 17:35 lddlibc4
-rwxr-xr-x 1 root root   82114 May 12 17:33 locale
-rwxr-xr-x 1 root root  785741 May 12 17:33 localedef
-rwxr-xr-x 1 root root    6478 May 12 17:34 mtrace
-rwxr-xr-x 1 root root  290402 May 12 19:06 nm
-rwxr-xr-x 1 root root  728621 May 12 19:06 objcopy
-rwxr-xr-x 1 root root  734864 May 12 19:06 objdump
-rwxr-xr-x 1 root root   19197 May 12 17:34 pcprofiledump
lrwxrwxrwx 1 root root      15 Apr 17 16:20 perl -> /tools/bin/perl
-rwxr-xr-x 1 root root  228323 May 12 19:06 ranlib
-rwxr-xr-x 1 root root  432177 May 12 19:06 readelf
-rwxr-xr-x 1 root root  192969 May 12 17:34 rpcgen
-rwxr-xr-x 1 root root  116701 May 12 19:06 size
-rwxr-xr-x 1 root root   56800 May 12 17:35 sprof
-rwxr-xr-x 1 root root  117155 May 12 19:06 strings
-rwxr-xr-x 1 root root  728620 May 12 19:06 strip
-rwxr-xr-x 1 root root    6892 May 12 17:34 tzselect
-rwxr-xr-x 1 root root    5284 May 12 17:34 xtrace

root:/# ls /usr/lib -dl
drwxr-xr-x 6 root root 4096 May 12 19:06 /usr/lib

root:/# ls /usr/lib -l
total 21592
-rw-r--r-- 1 root root      850 May 12 17:33 Mcrt1.o
-rw-r--r-- 1 root root     2969 May 12 17:33 Scrt1.o
-rw-r--r-- 1 root root     2891 May 12 17:33 crt1.o
-rw-r--r-- 1 root root     1952 May 12 17:33 crti.o
-rw-r--r-- 1 root root     1512 May 12 17:33 crtn.o
drwxr-xr-x 2 root root     4096 May 12 17:33 gconv
-rw-r--r-- 1 root root     4299 May 12 17:33 gcrt1.o
drwxr-xr-x 3 root root     4096 May 12 17:35 glibc
drwxr-xr-x 2 root root     4096 May 12 19:06 ldscripts
-rw-r--r-- 1 root root     3302 May 12 17:33 libBrokenLocale.a
lrwxrwxrwx 1 root root       30 May 12 17:33 
libBrokenLocale.so -> ../../lib/libBrokenLocale.so.1
-rw-r--r-- 1 root root    77416 May 12 17:34 libanl.a
lrwxrwxrwx 1 root root       21 May 12 17:34 
libanl.so -> ../../lib/libanl.so.1
-rwxr-xr-x 1 root root  2019113 May 12 19:06 libbfd-2.16.1.so
-rw-r--r-- 1 root root  4103484 May 12 19:06 libbfd.a
-rwxr-xr-x 1 root root      782 May 12 19:06 libbfd.la
lrwxrwxrwx 1 root root       16 May 12 19:06 libbfd.so -> libbfd-2.16.1.so
-rw-r--r-- 1 root root     1962 May 12 17:34 libbsd-compat.a
-rw-r--r-- 1 root root 10894880 May 12 17:33 libc.a
-rw-r--r-- 1 root root      204 May 12 17:33 libc.so
-rw-r--r-- 1 root root    32620 May 12 17:33 libc_nonshared.a
lrwxrwxrwx 1 root root       22 May 12 17:34 
libcidn.so -> ../../lib/libcidn.so.1
-rw-r--r-- 1 root root    61798 May 12 17:34 libcrypt.a
lrwxrwxrwx 1 root root       23 May 12 17:34 
libcrypt.so -> ../../lib/libcrypt.so.1
-rw-r--r-- 1 root root    30186 May 12 17:34 libdl.a
lrwxrwxrwx 1 root root       20 May 12 17:34 libdl.so -> ../../lib/libdl.so.2
-rw-r--r-- 1 root root     1962 May 12 17:34 libg.a
lrwxrwxrwx 1 root root       22 Apr 17 16:20 
libgcc_s.so -> /tools/lib/libgcc_s.so
lrwxrwxrwx 1 root root       24 Apr 17 16:20 
libgcc_s.so.1 -> /tools/lib/libgcc_s.so.1
-rw-r--r-- 1 root root   500926 May 12 19:06 libiberty.a
-rw-r--r-- 1 root root     1712 May 12 17:33 libieee.a
-rw-r--r-- 1 root root  1231442 May 12 17:33 libm.a
lrwxrwxrwx 1 root root       19 May 12 17:33 libm.so -> ../../lib/libm.so.6
-rw-r--r-- 1 root root     2576 May 12 17:34 libmcheck.a
-rw-r--r-- 1 root root   691022 May 12 17:35 libnsl.a
lrwxrwxrwx 1 root root       21 May 12 17:35 
libnsl.so -> ../../lib/libnsl.so.1
lrwxrwxrwx 1 root root       28 May 12 17:35 
libnss_compat.so -> ../../lib/libnss_compat.so.2
lrwxrwxrwx 1 root root       25 May 12 17:34 
libnss_dns.so -> ../../lib/libnss_dns.so.2
lrwxrwxrwx 1 root root       27 May 12 17:34 
libnss_files.so -> ../../lib/libnss_files.so.2
lrwxrwxrwx 1 root root       28 May 12 17:34 
libnss_hesiod.so -> ../../lib/libnss_hesiod.so.2
lrwxrwxrwx 1 root root       25 May 12 17:35 
libnss_nis.so -> ../../lib/libnss_nis.so.2
lrwxrwxrwx 1 root root       29 May 12 17:35 
libnss_nisplus.so -> ../../lib/libnss_nisplus.so.2
-rwxr-xr-x 1 root root   207612 May 12 19:06 libopcodes-2.16.1.so
-rw-r--r-- 1 root root   365734 May 12 19:06 libopcodes.a
-rwxr-xr-x 1 root root      761 May 12 19:06 libopcodes.la
lrwxrwxrwx 1 root root       20 May 12 19:06 libopcodes.so -> 
libopcodes-2.16.1.so
-rw-r--r-- 1 root root   947388 May 12 17:34 libpthread.a
-rw-r--r-- 1 root root      216 May 12 17:34 libpthread.so
-rw-r--r-- 1 root root     3332 May 12 17:34 libpthread_nonshared.a
-rw-r--r-- 1 root root   298596 May 12 17:34 libresolv.a
lrwxrwxrwx 1 root root       24 May 12 17:34 
libresolv.so -> ../../lib/libresolv.so.2
-rw-r--r-- 1 root root   218980 May 12 17:34 librpcsvc.a
-rw-r--r-- 1 root root   219852 May 12 17:34 librt.a
lrwxrwxrwx 1 root root       20 May 12 17:34 librt.so -> ../../lib/librt.so.1
lrwxrwxrwx 1 root root       27 May 12 17:34 
libthread_db.so -> ../../lib/libthread_db.so.1
-rw-r--r-- 1 root root    26008 May 12 17:35 libutil.a
lrwxrwxrwx 1 root root       22 May 12 17:35 
libutil.so -> ../../lib/libutil.so.1
drwxr-xr-x 2 root root     4096 Apr 17 19:27 locale

ls /bin/sh -ld
lrwxrwxrwx 1 root root 4 Apr 17 16:20 /bin/sh -> bash

root:/# ls /etc/mtab -ld
-rw-r--r-- 1 root root 115 May 12 18:56 /etc/mtab

root:/# cat /etc/mtab
none /dev/pts devpts rw,gid=4,mode=620 0 0
none /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=4,mode=620 0 0

> I've never built from Debian, but they put together solid systems.
> I'd be surprised if Debian was the cause of your problems.  If you're
> desperate, you can try to run the build from the LFS LiveCD.  This is
> a known good host that people around here have used with good success.
>
> http://www.linuxfromscratch.org/livecd/

Well, if there is no other way, I will try that. Nevertheless I still hope 
that tere is a chance to find out what is wrong with my build system. 
Probably I did something wrong. But how to find out what?

Note: I had didn't do all the test of the packages within the chapter 5 as in 
the beginning it often says, that a check is not mandatory: "Compilation is 
now complete. As discussed earlier, running the test suite is not mandatory 
for the temporary tools here in this chapter. To run the Binutils test suite 
anyway, issue the following command:"

Might it be of any use to run the test suite from every tool?

> --
> Dan

Leonhard.

PS: I hope this mail is not to long, but gives a better insight on what I did 
so far.



More information about the lfs-support mailing list