BPF List
 help / color / mirror / Atom feed
From: Anton Protopopov <a.s.protopopov@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Puranjay Mohan <puranjay@kernel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: fix build with new LLVM
Date: Mon, 20 Oct 2025 09:06:37 +0000	[thread overview]
Message-ID: <aPX7nYh09CPlFgra@mail.gmail.com> (raw)
In-Reply-To: <CAADnVQ+2ic2gWyvqp4qFCwZpKqV+7BDnovL08Jp0tFSaC4pm9g@mail.gmail.com>

On 25/09/18 09:26AM, Alexei Starovoitov wrote:
> On Thu, Sep 18, 2025 at 9:21 AM Anton Protopopov
> <a.s.protopopov@gmail.com> wrote:
> >
> > On 25/09/18 08:02AM, Alexei Starovoitov wrote:
> > > On Thu, Sep 18, 2025 at 2:30 AM Anton Protopopov
> > > <a.s.protopopov@gmail.com> wrote:
> > > >
> > > > The progs/stream.c BPF program now uses arena helpers, so it includes
> > > > bpf_arena_common.h, which conflicts with the declarations generated
> > > > in vmlinux.h. This leads to the following build errors with the recent
> > > > LLVM:
> > > >
> > > >     In file included from progs/stream.c:8:
> > > >     .../tools/testing/selftests/bpf/bpf_arena_common.h:47:15: error: conflicting types for 'bpf_arena_alloc_pages'
> > > >        47 | void __arena* bpf_arena_alloc_pages(void *map, void __arena *addr, __u32 page_cnt,
> > > >           |               ^
> > > >     .../tools/testing/selftests/bpf/tools/include/vmlinux.h:229284:14: note: previous declaration is here
> > > >      229284 | extern void *bpf_arena_alloc_pages(void *p__map, void *addr__ign, u32 page_cnt, int node_id, u64 flags) __weak __ksym;
> > > >             |              ^
> > > >
> > > >     ... etc
> > >
> > > I suspect you're using old pahole.
> > > New one can transfer __arena tags into vmlinux.h
> >
> > Ok, TIL about CONFIG_PAHOLE_VERSION (before I've sent the patch,
> > I've updated the pahole, re-built the kernel, but didn't do `make
> > oldconfig` after updating pahole.)
> 
> Yeah. It's a footgun that few people are aware of :(
> I was bitten by it too.
> We have a small section about pahole in bpf_devel_QA.rst.
> We should probably expand it and list the common issues and how to fix them.
> Every week somebody sends a patch due to old pahole :(

And today I also learned about the "next" branch of the pahole repo.
The "master" branch was too old to generate kfunc header for a kfunc
compiled with a .cold part (namely, bpf_dynptr_slice).

As the "old pahole" thing happens to so many people, maybe there is
a way to in-source it into kernel?..

      parent reply	other threads:[~2025-10-20  9:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18  9:36 [PATCH bpf-next] selftests/bpf: fix build with new LLVM Anton Protopopov
2025-09-18 15:02 ` Alexei Starovoitov
2025-09-18 16:27   ` Anton Protopopov
2025-09-18 16:26     ` Alexei Starovoitov
2025-09-19 22:29       ` Andrii Nakryiko
2025-10-20  9:06       ` Anton Protopopov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aPX7nYh09CPlFgra@mail.gmail.com \
    --to=a.s.protopopov@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=puranjay@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox