File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -830,11 +830,17 @@ impl<'a> Linker for MsvcLinker<'a> {
830
830
name : & str ,
831
831
verbatim : bool ,
832
832
whole_archive : bool ,
833
- _search_paths : & SearchPaths ,
833
+ search_paths : & SearchPaths ,
834
834
) {
835
+ // Static libraries built by MSVC are usually called foo.lib.
836
+ // However, under MinGW and build systems such as Meson, they are
837
+ // called libfoo.a
835
838
let prefix = if whole_archive { "/WHOLEARCHIVE:" } else { "" } ;
836
- let suffix = if verbatim { "" } else { ".lib" } ;
837
- self . cmd . arg ( format ! ( "{prefix}{name}{suffix}" ) ) ;
839
+ let search_paths = search_paths. get ( self . sess ) ;
840
+ let path = find_native_static_library ( name, verbatim, search_paths, self . sess ) ;
841
+ let mut arg = OsString :: from ( prefix) ;
842
+ arg. push ( path) ;
843
+ self . cmd . arg ( arg) ;
838
844
}
839
845
840
846
fn link_staticlib_by_path ( & mut self , path : & Path , whole_archive : bool ) {
You can’t perform that action at this time.
0 commit comments