Linux Kernel Patches Add Clang LTO Support
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.
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.
7 Comments