Over the past few says I’ve been getting to know GCC 4.0.0 on Mac OS X. It is going to ship with Xcode 2.0 and I wanted to try out the new auto vectorization. And on top of that, stuff compiled with GCC 4 is supposed to be around 15% faster than version 3.3.
So, how did it go? To put it simply. It didn’t.
I checked out the latest source from the gcc-4.0.0 CVS branch, downloaded and installed cctools 528.5, built gcc from source, installed it. And gues what. It worked!
So why did I say it didn’t work then. Well most people assume that on Mac OS X you will be using Apple’s version of GCC. What’s the difference? Well Apple includes support for pascal strings. Something which is used in old APIs and other legacy code. The thing is that Mozilla still uses pascal strings in it’s source. And because of that I went through days of trying to figure out what \p was and trying to modify the source code so if would “work” with GCC 4.0. Meanwhile it was actually a problem with a missing GCC extension.
So why is this Apple only? Well Apple actually tried hard in my opinion to get -fpascal-strings into the mainline GCC but it was rejected. This is in 2001.
You can read the mailing list archives for yourself if you wish.
There are other small things here and there that break code that worked before. I won’t get into details here. For example plib would not build anymore either but I did not have a chance to investigate that.
Now I have been forced to move back to Apple’s GCC 3.3 in order to update the SVG Mac OS X builds I’m supposed to make available daily.
I was really looking forward to trying out the new optimizations but I guess waiting until Tiger is the only choice. And then sell a leg in order to pay for it.




