Skip to content

fix(bpf) Allow vmlinux.h from kernel 6.19+ to compile - #202

Merged
nickschuch merged 1 commit into
mainfrom
t3/fix-failing-head-builds
Nov 27, 2026
Merged

nickschuch merged 1 commit into
mainfrom
t3/fix-failing-head-builds

Conversation

@nickschuch

Copy link
Copy Markdown
Contributor

Summary

  • Kernels from 6.19 are built with -fms-extensions, so the vmlinux.h that bpf2go dumps from the runner's kernel can contain tagged structs embedded as anonymous members (e.g. struct ns_tree; inside struct ns_common).
  • Our -Wall -Werror flags reject that with declaration does not declare anything [-Werror,-Wmissing-declarations], which breaks the test job on main and open PRs after the runner image moved to Ubuntu 26.04.
  • Pass -fms-extensions -Wno-microsoft-anon-tag to bpf2go in mise.toml, matching the flags the kernel uses.

Testing

  • Reproduced the error with a two-struct C file using clang 19.1.4 from alpine:3.21 (the Dockerfile base): fails with the current flags, compiles with the new flags.
  • docker build --target=test . passes locally (build, lint, test, race tests).
  • Not run: the CI workflow on an Ubuntu 26.04 runner. The local host runs kernel 6.18, so its generated header does not contain the affected constructs.

- Kernels from 6.19 embed tagged structs as anonymous members, which needs -fms-extensions to parse.
- Pass -fms-extensions and -Wno-microsoft-anon-tag to bpf2go cflags so the dumped vmlinux.h builds.
@nickschuch
nickschuch merged commit f55494c into main Nov 27, 2026
10 checks passed
@nickschuch
nickschuch deleted the t3/fix-failing-head-builds branch November 27, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants