use a different default configure.compiler (was: UsingTheRightCompiler)

vincent habchi vince at macports.org
Mon Apr 16 02:46:26 PDT 2012


Hi everybody,

Le 16 avr. 2012 à 09:00, Ryan Schmidt <ryandesign at macports.org> a écrit :

> 
> On Apr 15, 2012, at 23:04, Jeff Singleton wrote:
> 
>> I just can't say a lot for Clang.  I have mentioned this before.  I have taken many suggestions.  Tried Tried and Tried some more to like Clang.
>> 
>> I just can't do it.
>> 
>> Its ugly.  It causes more problems between ports that depend on one another, yet some are built with Clang, other built with GCC.
> 
> I've not heard of any problems related to some ports being built with clang and others built with other compilers; if you have examples of this please let us know.

My own experience is that Clang works fine. LLVM based tools are now used extensively, be it by Apple for traditional GCC substitution, or by other companies like, e.g. NVidia for its OpenGL JIT compiler. LLVM is modern, extensible, modular and easily ported to any hardware whereas GCC is hoary, monolithic and totally cryptic, let alone code documentation. 

The only drawback I still see to the use of Clang is its inferior performance when it comes to floating point brute force. In fact, I carried out some tests with Clang on Atlas latest development version. Good news is that Clang works fine, even with AVX assembly; Bad news is that performance is still worse than GCC, sometimes by more than 40%, at least on Linux. On OS X, no comparison is possible since the provided assembler ‘/usr/bin/as’ is antiquated and does not recognize AVX instructions, and using Clang as an assembler fails because GCC emits non Intel compliant instructions that llvm-mc does not recognize. This might be slightly different on OS X because since LLVM is basically Apple driven there might be additional optimizations enabled for Darwin. But there is still room for additional improvements.

Additional tools like a new linker, lld, are underway; It will eventually replace ld64.

By the way, is it possible to add GCC 4.7 as a possible compiler?

Vincent





More information about the macports-users mailing list