Re: [PATCH v7 3/3] kbuild: distributed build support for Clang ThinLTO
From: Rong Xu
Date: Mon Mar 30 2026 - 11:55:44 EST
op
On Mon, Mar 30, 2026 at 3:01 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> On Sun, Mar 29, 2026 at 10:05:02PM +0200, Nicolas Schier wrote:
> > On Sat, Mar 28, 2026 at 01:19:27AM +0000, xur@xxxxxxxxxx wrote:
> > > diff --git a/Makefile b/Makefile
> > > index 69ccf9b8507d..d474b6f0f212 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -1047,11 +1047,11 @@ export CC_FLAGS_SCS
> > > endif
> > >
> > > ifdef CONFIG_LTO_CLANG
> > > -ifdef CONFIG_LTO_CLANG_THIN
> > > +ifdef CONFIG_LTO_CLANG_FULL
> > > +CC_FLAGS_LTO := -flto
> > > +else
> > > CC_FLAGS_LTO := -flto=thin -fsplit-lto-unit
> > > KBUILD_LDFLAGS += $(call ld-option,--lto-whole-program-visibility -mllvm -always-rename-promoted-locals=false)
> > > -else
> > > -CC_FLAGS_LTO := -flto
> > > endif
> > > CC_FLAGS_LTO += -fvisibility=hidden
> > >
> >
> > This hunk is just reordering but does not change any functionality,
> > right?
>
> It does, as CONFIG_LTO_CLANG_THIN and CONFIG_LTO_CLANG_THIN_DIST are two
> distinct options. That said, this hunk still does not look right based
> on Yonghong's comment?
>
> https://lore.kernel.org/044bebc0-d996-4be3-9330-a64195c19a84@xxxxxxxxx/
>
> Rong, have you tested this with a recent version of LLVM? Or has support
> for this flag been added to the distributed mode since Yonghong's
> comment?
I did not know the Yonghong's recent change is not compatible with
distributed mode.
I meanted to enable that in distributed mode. But after reading
Yonghong's patch in llvm, I should have disabled
the -always-rename-promoted-locals=false option.
I lightly tested my patch, but not with the llvm23 compiler. So
ld-option was filled out this option.
I can submit another version to fix this.
>
> > Nathan, Piotr: your tags got dropped from v6 to v7. Do you want to
> > renew them?
>
> Yes, once the above is sorted out.
>
> Cheers,
> Nathan