Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:

jobs:
ci:
runs-on: ubuntu-24.04
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}

timeout-minutes: 70
timeout-minutes: ${{ matrix.arch == 'arm64' && 150 || 70 }}

strategy:
fail-fast: false
Expand All @@ -21,7 +21,7 @@ jobs:

arch:
- x86_64
# arm64
- arm64

config:
- defconfig
Expand All @@ -48,13 +48,16 @@ jobs:
echo 'IMAGE_PATH=arch/x86/boot/bzImage' >> $GITHUB_ENV
echo 'QEMU_ARCH=x86_64' >> $GITHUB_ENV
echo 'QEMU_ARGS=-append console=ttyS0' >> $GITHUB_ENV
echo 'GCC_DEB=gcc-15.deb' >> $GITHUB_ENV
echo 'LIBGCCJIT_TARGETS=x86_64-linux-gnu x86_64-unknown-linux-gnu' >> $GITHUB_ENV
- if: matrix.arch == 'arm64'
run: |
echo 'MAKE_ARCH=ARCH=arm64' >> $GITHUB_ENV
echo 'MAKE_CROSS_COMPILE=CROSS_COMPILE=aarch64-linux-gnu-' >> $GITHUB_ENV
echo 'IMAGE_PATH=arch/arm64/boot/Image.gz' >> $GITHUB_ENV
echo 'QEMU_ARCH=aarch64' >> $GITHUB_ENV
echo 'QEMU_ARGS=-machine virt' >> $GITHUB_ENV
echo 'QEMU_ARGS=-machine virt -cpu cortex-a72' >> $GITHUB_ENV
echo 'GCC_DEB=gcc-15-aarch64.deb' >> $GITHUB_ENV
echo 'LIBGCCJIT_TARGETS=aarch64-unknown-linux-gnu aarch64-unknown-none-softfloat' >> $GITHUB_ENV

- if: matrix.output == 'src'
run: |
Expand All @@ -72,9 +75,6 @@ jobs:
sudo apt-get -y update
sudo apt-get -y --no-install-recommends install bc file git make flex bison libelf-dev libssl-dev curl python3 llvm clang lld binutils qemu-system-x86 qemu-system-arm

- if: matrix.arch == 'arm64'
run: sudo apt-get -y --no-install-recommends install gcc-aarch64-linux-gnu libc6-dev-arm64-cross

# Setup: checkout Linux source tree.
- if: matrix.tree == 'torvalds'
run: git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux
Expand Down Expand Up @@ -118,8 +118,8 @@ jobs:
sudo apt-get install clang-19
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 190

curl --proto '=https' --tlsv1.2 -sSfLO https://github.com/rust-lang/gcc/releases/latest/download/gcc-15.deb
sudo dpkg -i gcc-15.deb
curl --proto '=https' --tlsv1.2 -sSfLO https://github.com/rust-lang/gcc/releases/latest/download/$GCC_DEB
sudo dpkg -i $GCC_DEB

git clone --depth 1 https://github.com/rust-lang/rustc_codegen_gcc

Expand All @@ -133,11 +133,13 @@ jobs:

# Since the Makefile uses the sysroot provided by rustup, we need to
# manually copy libgccjit.so in this sysroot directory.
dir1=~/.rustup/toolchains/$rust_version-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/lib/x86_64-linux-gnu/
dir2=~/.rustup/toolchains/$rust_version-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/lib/x86_64-unknown-linux-gnu/
mkdir -p $dir1 $dir2
ln -s /usr/lib/libgccjit.so $dir1/libgccjit.so
ln -s /usr/lib/libgccjit.so $dir2/libgccjit.so
# cg_gcc looks it up in a directory named after the kernel's Rust target.
host_triple=$(uname -m)-unknown-linux-gnu
for target in $LIBGCCJIT_TARGETS; do
dir=~/.rustup/toolchains/$rust_version-$host_triple/lib/rustlib/$host_triple/codegen-backends/lib/$target/
mkdir -p $dir
ln -s /usr/lib/libgccjit.so $dir/libgccjit.so
done

cd rustc_codegen_gcc
echo 'gcc-path = "/usr/lib"' > config.toml
Expand Down
Loading