Re: [PATCH v3 1/4] tools build: Add explicitly sequenced -lzstd to libbfd feature fallback

From: Namhyung Kim

Date: Fri Nov 13 2026 - 21:59:59 EST


On Thu, Nov 12, 2026 at 10:13:35AM -0800, Ian Rogers wrote:
> On Tue, Nov 3, 2026 at 9:03 PM <bot+bpf-ci@xxxxxxxxxx> wrote:
> >
> > > tools build: Add explicitly sequenced -lzstd to libbfd feature fallback
> >
> > TL;DR: Possible build break at this commit: the libbfd -lzstd fallback is
> > removed but no consumer uses the new feature test yet, so perf may fail to
> > link and bpftool may lose JIT disassembly.
> >
> > > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> > > --- a/tools/build/feature/Makefile
> > > +++ b/tools/build/feature/Makefile
> >
> > [ ... ]
> >
> > > @@ -249,18 +250,21 @@ $(OUTPUT)test-python-module.bin:
> > > $(BUILD) $(FLAGS_PYTHON_EMBED)
> > >
> > > $(OUTPUT)test-libbfd.bin:
> > > - $(BUILD_BFD) || $(BUILD_BFD) -lzstd
> > > + $(BUILD_BFD)
> > >
> > > $(OUTPUT)test-libbfd-threadsafe.bin:
> > > - $(BUILD_BFD) || $(BUILD_BFD) -lzstd || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz
> > > + $(BUILD_BFD) || $(BUILD_BFD) -liberty || $(BUILD_BFD) -liberty -lz || \
> > > + $(BUILD_BFD) -liberty -lz -lzstd
> >
> > Can this leave perf and bpftool unable to link libbfd at this commit?
>
> So the concern is that at this commit, not later in the series, a
> feature test for a libbfd built with zstd that previously failed to
> link in this feature test will now succeed, but the parent Makefile
> will not pass the -zstd flag and so break the build. This issue is
> fixed later in the series by adding the -lzstd. Will this impact
> anything? It will turn one broken build into a different kind of
> broken build. I can reengineer the series to maintain bisectability
> but this seems like a low priority issue to address.

Ok, fair enough. As it got acked from other maintainers, I think it's
good to go.

Thanks,
Namhyung