From: Debian Rust Maintainers Date: Tue, 29 Mar 2022 11:23:46 +0000 (+0100) Subject: d-bootstrap-rustflags X-Git-Tag: archive/raspbian/1.58.1+dfsg1-1+rpi1^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a70cfd2f5e2efcc41dbab3af5da1cd7b71565542;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 edd5bf1b53..460f482d4a 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -993,6 +993,18 @@ impl<'a> Builder<'a> { rustflags.arg("-Zsymbol-mangling-version=legacy"); } + // Debian-specific stuff here + // 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.