LLVMLinux Works To Make More Code Clang-Compatible With Linux 3.18
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.
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.
6 Comments