clang, which many people look to as a gcc replacement, is now able to build itself. (Thanks John Marino for the heads-up, some time ago) It can also build world and kernel on DragonFly, going on the work of Sascha Wildner!
Using the pkgsrc package, put
clang_CC=/usr/pkg/bin/clang
in /etc/compilers.conf and then set $CCVER to “clang” when building:
env WORLD_CCVER=clang make -DNO_GCC44 buildworld
I haven’t tried this, so any errors in description are mine, not Sascha’s – can someone verify? I don’t have a test system to run it on right now.
Edit: see Sascha’s comment for the definitive method.
It’ll be hard for clang to replace GCC when it needs about 2GB of memory to link itself.
Available RAM is only going to increase and clang is only going to be optimized as time passes by.
The description given here is for before my last commit about this. Now it is set up that with CCVER=clang you get the version from pkgsrc (with the svn version being ‘clangsvn’). The details are in http://leaf.dragonflybsd.org/cgi/web-man?command=compilers.conf§ion=5.
Sascha