Skip to content

Commit b6a291c

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 from now on, we use the `llvm-sys/force-dynamic` feaure only for LLVM built from source.
1 parent 7585ff7 commit b6a291c

File tree

5 files changed

+45
-16
lines changed

5 files changed

+45
-16
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 8 deletions
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,7 @@ 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+
sudo apt -y install llvm-${{ matrix.llvm }}-dev libpolly-${{ matrix.llvm }}-dev
125122
echo /usr/lib/llvm-${{ matrix.llvm }}/bin >> $GITHUB_PATH
126123
127124
- name: Restore LLVM
@@ -152,15 +149,29 @@ jobs:
152149
- uses: taiki-e/install-action@cargo-hack
153150

154151
- name: Check
152+
if: matrix.llvm == 'source'
155153
run: cargo hack check --feature-powerset --features llvm-sys/force-dynamic
156154

155+
- name: Check
156+
if: matrix.llvm != 'source'
157+
run: cargo hack check --feature-powerset
158+
157159
- name: Build
160+
if: matrix.llvm == 'source'
158161
run: cargo hack build --feature-powerset --features llvm-sys/force-dynamic
159162

163+
- name: Build
164+
if: matrix.llvm != 'source'
165+
run: cargo hack build --feature-powerset
166+
160167
- name: Test
161-
if: matrix.rust == 'nightly'
168+
if: matrix.llvm == 'source' && matrix.rust == 'nightly'
162169
run: cargo hack test --feature-powerset --features llvm-sys/force-dynamic
163170

171+
- name: Test
172+
if: matrix.llvm != 'source' && matrix.rust == 'nightly'
173+
run: cargo hack test --feature-powerset
174+
164175
- uses: actions/checkout@v4
165176
if: matrix.rust == 'nightly'
166177
with:
@@ -169,9 +180,13 @@ jobs:
169180
submodules: recursive
170181

171182
- name: Install
172-
if: matrix.rust == 'nightly'
183+
if: matrix.llvm == 'source' && matrix.rust == 'nightly'
173184
run: cargo install --path . --no-default-features --features llvm-sys/force-dynamic
174185

186+
- name: Install
187+
if: matrix.llvm != 'source' && matrix.rust == 'nightly'
188+
run: cargo install --path . --no-default-features
189+
175190
# TODO: Remove this and run the integration tests on the local machine when they pass on 5.15.
176191
- name: Download debian kernels
177192
if: matrix.rust == 'nightly' && runner.arch == 'ARM64'

.github/workflows/llvm.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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)