mirror of
https://github.com/rust-lang/rust
synced 2024-10-06 16:51:35 +00:00
make sure the standard library compiles properly with synthetic targets
It might happen that a synthetic target name does not match one of the hardcoded ones in std's build script, causing std to fail to build. This commit changes the std build script avoid including the restricted-std feature unconditionally when a synthetic target is being built.
This commit is contained in:
parent
9de3c29319
commit
6fd0d1ba14
|
@ -36,6 +36,8 @@ fn main() {
|
|||
|| target.contains("nintendo-3ds")
|
||||
|| target.contains("vita")
|
||||
|| target.contains("nto")
|
||||
// See src/bootstrap/synthetic_targets.rs
|
||||
|| env::var("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET").is_ok()
|
||||
{
|
||||
// These platforms don't have any special requirements.
|
||||
} else {
|
||||
|
|
|
@ -169,6 +169,11 @@ fn run(self, builder: &Builder<'_>) {
|
|||
cargo.arg("-p").arg(krate);
|
||||
}
|
||||
|
||||
// See src/bootstrap/synthetic_targets.rs
|
||||
if target.is_synthetic() {
|
||||
cargo.env("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET", "1");
|
||||
}
|
||||
|
||||
let _guard = builder.msg(
|
||||
Kind::Build,
|
||||
compiler.stage,
|
||||
|
|
Loading…
Reference in a new issue