# Build kernel and world using clang 3.1



## Niatross (Dec 31, 2012)

I am using FreeBSD 9.0-RELEASE.

I installed clang 3.1_2 from the FreeBSD Ports Collection

Is it a wise idea to build the kernel and world using clang 3.1_2 or should I use the clang from the base system (AKA: clang 3.0)?


----------



## Beeblebrox (Dec 31, 2012)

Base clang is already version 3.1. Why are you going through all that trouble of ports-this and base-that, just for the minute difference of 3.1 vs 3.1-2?

Use clang provided in base, delete the port install (lang/clang*) and be done with it. You can even disable the build for gcc42 in buildworld since you don't plan to use it (come ports will require gcc, so you will have to install gcc46 or such from ports).

If you want to be adventurous and cutting edge that badly, switch from RELENG to STABLE - although it's not HEAD, it's still a development branch and new stuff gets placed in there fairly quickly.

`# svn co [url=svn://svn.freebsd.org/base/stable/9]svn://svn.freebsd.org/base/stable/9[/url] /usr/src`


----------



## kpa (Dec 31, 2012)

Base clang(1) on 9.0-RELEASE is actually version 3.0 and it's just good enough to compile world and kernel, otherwise it's not a good choise for ports compiler.

I would stick to using the base clang(1), it's proven to work for builing world and kernel on 9.0-RELEASE. Keep in mind that 9.0-RELEASE sources are not going to be fixed if something does not work with a newer compiler from ports.


----------



## xibo (Dec 31, 2012)

llvm/clang-3.2 will be MFCed to stable in about a week, probably there will be a port for it by then, too.

From a support point of view it would rather be wise to update to FreeBSD-9.1 which contains llvm/clang-3.1 and can build almost every port with it, too.


----------

