LFS Book 5.5.1 Installation of gcc

Tomáš Skočdopole tomas.skocdopole at gmail.com
Thu Jan 8 05:07:23 PST 2009

2009/1/8 Anthony Price <elenmar at mailworks.org>:
> 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.


there is little mistake - there should be /mnt/lfs/sources instead of

There are extracted commands from book (your starting point is in the
$LFS/sources directory - there are source packages and patches):
# 5.5 GCC-4.3.2 - Pass 1

# Unpack source
tar xvf gcc-4.3.2.tar.bz2
cd gcc-4.3.2

# Commands from book
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

mkdir -v ../gcc-build
cd ../gcc-build

CC="gcc -B/usr/bin/" ../gcc-4.3.2/configure --prefix=/tools \
    --with-local-prefix=/tools --disable-nls --disable-shared --disable-libssp \


make install

ln -vs libgcc.a `gcc -print-libgcc-file-name | \
    sed 's/libgcc/&_eh/'`

ln -vs gcc /tools/bin/cc

# And there you should cd back to $LFS/sources and remove garbage
(gcc-4.3.2 and gcc-build).

Regards Thomas Skocdopole

More information about the lfs-support mailing list