@@ -388,11 +388,12 @@ impl<'a> Context<'a> {
388
388
}
389
389
390
390
let dypair = self . dylibname ( ) ;
391
+ let staticpair = self . staticlibname ( ) ;
391
392
392
393
// want: crate_name.dir_part() + prefix + crate_name.file_part + "-"
393
394
let dylib_prefix = format ! ( "{}{}" , dypair. 0 , self . crate_name) ;
394
395
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) ;
396
397
397
398
let mut candidates = HashMap :: new ( ) ;
398
399
let mut staticlibs = vec ! ( ) ;
@@ -425,7 +426,7 @@ impl<'a> Context<'a> {
425
426
false )
426
427
} else {
427
428
if file. starts_with ( & staticlib_prefix[ ..] ) &&
428
- file. ends_with ( ".a" ) {
429
+ file. ends_with ( & staticpair . 1 ) {
429
430
staticlibs. push ( CrateMismatch {
430
431
path : path. to_path_buf ( ) ,
431
432
got : "static" . to_string ( )
@@ -644,6 +645,13 @@ impl<'a> Context<'a> {
644
645
( t. options . dll_prefix . clone ( ) , t. options . dll_suffix . clone ( ) )
645
646
}
646
647
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
+
647
655
fn find_commandline_library ( & mut self , locs : & [ String ] ) -> Option < Library > {
648
656
// First, filter out all libraries that look suspicious. We only accept
649
657
// files which actually exist that have the correct naming scheme for
0 commit comments