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> {
830830 name : & str ,
831831 verbatim : bool ,
832832 whole_archive : bool ,
833- _search_paths : & SearchPaths ,
833+ search_paths : & SearchPaths ,
834834 ) {
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
835838 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) ;
838844 }
839845
840846 fn link_staticlib_by_path ( & mut self , path : & Path , whole_archive : bool ) {
You can’t perform that action at this time.
0 commit comments