Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIPS executables are not maximally portable #41606

Closed
nagisa opened this issue Apr 28, 2017 · 5 comments
Closed

MIPS executables are not maximally portable #41606

nagisa opened this issue Apr 28, 2017 · 5 comments
Labels
C-bug Category: This is a bug. O-MIPS Target: MIPS processors

Comments

@nagisa
Copy link
Member

nagisa commented Apr 28, 2017

Running on qemu with -M malta -cpu 4Kc, running rustup-init results in run_utf8_validation:

(gdb) bt
#0  0x55a1cd38 in run_utf8_validation ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libcore/str/mod.rs:1221
#1  core::str::from_utf8 ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libcore/str/mod.rs:233
#2  0x559ed898 in from_utf8 ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libcollections/string.rs:470
#3  into_string ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/sys/unix/os_str.rs:91
#4  into_string ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/ffi/os_str.rs:67
#5  {{closure}} ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/env.rs:617
#6  map<std::ffi::os_str::OsString,collections::string::String,closure> ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libcore/option.rs:383
#7  std::env::{{impl}}::next ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/env.rs:617
#8  0x5561b38c in rustup_init::run_multirust::h4c791998cd88b205 ()
#9  0x5561aa74 in rustup_init::main::hdb8423f0f289797c ()
#10 0x55a086f4 in std::panicking::try::do_call<fn(),()> ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/panicking.rs:356
#11 0x55a122fc in panic_unwind::__rust_maybe_catch_panic ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libpanic_unwind/lib.rs:97
#12 0x55a09458 in try<(),fn()> ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/panicking.rs:332
#13 catch_unwind<fn(),()> ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/panic.rs:351
#14 std::rt::lang_start ()
    at /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-rustbuild-linux/build/src/libstd/rt.rs:57
#15 0x55620de4 in main ()
(gdb) quit

-cpu 4KEc does work.

@jcowgill
Copy link
Contributor

This is probably because the default mips cpu baseline in LLVM is MIPS32r2 and the 4Kc processor does not implement that version of the ISA (it only implemente MIPS32r1). However, 4KEc does implement MIPS32r2.

I'm not sure the default ISA level should be changed. There were quite a lot of instructions added in mips32r2 so I think it would only be a good idea to lower the baseline if someone actually benefits from it (QEMU doesn't really count). AFAIK I don't think any pre-r2 processors have been fabricated for some years now (I think maybe the Loongson-2 series from 2008 were the last ones?)

@Mark-Simulacrum Mark-Simulacrum added the O-MIPS Target: MIPS processors label Jun 23, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
@sanxiyn
Copy link
Member

sanxiyn commented Mar 14, 2018

I think it is somewhat reasonable to synchronize ISA baseline with Linux distributions. FYI, as documented in https://wiki.debian.org/MIPSPort, current Debian stable baseline is MIPS32R2.

@jcowgill
Copy link
Contributor

#48874 may be relevant

@sanxiyn
Copy link
Member

sanxiyn commented Mar 16, 2018

#48874 is merged. Closing this, as default ISA level is intentional.

@sanxiyn sanxiyn closed this as completed Mar 16, 2018
@Jedzia
Copy link

Jedzia commented Mar 25, 2019

For people that don't use MIPS32R2 (like me with R1) and want to compile pre #48874 maybe this helps:

Minimal build for VU+ DUO2 mipsel-unknown-linux-gnu with Rust on Windows #37507 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-MIPS Target: MIPS processors
Projects
None yet
Development

No branches or pull requests

5 participants