[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Compiler choice for OSS (WAS: Re: Trouble with Mozilla Java plugin)

On Sunday 01 June 2003 15:09, Roberto Sanchez wrote:
>  --- Aryan Ameri <a.ameri@linuxiran.org> escribió:
> > The compiler version is always important (due to the nature of C).
> > For example Mozilla 1.4 can be compiled with gcc on windows, but no
> > plugin would then work with it, because all the plugins have been
> > compiled with the Microsoft compiler.
> This is something I have always wondered about.  Why do OSS projects
> use gcc for every platform except Windows?  I thought one of the
> great advantages of gcc was that is was ported to pretty much every
> operating system.  Why not just always use gcc?  Then there would be
> no need to maintain separate makefiles for different compilers.

I am a rookie programmer, so there are probably other people in this 
list with more insight on C and it's compilers, but here is my opinion:

In the ideal world, you shouldn't care about compilers. In this world 
you should write ANSI standard codes, and then all compilers should 
produce the same binary out of it. However, in reality this is not the 

Compilers are not ABI compatible with each other. Even different 
versions of the same compiler might not be ABI compatible with each 
other (gcc 2.x versus gcc 3.x). when writing programs, programmers 
should write the code for a special compiler in mind. The Linux kernel 
2.4 is written to be compiled with gcc 2.x, the windows kernel is 
written to be compiled with microsoft's compiler, and so forth. I once 
tried compiling KDE 3.0 and Linux kernel 2.4 using the Intel compiler; 
it never worked. 

Now, you ask why OSS programmers don't use gcc on windows? Well, some 
do, but gcc is not Windows' compiler. gcc is the compiler for linux, 
BSD, and Mac OS X, not on Windows. If you want ABI compatibility with 
other programs on windows, as they are not probably compiled with gcc, 
it wouldn't be a good idea to compile your programs with gcc. As the 
example with mozilla on windows shows. Macromedia will never use gcc to 
compile flash on windows, so if you compile mozilla with gcc, then it 
wouldn't work with flash (and java and ...).

Just my $0.02


/* There is SCO owned IP all over the Linux kernel. SCO will hunt them.
Free software infidels are liars. We will kill them all, and roast their
stomach in hell. Our estimates show that all slashodot viewers will die.
 --Mohammad Al-Sahhaf SCO Sopkesman, Former Iraqi information minister*/

Aryan Ameri

Reply to: