From cc7cb122880fd5d6f0a800515df859e64c7c5715 Mon Sep 17 00:00:00 2001 From: Debian Rust Maintainers Date: Sat, 18 Sep 2021 11:45:21 +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 db6255cc5..18b0d88b5 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -905,6 +905,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