File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 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> {
812812 }
813813
814814 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
815818 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) ;
818823 }
819824
820825 fn link_staticlib_by_path ( & mut self , path : & Path , whole_archive : bool ) {
You can’t perform that action at this time.
0 commit comments