Skip to content

Build issues with LIBXDP_STATIC and BPF target includes (Arch Linux) #87

@Emmanuel326

Description

@Emmanuel326

Hi! @gamemann

While trying to build this project on Arch Linux, I ran into a couple of
build-system issues that seem to be masked on Debian/Ubuntu setups.

Environment

  • Distro: Arch Linux
  • Compiler: clang
  • Kernel: 6.x
  • libconfig: 1.8.2
  • libbpf/libxdp: system packages

Issue 1: libconfig detection

The loader unconditionally links against -lconfig, but there is no
early check for libconfig availability. This causes confusing linker
errors when libconfig is missing.

I added a small pkg-config check that fails early, while skipping
make clean, which seems to improve UX without changing behavior.

Issue 2: LIBXDP_STATIC=1 fails to link

When LIBXDP_STATIC=1 (default), the loader fails with unresolved symbols
(e.g. xdp_program__*, bpf_map_*). This appears to be related to how
libbpf/libxdp objects are collected and linked.

Building with LIBXDP_STATIC=0 links correctly, but then the BPF target
(-target bpf) fails due to system header usage, suggesting missing
kernel/UAPI isolation for the BPF build.

Proposed approach

  • Document LIBXDP_STATIC=0 as the supported/default mode
    or
  • Fix static linking by explicitly linking libbpf/libxdp (or using
    pkg-config for both)
  • Isolate BPF compilation flags/headers (common pattern in libbpf-based
    projects)

I’m happy to submit a PR once direction is agreed on.

Thanks for the project — it’s been useful to study!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions