Skip to content

Commit 05f578e

Browse files
committed
chore: Update to LLVM 19
Latest Rust nightly switched to LLVM 19, so we need to update in order to support rustc-llvm-proxy. LLVM 19 packages don't provide shared libraries anymore, so the usafe of `llvm-sys/force-dynamic` feature is dropped. Instead, we just let llvm-sys decide what kind of libraries to use. llvm-sys fails to build without libpolly being installed, which is not right, but needs to be fixed upstream. For now, we just install it in CI.
1 parent 7585ff7 commit 05f578e

File tree

5 files changed

+32
-18
lines changed

5 files changed

+32
-18
lines changed

.github/workflows/ci.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,9 @@ jobs:
5555
rust:
5656
- stable
5757
- beta
58-
# TODO: unpin nightly. There was a regression in
59-
# https://github.com/rust-lang/rust/compare/1cec373f6...becebb315 that causes
60-
# tests/btf/assembly/anon_struct_c.rs to fail to link.
61-
- nightly-2024-04-16
58+
- nightly
6259
llvm:
63-
- 18
60+
- 19
6461
- source
6562
name: rustc=${{ matrix.rust }} llvm=${{ matrix.llvm }}
6663
needs: llvm
@@ -121,7 +118,10 @@ jobs:
121118
echo -e deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.llvm }} main | sudo tee /etc/apt/sources.list.d/llvm.list
122119
123120
sudo apt update
124-
sudo apt -y install llvm-${{ matrix.llvm }}-dev
121+
# TODO(vadorovsky): Remove the requirement of libpolly. It's being
122+
# unnecessarily required by build.rs of llvm-sys, which does so based
123+
# on the output of llvm-config.
124+
sudo apt -y install llvm-${{ matrix.llvm }}-dev libpolly-${{ matrix.llvm }}-dev
125125
echo /usr/lib/llvm-${{ matrix.llvm }}/bin >> $GITHUB_PATH
126126
127127
- name: Restore LLVM
@@ -152,14 +152,14 @@ jobs:
152152
- uses: taiki-e/install-action@cargo-hack
153153

154154
- name: Check
155-
run: cargo hack check --feature-powerset --features llvm-sys/force-dynamic
155+
run: cargo hack check --feature-powerset
156156

157157
- name: Build
158-
run: cargo hack build --feature-powerset --features llvm-sys/force-dynamic
158+
run: cargo hack build --feature-powerset
159159

160160
- name: Test
161161
if: matrix.rust == 'nightly'
162-
run: cargo hack test --feature-powerset --features llvm-sys/force-dynamic
162+
run: cargo hack test --feature-powerset
163163

164164
- uses: actions/checkout@v4
165165
if: matrix.rust == 'nightly'
@@ -170,7 +170,7 @@ jobs:
170170

171171
- name: Install
172172
if: matrix.rust == 'nightly'
173-
run: cargo install --path . --no-default-features --features llvm-sys/force-dynamic
173+
run: cargo install --path . --no-default-features
174174

175175
# TODO: Remove this and run the integration tests on the local machine when they pass on 5.15.
176176
- name: Download debian kernels

.github/workflows/llvm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- id: ls-remote
1717
run: |
1818
set -euxo pipefail
19-
value=$(git ls-remote https://github.com/aya-rs/llvm-project.git refs/heads/rustc/18.0-2024-02-13 | cut -f1)
19+
value=$(git ls-remote https://github.com/aya-rs/llvm-project.git refs/heads/rustc/19.1-2024-07-30 | cut -f1)
2020
echo "sha=$value" >> "$GITHUB_OUTPUT"
2121
2222
- id: cache-key

Cargo.lock

+16-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ar = { version = "0.9.0" }
2828
aya-rustc-llvm-proxy = { version = "0.9.2", optional = true }
2929
gimli = { version = "0.31.0" }
3030
libc = { version = "0.2.155" }
31-
llvm-sys = { features = ["disable-alltargets-init"], version = "180.0.0-rc2" }
31+
llvm-sys = { features = ["disable-alltargets-init"], version = "191.0.0-rc1" }
3232
log = { version = "0.4.22" }
3333
thiserror = { version = "1.0.63" }
3434
tracing = "0.1"

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ files with embedded bitcode (.o), optionally stored inside ar archives (.a).
1717

1818
## Installation
1919

20-
The linker requires LLVM 18. It can use the same LLVM used by the rust compiler,
20+
The linker requires LLVM 19. It can use the same LLVM used by the rust compiler,
2121
or it can use an external LLVM installation.
2222

2323
If your target is `aarch64-unknown-linux-gnu` (i.e. Linux on Apple Silicon) you
@@ -33,14 +33,14 @@ cargo install bpf-linker
3333

3434
### Using external LLVM
3535

36-
On Debian based distributions you need to install the `llvm-18-dev`, `libclang-18-dev`
37-
and `libpolly-18-dev` packages. If your distro doesn't have them you can get them
36+
On Debian based distributions you need to install the `llvm-19-dev`, `libclang-19-dev`
37+
and `libpolly-19-dev` packages. If your distro doesn't have them you can get them
3838
from the official LLVM repo at https://apt.llvm.org.
3939

4040
On rpm based distribution you need the `llvm-devel` and `clang-devel` packages.
4141
If your distro doesn't have them you can get them from Fedora Rawhide.
4242

43-
Once you have installed LLVM 18 you can install the linker running:
43+
Once you have installed LLVM 19 you can install the linker running:
4444

4545
```sh
4646
cargo install bpf-linker --no-default-features

0 commit comments

Comments
 (0)