File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -1494,7 +1494,12 @@ fn print_native_static_libs(
14941494 | NativeLibKind :: Unspecified => {
14951495 let verbatim = lib. verbatim ;
14961496 if sess. target . is_like_msvc {
1497- Some ( format ! ( "{}{}" , name, if verbatim { "" } else { ".lib" } ) )
1497+ let ( prefix, suffix) = if verbatim {
1498+ ( "" , "" )
1499+ } else {
1500+ ( & * sess. target . staticlib_prefix , & * sess. target . staticlib_suffix )
1501+ } ;
1502+ Some ( format ! ( "{prefix}{name}{suffix}" ) )
14981503 } else if sess. target . linker_flavor . is_gnu ( ) {
14991504 Some ( format ! ( "-l{}{}" , if verbatim { ":" } else { "" } , name) )
15001505 } else {
Original file line number Diff line number Diff line change @@ -958,9 +958,13 @@ impl<'a> Linker for MsvcLinker<'a> {
958958 if let Some ( path) = try_find_native_static_library ( self . sess , name, verbatim) {
959959 self . link_staticlib_by_path ( & path, whole_archive) ;
960960 } else {
961- let prefix = if whole_archive { "/WHOLEARCHIVE:" } else { "" } ;
962- let suffix = if verbatim { "" } else { ".lib" } ;
963- self . link_arg ( format ! ( "{prefix}{name}{suffix}" ) ) ;
961+ let opts = if whole_archive { "/WHOLEARCHIVE:" } else { "" } ;
962+ let ( prefix, suffix) = if verbatim {
963+ ( "" , "" )
964+ } else {
965+ ( & * self . sess . target . staticlib_prefix , & * self . sess . target . staticlib_suffix )
966+ } ;
967+ self . link_arg ( format ! ( "{opts}{prefix}{name}{suffix}" ) ) ;
964968 }
965969 }
966970
You can’t perform that action at this time.
0 commit comments