Skip to content

ci: upgrade LLVM to 20.1, drop LLVM 11 #1800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2025
Merged

Conversation

ti-mo
Copy link
Collaborator

@ti-mo ti-mo commented Jun 10, 2025

LLVM 11 is getting a bit long in the tooth and doesn't support decl tags.

Target 14, 17 and the newly-released LLVM 20.

LLVM 20.1 is out, and LLVM 11 has reached its 5th birthday.

LLVM 11 notably doesn't support decl tags, which we want to start using in
loader.c, so drop it from CI.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo requested a review from a team as a code owner June 10, 2025 11:40
@ti-mo ti-mo force-pushed the tb/upgrade-llvm-20 branch from 336cd83 to 29b0fb0 Compare June 10, 2025 13:38
@ti-mo ti-mo requested a review from dylandreimerink as a code owner June 10, 2025 13:38
@ti-mo ti-mo changed the title ci: upgrade LLVM to 20.1, drop LLVM 11 support ci: upgrade LLVM to 20.1, drop LLVM 11 Jun 10, 2025
@dylandreimerink
Copy link
Member

unknown insn class 6

That can't be good 🫣

@ti-mo
Copy link
Collaborator Author

ti-mo commented Jun 10, 2025

unknown insn class 6

That can't be good 🫣

Looking into it, I think LLVM20 may be using ISAv3 by default.

@ti-mo
Copy link
Collaborator Author

ti-mo commented Jun 10, 2025

Found it: llvm/llvm-project@7852ebc. -mcpu=v3 is now the default.

@yonghong-song This is slightly surprising given this breaks existing tools on kernels <5.1 if they don't specify -mcpu=v1/v2 explicitly. The kernel docs (https://docs.kernel.org/bpf/bpf_devel_QA.html#q-new-bpf-instruction-for-kernel-and-llvm) need to be updated as well:

By default the generic processor target is used, which is the base instruction set (v1) of BPF.

I'll set -mcpu=v2 here until we drop <5.1 in CI.

@ti-mo ti-mo force-pushed the tb/upgrade-llvm-20 branch from 29b0fb0 to b8c74fe Compare June 10, 2025 14:27
A prior commit upgraded the toolchain to this set of LLVM versions.

-mcpu=v3 is now the default in LLVM 20, so specify -mcpu=v2 explicitly to
maintain compatibility with 4.x kernels.

Signed-off-by: Timo Beckers <timo@isovalent.com>
@ti-mo ti-mo force-pushed the tb/upgrade-llvm-20 branch from b8c74fe to cc0c1e2 Compare June 10, 2025 14:40
@ti-mo ti-mo merged commit 87af60f into cilium:main Jun 10, 2025
17 of 18 checks passed
@ti-mo ti-mo deleted the tb/upgrade-llvm-20 branch June 10, 2025 14:52
@yonghong-song
Copy link

Found it: llvm/llvm-project@7852ebc. -mcpu=v3 is now the default.

@yonghong-song This is slightly surprising given this breaks existing tools on kernels <5.1 if they don't specify -mcpu=v1/v2 explicitly. The kernel docs (https://docs.kernel.org/bpf/bpf_devel_QA.html#q-new-bpf-instruction-for-kernel-and-llvm) need to be updated as well:

By default the generic processor target is used, which is the base instruction set (v1) of BPF.

I'll set -mcpu=v2 here until we drop <5.1 in CI.

Yes, in llvm20 we move -mcpu=v3 as default to handle some atomic insns (esp. for arm64). Please to use -mcpu=v1/v2 as appropriate. Thanks.

@yonghong-song
Copy link

Found it: llvm/llvm-project@7852ebc. -mcpu=v3 is now the default.

@yonghong-song This is slightly surprising given this breaks existing tools on kernels <5.1 if they don't specify -mcpu=v1/v2 explicitly. The kernel docs (https://docs.kernel.org/bpf/bpf_devel_QA.html#q-new-bpf-instruction-for-kernel-and-llvm) need to be updated as well:

Will update the doc soon. thanks.

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.

3 participants