Fix building with same version 1.38.0

This commit is contained in:
Ximin Luo 2019-11-28 23:54:01 +00:00
parent 99e562ce7b
commit dd5b763817
4 changed files with 27 additions and 2 deletions

View File

@ -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 "

View File

@ -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

View File

@ -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"]

2
debian/rules vendored
View File

@ -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