gcc-2.95.3

Introduction to gcc-2.95.3

Download location (FTP):       ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3.tar.gz
Version used:                  2.95.3
Package size:                  7 MB
Estimated Disk space required: 104 MB

There are two reasons for installing gcc-2.95.3. The first is that the kernel developers have certified gcc-2.95.3 as the preferred compiler for compiling the kernel. The other (and more compelling reason) is that some commercial closed-source packages (such as Netscape Navigator, Yahoo Pager) and precompiled packages (such as Mozilla) are linked against gcc-2.95.3 libs.

Download the gcc patches from http://downloads.linuxfromscratch.org/blfs-patches.

Installation of gcc

Apply the two patches, one to fix compilation and the other to stop the fixincludes script from executing.

patch -Np1 -i ../gcc-2.95.3-1.patch &&
patch -Np1 -i ../gcc-2.95.3-no-fixinc.patch

The gcc development team recommends building in a separate directory.

mkdir ../gcc-build &&
cd ../gcc-build

Configure gcc to build the C and C++ compilers and enable the related C++ options.

../gcc-2.95.3/configure \
--prefix=/opt/gcc2 \
--enable-shared --enable-languages=c,c++ \
--enable-threads=posix

Compile and install gcc and remove unneeded directories (adjust the machine triplet to match your architecture).

make bootstrap &&
make install &&
ln -sf gcc /opt/gcc2/bin/cc &&
rm -rf /opt/gcc2/{i686-pc-linux-gnu,info,man}

Make note of the library that is installed.

L=`find /opt/gcc2/lib -name "*libstdc++*.so" -type f` &&
IL=`basename $L`

Move the C++ libraries to the standard lib directory to avoid having to add /opt/gcc2/lib to /etc/ld.so.conf.

for i in /opt/gcc2/lib/*.so*; do mv -f $i /usr/lib;
ln -sf /usr/lib/`basename $i` /opt/gcc2/lib; done

Create symlinks required by commercial and precompiled packages.

ln -sf $IL /usr/lib/libstdc++-libc6.1-1.so.2 &&
ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &&
ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3

Configuring gcc

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /usr/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.

The instructions given above make compatibility symlinks that pre-compiled packages in BLFS require. You may create additional compatibility links based on your requirements.

If you only need the gcc-2.95.3 libraries, you may delete /opt/gcc2.

Whenever you need to use gcc-2.95.3 instead of you system installed compiler, add /opt/gcc2/bin to the front of your PATH before compiling the concerned package.

Contents

The gcc-2.95.3 package contains the gcc-2.95.3 C and C++ compilers and gcc-2.95.3 libstdc++.so that is required by some commercial and pre-compiled packages.