Repository navigation
template: build warning-free under clang 22 - #37
Merged
Merged
Conversation
- gen-vmlinux.sh: prepend `#pragma clang system_header` to the generated vmlinux.h. bpftool dumps the kernel's tagged anonymous members verbatim (`struct foo;` inside a union), which clang 22 reports under -Wmissing-declarations. Diagnostics only; CO-RE is untouched. - runqlat.bpf.c: replace the `#pragma unroll` log2 loop (clang 22 refuses to unroll a loop with an early exit) with the branchless binary-search log2 from libbpf-tools. Same bucketing, fixed instruction count. - Makefile: default TOOLCHAIN_TAG to v0.10.1, matching the synced vendor.
julian-goldstein
force-pushed
the
toolchain-v0.10.1
branch
from
October 27, 2026 22:51
0970501 to
4c1d66d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-Wmissing-declarationswarnings from vmlinux.h. bpftool dumps the kernel's tagged anonymous members verbatim (struct slock_owned;inside a union), which clang 22 now flags.gen-vmlinux.shprepends#pragma clang system_headerto the generated header. Diagnostics only: CO-RE relocations andpreserve_access_indexare unaffected, and user headers insrc/bpf/includekeep full-Wall.loop not unrolledwarning in runqlat.bpf.c. clang 22 refuses#pragma unrollon a loop with an earlybreak. The log2 bucketing now uses the branchless binary-search log2 from libbpf-tools: samefloor(log2(delta))result, fixed instruction count, nothing for the verifier to bound.TOOLCHAIN_TAGto v0.10.1, matching the already-synced vendored toolchain (it still said v0.1, which no longer exists on the release server).Test plan
scripts/newinto a scratch dir, thenmake: both BPF units compile with the v0.10.1 clang, link intobin/probe.bpf.o, esbuild bundles.make clean-bpf && make bpfproduces zero warning lines (previously 19).