diff --git a/ci/test.sh b/ci/test.sh index 27319cc6e..e41f5ab15 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -40,6 +40,10 @@ main() { rustup toolchain add nightly CROSS_FLAGS="${CROSS_FLAGS} -Zbuild-std" CROSS+=("+nightly") + if [[ "${TARGET}" == *"mips"* ]]; then + # workaround for https://github.com/cross-rs/cross/issues/1322 & https://github.com/rust-lang/rust/issues/108835 + [[ ! "$RUSTFLAGS" =~ opt-level ]] && export RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C opt-level=1" + fi elif ! (( ${STD:-0} )); then # don't use xargo: should have native support just from rustc rustup toolchain add nightly @@ -204,7 +208,7 @@ main() { pushd "${td}" cargo init --bin --name hello . retry cargo fetch - RUSTFLAGS="-C target-feature=-crt-static" \ + RUSTFLAGS="$RUSTFLAGS -C target-feature=-crt-static" \ cross_build --target "${TARGET}" popd diff --git a/targets.toml b/targets.toml index 78bb9c7cf..117845e22 100644 --- a/targets.toml +++ b/targets.toml @@ -122,6 +122,7 @@ dylib = true std = true run = true runners = "qemu-user" +build-std = true [[target]] target = "mipsel-unknown-linux-gnu" @@ -131,6 +132,7 @@ dylib = true std = true run = true runners = "qemu-user qemu-system" +build-std = true [[target]] target = "mips64-unknown-linux-gnuabi64" @@ -139,6 +141,7 @@ cpp = true dylib = true std = true run = true +build-std = true [[target]] target = "mips64el-unknown-linux-gnuabi64" @@ -148,6 +151,7 @@ dylib = true std = true run = true runners = "qemu-user qemu-system" +build-std = true [[target]] target = "mips64-unknown-linux-muslabi64" @@ -156,6 +160,7 @@ cpp = true dylib = true std = true run = true +build-std = true [[target]] target = "mips64el-unknown-linux-muslabi64" @@ -164,6 +169,7 @@ os = "ubuntu-latest" cpp = true std = true run = true +build-std = true [[target]] target = "powerpc-unknown-linux-gnu"