File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -89,13 +89,6 @@ fn main() {
89
89
cmd. arg ( "--sysroot" ) . arg ( & sysroot) ;
90
90
}
91
91
92
- // When we build Rust dylibs they're all intended for intermediate
93
- // usage, so make sure we pass the -Cprefer-dynamic flag instead of
94
- // linking all deps statically into the dylib.
95
- if env:: var_os ( "RUSTC_NO_PREFER_DYNAMIC" ) . is_none ( ) {
96
- cmd. arg ( "-Cprefer-dynamic" ) ;
97
- }
98
-
99
92
// If we're compiling specifically the `panic_abort` crate then we pass
100
93
// the `-C panic=abort` option. Note that we do not do this for any
101
94
// other crate intentionally as this is the only crate for now that we
Original file line number Diff line number Diff line change @@ -1227,6 +1227,16 @@ impl<'a> Builder<'a> {
1227
1227
1228
1228
self . ci_env . force_coloring_in_ci ( & mut cargo) ;
1229
1229
1230
+ // When we build Rust dylibs they're all intended for intermediate
1231
+ // usage, so make sure we pass the -Cprefer-dynamic flag instead of
1232
+ // linking all deps statically into the dylib.
1233
+ match mode {
1234
+ Mode :: Std | Mode :: Rustc | Mode :: Codegen => {
1235
+ rustflags. arg ( "-Cprefer-dynamic" ) ;
1236
+ }
1237
+ _ => { }
1238
+ }
1239
+
1230
1240
Cargo {
1231
1241
command : cargo,
1232
1242
rustflags,
Original file line number Diff line number Diff line change @@ -1814,10 +1814,6 @@ impl Step for Crate {
1814
1814
. expect ( "nodejs not configured" ) ,
1815
1815
) ;
1816
1816
} else if target. starts_with ( "wasm32" ) {
1817
- // On the wasm32-unknown-unknown target we're using LTO which is
1818
- // incompatible with `-C prefer-dynamic`, so disable that here
1819
- cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
1820
-
1821
1817
let node = builder
1822
1818
. config
1823
1819
. nodejs
Original file line number Diff line number Diff line change @@ -234,10 +234,6 @@ pub fn prepare_tool_cargo(
234
234
let dir = builder. src . join ( path) ;
235
235
cargo. arg ( "--manifest-path" ) . arg ( dir. join ( "Cargo.toml" ) ) ;
236
236
237
- // We don't want to build tools dynamically as they'll be running across
238
- // stages and such and it's just easier if they're not dynamically linked.
239
- cargo. env ( "RUSTC_NO_PREFER_DYNAMIC" , "1" ) ;
240
-
241
237
if source_type == SourceType :: Submodule {
242
238
cargo. env ( "RUSTC_EXTERNAL_TOOL" , "1" ) ;
243
239
}
You can’t perform that action at this time.
0 commit comments