From 20eb50bb7d5a8c186e456eb4fa8dd9a5bb03338f Mon Sep 17 00:00:00 2001 From: WizzardSK Date: Tue, 28 Jul 2026 18:29:14 +0200 Subject: [PATCH] ci: add a Linux aarch64 build There is no rust-linux-aarch64.yml template yet (libretro/libretro-super#2030) and the rust build image is amd64-only, so this cross-compiles from that image the same way it already cross-compiles the Apple and Android arm64 targets: add the target, the cross linker via CARGO_TARGET_*_LINKER, and an aarch64 strip. before_script inlines the rustup target add rather than extending .rust-target-install, since the cross linker has to be apt-installed in the same block; the toolchain-pin handling from the #91899 post-mortem is unchanged. --- .gitlab-ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94931223..94172468 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -116,6 +116,29 @@ libretro-build-linux-x64: variables: RUST_TARGET: x86_64-unknown-linux-gnu +# Linux aarch64 +# Cross-compiled from the same image as the x64 job, the way that image already +# cross-compiles the Apple and Android arm64 targets. There is no +# rust-linux-aarch64.yml template yet (libretro/libretro-super#2030) and the +# rust image is amd64-only, so the target and its linker are added here. +# +# `before_script` is spelled out instead of extending `.rust-target-install` +# because the cross linker has to be installed as well; the `rustup target add +# ${RUST_TARGET}` line is the same one that helper provides, so the #91899 +# toolchain-pin trap is handled identically. +libretro-build-linux-aarch64: + extends: + - .libretro-rust-linux-x64 + - .core-defs + variables: + RUST_TARGET: aarch64-unknown-linux-gnu + TARGET_ARCH: aarch64-unknown-linux-gnu + STRIP: aarch64-linux-gnu-strip + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + before_script: + - apt-get update -qy && apt-get install -yq gcc-aarch64-linux-gnu + - rustup target add ${RUST_TARGET} + # macOS 64-bit libretro-build-osx-x64: extends: