LLVM Clang Compiling The Linux Kernel Is A Big Topic For 2015
Written by Michael Larabel in LLVM on 21 February 2015 at 11:15 AM EST. 17 Comments
LLVM --
It's been talked about for years and is still an ongoing but very active endeavor: building the mainline Linux kernel with LLVM's Clang compiler rather than GCC.

Going back years we've been monitoring the situation of building the mainline Linux kernel with Clang in place of GCC. In doing so, Clang can offer faster build times, provide better diagnostics (though GCC's diagnostics have recently improved), potentially catch errors missed by GCC, and integrate with LLVM's other interesting and useful developer tools. Being able to compile the kernel code under multiple compilers also improves its code portability. All of the necessary compiler-side patches have been merged into LLVM and Clang for compiling the Linux kernel, but there's still around 40 patches still needed against the Linux kernel that haven't yet been mainlined.

Behan Webster presented at this week's Linux Foundation Collaboration Summit (LFCS 2015 in Santa Rosa) to once again provide an update on the status of Clang'ing the Linux kernel. The 40 or so outstanding kernel patches are for the four architectures currently being tried for Clang compilation: x86, ARM, ARM64/AArch64, and MIPS. There's also PowerPC support being independently worked on. Over half of these 40 patches though are CPU architecture independent.

One new bit of information shared by this week's presentation is that "a large company was able to find a significant error in their private kernel which had apparently been missed by GCC." The company had invested more than two weeks into finding the error while when finally trying to compile under Clang they were able to figure it out in minutes.

If you wish to learn more about the current state of compiling the Linux kernel with Clang or have missed out on previous yearly updates, head on over to these LFCS 2015 PDF slides.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week