LLVM 22.1
Posted: Wed Feb 25, 2026 1:10 am
Released last night, LLVM 22.1 stable. It's not considered stable until .1 (gcc does that now too)
So, I figured I'd get started on it. It compiled uneventfully, I just plugged it into my custom PKGBUILDs (options are all still valid etc.)
After that, the first thing to test is... can rust build with/against it.
No! It failed. Firstly I missed link-shared = false on my last Rust build so the shared LLVM libraries were broken sonames. Restart with a downloaded cargo and rustc to build the bootstrap. Then it failed soon after bootstrap with a missing header llvm/Passes/PassPlugin.h
I was all WTF, did they remove that header and implement it some other way? No, they just moved it into Plugins. It seems silly, as it's the only file in there. The other, related includes (being included by path) are still in Passes.
So I grepped for it in the rust source, and found it all over the place in llvm-project, but my build isn't going there as I'm using my own. It was only ONE place I needed to change it:
src/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
The #include line Changed from "llvm/Passes/PassPlugin.h" to "llvm/Plugins/Passplugin.h"
(I didn't make a patch as I was just testing, and it's easier to just change a few characters in a file anyway)
Surely it couldn't be that easy, and this is just the first speed bump. No, that was all that was wrong. Rust 1.93.1 otherwise builds and works fine (both 64 and 32 bit targets) with LLVM 22 (and I did build it in statically this time). I used my rust build to bootstrap another.
My rust compiler and cargo work. Now the real test... can this LLVM/Clang 22 and Rust compile Firefox. I already know I can't do the WASI thing yet, as the wasi-sdk project isn't updated for LLVM 22 (that just won't work until it is) but if I can compile Firefox without that for now, then the LLVM upgrade will be viable.
So, I figured I'd get started on it. It compiled uneventfully, I just plugged it into my custom PKGBUILDs (options are all still valid etc.)
After that, the first thing to test is... can rust build with/against it.
No! It failed. Firstly I missed link-shared = false on my last Rust build so the shared LLVM libraries were broken sonames. Restart with a downloaded cargo and rustc to build the bootstrap. Then it failed soon after bootstrap with a missing header llvm/Passes/PassPlugin.h
I was all WTF, did they remove that header and implement it some other way? No, they just moved it into Plugins. It seems silly, as it's the only file in there. The other, related includes (being included by path) are still in Passes.
So I grepped for it in the rust source, and found it all over the place in llvm-project, but my build isn't going there as I'm using my own. It was only ONE place I needed to change it:
src/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
The #include line Changed from "llvm/Passes/PassPlugin.h" to "llvm/Plugins/Passplugin.h"
(I didn't make a patch as I was just testing, and it's easier to just change a few characters in a file anyway)
Surely it couldn't be that easy, and this is just the first speed bump. No, that was all that was wrong. Rust 1.93.1 otherwise builds and works fine (both 64 and 32 bit targets) with LLVM 22 (and I did build it in statically this time). I used my rust build to bootstrap another.
My rust compiler and cargo work. Now the real test... can this LLVM/Clang 22 and Rust compile Firefox. I already know I can't do the WASI thing yet, as the wasi-sdk project isn't updated for LLVM 22 (that just won't work until it is) but if I can compile Firefox without that for now, then the LLVM upgrade will be viable.