diff options
| author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-02-22 14:38:38 -0500 |
|---|---|---|
| committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-02-22 15:23:15 -0500 |
| commit | 03ca0e270613592f35ce654e2ef1e68cdfb154e3 (patch) | |
| tree | ca62cb5fd03b6eb684221d6ec6866cf9beca657b | |
| parent | 3eeefc21f1a3ed9755c072c83808ed5c087b8c9a (diff) | |
| download | rust-03ca0e270613592f35ce654e2ef1e68cdfb154e3.tar.gz rust-03ca0e270613592f35ce654e2ef1e68cdfb154e3.zip | |
Allow getting `no_std` from the config file
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`.
| -rw-r--r-- | src/bootstrap/config.rs | 3 | ||||
| -rw-r--r-- | src/bootstrap/sanity.rs | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 214d572329e..b474d896bd2 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -353,6 +353,7 @@ struct TomlTarget { musl_root: Option<String>, wasi_root: Option<String>, qemu_rootfs: Option<String>, + no_std: Option<bool>, } impl Config { @@ -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); } diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 8ff7056e628..76e721ed8e3 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -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) { |
