LFS Book 5.5.1 Installation of gcc
elenmar at mailworks.org
Thu Jan 8 03:02:08 PST 2009
Rob Thornton wrote:
> Anthony Price wrote:
>> 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
>> However, no matter what I try, the new (target) GCC will not compile
>> 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.
> 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!
Thanks to all - Rob, Ken, Jack - for help and advice received.
I tried various things but ended up in a mess so I cut my losses and
started again from scratch and it worked.
The trick of it turned out to be this:
1. Copy gcc, mpfr and gmp sources to the /man/lfs/sources directory.
2. Unpack the gcc archive
3. cd to the gcc sunbdirectory under sources
4. Unpack and rename the mpfr and gmp sources *from there*
5. Create the gcc install directory & cd to it
6. Follow the build instructions in the book.
Worked! nuff said.
More information about the lfs-support