oxipng/.cargo/config.toml
Alejandro González 1bb7109804
Another AArch64 Linux musl build fix attempt
After testing more thoroughly on my box, it turned out that the libgcc
linking workaround should indeed fix our build errors, but on CI that
did not happen because the `RUSTFLAGS` environment variable is set,
which takes precedence over any configuration at `.cargo/config.toml`.
Therefore, let's also add the workaround to `RUSTFLAGS` on the CI
workflow definition.

This should be a satisfactory enough stopgap solution that does not
require ourselves to be pinned to a specific nightly or drop these
builds until https://github.com/rust-lang/rust/issues/128401 is sorted
out.
2024-08-07 20:54:30 +02:00

24 lines
1.2 KiB
TOML

# 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"
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.aarch64-unknown-linux-musl]
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
# https://github.com/rust-lang/rust/issues/128401 (the issue most relevant to
# our observed failures)
# Note that these flags are not enforced on CI because CI overrides them through
# the RUSTFLAG environment variable. Check out the CI workflow definition file at
# .github/workflows/oxipng.yml for more info
rustflags = ["-Clink-args=-lgcc"]