aboutsummaryrefslogtreecommitdiffstats
path: root/community/rust/0014-Link-stage-2-tools-dynamically-to-libstd.patch
blob: 632717f56bf293b9c9c41fb7742db4d4930fc114 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.

@q66

--- 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 {