From 5d906385f82ff2597fb7bdcfa53b8669d928ce2a Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Sun, 20 Dec 2020 18:52:10 +0000 Subject: [PATCH] d-rustflags Gbp-Pq: Name d-rustflags.patch --- src/bootstrap/builder.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index f60c7748ae..6200ba92f8 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -829,6 +829,21 @@ impl<'a> Builder<'a> { rustflags.arg("-Zsymbol-mangling-version=v0"); } + // Debian-specific stuff here + // don't error on warnings, this sometimes causes builds to fail when + // we re-bootstrap using the same version, that introduced a new warning + rustflags.arg("--cap-lints=warn"); + // set linker flags from LDFLAGS + if let Ok(ldflags) = env::var("LDFLAGS") { + for flag in ldflags.split_whitespace() { + if target.contains("windows") && flag.contains("relro") { + // relro is ELF-specific + continue; + } + rustflags.arg(&format!("-Clink-args={}", flag)); + } + } + // FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`, // but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See // #71458. -- 2.30.2