File tree 1 file changed +7
-9
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -2283,7 +2283,7 @@ fn add_native_libs_from_crate(
2283
2283
return ;
2284
2284
}
2285
2285
2286
- if sess . opts . unstable_opts . packed_bundled_libs && link_static && cnum != LOCAL_CRATE {
2286
+ if link_static && cnum != LOCAL_CRATE && !bundled_libs . is_empty ( ) {
2287
2287
// If rlib contains native libs as archives, unpack them to tmpdir.
2288
2288
let rlib = & codegen_results. crate_info . used_crate_source [ & cnum] . rlib . as_ref ( ) . unwrap ( ) . 0 ;
2289
2289
archive_builder_builder
@@ -2329,9 +2329,9 @@ fn add_native_libs_from_crate(
2329
2329
&& sess. opts . test ) ;
2330
2330
2331
2331
if bundle && cnum != LOCAL_CRATE {
2332
- if sess . opts . unstable_opts . packed_bundled_libs {
2332
+ if let Some ( filename ) = lib . filename {
2333
2333
// If rlib contains native libs as archives, they are unpacked to tmpdir.
2334
- let path = tmpdir. join ( lib . filename . unwrap ( ) . as_str ( ) ) ;
2334
+ let path = tmpdir. join ( filename. as_str ( ) ) ;
2335
2335
if whole_archive {
2336
2336
cmd. link_whole_rlib ( & path) ;
2337
2337
} else {
@@ -2464,12 +2464,10 @@ fn add_upstream_rust_crates<'a>(
2464
2464
match linkage {
2465
2465
Linkage :: Static | Linkage :: IncludedFromDylib => {
2466
2466
if link_static_crate {
2467
- if sess. opts . unstable_opts . packed_bundled_libs {
2468
- bundled_libs = codegen_results. crate_info . native_libraries [ & cnum]
2469
- . iter ( )
2470
- . filter_map ( |lib| lib. filename )
2471
- . collect ( ) ;
2472
- }
2467
+ bundled_libs = codegen_results. crate_info . native_libraries [ & cnum]
2468
+ . iter ( )
2469
+ . filter_map ( |lib| lib. filename )
2470
+ . collect ( ) ;
2473
2471
add_static_crate (
2474
2472
cmd,
2475
2473
sess,
You can’t perform that action at this time.
0 commit comments