From dd5b763817868ef0cdced2ee3c3969ee726dbac0 Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Thu, 28 Nov 2019 23:54:01 +0000 Subject: [PATCH] Fix building with same version 1.38.0 --- debian/patches/d-fix-mips64el-bootstrap.patch | 2 +- debian/patches/series | 1 + debian/patches/u-rustbuild-rustflags.patch | 24 +++++++++++++++++++ debian/rules | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 debian/patches/u-rustbuild-rustflags.patch diff --git a/debian/patches/d-fix-mips64el-bootstrap.patch b/debian/patches/d-fix-mips64el-bootstrap.patch index 3239d1a8ec..abc6eb2585 100644 --- a/debian/patches/d-fix-mips64el-bootstrap.patch +++ b/debian/patches/d-fix-mips64el-bootstrap.patch @@ -4,7 +4,7 @@ Bug: https://github.com/rust-lang/rust/issues/52108 @@ -620,6 +620,8 @@ (os.pathsep + env["LIBRARY_PATH"]) \ if "LIBRARY_PATH" in env else "" - env["RUSTFLAGS"] = "-Cdebuginfo=2 " + env["RUSTFLAGS"] += " -Cdebuginfo=2 " + if self.build_triple().startswith('mips'): + env["RUSTFLAGS"] += "-Cllvm-args=-mxgot " diff --git a/debian/patches/series b/debian/patches/series index a0575ddfd6..9d8de2fac1 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -10,6 +10,7 @@ u-mips-fixes.diff u-fix-cross-compile-install-again.patch # not forwarded, or forwarded but unlikely to be merged +u-rustbuild-rustflags.patch u-reproducible-dl-stage0.patch # Debian-specific patches, not suitable for upstream diff --git a/debian/patches/u-rustbuild-rustflags.patch b/debian/patches/u-rustbuild-rustflags.patch new file mode 100644 index 0000000000..01abc7f62a --- /dev/null +++ b/debian/patches/u-rustbuild-rustflags.patch @@ -0,0 +1,24 @@ +--- a/src/bootstrap/bootstrap.py ++++ b/src/bootstrap/bootstrap.py +@@ -618,7 +618,7 @@ + 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 " ++ env["RUSTFLAGS"] += " -Cdebuginfo=2 " + + build_section = "target.{}".format(self.build_triple()) + target_features = [] +@@ -627,10 +627,10 @@ + 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"] += " -C linker=" + target_linker + + env["PATH"] = os.path.join(self.bin_root(), "bin") + \ + os.pathsep + env["PATH"] diff --git a/debian/rules b/debian/rules index 75ec916da3..790e4e7677 100755 --- a/debian/rules +++ b/debian/rules @@ -16,8 +16,8 @@ LOCAL_RUST_VERSION := $(shell rustc --version --verbose | sed -ne 's/^release: / include /usr/share/dpkg/buildflags.mk # TODO: more correct to use `[build] rustflags = []` list syntax in Cargo.toml RUSTFLAGS = $(addprefix -C link-args=,$(LDFLAGS)) +RUSTFLAGS += --cap-lints warn --remap-path-prefix=$(CURDIR)=/usr/src/rustc-$(RUST_LONG_VERSION) export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS -RUSTFLAGS += --remap-path-prefix=$(CURDIR)=/usr/src/rustc-$(RUST_LONG_VERSION) export CARGO_HOME = $(CURDIR)/debian/cargo ifneq (,$(filter $(DEB_BUILD_ARCH), sparc64)) export CARGO_INCREMENTAL = 0