Skip to content

Cross-compile BPF skeleton stubs for x86_64 dev builds #21

@Brad-Edwards

Description

@Brad-Edwards

Problem

The daemon cannot build on x86_64 dev machines because bpf_loader.c includes generated skeleton headers (owlbear_lsm.skel.h, owlbear_trace.skel.h, owlbear_kprobe.skel.h, owlbear_net.skel.h) that only exist after make -C ebpf on an ARM64 host with clang + bpftool.

This means the full daemon binary is unbuildable outside the Graviton3 instance. Unit tests work because bpf_event_convert.c was extracted, but you can't even compile-check main.c or bpf_loader.c locally.

Proposal

Generate stub skeleton headers (empty struct + no-op open/load/attach/destroy functions) that satisfy the compiler on non-ARM64 hosts. Gate via #ifdef __aarch64__ or a BPF_STUBS=1 make variable.

This unblocks make daemon on dev machines for syntax/type checking and local iteration.

Acceptance

  • make daemon BPF_STUBS=1 compiles on x86_64 with -Werror
  • Real skeletons still used on ARM64 builds

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions