Re: [PATCH bpf-next v2] selftests/bpf: Use unsigned loop counter in test_buddy_alloc_free
From: Alexei Starovoitov
Date: Mon Nov 30 2026 - 23:06:44 EST
On Mon, Nov 30, 2026 at 07:44 PM George Guo <dongtai.guo@xxxxxxxxx> wrote:
> test_buddy_alloc_free() picks an allocation size with
> alloc_free_sizes[(i * 5) % 8], where i is a signed int. That is a
> signed remainder, and building the BPF selftests with clang 19 fails:
>
> test_buddy.bpf.c:109:54: error: unsupported signed division, please convert to unsigned div/mod.
In June you reported that clang 19 cannot build libarena at all:
https://lore.kernel.org/bpf/20260630025809.74043-1-dongtai.guo@xxxxxxxxx/
fatal error: error in backend: Cannot select: AtomicCmpSwap<(s32)> ...
In function: arena_spin_lock_slowpath
arena_spin_lock_slowpath() still has the 32-bit cmpxchg.
libarena/Makefile still passes no -mcpu.
By that report the build with clang 19 fails with and without this patch.
The answer is the same as in June. Pls upgrade clang.
pw-bot: cr