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

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.

4 Replies to “Self-hosting clang; building DragonFly with it too”

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

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

Comments are closed.