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

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