From 0b21aeb189274033ea9701b6ad217a694a3c06ff Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Sat, 29 Aug 2020 16:54:36 +0100 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 c7061f8ca1..c4a11d54e8 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -831,6 +831,21 @@ impl<'a> Builder<'a> { rustflags.arg("--cfg=bootstrap"); } + // 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