LLVMLinux Works To Make More Code Clang-Compatible With Linux 3.18
Written by Michael Larabel in Linux Kernel on 14 October 2014 at 11:30 AM EDT. 6 Comments
LINUX KERNEL --
On top of some separate patches to make the mainline 64-bit ARM Linux kernel closer to building under Clang, a separate pull request was sent in for the Linux 3.18 kernel that works to make other areas of the kernel's massive code-base more compatible with the LLVM/Clang compiler.

The LLVMLinux project remains dedicated to making the Linux kernel compatible with LLVM's Clang as an alternative to using GCC. Using this alternative compiler can yield faster build times, lower memory usage, static analysis capabilities, and for making the kernel's code more portable across compilers. Read more in my recent Building The Linux Kernel With LLVM's Clang Yields Comparable Performance article.

Today's LLVMLinux patches for the Linux 3.18 kernel are about reducing the kernel's use of VLAIS: Variable Length Arrays in Structs. VLAIS is a GCC extension for allowing variable length arrays in structions, but unfortunately is a feature not supported outside of GCC -- because it is not allowed by the C standard. With Clang not pursuing VLAIS support over it being not part of the C standard, LLVMLinux developers have been left to workaround the feature.

Behan Webster is replacing the VLAIS kernel usage with a new SHASH_DESC_ON_STACK macro to replace the former functionality. Besides introducing this new macro, the LLVMLinux 3.18 patches replace the VLAIS usage within the Crypto code and Btrfs. The 3.18 pull request can be read on the kernel mailing list. More changes are expected for Linux 3.19; the mainline Linux kernel for x86 and ARM gets closer to being Clang-compatible but there's still outstanding patches needed as documented via the Linux Foundation project site.
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