ci: mipsel-softfloat — use mipsel-musl image + RUSTFLAGS=+soft-float

The image tag I assumed existed (`mipsel-musl-softfloat`) isn't
published by messense; docker-pull errored with "manifest unknown".
Available mipsel tags are just `mipsel-musl` (hardfloat) and the
regional mirrors of same.

Fix: use `messense/rust-musl-cross:mipsel-musl` (the standard
hardfloat image) and force soft-float code generation via
`RUSTFLAGS=-C target-feature=+soft-float` on top of the nightly
`-Z build-std=std,panic_abort` we were already using. build-std
recompiles libstd with the same RUSTFLAGS, so libstd itself comes
out soft-float even though the image's gcc/musl is hardfloat. We
don't link anything beyond libc for mhrv-rs (ring is pure-asm for
the crypto hot paths), so the fact that musl libm isn't soft-float
doesn't bite us.

Net result: the binary emits no hardware FP instructions, which is
what MT7621 actually needs.
This commit is contained in:
therealaleph
2026-04-23 10:14:11 +03:00
parent cbfdab582a
commit 6541eb013f
+12 -6
View File
@@ -150,16 +150,22 @@ jobs:
cargo build --release --target aarch64-unknown-linux-musl --bin mhrv-rs cargo build --release --target aarch64-unknown-linux-musl --bin mhrv-rs
sudo chown -R "$(id -u):$(id -g)" target sudo chown -R "$(id -u):$(id -g)" target
# OpenWRT MT7621 / mipsel-softfloat. The messense image tag # OpenWRT MT7621 / mipsel-softfloat. messense doesn't publish a
# `mipsel-musl-softfloat` ships a toolchain that emits soft-float # `:mipsel-musl-softfloat` tag — the mipsel-musl image is
# insn exclusively — matches the MT7621's FPU-less reality. # hardfloat. We build soft-float anyway via
# Requires Rust nightly + -Z build-std because mipsel is tier 3 # `RUSTFLAGS=-C target-feature=+soft-float` + `-Z build-std` so
# in the stable channel, which means no pre-built std. # libstd itself is recompiled to emit soft-float code. The
# gcc/musl shipping in the image is hardfloat but we never link
# anything more than libc (`ring` is pure asm for the crypto
# that matters), so musl's lack of softfloat libm doesn't bite.
# Requires nightly Rust since mipsel is Rust tier 3 in the
# stable channel — no prebuilt std.
- name: Build CLI (mipsel-softfloat via docker) - name: Build CLI (mipsel-softfloat via docker)
if: matrix.target == 'mipsel-unknown-linux-musl' && matrix.mipsel_softfloat == true if: matrix.target == 'mipsel-unknown-linux-musl' && matrix.mipsel_softfloat == true
run: | run: |
docker run --rm -v "$PWD":/src -w /src \ docker run --rm -v "$PWD":/src -w /src \
messense/rust-musl-cross:mipsel-musl-softfloat \ -e RUSTFLAGS='-C target-feature=+soft-float' \
messense/rust-musl-cross:mipsel-musl \
sh -c "rustup toolchain install nightly --profile minimal --component rust-src && \ sh -c "rustup toolchain install nightly --profile minimal --component rust-src && \
cargo +nightly build --release \ cargo +nightly build --release \
-Z build-std=std,panic_abort \ -Z build-std=std,panic_abort \