@@ -388,11 +388,12 @@ impl<'a> Context<'a> {
388388 }
389389
390390 let dypair = self . dylibname ( ) ;
391+ let staticpair = self . staticlibname ( ) ;
391392
392393 // want: crate_name.dir_part() + prefix + crate_name.file_part + "-"
393394 let dylib_prefix = format ! ( "{}{}" , dypair. 0 , self . crate_name) ;
394395 let rlib_prefix = format ! ( "lib{}" , self . crate_name) ;
395- let staticlib_prefix = format ! ( "lib{}" , self . crate_name) ;
396+ let staticlib_prefix = format ! ( "{}{}" , staticpair . 0 , self . crate_name) ;
396397
397398 let mut candidates = HashMap :: new ( ) ;
398399 let mut staticlibs = vec ! ( ) ;
@@ -425,7 +426,7 @@ impl<'a> Context<'a> {
425426 false )
426427 } else {
427428 if file. starts_with ( & staticlib_prefix[ ..] ) &&
428- file. ends_with ( ".a" ) {
429+ file. ends_with ( & staticpair . 1 ) {
429430 staticlibs. push ( CrateMismatch {
430431 path : path. to_path_buf ( ) ,
431432 got : "static" . to_string ( )
@@ -644,6 +645,13 @@ impl<'a> Context<'a> {
644645 ( t. options . dll_prefix . clone ( ) , t. options . dll_suffix . clone ( ) )
645646 }
646647
648+ // Returns the corresponding (prefix, suffix) that files need to have for
649+ // static libraries
650+ fn staticlibname ( & self ) -> ( String , String ) {
651+ let t = & self . target ;
652+ ( t. options . staticlib_prefix . clone ( ) , t. options . staticlib_suffix . clone ( ) )
653+ }
654+
647655 fn find_commandline_library ( & mut self , locs : & [ String ] ) -> Option < Library > {
648656 // First, filter out all libraries that look suspicious. We only accept
649657 // files which actually exist that have the correct naming scheme for
0 commit comments