BPF List
 help / color / mirror / Atom feed
* [BPF selftests]:bpf_arena_common.h: error: conflicting types for 'bpf_arena_alloc_pages'
@ 2025-11-09 17:09 Vincent Li
  2025-11-09 19:50 ` Yonghong Song
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Li @ 2025-11-09 17:09 UTC (permalink / raw)
  To: bpf
  Cc: ast, Andrii Nakryiko, Daniel Borkmann, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song

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?


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BPF selftests]:bpf_arena_common.h: error: conflicting types for 'bpf_arena_alloc_pages'
  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
  2025-11-10  0:44   ` Vincent Li
  0 siblings, 1 reply; 4+ messages in thread
From: Yonghong Song @ 2025-11-09 19:50 UTC (permalink / raw)
  To: Vincent Li, bpf
  Cc: ast, Andrii Nakryiko, Daniel Borkmann, Martin KaFai Lau,
	Eduard Zingerman, Song Liu



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BPF selftests]:bpf_arena_common.h: error: conflicting types for 'bpf_arena_alloc_pages'
  2025-11-09 19:50 ` Yonghong Song
@ 2025-11-10  0:44   ` Vincent Li
  2025-11-10 17:31     ` Vincent Li
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Li @ 2025-11-10  0:44 UTC (permalink / raw)
  To: Yonghong Song
  Cc: bpf, ast, Andrii Nakryiko, Daniel Borkmann, Martin KaFai Lau,
	Eduard Zingerman, Song Liu

On Sun, Nov 9, 2025 at 11:50 AM Yonghong Song <yonghong.song@linux.dev> wrote:
>
>
>
> 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/
>

Thanks Yonghong! I just tried the pahole master branch which shows
1.30 version, and pahole next branch which shows 1.31 version, same
problem.

[root@fedora dwarves]# pahole --version
v1.31

[root@fedora build]# cd /usr/src/linux-loongson/tools/testing/selftests/bpf/
[root@fedora bpf]# make clean
  CLEAN
  CLEAN   Module.symvers
  CLEAN   eBPF_helpers-manpage
  CLEAN   eBPF_syscall-manpage
[root@fedora bpf]# make -j6

Auto-detecting system features:
...                                    llvm: [ on  ]
...
  INSTALL bpftool
  GEN      vmlinux.h
...
CLNG-BPF [test_progs] strobemeta.bpf.o
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,

> >
> >
> > 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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BPF selftests]:bpf_arena_common.h: error: conflicting types for 'bpf_arena_alloc_pages'
  2025-11-10  0:44   ` Vincent Li
@ 2025-11-10 17:31     ` Vincent Li
  0 siblings, 0 replies; 4+ messages in thread
From: Vincent Li @ 2025-11-10 17:31 UTC (permalink / raw)
  To: Yonghong Song
  Cc: bpf, ast, Andrii Nakryiko, Daniel Borkmann, Martin KaFai Lau,
	Eduard Zingerman, Song Liu

On Sun, Nov 9, 2025 at 4:44 PM Vincent Li <vincent.mc.li@gmail.com> wrote:
>
> On Sun, Nov 9, 2025 at 11:50 AM Yonghong Song <yonghong.song@linux.dev> wrote:
> >
> >
> >
> > 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/
> >
>
> Thanks Yonghong! I just tried the pahole master branch which shows
> 1.30 version, and pahole next branch which shows 1.31 version, same
> problem.
>
> [root@fedora dwarves]# pahole --version
> v1.31
>
> [root@fedora build]# cd /usr/src/linux-loongson/tools/testing/selftests/bpf/
> [root@fedora bpf]# make clean
>   CLEAN
>   CLEAN   Module.symvers
>   CLEAN   eBPF_helpers-manpage
>   CLEAN   eBPF_syscall-manpage
> [root@fedora bpf]# make -j6
>
> Auto-detecting system features:
> ...                                    llvm: [ on  ]
> ...
>   INSTALL bpftool
>   GEN      vmlinux.h
> ...
> CLNG-BPF [test_progs] strobemeta.bpf.o
> 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,
>

I had an issue with kernel 6.18.0-rc4+, 6.18.0-rc5+ is fixed

> > >
> > >
> > > 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
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-10 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-11-10  0:44   ` Vincent Li
2025-11-10 17:31     ` Vincent Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox