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

Please reconsider mips32 "r1" support #68865

Closed
alexpdp7 opened this issue Feb 5, 2020 · 2 comments
Closed

Please reconsider mips32 "r1" support #68865

alexpdp7 opened this issue Feb 5, 2020 · 2 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. O-MIPS Target: MIPS processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@alexpdp7
Copy link

alexpdp7 commented Feb 5, 2020

Hi,

In:

#48874

, the mips targets were bumped to use the mips32r2 instruction set. There's a few systems being sold today which use cheap mips32-non-r1 chips, like:

https://retrogame300.com/collections/all
https://retromimi.com/products/retro-game-plus

, etc. They use buildroot-derived operating systems, which adds some complexity to adding a new target to Rust, so I'm wondering if it could be acceptable to add a new target or revert that change, as it would make things simpler to code for such devices.

Cheers,

Álex

@jonas-schievink jonas-schievink added C-feature-request Category: A feature request, i.e: not implemented / a PR. O-MIPS Target: MIPS processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 5, 2020
@alexpdp7
Copy link
Author

alexpdp7 commented Feb 6, 2020

Note: I just tested that:

+diff --git a/src/librustc_target/spec/mipsel_unknown_linux_uclibc.rs b/src/librustc_target/spec/mipsel_unknown_linux_uclibc.rs
+index a8152011efa..1e730ea9d47 100644
+--- a/src/librustc_target/spec/mipsel_unknown_linux_uclibc.rs
++++ b/src/librustc_target/spec/mipsel_unknown_linux_uclibc.rs
+@@ -14,8 +14,8 @@ pub fn target() -> TargetResult {
+         linker_flavor: LinkerFlavor::Gcc,
+ 
+         options: TargetOptions {
+-            cpu: "mips32r2".to_string(),
+-            features: "+mips32r2,+soft-float".to_string(),
++            cpu: "mips32".to_string(),
++            features: "mips32,-mips32r2,+single-float".to_string(),
+             max_atomic_width: Some(32),
+             target_mcount: "_mcount".to_string(),
+ 
+-- 
+2.20.1
+
-- 
2.20.1

works, allowing me to generate binaries which don't crash on mips32 non-r1. although I'm not so sure about FPU support. If someone comes across this, I documented my whole process for crosscompiling using buildroot, etc. at:

https://github.com/alexpdp7/retrofw2-rust

@workingjubilee
Copy link
Member

This feature level was fairly deliberately chosen, see the discussion here:

Since this request was made we now support a number of interesting MIPS targets, some with even lower requirements, so it seems to me that changing this is not necessary. Ultimately, this can be toggled via -Ctarget-feature.

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. O-MIPS Target: MIPS processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants