BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: Vincent Li <vincent.mc.li@gmail.com>, bpf <bpf@vger.kernel.org>
Cc: ast <ast@kernel.org>, Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>
Subject: Re: [BPF selftests]:bpf_arena_common.h: error: conflicting types for 'bpf_arena_alloc_pages'
Date: Sun, 9 Nov 2025 11:50:29 -0800	[thread overview]
Message-ID: <893afb17-aac2-47d6-8651-e07ccc37995b@linux.dev> (raw)
In-Reply-To: <CAK3+h2yuppeOisqT+G6pf9zsP7sTbbbgKWpMe6s5TL6fZ-coWg@mail.gmail.com>



On 11/9/25 9:09 AM, Vincent Li wrote:
> Hi,
>
> Sorry if this is a known issue,  but I could not find it.  my build environment:
>
> [root@fedora linux-loongson]# pahole --version
> v1.30
> [root@fedora linux-loongson]# clang --version
> clang version 21.1.5
> Target: loongarch64-redhat-linux
> Thread model: posix
> InstalledDir: /usr/bin
>
> [root@fedora linux-loongson]# bpftool version
> bpftool v7.6.0
> using libbpf v1.6
> features: llvm, skeletons
>
> I got errors below while building bpf selftests with bpf-next branch,
> I had to comment out the bpf_arena_alloc_pages,
> bpf_arena_reserve_pages, bpf_arena_free_pages in
> tools/include/vmlinux.h, then progs/stream.c build succeeded. It looks
> like these functions in tools/include/vmlinux.h generated by bpftool
> are not the same as in bpf_arena_common.h. is there something wrong in
> my build environment?

Could you try pahole master branch? See the conversion in
   https://lore.kernel.org/bpf/8a94c764c5fa4ff04fa7dd69ed47fcdf782b814e@linux.dev/

>
>
> In file included from progs/stream.c:8:
> /usr/src/linux-loongson/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,
>        |               ^
> /usr/src/linux-loongson/tools/testing/selftests/bpf/tools/include/vmlinux.h:180401:14:
> note:
>        previous declaration is here
>   180401 | extern void *bpf_arena_alloc_pages(void *p__map, void
> *addr__ign, u32 page_cnt, int node_i...
>          |              ^
> In file included from progs/stream.c:8:
> /usr/src/linux-loongson/tools/testing/selftests/bpf/bpf_arena_common.h:49:5:
> error:
>        conflicting types for 'bpf_arena_reserve_pages'
>     49 | int bpf_arena_reserve_pages(void *map, void __arena *addr,
> __u32 page_cnt) __ksym __weak;
>        |     ^
> /usr/src/linux-loongson/tools/testing/selftests/bpf/tools/include/vmlinux.h:180403:12:
> note:
>        previous declaration is here
>   180403 | extern int bpf_arena_reserve_pages(void *p__map, void
> *ptr__ign, u32 page_cnt) __weak __ksym;
>          |            ^
> In file included from progs/stream.c:8:
> /usr/src/linux-loongson/tools/testing/selftests/bpf/bpf_arena_common.h:50:6:
> error:
>        conflicting types for 'bpf_arena_free_pages'
>     50 | void bpf_arena_free_pages(void *map, void __arena *ptr, __u32
> page_cnt) __ksym __weak;
>        |      ^
> /usr/src/linux-loongson/tools/testing/selftests/bpf/tools/include/vmlinux.h:180402:13:
> note:
>        previous declaration is here
>   180402 | extern void bpf_arena_free_pages(void *p__map, void
> *ptr__ign, u32 page_cnt) __weak __ksym;
>          |             ^
> 3 errors generated.
>
> Vincent


  reply	other threads:[~2025-11-09 19:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-09 17:09 [BPF selftests]:bpf_arena_common.h: error: conflicting types for 'bpf_arena_alloc_pages' Vincent Li
2025-11-09 19:50 ` Yonghong Song [this message]
2025-11-10  0:44   ` Vincent Li
2025-11-10 17:31     ` Vincent Li

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=893afb17-aac2-47d6-8651-e07ccc37995b@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=song@kernel.org \
    --cc=vincent.mc.li@gmail.com \
    /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