Installing GCC-2.95.3

Estimated build time:           22 minutes
Estimated required disk space:  148 MB

Installation of GCC

This package is known to behave badly when you have changed it's default optimization flags (including the -march and -mcpu options). GCC is best left alone, so we recommend you unsetting CFLAGS, CXXFLAGS and other such variables/settings that would change the default optimization that it comes with.

Install GCC by running the following commands. These commands will build the C and C++ compiler. Other compilers are available within the gcc package. If you want to build all the other availble compilers too, leave out the --enable-languages=c,c++ option in the configure command. See the GCC documentation for more details on which additional compilers are available.

Note: the build of other compilers is not tested by the people who actively work on LFS.

patch -Np1 -i ../gcc-2.95.3-2.patch &&
mkdir ../gcc-build &&
cd ../gcc-build &&
../gcc-2.95.3/configure --prefix=/usr --enable-shared \
���--enable-languages=c,c++ --enable-threads &&
make bootstrap &&
make install

Command explanations

--enable-threads: C++ exception handling for multithreaded code will not work if gcc is compiled without --enable-threads.

Contents

The GCC package contains compilers, preprocessors and the GNU C++ Library.

Description

Compiler

A compiler translates source code in text format to a format that a computer understands. After a source code file is compiled into an object file, a linker will create an executable file from one or more of these compiler generated object files.

Preprocessor

A preprocessor pre-processes a source file, such as including the contents of header files into the source file. It's a good idea to not do this manually to save a lot of time. Someone just inserts a line like #include <filename>. The preprocessor inserts the contents of that file into the source file. That's one of the things a preprocessor does.

C++ Library

The C++ library is used by C++ programs. The C++ library contains functions that are frequently used in C++ programs. This way the programmer doesn't have to write certain functions (such as writing a string of text to the screen) from scratch every time he creates a program.

Dependencies

GCC-2.95.3 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
ranlib from the binutils package

cmp from the diffutils package

chmod from the fileutils package
cp from the fileutils package
ln from the fileutils package
ls from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package
touch from the fileutils package

find from the find package

gcc from the gcc package
cc from the gcc package

egrep from the grep package
grep from the grep package

make from the make package

mawk from the mawk package

sed from the sed package

basename from the sh-utils package
echo from the sh-util package
expr from the sh-utils package
sleep from the sh-utils package
true from the sh-utils package
uname from the sh-utils package

tar from the tar package

makeinfo from the texinfo package

cat from the textutils package
head from the textutils package
sort from the textutils package
tail from the textutils package
tr from the textutils package
uniq from the textutils package