GCC 2.95.3 Guide | Go Back
This simple gcc howto will help most users out there to get source distributions to compile properly. As you might know, latest versions of gcc do have compilation problems. mySQL, vmailmgr and some other programs will simply refuse to compile on newer versions of gcc. After doing some research, I found out that the best and most stable version of gcc is 2.95.3. In this quick howto you will configure and install the best gcc version.
GCC 2.95.3 Guide
or
A simple GCC howto for beginners
1) Who should use this guide?
Those of you who need mySQL and other sources to compile properly.
2) On what operating systems has this guide been tested on?
This guide should work on any Linux, FreeBSD and OpenBSD system. I have successfully compiled gcc on Redhat Linux 7.3 and 8.0. If you make it work on any other platform, please let me know.
3) Downloading gcc 2.95.3 source
Download the following source into /usr/local/src:
- GCC v2.95.3 from http://gcc.gnu.org
3) Configuring gcc
The most important part of gcc installation is configuration. You have to make sure that the values passed to configure script correspond to your system. For Redhat Linux, issue the following commands:
# cd /usr/local/src
# tar zxf gcc-2.95.3.tar.gz
# cd gcc-2.95.3
# ./configure –host=i686-redhat-linux –build=i686-redhat-linux –enable-multilib
–enable-shared –with-system-zlib –prefix=/usr –enable-threads=posix
Configure will take a while and create the necessary makefile. Of course, if your OS is not Redhat, you have to change –host and –build lines accordingly.
4) Compiling and testing gcc
Now all we need to do is compile gcc and install it:
# make
# make install
The compilation process for gcc is very long (depends on your CPU speed). On my system it took a while, so I just went to have my dinner :-)
Now let’s see how the installation went by testing gcc version:
# gcc -v
Reading specs from /usr/lib/gcc-lib/i686-redhat-linux/2.95.3/specs
gcc version 2.95.3 20010315 (release)
If you get a similar output, it means that everything went smoothly! If not, something is wrong. Try to locate your gcc executable ([color=red]locate gcc | more[/color]) and see if you have gcc installed somewhere other than /usr/bin. If you have multiple gcc instances, it is best to get rid of those. Simply rename them (just in case).
That’s it! You’re done! Congratulations :-)

following your instructions to install gcc-2.95.3 getting the error message:
***The command ‘cc -o conftest -g conftest’ failed
***You must set the environment variable CC to a working compiler
I removed the gcc-4.3 version from the system (Fedora Core7), what othe compiler can be used to get the gcc-2.95.3 properly installed?
Thanks
Luis
Another site (Linux from Scratch) had other compile options such as –enable-languages-c,c++;
Is this available or necessary if one does not enable it as above. Also, my kernel compiles of mandrake linux 2.4.21-0.32 kernel are not automatically providing a kernel.h updated as in
ls -l /boot/kernel.h-2.4.21-0.32mdk
-rw-r–r– 1 root root 441 Jul 27 21:16 /boot/kernel.h-2.4.21-0.32mdk
this demonstrates that I still have this old build kernel.h and hence it seems I will never boot mk custom kernel which is labelled 2.3.21-0.32mdkcustom in the Makefile
A parting note; I think it would be helpful for newbies to have it noted that the gcc package that comes with the distribution must be used to build this older gcc version and that some recommend setting a further scripting enabler of –prefix=/opt/gcc-2.95.3 so as to load this version away from the newer version (in /opt/gcc-2.95.3 directory) to not confuse things. Alas some linking of libraries may be necessary here and so perhaps this is just another layer of confusion..
for i in /opt/gcc-2.95.3/lib/*.so*; do mv -f $i /usr/lib;
ln -sf /usr/lib/`basename $i` /opt/gcc-2.95.3/lib; done
I do not know if this accomplishes it but it describes the idea.
If this is done; the make command using the early gcc is
make CC=/opt/gcc.2.95.3/bin/gcc dep && clean && bzImage ; for example
http://www.tldp.org/LDP/lfs/html/chapter06/gcc-2953.html isthe reference link