Linux Kernel Patches Add Clang LTO Support

Written by Michael Larabel in Linux Kernel on 4 November 2017 at 06:54 AM EDT. 7 Comments
LINUX KERNEL
Patches by an Android security team member at Google allow the Linux kernel to be compiled with Clang using Link Time Optimizations (LTO).

Sami Tolvanen of Google posted the kernel patches on Friday to support building the Linux kernel with Clang using LTO enabled and paired with GNU Gold with the LLVMgold plug-in for linking the kernel build.

Initially this Linux kernel Clang LTO'ing is just targeting the AArch64/ARM64 kernel build with there being issues at play for other architectures at the moment. Unfortunately, no word on performance differences of the resulting kernel or build time changes as a result of this support, but it should be worthwhile considering Google is joining the "Clang'ing the kernel" party. It's nice to see this effort continued with the upstream "LLVMLinux" work having not progressed much in recent years while there still are some patches away from the Linux kernel building nicely with Clang across all architectures and with all drivers/Kconfig options enabled.

These Clang LTO patches for the Linux kernel can be found via the kernel mailing list.
Related News
About The Author
Michael Larabel

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, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week