void-packages/srcpkgs/rust/patches/0010-Link-stage2-tools-dynamically-to-libstd.patch
2020-02-23 19:56:54 +01:00

31 lines
1.1 KiB
Diff

From cdb82589b4be62c11186e4645a5fd358f5c55421 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 21 Dec 2019 17:01:59 +0100
Subject: [PATCH 10/16] Link stage2 tools dynamically to libstd
Replaces an older patch by Samuel Holland. The RUSTC_NO_PREFER_DYNAMIC
env var was removed and replaced with the following logic in builder.rs.
The idea for this patch is to link stage2 tools dynamically as these will
be distributed (if built). Intermediate tools from previous stages will
be statically linked for convenience.
---
src/bootstrap/builder.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 8b0ad169..4bc13ac2 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1228,6 +1228,8 @@ impl<'a> Builder<'a> {
// linking all deps statically into the dylib.
if let Mode::Std | Mode::Rustc | Mode::Codegen = mode {
rustflags.arg("-Cprefer-dynamic");
+ } else if stage >= 2 {
+ rustflags.arg("-Cprefer-dynamic");
}
Cargo {
--
2.25.0