Self-hosting clang; building DragonFly with it too

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


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.

Posted by     Categories: DragonFly, Goings-on     4 Comments
4 Comments on Self-hosting clang; building DragonFly with it too


  1. Anonymous says:

    It’ll be hard for clang to replace GCC when it needs about 2GB of memory to link itself.

  2. Anonymous says:

    Available RAM is only going to increase and clang is only going to be optimized as time passes by.

  3. Sascha Wildner says:

    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


  4. […] been possible to install and run clang on DragonFly for a long time, of course, and at least build world with it.  However, John Marino is putting in significant work […]