Skip to content

Commit 03ca0e2

Browse files
committed
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`.
1 parent 3eeefc2 commit 03ca0e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/bootstrap/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ struct TomlTarget {
353353
musl_root: Option<String>,
354354
wasi_root: Option<String>,
355355
qemu_rootfs: Option<String>,
356+
no_std: Option<bool>,
356357
}
357358

358359
impl Config {
@@ -615,6 +616,8 @@ impl Config {
615616
target.musl_root = cfg.musl_root.clone().map(PathBuf::from);
616617
target.wasi_root = cfg.wasi_root.clone().map(PathBuf::from);
617618
target.qemu_rootfs = cfg.qemu_rootfs.clone().map(PathBuf::from);
619+
target.no_std =
620+
cfg.no_std.unwrap_or(triple.contains("-none-") || triple.contains("nvptx"));
618621

619622
config.target_config.insert(INTERNER.intern_string(triple.clone()), target);
620623
}

src/bootstrap/sanity.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ pub fn check(build: &mut Build) {
194194

195195
if target.contains("-none-") || target.contains("nvptx") {
196196
if build.no_std(*target).is_none() {
197-
let target = build.config.target_config.entry(target.clone()).or_default();
198-
199-
target.no_std = true;
197+
build.config.target_config.entry(target.clone()).or_default();
200198
}
201199

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

0 commit comments

Comments
 (0)