LLVM Clang Compiling The Linux Kernel Is A Big Topic For 2015
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.
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.
17 Comments