Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0316013

Browse files
committedJan 30, 2016
rustc: Set MIPS cpu/features in the compiler
Currently any compilation to MIPS spits out the warning: 'generic' is not a recognized processor for this target (ignoring processor) Doesn't make for a great user experience! We don't encounter this in the normal bootstrap because the cpu/feature set are set by the makefiles. Instead let's just propagate these to the defaults for the entire target all the time (still overridable from the command line) and prevent warnings from being emitted by default.
1 parent 303892e commit 0316013

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed
 

‎mk/cfg/mips-unknown-linux-gnu.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ CFG_UNIXY_mips-unknown-linux-gnu := 1
2020
CFG_LDPATH_mips-unknown-linux-gnu :=
2121
CFG_RUN_mips-unknown-linux-gnu=
2222
CFG_RUN_TARG_mips-unknown-linux-gnu=
23-
RUSTC_FLAGS_mips-unknown-linux-gnu := -C target-cpu=mips32r2 -C target-feature="+mips32r2" -C soft-float
23+
RUSTC_FLAGS_mips-unknown-linux-gnu :=
2424
CFG_GNU_TRIPLE_mips-unknown-linux-gnu := mips-unknown-linux-gnu

‎mk/cfg/mipsel-unknown-linux-gnu.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ CFG_UNIXY_mipsel-unknown-linux-gnu := 1
2020
CFG_LDPATH_mipsel-unknown-linux-gnu :=
2121
CFG_RUN_mipsel-unknown-linux-gnu=
2222
CFG_RUN_TARG_mipsel-unknown-linux-gnu=
23-
RUSTC_FLAGS_mipsel-unknown-linux-gnu := -C target-cpu=mips32 -C target-feature="+mips32"
23+
RUSTC_FLAGS_mipsel-unknown-linux-gnu :=
2424
CFG_GNU_TRIPLE_mipsel-unknown-linux-gnu := mipsel-unknown-linux-gnu

‎src/librustc_back/target/mips_unknown_linux_gnu.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use target::Target;
11+
use target::{Target, TargetOptions};
1212

1313
pub fn target() -> Target {
1414
Target {
@@ -19,6 +19,10 @@ pub fn target() -> Target {
1919
target_os: "linux".to_string(),
2020
target_env: "gnu".to_string(),
2121
target_vendor: "unknown".to_string(),
22-
options: super::linux_base::opts()
22+
options: TargetOptions {
23+
cpu: "mips32r2".to_string(),
24+
features: "+mips32r2,+soft-float".to_string(),
25+
..super::linux_base::opts()
26+
},
2327
}
2428
}

‎src/librustc_back/target/mipsel_unknown_linux_gnu.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use target::Target;
11+
use target::{Target, TargetOptions};
1212

1313
pub fn target() -> Target {
1414
Target {
@@ -20,6 +20,10 @@ pub fn target() -> Target {
2020
target_env: "gnu".to_string(),
2121
target_vendor: "unknown".to_string(),
2222

23-
options: super::linux_base::opts()
23+
options: TargetOptions {
24+
cpu: "mips32".to_string(),
25+
features: "+mips32".to_string(),
26+
..super::linux_base::opts()
27+
},
2428
}
2529
}

0 commit comments

Comments
 (0)
Please sign in to comment.