rustc_target: Make sure that in-tree targets follow conventions for os and vendor values
This commit is contained in:
parent
1def24c5f4
commit
e0a8f22053
1 changed files with 13 additions and 0 deletions
|
@ -36,5 +36,18 @@ impl Target {
|
||||||
&& self.post_link_objects_fallback.is_empty())
|
&& self.post_link_objects_fallback.is_empty())
|
||||||
|| self.crt_objects_fallback.is_some()
|
|| self.crt_objects_fallback.is_some()
|
||||||
);
|
);
|
||||||
|
// Keep the default "unknown" vendor instead.
|
||||||
|
assert_ne!(self.vendor, "");
|
||||||
|
if !self.can_use_os_unknown() {
|
||||||
|
// Keep the default "none" for bare metal targets instead.
|
||||||
|
assert_ne!(self.os, "unknown");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add your target to the whitelist if it has `std` library
|
||||||
|
// and you certainly want "unknown" for the OS name.
|
||||||
|
fn can_use_os_unknown(&self) -> bool {
|
||||||
|
self.llvm_target == "wasm32-unknown-unknown"
|
||||||
|
|| (self.env == "sgx" && self.vendor == "fortanix")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue