11use super :: command:: Command ;
22use super :: symbol_export;
3- use crate :: back:: link:: SearchPaths ;
43use crate :: errors;
54use rustc_span:: symbol:: sym;
65
@@ -172,13 +171,7 @@ pub trait Linker {
172171 fn link_framework_by_name ( & mut self , _name : & str , _verbatim : bool , _as_needed : bool ) {
173172 bug ! ( "framework linked with unsupported linker" )
174173 }
175- fn link_staticlib_by_name (
176- & mut self ,
177- name : & str ,
178- verbatim : bool ,
179- whole_archive : bool ,
180- search_paths : & SearchPaths ,
181- ) ;
174+ fn link_staticlib_by_name ( & mut self , name : & str , verbatim : bool , whole_archive : bool ) ;
182175 fn link_staticlib_by_path ( & mut self , path : & Path , whole_archive : bool ) ;
183176 fn include_path ( & mut self , path : & Path ) ;
184177 fn framework_path ( & mut self , path : & Path ) ;
@@ -482,13 +475,7 @@ impl<'a> Linker for GccLinker<'a> {
482475 self . cmd . arg ( "-framework" ) . arg ( name) ;
483476 }
484477
485- fn link_staticlib_by_name (
486- & mut self ,
487- name : & str ,
488- verbatim : bool ,
489- whole_archive : bool ,
490- search_paths : & SearchPaths ,
491- ) {
478+ fn link_staticlib_by_name ( & mut self , name : & str , verbatim : bool , whole_archive : bool ) {
492479 self . hint_static ( ) ;
493480 let colon = if verbatim && self . is_gnu { ":" } else { "" } ;
494481 if !whole_archive {
@@ -497,8 +484,7 @@ impl<'a> Linker for GccLinker<'a> {
497484 // -force_load is the macOS equivalent of --whole-archive, but it
498485 // involves passing the full path to the library to link.
499486 self . linker_arg ( "-force_load" ) ;
500- let search_paths = search_paths. get ( self . sess ) ;
501- self . linker_arg ( find_native_static_library ( name, verbatim, search_paths, self . sess ) ) ;
487+ self . linker_arg ( find_native_static_library ( name, verbatim, self . sess ) ) ;
502488 } else {
503489 self . linker_arg ( "--whole-archive" ) ;
504490 self . cmd . arg ( format ! ( "-l{colon}{name}" ) ) ;
@@ -825,13 +811,7 @@ impl<'a> Linker for MsvcLinker<'a> {
825811 self . cmd . arg ( format ! ( "{}{}" , name, if verbatim { "" } else { ".lib" } ) ) ;
826812 }
827813
828- fn link_staticlib_by_name (
829- & mut self ,
830- name : & str ,
831- verbatim : bool ,
832- whole_archive : bool ,
833- _search_paths : & SearchPaths ,
834- ) {
814+ fn link_staticlib_by_name ( & mut self , name : & str , verbatim : bool , whole_archive : bool ) {
835815 let prefix = if whole_archive { "/WHOLEARCHIVE:" } else { "" } ;
836816 let suffix = if verbatim { "" } else { ".lib" } ;
837817 self . cmd . arg ( format ! ( "{prefix}{name}{suffix}" ) ) ;
@@ -1064,13 +1044,7 @@ impl<'a> Linker for EmLinker<'a> {
10641044 self . cmd . arg ( "-l" ) . arg ( name) ;
10651045 }
10661046
1067- fn link_staticlib_by_name (
1068- & mut self ,
1069- name : & str ,
1070- _verbatim : bool ,
1071- _whole_archive : bool ,
1072- _search_paths : & SearchPaths ,
1073- ) {
1047+ fn link_staticlib_by_name ( & mut self , name : & str , _verbatim : bool , _whole_archive : bool ) {
10741048 self . cmd . arg ( "-l" ) . arg ( name) ;
10751049 }
10761050
@@ -1243,13 +1217,7 @@ impl<'a> Linker for WasmLd<'a> {
12431217 self . cmd . arg ( "-l" ) . arg ( name) ;
12441218 }
12451219
1246- fn link_staticlib_by_name (
1247- & mut self ,
1248- name : & str ,
1249- _verbatim : bool ,
1250- whole_archive : bool ,
1251- _search_paths : & SearchPaths ,
1252- ) {
1220+ fn link_staticlib_by_name ( & mut self , name : & str , _verbatim : bool , whole_archive : bool ) {
12531221 if !whole_archive {
12541222 self . cmd . arg ( "-l" ) . arg ( name) ;
12551223 } else {
@@ -1396,13 +1364,7 @@ impl<'a> Linker for L4Bender<'a> {
13961364 bug ! ( "dylibs are not supported on L4Re" ) ;
13971365 }
13981366
1399- fn link_staticlib_by_name (
1400- & mut self ,
1401- name : & str ,
1402- _verbatim : bool ,
1403- whole_archive : bool ,
1404- _search_paths : & SearchPaths ,
1405- ) {
1367+ fn link_staticlib_by_name ( & mut self , name : & str , _verbatim : bool , whole_archive : bool ) {
14061368 self . hint_static ( ) ;
14071369 if !whole_archive {
14081370 self . cmd . arg ( format ! ( "-PC{name}" ) ) ;
@@ -1580,20 +1542,13 @@ impl<'a> Linker for AixLinker<'a> {
15801542 self . cmd . arg ( format ! ( "-l{name}" ) ) ;
15811543 }
15821544
1583- fn link_staticlib_by_name (
1584- & mut self ,
1585- name : & str ,
1586- verbatim : bool ,
1587- whole_archive : bool ,
1588- search_paths : & SearchPaths ,
1589- ) {
1545+ fn link_staticlib_by_name ( & mut self , name : & str , verbatim : bool , whole_archive : bool ) {
15901546 self . hint_static ( ) ;
15911547 if !whole_archive {
15921548 self . cmd . arg ( format ! ( "-l{name}" ) ) ;
15931549 } else {
15941550 let mut arg = OsString :: from ( "-bkeepfile:" ) ;
1595- let search_path = search_paths. get ( self . sess ) ;
1596- arg. push ( find_native_static_library ( name, verbatim, search_path, self . sess ) ) ;
1551+ arg. push ( find_native_static_library ( name, verbatim, self . sess ) ) ;
15971552 self . cmd . arg ( arg) ;
15981553 }
15991554 }
@@ -1792,13 +1747,7 @@ impl<'a> Linker for PtxLinker<'a> {
17921747 panic ! ( "external dylibs not supported" )
17931748 }
17941749
1795- fn link_staticlib_by_name (
1796- & mut self ,
1797- _name : & str ,
1798- _verbatim : bool ,
1799- _whole_archive : bool ,
1800- _search_paths : & SearchPaths ,
1801- ) {
1750+ fn link_staticlib_by_name ( & mut self , _name : & str , _verbatim : bool , _whole_archive : bool ) {
18021751 panic ! ( "staticlibs not supported" )
18031752 }
18041753
@@ -1880,13 +1829,7 @@ impl<'a> Linker for LlbcLinker<'a> {
18801829 panic ! ( "external dylibs not supported" )
18811830 }
18821831
1883- fn link_staticlib_by_name (
1884- & mut self ,
1885- _name : & str ,
1886- _verbatim : bool ,
1887- _whole_archive : bool ,
1888- _search_paths : & SearchPaths ,
1889- ) {
1832+ fn link_staticlib_by_name ( & mut self , _name : & str , _verbatim : bool , _whole_archive : bool ) {
18901833 panic ! ( "staticlibs not supported" )
18911834 }
18921835
@@ -1977,13 +1920,7 @@ impl<'a> Linker for BpfLinker<'a> {
19771920 panic ! ( "external dylibs not supported" )
19781921 }
19791922
1980- fn link_staticlib_by_name (
1981- & mut self ,
1982- _name : & str ,
1983- _verbatim : bool ,
1984- _whole_archive : bool ,
1985- _search_paths : & SearchPaths ,
1986- ) {
1923+ fn link_staticlib_by_name ( & mut self , _name : & str , _verbatim : bool , _whole_archive : bool ) {
19871924 panic ! ( "staticlibs not supported" )
19881925 }
19891926
0 commit comments