Re: [PATCH v5 0/2] kbuild: distributed build support for Clang ThinLTO

From: Rong Xu

Date: Thu Dec 04 2025 - 13:36:52 EST


Thanks Nathan for testing and reviewing the patch!

On Thu, Dec 4, 2025 at 9:50 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> Hi Rong,
>
> On Tue, Oct 28, 2025 at 06:28:20PM +0000, xur@xxxxxxxxxx wrote:
>
> First of all, my apologies for taking so long to get to testing and
> reviewing this patchset.
>
> > Rong Xu (2):
> > kbuild: move vmlinux.a build rule to scripts/Makefile.vmlinux_a
> > kbuild: distributed build support for Clang ThinLTO
> >
> > .gitignore | 2 +
> > Makefile | 25 +++++-------
> > arch/Kconfig | 19 +++++++++
> > scripts/Makefile.lib | 7 ++++
> > scripts/Makefile.thinlto | 40 ++++++++++++++++++
> > scripts/Makefile.vmlinux_a | 83 ++++++++++++++++++++++++++++++++++++++
> > scripts/mod/modpost.c | 15 +++++--
> > 7 files changed, 174 insertions(+), 17 deletions(-)
> > create mode 100644 scripts/Makefile.thinlto
> > create mode 100644 scripts/Makefile.vmlinux_a
>
> Overall, this seems reasonable from a high level perspective. I have
> been testing it with my arm64 and x86_64 distribution configurations for
> the past couple of days and I have not noticed any issues.
>
> Did you take a look at the robot report from patch 2?
>
> https://lore.kernel.org/202511052257.Bb85ptQG-lkp@xxxxxxxxx/
>
> It seems like it could be caused by different optimizations?

I haven't tried to reproduce the issue in this report. However, based
on the warning messages, it looks fine to me: Distributed build mode
will have different optimizations from current in-process ThinLTO
build. This is mainly due to the fact that distributed build mode has
more precise option control. For a more detailed explanation, please
refer to my LLVM Discourse post:
https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934

Additionally, I will be presenting a talk on distributed ThinLTO
builds at the LPC next week and would be happy to discuss this topic
further with interested individuals in person.

Thanks,

-Rong

>
> I plan to take a more in-depth look at the implementation after I am
> back home from Plumbers in a couple of weeks (just to make sure I
> understand it from a maintainer's perspective). Based on that, I will
> either apply it to kbuild-next for 6.20/7.0 or ask for further
> interations, while still aiming to get it into that release.
>
> Cheers,
> Natha