rustc/debian/patches/d-bootstrap-rustflags.patch
Fabian Grünbichler 8c7f677448 rebase patches
and drop those applied upstream/no longer needed

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-03-08 11:30:22 +00:00

22 lines
853 B
Diff

--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -974,6 +974,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.