CLANG for compiling the Linux kernel


Is there any status regarding building the Linux kernel with clang?

The llvm kernel project seems to have halted back in 2015.

I would like to use clang/llvm for some analysis of the Linux kernel,
but it does not seem to even like the kernel header files.

If anyone can point me to a linux kernel git repo that builds with
LLVM, I would find that very useful.

Kind Regards


It’s definitely still an active area. There are a few things that happened recently to the Linux kernel which made it incompatible with Clang. In particular, they require “asm goto”, which Clang doesn’t have (yet). There are ways around this until support comes in.

Take a look at