Skip to content

Commit

Permalink
Update CI to LLVM 18
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Feb 22, 2024
1 parent d491852 commit d203c35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
build:
runs-on: ubuntu-20.04
env:
CC: clang-17
CXX: clang-17
CFLAGS: "-flto -fuse-ld=lld-17"
CXXFLAGS: "-flto -fuse-ld=lld-17"
CC: clang-18
CXX: clang-18
CFLAGS: "-flto -fuse-ld=lld-18"
CXXFLAGS: "-flto -fuse-ld=lld-18"
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo ./llvm.sh 18
sudo apt-get install -y crossbuild-essential-arm64
- uses: actions/cache@v4
with:
Expand All @@ -41,19 +41,19 @@ jobs:
rustup target add --toolchain nightly x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
- name: Build x86_64
env:
CARGO_HOST_LINKER: "clang-17"
CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-17"
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=x86_64-unknown-linux-gnu"
CARGO_HOST_LINKER: "clang-18"
CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-18"
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-18 -Clink-arg=-fuse-ld=lld-18 -Clink-arg=--target=x86_64-unknown-linux-gnu"
run: cargo +nightly -Ztarget-applies-to-host -Zhost-config build --verbose --release --target=x86_64-unknown-linux-gnu
- uses: actions/upload-artifact@v4
with:
name: hath-rust-x86_64
path: target/x86_64-unknown-linux-gnu/release/hath-rust
- name: Build aarch64
env:
CARGO_HOST_LINKER: "clang-17"
CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-17"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=aarch64-unknown-linux-gnu"
CARGO_HOST_LINKER: "clang-18"
CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-18"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-18 -Clink-arg=-fuse-ld=lld-18 -Clink-arg=--target=aarch64-unknown-linux-gnu"
run: cargo +nightly -Ztarget-applies-to-host -Zhost-config build --verbose --release --target=aarch64-unknown-linux-gnu
- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
FROM --platform=linux/amd64 rust:bookworm AS builder

ARG LLVM_VERSION=17
ARG LLVM_VERSION=18
ENV CC=clang-${LLVM_VERSION} CXX=clang-${LLVM_VERSION} CFLAGS="-flto -fuse-ld=lld-${LLVM_VERSION}" CXXFLAGS="-flto -fuse-ld=lld-${LLVM_VERSION}"

WORKDIR /usr/src/myapp
Expand Down

0 comments on commit d203c35

Please sign in to comment.