File tree 1 file changed +4
-3
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2454,15 +2454,17 @@ fn add_upstream_rust_crates<'a>(
2454
2454
// We must always link crates `compiler_builtins` and `profiler_builtins` statically.
2455
2455
// Even if they were already included into a dylib
2456
2456
// (e.g. `libstd` when `-C prefer-dynamic` is used).
2457
+ // FIXME: `dependency_formats` can report `profiler_builtins` as `NotLinked` for some
2458
+ // reason, it shouldn't do that because `profiler_builtins` should indeed be linked.
2457
2459
let linkage = data[ cnum. as_usize ( ) - 1 ] ;
2458
2460
let link_static_crate = linkage == Linkage :: Static
2459
- || linkage == Linkage :: IncludedFromDylib
2461
+ || ( linkage == Linkage :: IncludedFromDylib || linkage == Linkage :: NotLinked )
2460
2462
&& ( codegen_results. crate_info . compiler_builtins == Some ( cnum)
2461
2463
|| codegen_results. crate_info . profiler_runtime == Some ( cnum) ) ;
2462
2464
2463
2465
let mut bundled_libs = Default :: default ( ) ;
2464
2466
match linkage {
2465
- Linkage :: Static | Linkage :: IncludedFromDylib => {
2467
+ Linkage :: Static | Linkage :: IncludedFromDylib | Linkage :: NotLinked => {
2466
2468
if link_static_crate {
2467
2469
bundled_libs = codegen_results. crate_info . native_libraries [ & cnum]
2468
2470
. iter ( )
@@ -2483,7 +2485,6 @@ fn add_upstream_rust_crates<'a>(
2483
2485
let src = & codegen_results. crate_info . used_crate_source [ & cnum] ;
2484
2486
add_dynamic_crate ( cmd, sess, & src. dylib . as_ref ( ) . unwrap ( ) . 0 ) ;
2485
2487
}
2486
- Linkage :: NotLinked => { }
2487
2488
}
2488
2489
2489
2490
// Static libraries are linked for a subset of linked upstream crates.
You can’t perform that action at this time.
0 commit comments