Google 的工程师提议在编译 Linux 内核时为 LLVM/Clang 引入分布式 ThinLTO 构建支持。与当前正在进行的 ThinLTO 模式相比,用于链路时优化的分布式 ThinLTO 模式可以缩短构建时间,同时也更方便,可与内核实时修补解决方案配合使用。
Rong Xu 和 Google 的其他工程师正在研究使用 LLVM/Clang 对 Linux 内核的分布式 ThinLTO 支持。至于执行链路时优化的 ThinLTO 行为的差异:
进程内:通过链接器调用 Thin-link 和 ThinLTO BE 编译。BE 编译是多线程的。
分布式:Thin-link 通过链接器。它会生成 ThinLTO 索引文件。ThinLTO BE 编译与链接器分开,构建系统/makefile 使用 ThinLTO 索引文件和预链接 IR 对象显式调用它。
除了使用内核实时修补更舒适和更方便之外,使用 LLVM Clang 20 对 Linux 内核进行分布式 ThinLTO 编译比使用现有的进程内 ThinLTO 配置要快得多:
如果对 Linux 内核的分布式 ThinLTO 支持提案感到好奇,可以通过 LLVM Discourse 找到它。
转自 Google Engineers Exploring Distributed ThinLTO Builds Of The Linux Kernel – Phoronix