Re: linux-next: build failure after merge of the bpf-next tree

From: Alexei Starovoitov
Date: Tue Aug 25 2020 - 10:34:43 EST


On Mon, Aug 24, 2020 at 11:50 PM Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
>
> Hi Alexei,
>
> On Mon, 24 Aug 2020 20:27:28 -0700 Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote:
> >
> > 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?
>
> Sorry, but if this is not necessary to build the kernel, then an
> allmodconfig build needs to succeed so you need to do the detection and
> turn it off automatically. Or you could make it so that it has to be
> manually enabled in all circumstances.

what do you suggest to use to make it 'manually enabled' ?
All I could think of is to add:
depends on !COMPILE_TEST
so that allmodconfig doesn't pick it up.