fix cross-compile

This commit is contained in:
Ximin Luo 2021-05-15 15:19:08 +01:00
parent 3f778b6312
commit e9741b13cd
3 changed files with 26 additions and 0 deletions

View File

@ -14,6 +14,15 @@ index e959c1a6511..39308996342 100644
toml = "0.5.3"
unicode-normalization = "0.1"
semver = "0.11"
@@ -29,7 +29,7 @@ rustc-semver = "1.1.0"
# see <https://github.com/rust-lang/rust/pull/63587#issuecomment-522343864>
url = { version = "2.1.0", features = ["serde"] }
quote = "1"
-syn = { version = "1", features = ["full"] }
+syn = { version = "1", features = ["full", "visit-mut", "extra-traits", "visit"] }
[features]
deny-warnings = []
diff --git a/src/tools/rustfmt/Cargo.toml b/src/tools/rustfmt/Cargo.toml
index 0f5bec2dcca..c9a64f05949 100644
--- a/src/tools/rustfmt/Cargo.toml

View File

@ -11,6 +11,7 @@ u-tests-ignore-arm.patch
u-mips-fixes.diff
u-ignore-endian-big.patch
u-build-cargo-only-if-requested.patch
u-fix-cross-compile-tools.patch
#u-allow-system-compiler-rt.patch
# not forwarded, or forwarded but unlikely to be merged

View File

@ -0,0 +1,16 @@
Forwarded: https://github.com/rust-lang/rust/pull/85326
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -52,7 +52,10 @@
let is_optional_tool = self.is_optional_tool;
match self.mode {
- Mode::ToolRustc => builder.ensure(compile::Rustc { compiler, target }),
+ Mode::ToolRustc => {
+ builder.ensure(compile::Std { compiler, target: compiler.host });
+ builder.ensure(compile::Rustc { compiler, target });
+ }
Mode::ToolStd => builder.ensure(compile::Std { compiler, target }),
Mode::ToolBootstrap => {} // uses downloaded stage0 compiler libs
_ => panic!("unexpected Mode for tool build"),