File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 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(
22832283 return ;
22842284 }
22852285
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 ( ) {
22872287 // If rlib contains native libs as archives, unpack them to tmpdir.
22882288 let rlib = & codegen_results. crate_info . used_crate_source [ & cnum] . rlib . as_ref ( ) . unwrap ( ) . 0 ;
22892289 archive_builder_builder
@@ -2329,9 +2329,9 @@ fn add_native_libs_from_crate(
23292329 && sess. opts . test ) ;
23302330
23312331 if bundle && cnum != LOCAL_CRATE {
2332- if sess . opts . unstable_opts . packed_bundled_libs {
2332+ if let Some ( filename ) = lib . filename {
23332333 // 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 ( ) ) ;
23352335 if whole_archive {
23362336 cmd. link_whole_rlib ( & path) ;
23372337 } else {
@@ -2464,12 +2464,10 @@ fn add_upstream_rust_crates<'a>(
24642464 match linkage {
24652465 Linkage :: Static | Linkage :: IncludedFromDylib => {
24662466 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 ( ) ;
24732471 add_static_crate (
24742472 cmd,
24752473 sess,
You can’t perform that action at this time.
0 commit comments