From a9dca3b243022a320b53543a975ff4774986ba5f Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Thu, 28 Nov 2019 10:11:48 +0000 Subject: [PATCH 1/2] rustbuild: fix cross-compile install although, not sure why this works - it wasn't needed before --- src/bootstrap/install.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs index 384219c38fd04..f8734ebdf4254 100644 --- a/src/bootstrap/install.rs +++ b/src/bootstrap/install.rs @@ -260,7 +260,7 @@ install!((self, builder, _config), }; Rustc, "src/librustc", true, only_hosts: true, { builder.ensure(dist::Rustc { - compiler: self.compiler, + compiler: builder.compiler(builder.top_stage, self.target), }); install_rustc(builder, self.compiler.stage, self.target); }; From 0533249fd7950a34a8046956c5bb1737e620198f Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Thu, 28 Nov 2019 10:11:02 +0000 Subject: [PATCH 2/2] rustbuild: don't clobber RUSTFLAGS, append to it --- src/bootstrap/bootstrap.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 730e8cf05d41d..bb169414886de 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -643,7 +643,9 @@ def build_bootstrap(self): env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ (os.pathsep + env["LIBRARY_PATH"]) \ if "LIBRARY_PATH" in env else "" - env["RUSTFLAGS"] = "-Cdebuginfo=2 " + # preserve existing RUSTFLAGS + env.setdefault("RUSTFLAGS", "") + env["RUSTFLAGS"] += " -Cdebuginfo=2" build_section = "target.{}".format(self.build_triple()) target_features = [] @@ -652,13 +654,13 @@ def build_bootstrap(self): elif self.get_toml("crt-static", build_section) == "false": target_features += ["-crt-static"] if target_features: - env["RUSTFLAGS"] += "-C target-feature=" + (",".join(target_features)) + " " + env["RUSTFLAGS"] += " -C target-feature=" + (",".join(target_features)) target_linker = self.get_toml("linker", build_section) if target_linker is not None: - env["RUSTFLAGS"] += "-C linker=" + target_linker + " " - env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes " + env["RUSTFLAGS"] += " -C linker=" + target_linker + env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes" if self.get_toml("deny-warnings", "rust") != "false": - env["RUSTFLAGS"] += "-Dwarnings " + env["RUSTFLAGS"] += " -Dwarnings" env["PATH"] = os.path.join(self.bin_root(), "bin") + \ os.pathsep + env["PATH"]