From e2d58c112ba8041f47dd94e5d130b142208562f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Wed, 7 Aug 2024 16:12:06 +0200 Subject: [PATCH] Fix CI AArch64 Linux musl builds This is required to get PR #640 and further work on the repository moving. --- .cargo/config.toml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 82d1de25..aea7314b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,9 +1,19 @@ -# Remove this if targeting AArch64 from an AArch64 Linux box +# May need to remove these if targeting AArch64 from an AArch64 Linux box + [target.'cfg(all(target_os = "linux", target_arch = "aarch64"))'] -runner = 'qemu-aarch64' +runner = "qemu-aarch64" [target.aarch64-unknown-linux-gnu] -linker = 'aarch64-linux-gnu-gcc' +linker = "aarch64-linux-gnu-gcc" [target.aarch64-unknown-linux-musl] -linker = 'aarch64-linux-musl-gcc' +linker = "aarch64-linux-musl-gcc" +# AArch64 Linux musl targets are repeatedly affected under varying +# circumstances by fixedn't linking issues to compiler builtin symbols. +# Linking to libgcc, though arguably an inelegant hack that's only portable +# to our glibc from musl crosscompilation scenario, is effective to reliably +# provide an implementation of those fundamental symbols over time, without +# user-visible impacts on the final executables. See: +# https://github.com/rust-lang/rust/issues/46651 +# https://github.com/rust-lang/compiler-builtins/issues/201 +rustflags = ["-Clink-args=-lgcc"]