File tree 1 file changed +7
-2
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -812,9 +812,14 @@ impl<'a> Linker for MsvcLinker<'a> {
812
812
}
813
813
814
814
fn link_staticlib_by_name ( & mut self , name : & str , verbatim : bool , whole_archive : bool ) {
815
+ // Static libraries built by MSVC are usually called foo.lib.
816
+ // However, under MinGW and build systems such as Meson, they are
817
+ // called libfoo.a
815
818
let prefix = if whole_archive { "/WHOLEARCHIVE:" } else { "" } ;
816
- let suffix = if verbatim { "" } else { ".lib" } ;
817
- self . cmd . arg ( format ! ( "{prefix}{name}{suffix}" ) ) ;
819
+ let path = find_native_static_library ( name, verbatim, self . sess ) ;
820
+ let mut arg = OsString :: from ( prefix) ;
821
+ arg. push ( path) ;
822
+ self . cmd . arg ( arg) ;
818
823
}
819
824
820
825
fn link_staticlib_by_path ( & mut self , path : & Path , whole_archive : bool ) {
You can’t perform that action at this time.
0 commit comments