I'm writing a compiler in Rust using the llvm-ir crate but it only supports up to LLVM 19.
I need to compile Rust's LLVM IR output using my compiler. But running rustc --version --verbose
outputs the relevant information:
release: 1.87.0
LLVM version: 20.1.1
So the version i have installed can't be compiled. So i need a Rust version that uses LLVM 19 or lower.
I tried looking through the Rust Changelogs but i don't see mentions of the LLVM version. I tried looking through some of the source code but i could't make sense of it.
What are the ways for choosing a Rust version based on the LLVM version that they use? Do i look through the source code? Do i use a similar command?
Here are two ways:
Going through each Rust version and checking the LLVM version it uses using rustc. A very accessible and convenient way to do this is using https://rust.godbolt.org/ which lets you switch between versions quickly.
Going to the Rust git repository and looking at the commit history of llvm-project: https://github.com/rust-lang/rust/commits/master/src/llvm-project