From: Debian Rust Maintainers Date: Fri, 22 Oct 2021 22:29:14 +0000 (+0100) Subject: d-bootstrap-rustflags X-Git-Tag: archive/raspbian/1.56.0+dfsg1-2+rpi1^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=62773eac8be9006b803e0f9ccc58a37f589d74cd;p=rustc.git d-bootstrap-rustflags Gbp-Pq: Name d-bootstrap-rustflags.patch --- diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index c325342b21..0ec8b92337 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -974,6 +974,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.