Re: linux-next: build failure after merge of the bpf-next tree
From: Alexei Starovoitov
Date: Mon Aug 24 2020 - 23:27:44 EST
On Mon, Aug 24, 2020 at 8:04 PM Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
>
> Hi Alexei,
>
> On Mon, 24 Aug 2020 18:25:44 -0700 Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote:
> >
> > On Mon, Aug 24, 2020 at 6:20 PM Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > On Fri, 21 Aug 2020 11:11:11 +1000 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
> > > >
> > > > After merging the bpf-next tree, today's linux-next build (x86_64
> > > > allmodconfig) failed like this:
> > > >
> > > > Auto-detecting system features:
> > > > ... libelf: [ [31mOFF [m ]
> > > > ... zlib: [ [31mOFF [m ]
> > > > ... bpf: [ [32mon [m ]
> > > >
> > > > No libelf found
> > > > make[5]: *** [Makefile:284: elfdep] Error 1
> > > >
> > > > Caused by commit
> > > >
> > > > d71fa5c9763c ("bpf: Add kernel module with user mode driver that populates bpffs.")
> > > >
> > > > [For a start, can we please *not* add this verbose feature detection
> > > > output to the nrormal build?]
> > > >
> > > > This is a PowerPC hosted cross build.
> > > >
> > > > I have marked BPF_PRELOAD as BROKEN for now.
> > >
> > > Still getting this failure ...
> >
> > I don't have powerpc with crosscompiler to x86 to reproduce.
> > What exactly the error?
>
> Just as above.
I didn't receive the first email you've replied to.
The build error is:
"
No libelf found
make[5]: *** [Makefile:284: elfdep] Error 1
"
and build process stops because libelf is not found, right?
That is expected and necessary.
bpf_preload needs libbpf that depends on libelf.
The only 'fix' is to turn off bpf_preload.
It's off by default.
allmodconfig cannot build bpf_preload umd if there is no libelf.
There is CC_CAN_LINK that does feature detection.
We can extend scripts/cc-can-link.sh or add another script that
will do CC_CAN_LINK_LIBELF, but such approach doesn't scale.
imo it's cleaner to rely on feature detection by libbpf Makefile with
an error above instead of adding such knobs to top Kconfig.
Does it make sense?