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`.
This commit is contained in:
parent
3eeefc21f1
commit
03ca0e2706
2 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue