Skip to content

loader: Add -Wno-unused-command-line-argument on compiler tests.#43299

Merged
julianwiedmann merged 1 commit intocilium:mainfrom
ajmmm:pr/compiler-test-no-unused-args
Jan 18, 2026
Merged

loader: Add -Wno-unused-command-line-argument on compiler tests.#43299
julianwiedmann merged 1 commit intocilium:mainfrom
ajmmm:pr/compiler-test-no-unused-args

Conversation

@ajmmm
Copy link
Copy Markdown
Member

@ajmmm ajmmm commented Dec 12, 2025

When upgrading from Rocky Linux 9.6 to 9.7, the distributed LLVM toolchain was jumped from 19.1 to 20.1. Since then, the datapath compiler test has failed with the following message for both bpf_lxc.c and bpf_host.c:

=== RUN   TestPrivilegedCompile
=== RUN   TestPrivilegedCompile/obj:bpf_lxc.o
=== RUN   TestPrivilegedCompile/obj:bpf_host.o
=== RUN   TestPrivilegedCompile/c:bpf_lxc.c
    logger.go:256: time=2025-12-12T16:40:58.313Z level=ERROR source=/home/ajm/cilium/pkg/datapath/loader/compile.go:219 msg="Failed to compile bpf_lxc.c: exit status 1" compilerPID=33313
    logger.go:256: time=2025-12-12T16:40:58.330Z level=WARN source=/home/ajm/cilium/pkg/datapath/loader/compile.go:227 msg="clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]"
    compile_test.go:39:
        	Error Trace:	/home/ajm/cilium/pkg/datapath/loader/compile_test.go:39
        	Error:      	Received unexpected error:
        	            	Failed to compile bpf_lxc.c: exit status 1
        	Test:       	TestPrivilegedCompile/c:bpf_lxc.c
=== RUN   TestPrivilegedCompile/c:bpf_host.c
    logger.go:256: time=2025-12-12T16:40:59.132Z level=ERROR source=/home/ajm/cilium/pkg/datapath/loader/compile.go:219 msg="Failed to compile bpf_host.c: exit status 1" compilerPID=33314
    logger.go:256: time=2025-12-12T16:40:59.173Z level=WARN source=/home/ajm/cilium/pkg/datapath/loader/compile.go:227 msg="clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]"
    compile_test.go:39:
        	Error Trace:	/home/ajm/cilium/pkg/datapath/loader/compile_test.go:39
        	Error:      	Received unexpected error:
        	            	Failed to compile bpf_host.c: exit status 1
        	Test:       	TestPrivilegedCompile/c:bpf_host.c
--- FAIL: TestPrivilegedCompile (12.88s)
    --- PASS: TestPrivilegedCompile/obj:bpf_lxc.o (5.51s)
    --- PASS: TestPrivilegedCompile/obj:bpf_host.o (5.84s)
    --- FAIL: TestPrivilegedCompile/c:bpf_lxc.c (0.62s)
    --- FAIL: TestPrivilegedCompile/c:bpf_host.c (0.83s)

This is also true for Ubuntu 25.10 which also ships with LLVM 20.1, and goes away if downgraded back to 19.1.

This commit adds the -Wno-unused-command-line-argument flag to the test to suppress this fault, which is only observed when running privileged tests. It does not appear when running Cilium and running a workload.

No functional change.

Add -Wno-unused-command-line-argument to loader/compiler unit test to mitigate test fault with LLVM 20.1.

When upgrading from Rocky Linux 9.6 to 9.7, the distributed LLVM
toolchain was jumped from 19.1 to 20.1. Since then, the datapath
compiler test has failed with the following message for both
bpf_lxc.c and bpf_host.c:

  clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument]

This is also true for Ubuntu 25.10 which also ships with LLVM 20.1,
and goes away if downgraded back to 19.1.

This commit adds the -Wno-unused-command-line-argument flag to the
test to suppress this fault, which is only observed when running
privileged tests. It does not appear when running Cilium and running
a workload.

No functional change.

Signed-off-by: Alasdair McWilliam <alasdair.mcwilliam@isovalent.com>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Dec 12, 2025
@ajmmm
Copy link
Copy Markdown
Member Author

ajmmm commented Dec 12, 2025

/test

@ajmmm ajmmm marked this pull request as ready for review December 12, 2025 17:35
@ajmmm ajmmm requested a review from a team as a code owner December 12, 2025 17:35
@ajmmm ajmmm requested a review from rgo3 December 12, 2025 17:35
@rgo3
Copy link
Copy Markdown
Contributor

rgo3 commented Dec 16, 2025

Any idead why -c is now unused?

@ajmmm
Copy link
Copy Markdown
Member Author

ajmmm commented Dec 17, 2025

Any idead why -c is now unused?

No, I did some digging but couldn't find anything that stood out to me.

  • Thought it might be a difference in how Rocky builds the 19.1 package vs 20.1 package, so compared the spec files. There are build differences but nothing obvious.
  • That led me to test on Ubuntu which showed the same issue, so ruled out how the distribution builds it.
  • Thought it might be an AArch64 specific issue so tested on Rocky x86 and the same issue bubbled up.
  • Dug in the LLVM & Clang 20.1 release notes but there's a lot of changes and as I say nothing stood out to me around unused command line arguments.
  • I don't know the LLVM codebase so didn't look too much into that. There were no commits that stood out (to me) about what might have changed. But I confess I didn't look too hard.

At this point I tested the downgrade on Ubuntu back to LLVM 19.1 and the issue went away.

Unfortunately you can't do this on Rocky 9.7 because they've built some other components that now depend on LLVM 20.1 and it causes conflicts.

At this point I cut my losses and this PR appeared... :D

@rgo3 rgo3 added area/loader Impacts the loading of BPF programs into the kernel. area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/ci This PR makes changes to the CI. labels Dec 17, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Dec 17, 2025
@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it
has not had recent activity. It will be closed if no further activity
occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label Jan 17, 2026
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jan 17, 2026
@julianwiedmann julianwiedmann added this pull request to the merge queue Jan 18, 2026
Merged via the queue into cilium:main with commit 3257358 Jan 18, 2026
82 checks passed
@ajmmm ajmmm deleted the pr/compiler-test-no-unused-args branch January 20, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. area/loader Impacts the loading of BPF programs into the kernel. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI. stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants