Since last year, when building the Linux kernel with LLVM’s Clang compiler, there has been support for enabling link-time optimizations (LTO, link-time optimizations) for kernel builds. There is still a lack of LTO support for building the Linux kernel with GCC, and a series of patches released today is the latest attempt to make this happen.

Clang’s LTO support was merged in Linux 5.16, where it remains today. In addition to improving build performance, this move also provides Clang-based CFI support for the kernel.

As early as ten years ago, before Clang was able to build the mainline of the Linux kernel, some developers had submitted GCC LTO patches for the kernel, but they were not merged in the end because at that time GCC’s LTO support is not perfect,Failed to convince Linus.In recent years, alsoThere are multiple manufacturersReleased LTO patches for the Linux kernel.With the development of modern GCC compilers (and Clang), LTO has gradually become better, like Fedora will use LTO by default when packaging their distribution installation packages, and there are companies like Clear Linux by using AutoFDO(feedback compilation optimization based on program performance analysis tools) to further improve the performance of its distribution.

In late 2022, SUSE engineer Jiri Slaby submitted a patch for GCC LTO support, also as a “first call for comments”, based in part on a previous patch by Andi Kleen and the work of SUSE engineer Martin Liska.

Although optimizing the compiler’s link time usually improves performance. But at present, it seems that the GCC LTO support for the Linux kernel has not changed significantly after testing by kernel developers.

See the mailing list for details.

#SUSE #Engineers #Submit #GCC #LTO #Patches #Optimizing #Linux #Kernel #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *