Skip to content

Commit

Permalink
Allow getting no_std from the config file
Browse files Browse the repository at this point in the history
Currently, it is only set correctly in the sanity checking implicit
default fallback code. Having a config file at all will for force
`no_std = false`.
  • Loading branch information
Ericson2314 committed Feb 22, 2020
1 parent 3eeefc2 commit 03ca0e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ struct TomlTarget {
musl_root: Option<String>,
wasi_root: Option<String>,
qemu_rootfs: Option<String>,
no_std: Option<bool>,
}

impl Config {
Expand Down Expand Up @@ -615,6 +616,8 @@ impl Config {
target.musl_root = cfg.musl_root.clone().map(PathBuf::from);
target.wasi_root = cfg.wasi_root.clone().map(PathBuf::from);
target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from);
target.no_std =
cfg.no_std.unwrap_or(triple.contains("-none-") || triple.contains("nvptx"));

config.target_config.insert(INTERNER.intern_string(triple.clone()), target);
}
Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ pub fn check(build: &mut Build) {

if target.contains("-none-") || target.contains("nvptx") {
if build.no_std(*target).is_none() {
let target = build.config.target_config.entry(target.clone()).or_default();

target.no_std = true;
build.config.target_config.entry(target.clone()).or_default();
}

if build.no_std(*target) == Some(false) {
Expand Down

0 comments on commit 03ca0e2

Please sign in to comment.