Summary
The recently-merged libarena library (commit 86426a28c52d) declares void free(void __arena *ptr) which collides with an enum constant free = 1 in the s390x-generated vmlinux.h. This breaks the s390x selftest build deterministically for every PR.
Failure Details
- Test / Component: libarena BPF selftest build (all .bpf.c files including libarena/common.h)
- Frequency: Every CI run since libarena was merged (~Apr 27, 2026). Observed in 8+ independent PRs.
- Failure mode: Build error — clang rejects redefinition of
free as different kind of symbol
- Affected architectures: s390x only (x86_64 and aarch64 vmlinux.h do not contain the conflicting enum)
- CI runs observed:
Root Cause Analysis
libarena/include/libarena/common.h:53 declares:
void free(void __arena *ptr);
This header includes <vmlinux.h> which on s390x contains an enum constant:
free = 1, /* vmlinux.h:9209 */
The enum constant comes from BTF extraction of a kernel type specific to the s390x kernel configuration. When clang processes the libarena BPF sources, it first sees free as an enum enumerator (integer constant) from vmlinux.h, then encounters the function declaration void free(...), producing:
error: redefinition of 'free' as different kind of symbol
The Makefile already had -Wno-incompatible-library-redeclaration (line 55) to suppress warnings about redefining the C library free(), but this flag only handles type-mismatched redeclarations of the same kind of symbol. An enum-constant-to-function conflict is a "different kind" error that cannot be suppressed by any warning flag.
The issue was introduced by commit 86426a28c52d ("selftests/bpf: Add buddy allocator for libarena") which added the free() declaration and definition. The libarena v9 patches were merged without s390x CI validation catching this because the s390x build failure was already masked by the same error.
Proposed Fix
Rename the function from free() to arena_free() and provide a #define free(ptr) arena_free(ptr) macro for API compatibility. This mirrors the existing pattern for malloc() / malloc_internal(). See attached patch: 0001-selftests-bpf-Rename-libarena-free-to-arena_free-to-.patch.
Changes:
common.h: Replace void free(...) declaration with void arena_free(...) + #define free(ptr) arena_free(ptr)
common.bpf.c: Rename function definition from free() to arena_free()
Makefile: Remove the now-unnecessary -Wno-incompatible-library-redeclaration flag
Impact
Without this fix, every s390x CI build fails at the selftest compilation stage. All s390x test jobs are blocked — no s390x test results are produced for any PR. This means s390x-specific BPF regressions go undetected.
References
Summary
The recently-merged libarena library (commit 86426a28c52d) declares
void free(void __arena *ptr)which collides with an enum constantfree = 1in the s390x-generated vmlinux.h. This breaks the s390x selftest build deterministically for every PR.Failure Details
freeas different kind of symbolRoot Cause Analysis
libarena/include/libarena/common.h:53declares:This header includes
<vmlinux.h>which on s390x contains an enum constant:The enum constant comes from BTF extraction of a kernel type specific to the s390x kernel configuration. When clang processes the libarena BPF sources, it first sees
freeas an enum enumerator (integer constant) from vmlinux.h, then encounters the function declarationvoid free(...), producing:The Makefile already had
-Wno-incompatible-library-redeclaration(line 55) to suppress warnings about redefining the C libraryfree(), but this flag only handles type-mismatched redeclarations of the same kind of symbol. An enum-constant-to-function conflict is a "different kind" error that cannot be suppressed by any warning flag.The issue was introduced by commit
86426a28c52d("selftests/bpf: Add buddy allocator for libarena") which added thefree()declaration and definition. The libarena v9 patches were merged without s390x CI validation catching this because the s390x build failure was already masked by the same error.Proposed Fix
Rename the function from
free()toarena_free()and provide a#define free(ptr) arena_free(ptr)macro for API compatibility. This mirrors the existing pattern formalloc()/malloc_internal(). See attached patch:0001-selftests-bpf-Rename-libarena-free-to-arena_free-to-.patch.Changes:
common.h: Replacevoid free(...)declaration withvoid arena_free(...)+#define free(ptr) arena_free(ptr)common.bpf.c: Rename function definition fromfree()toarena_free()Makefile: Remove the now-unnecessary-Wno-incompatible-library-redeclarationflagImpact
Without this fix, every s390x CI build fails at the selftest compilation stage. All s390x test jobs are blocked — no s390x test results are produced for any PR. This means s390x-specific BPF regressions go undetected.
References