Upgrade to LLVM 20.1

This commit is contained in:
Sofia 2025-07-18 23:03:53 +03:00
parent 92f12e90eb
commit 9749a29680
4 changed files with 36 additions and 70 deletions

52
Cargo.lock generated
View File

@ -3,13 +3,10 @@
version = 4 version = 4
[[package]] [[package]]
name = "aho-corasick" name = "anyhow"
version = "1.1.3" version = "1.0.98"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "cc" name = "cc"
@ -43,23 +40,18 @@ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
[[package]] [[package]]
name = "llvm-sys" name = "llvm-sys"
version = "160.2.1" version = "201.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e73861901245d32e1c3d8b35b639cf100859b4cd0c9da56fe0273040acbb3ea4" checksum = "9bb947e8b79254ca10d496d0798a9ba1287dcf68e50a92b016fec1cc45bef447"
dependencies = [ dependencies = [
"anyhow",
"cc", "cc",
"lazy_static", "lazy_static",
"libc", "libc",
"regex", "regex-lite",
"semver", "semver",
] ]
[[package]]
name = "memchr"
version = "2.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.95" version = "1.0.95"
@ -79,40 +71,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "regex" name = "regex-lite"
version = "1.11.1" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]] [[package]]
name = "reid" name = "reid"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"colored", "colored",
"llvm-sys",
"reid-lib", "reid-lib",
"thiserror", "thiserror",
] ]

View File

@ -77,42 +77,42 @@ change erratically.
This is what worked for me, might not (probably) work for you, depending on This is what worked for me, might not (probably) work for you, depending on
various versions of various libraries. various versions of various libraries.
### Compiling LLVM 16.0.0 ### Compiling LLVM 20.1.8
#### Context #### Context
Context for my computer. I am on ArchLinux, and here are some libraries and Context for my computer. I am on ArchLinux, and here are some libraries and
their current versions that I have installed as of compiling, I'm not sure what their current versions that I have installed as of compiling, I'm not sure what
of them are relevant, if any, but saving them here still feels like a good idea of them are relevant, if any, but saving them here still feels like a good idea
for the future: for the future:
- `cmake 3.27.0-1` - `clang 19.1.7-2`
- `lib32-llvm-libs 15.0.7-1` - `cmake 4.0.2-1`
- `llvm 15.0.7-3` - `extra-cmake-modules 6.14.0-1`
- `llvm-libs 15.0.7-3` - `gcc 15.1.1+r7+gf36ec88aa85a-1`
- `gcc 13.1.1-2` - `gcc-libs 15.1.1+r7+gf36ec88aa85a-1`
- `gcc-libs 13.1.1-2` - `lib32-gcc-libs 15.1.1+r7+gf36ec88aa85a-1`
- `lib32-gcc-libs 13.1.1-2` - `lib32-llvm-libs 1:19.1.7-2`
- `lld 15.0.7-2` - `libgccjit 15.1.1+r7+gf36ec88aa85a-1`
- `lldb 15.0.7-3` - `lld 19.1.7-1`
- `clang 15.0.7-9` - `lldb 19.1.7-2`
- `llvm 19.1.7-2`
- `llvm-libs 19.1.7-2`
- `llvm14 14.0.6-5`
- `llvm14-libs 14.0.6-5`
- `llvm15 15.0.7-3`
- `llvm15-libs 15.0.7-3`
- `make 4.4.1-2` - `make 4.4.1-2`
- `automake 1.16.5-2`
#### Commands #### Commands
```sh ```sh
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-16.0.0.src.tar.xz git clone https://github.com/llvm/llvm-project.git --depth=1 --branch=llvmorg-20.1.8
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/cmake-16.0.0.src.tar.xz
tar xvf llvm-16.0.0.src.tar.xz cd llvm_project
tar xvf cmake-16.0.0.src.tar.xz
mv cmake-16.0.0.src cmake cmake llvm -B build -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INCLUDE_TESTS=OFF -DLLVM_BUILD_BENCHMARKS=OFF
cd llvm-16.0.0.src make -j23
cmake -B build -DCMAKE_INSTALL_PREFIX=$HOME/llvm-16 -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INCLUDE_TESTS=OFF
make -j8
``` ```
*Also Note:* Building LLVM with `Ninja` was not successful for me, but this *Also Note:* Building LLVM with `Ninja` was not successful for me, but this
@ -121,11 +121,11 @@ method was. Ninja may be successful with you, to try it, add `-G Ninja` to the
### Building this crate itself ### Building this crate itself
Assuming `llvm-16.0.0.src` from the previous step was at Assuming `llvm-project` from the previous step was at
`/path/llvm-16.0.0.src`, building this crate can be done via the following command: `/path/llvm-project`, building this crate can be done via the following command:
```sh ```sh
LLVM_SYS_160_PREFIX=/path/llvm-16.0.0.src/build cargo build LLVM_SYS_201_PREFIX=/path/llvm-project/build cargo build
``` ```
## In conclusion ## In conclusion

View File

@ -7,6 +7,6 @@ edition = "2024"
[dependencies] [dependencies]
## LLVM Bindings ## LLVM Bindings
llvm-sys = "160" llvm-sys = {version ="201.0.1", features=["force-static"] }
## Make it easier to generate errors ## Make it easier to generate errors
thiserror = "1.0.44" thiserror = "1.0.44"

View File

@ -12,8 +12,6 @@ default = ["color"]
color = ["colored"] color = ["colored"]
[dependencies] [dependencies]
## LLVM Bindings
llvm-sys = "160"
## Make it easier to generate errors ## Make it easier to generate errors
thiserror = "1.0.44" thiserror = "1.0.44"
reid-lib = { path = "../reid-llvm-lib" } reid-lib = { path = "../reid-llvm-lib" }