File tree 2 files changed +13
-4
lines changed
compiler/rustc_codegen_ssa/src/back
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(
1494
1494
| NativeLibKind :: Unspecified => {
1495
1495
let verbatim = lib. verbatim ;
1496
1496
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}" ) )
1498
1503
} else if sess. target . linker_flavor . is_gnu ( ) {
1499
1504
Some ( format ! ( "-l{}{}" , if verbatim { ":" } else { "" } , name) )
1500
1505
} else {
Original file line number Diff line number Diff line change @@ -958,9 +958,13 @@ impl<'a> Linker for MsvcLinker<'a> {
958
958
if let Some ( path) = try_find_native_static_library ( self . sess , name, verbatim) {
959
959
self . link_staticlib_by_path ( & path, whole_archive) ;
960
960
} 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}" ) ) ;
964
968
}
965
969
}
966
970
You can’t perform that action at this time.
0 commit comments