Clang

clang is a compiler for C family of languages using LLVM as a backend and optimizer. It aims to be GCC compatible yet stricter.

Using clang with portage
Although Gentoo package tree is not designed to be used with compiler other than GCC, clang can be enforced on most of the packages through CC and CXX variables.

Please note, however, that many of Gentoo packages still don't build with clang and a few don't work correctly after being built. That's why we suggest using /etc/portage/env file to enable the use of clang per-package.

In order to do that, first create a new environment override to use:

Then you can enable use of clang for packages using /etc/portage/package.env file:

If you have installed, the /etc/portage/package.env file could be modified using: