Fix linkage for large binaries on mips64 platforms ...

... by enabling xgot feature

Co-Authored-By: Zixing Liu <zixing.liu@canonical.com>
This commit is contained in:
Ximin Luo 2023-05-18 22:21:59 -06:00 committed by liushuyu
parent 498553fc04
commit b65c2afdfd
No known key found for this signature in database
GPG key ID: 23D1CE4534419437
4 changed files with 16 additions and 6 deletions

View file

@ -877,6 +877,12 @@ class RustBuild(object):
# preserve existing RUSTFLAGS
env.setdefault("RUSTFLAGS", "")
# we need to explicitly add +xgot here so that we can successfully bootstrap
# a usable stage1 compiler
# FIXME: remove this if condition on the next bootstrap bump
# cfg(bootstrap)
if self.build_triple().startswith('mips'):
env["RUSTFLAGS"] += " -Ctarget-feature=+xgot"
target_features = []
if self.get_toml("crt-static", build_section) == "true":
target_features += ["+crt-static"]