Skip to content

Commit 1bb7109

Browse files
committed
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 rust-lang/rust#128401 is sorted out.
1 parent e2d58c1 commit 1bb7109

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.cargo/config.toml

+5
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ linker = "aarch64-linux-musl-gcc"
1616
# user-visible impacts on the final executables. See:
1717
# https://github.com/rust-lang/rust/issues/46651
1818
# https://github.com/rust-lang/compiler-builtins/issues/201
19+
# https://github.com/rust-lang/rust/issues/128401 (the issue most relevant to
20+
# our observed failures)
21+
# Note that these flags are not enforced on CI because CI overrides them through
22+
# the RUSTFLAG environment variable. Check out the CI workflow definition file at
23+
# .github/workflows/oxipng.yml for more info
1924
rustflags = ["-Clink-args=-lgcc"]

.github/workflows/oxipng.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ jobs:
5555

5656
env:
5757
CARGO_BUILD_TARGET: ${{ matrix.target }}
58-
RUSTFLAGS: -Zlocation-detail=none
58+
# Hopefully temporary workaround for https://github.com/rust-lang/rust/issues/128401
59+
# See the comments for similar rustflag settings at .cargo/config.toml for more context
60+
RUSTFLAGS: ${{ matrix.target == 'aarch64-unknown-linux-musl' && '-Zlocation-detail=none -Clink-args=-lgcc' || '-Zlocation-detail=none' }}
5961

6062
steps:
6163
- name: Checkout source

0 commit comments

Comments
 (0)