Monday, September 11, 2006

Which gcc version?

I have been doing a lot of software development job on unix platform using C programming language. Normally I work on Linux and very old version of SUN Solaris system. How old? Is Solaris 2.5, which was release more than 10 years ago (1992). I use some old gcc compiler as well, don't be surprised if is as old as gcc 2.8.

There are a few version of gcc available, choosing a right version which suit your need is very important. Not all gcc version are (fully) compatible, I just share my gcc experience here:-

gcc 2.8.1. I like this very old version of gcc, is classic. It is small in size (binary), just about 3 to 5 megabytes, you can bring it along with you easily and install on many machine, I use it to compile the later version on target machine. The gcc itself is very easy to compile. I don't suggest anything earlier than 2.8, but I use gcc 2.7 once to compile an old linux kernel (2.0.x).

gcc 2.9x. gcc 2.8 doesn't work well with some new version of open souce software, you need a newer version compiler to do the compilation work. gcc 2.9x is not an offical release from free software foundation, users are waited too long until the next official release, so these people put in a lot of new functioin, and fork out the gcc 2.9x from the offical release. They do it so well that make most people forgotten the official release. If you are late 90s user, you should be familiar with this version.

A lot of the cross-compiler, tool-chain or ARM target binary compiler are base on this version.

gcc 3. Most people upgate from 2.9x to version 3.x without much problem, because they don't write program, especially C++ program, they hardly compily any open source software too. gcc 3 is not compatible with gcc 2.9x, gcc 3 is an official release, but gcc 2.9x is not.

One of common problem when user upgrade Java version or Mozilla/Firefox, and found out that the java plugins is not working anymore. This is cause by the in-compatibility of gcc binaries, browser and java plugins compile by a different version of gcc. eg. browser compile by gcc 3, but java plugins compile by gcc 2.9x. Normally the java plugins provide 2 binaries, one compiled by gcc 3, and another compiled by gcc 2.9x.

These days, not much people care about java plugins problem. They use firefox browser on Windows operating system, for unix users, most of them move to gcc 3. The most important thing is, they hardly need java plugins for website.

gcc 4. gcc has moved to version 4 for quite some time, I have no experience on using it.

Newer doen't mean better, just choose something which suit you best will do.

No comments: