@@ -2030,8 +2030,7 @@ fn add_local_native_libraries(
2030
2030
NativeLibKind :: Framework { as_needed } => {
2031
2031
cmd. link_framework ( name, as_needed. unwrap_or ( true ) )
2032
2032
}
2033
- NativeLibKind :: Static { bundle : None | Some ( true ) , .. }
2034
- | NativeLibKind :: Static { whole_archive : Some ( true ) , .. } => {
2033
+ NativeLibKind :: Static { whole_archive : Some ( true ) , .. } => {
2035
2034
cmd. link_whole_staticlib ( name, verbatim, & search_path) ;
2036
2035
}
2037
2036
NativeLibKind :: Static { .. } => cmd. link_staticlib ( name, verbatim) ,
@@ -2137,7 +2136,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
2137
2136
let src = & codegen_results. crate_info . used_crate_source [ & cnum] ;
2138
2137
match data[ cnum. as_usize ( ) - 1 ] {
2139
2138
_ if codegen_results. crate_info . profiler_runtime == Some ( cnum) => {
2140
- add_static_crate :: < B > ( cmd, sess, codegen_results, tmpdir, crate_type , cnum) ;
2139
+ add_static_crate :: < B > ( cmd, sess, codegen_results, tmpdir, cnum)
2141
2140
}
2142
2141
// compiler-builtins are always placed last to ensure that they're
2143
2142
// linked correctly.
@@ -2146,9 +2145,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
2146
2145
compiler_builtins = Some ( cnum) ;
2147
2146
}
2148
2147
Linkage :: NotLinked | Linkage :: IncludedFromDylib => { }
2149
- Linkage :: Static => {
2150
- add_static_crate :: < B > ( cmd, sess, codegen_results, tmpdir, crate_type, cnum) ;
2151
- }
2148
+ Linkage :: Static => add_static_crate :: < B > ( cmd, sess, codegen_results, tmpdir, cnum) ,
2152
2149
Linkage :: Dynamic => add_dynamic_crate ( cmd, sess, & src. dylib . as_ref ( ) . unwrap ( ) . 0 ) ,
2153
2150
}
2154
2151
@@ -2163,7 +2160,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
2163
2160
// was already "included" in a dylib (e.g., `libstd` when `-C prefer-dynamic`
2164
2161
// is used)
2165
2162
if let Some ( cnum) = compiler_builtins {
2166
- add_static_crate :: < B > ( cmd, sess, codegen_results, tmpdir, crate_type , cnum) ;
2163
+ add_static_crate :: < B > ( cmd, sess, codegen_results, tmpdir, cnum) ;
2167
2164
}
2168
2165
2169
2166
// Converts a library file-stem into a cc -l argument
@@ -2194,7 +2191,6 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
2194
2191
sess : & ' a Session ,
2195
2192
codegen_results : & CodegenResults ,
2196
2193
tmpdir : & Path ,
2197
- crate_type : CrateType ,
2198
2194
cnum : CrateNum ,
2199
2195
) {
2200
2196
let src = & codegen_results. crate_info . used_crate_source [ & cnum] ;
@@ -2208,14 +2204,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
2208
2204
// Note, though, that we don't want to include the whole of a
2209
2205
// compiler-builtins crate (e.g., compiler-rt) because it'll get
2210
2206
// repeatedly linked anyway.
2211
- let path = fix_windows_verbatim_for_gcc ( path) ;
2212
- if crate_type == CrateType :: Dylib
2213
- && codegen_results. crate_info . compiler_builtins != Some ( cnum)
2214
- {
2215
- cmd. link_whole_rlib ( & path) ;
2216
- } else {
2217
- cmd. link_rlib ( & path) ;
2218
- }
2207
+ cmd. link_rlib ( & fix_windows_verbatim_for_gcc ( path) ) ;
2219
2208
} ;
2220
2209
2221
2210
// See the comment above in `link_staticlib` and `link_rlib` for why if
0 commit comments