Skip to content

Commit

Permalink
fix mips (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilgardis authored Dec 23, 2023
2 parents d8a4aef + 224f1f9 commit 10bfcb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions targets.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ dylib = true
std = true
run = true
runners = "qemu-user"
build-std = true

[[target]]
target = "mipsel-unknown-linux-gnu"
Expand All @@ -131,6 +132,7 @@ dylib = true
std = true
run = true
runners = "qemu-user qemu-system"
build-std = true

[[target]]
target = "mips64-unknown-linux-gnuabi64"
Expand All @@ -139,6 +141,7 @@ cpp = true
dylib = true
std = true
run = true
build-std = true

[[target]]
target = "mips64el-unknown-linux-gnuabi64"
Expand All @@ -148,6 +151,7 @@ dylib = true
std = true
run = true
runners = "qemu-user qemu-system"
build-std = true

[[target]]
target = "mips64-unknown-linux-muslabi64"
Expand All @@ -156,6 +160,7 @@ cpp = true
dylib = true
std = true
run = true
build-std = true

[[target]]
target = "mips64el-unknown-linux-muslabi64"
Expand All @@ -164,6 +169,7 @@ os = "ubuntu-latest"
cpp = true
std = true
run = true
build-std = true

[[target]]
target = "powerpc-unknown-linux-gnu"
Expand Down

0 comments on commit 10bfcb9

Please sign in to comment.