Re: [PATCH v7 3/3] kbuild: distributed build support for Clang ThinLTO

From: Nathan Chancellor

Date: Mon Mar 30 2026 - 06:08:51 EST


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?

> 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