Skip to content

[bpf-ci-bot] libarena free() symbol clash breaks s390x selftest build #481

@kernel-patches-review-bot

Description

@kernel-patches-review-bot

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

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:

  1. common.h: Replace void free(...) declaration with void arena_free(...) + #define free(ptr) arena_free(ptr)
  2. common.bpf.c: Rename function definition from free() to arena_free()
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions