LFS Book 5.5.1 Installation of gcc

Rob Thornton rob_t at shaw.ca
Wed Jan 7 08:02:20 PST 2009



Anthony Price wrote:
> 07-01-2009
>
> Host System: Linux 2.6.24-21-generic #1 SMP Tue Oct 21 23:43:45 UTC 2008
> i686 GNU/Linux
> This is a 32 bit OS on 64 bit hardware.
> I have run the  version-check.sh script and the system meets the
> requirement for a build.
>
> Host gcc is: gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
>
>
> I have installed binutils without trouble so the basic setup seems to be
> working.
>
> However, no matter what I try,  the new (target) GCC will not compile
> properly.
>
> First question is regarding the instructions:
>
> tar -jxf ../mpfr-2.3.2.tar.bz2
> mv mpfr-2.3.2 mpfr
> tar -jxf ../gmp-4.2.4.tar.bz2
> mv gmp-4.2.4 gmp
>
> I installed these packages on the host. Copied the sources to /opt and
> compile and installed them (without error messages) on the host system.
> Was this the right thing to do - the book seems to be a bit ambiguous on
> this (or maybe I'm just having a stupider than average day)
>   
GMP and MPFR are not meant to exist on the host and should not be 
installed there. Do the following:

1. Unpack gcc
2. Unpack gmp && mpfr *inside* the gcc source tree
3. Rename the gmp && mpfr directories to simply 'gmp' and 'mpfr'

Compile gcc and things should go smoothly for you. Gcc will get built 
automatically using the sources of gmp and mpfr within its own source tree.
> After that I
>
> 1. unpacked the GCC package in /mnt/lfs/sources
> 2. created the build directory in /mnt/lfs/sources/gccbuils & cd'd to it
> 3. ran the CC=gcc....
> 4. ran make
>
> Step 4 resulted in the error message:
> checking for suffix of object files... configure: error: cannot compute
> suffix of object files: cannot compile
>
> Any help on this would be extremely useful.
>
> Regards,
>
> Anthony.
>   
Please make sure you re-read Chapter 5.3: General Compilation Notes.

The key to remember when building LFS is that it assumes you have 
already unpacked the sources you are about to build and are already in 
that source's root directory.  So, when it instructs you to unpack gmp 
and mpfr it assumes you are already within gcc's source directory and 
are unpacking them there.

Good luck and happy building!

Rob



More information about the lfs-support mailing list