11use super :: command:: Command ;
22use super :: symbol_export;
3+ use crate :: back:: link:: SearchPaths ;
34use crate :: errors;
45use rustc_span:: symbol:: sym;
56
@@ -175,7 +176,7 @@ pub trait Linker {
175176 & mut self ,
176177 name : & str ,
177178 verbatim : bool ,
178- search_paths : & [ PathBuf ] ,
179+ search_paths : & SearchPaths ,
179180 ) ;
180181 fn link_staticlib_by_path ( & mut self , path : & Path ) ;
181182 fn link_whole_staticlib_by_path ( & mut self , path : & Path ) ;
@@ -496,7 +497,7 @@ impl<'a> Linker for GccLinker<'a> {
496497 & mut self ,
497498 name : & str ,
498499 verbatim : bool ,
499- search_paths : & [ PathBuf ] ,
500+ search_paths : & SearchPaths ,
500501 ) {
501502 self . hint_static ( ) ;
502503 let target = & self . sess . target ;
@@ -508,7 +509,8 @@ impl<'a> Linker for GccLinker<'a> {
508509 // -force_load is the macOS equivalent of --whole-archive, but it
509510 // involves passing the full path to the library to link.
510511 self . linker_arg ( "-force_load" ) ;
511- let lib = find_native_static_library ( name, verbatim, search_paths, self . sess ) ;
512+ let lib =
513+ find_native_static_library ( name, verbatim, search_paths. get ( self . sess ) , self . sess ) ;
512514 self . linker_arg ( & lib) ;
513515 }
514516 }
@@ -842,7 +844,7 @@ impl<'a> Linker for MsvcLinker<'a> {
842844 & mut self ,
843845 name : & str ,
844846 verbatim : bool ,
845- _search_paths : & [ PathBuf ] ,
847+ _search_paths : & SearchPaths ,
846848 ) {
847849 self . cmd . arg ( format ! ( "/WHOLEARCHIVE:{}{}" , name, if verbatim { "" } else { ".lib" } ) ) ;
848850 }
@@ -1073,7 +1075,7 @@ impl<'a> Linker for EmLinker<'a> {
10731075 & mut self ,
10741076 name : & str ,
10751077 verbatim : bool ,
1076- _search_paths : & [ PathBuf ] ,
1078+ _search_paths : & SearchPaths ,
10771079 ) {
10781080 // not supported?
10791081 self . link_staticlib_by_name ( name, verbatim) ;
@@ -1261,7 +1263,7 @@ impl<'a> Linker for WasmLd<'a> {
12611263 & mut self ,
12621264 name : & str ,
12631265 _verbatim : bool ,
1264- _search_paths : & [ PathBuf ] ,
1266+ _search_paths : & SearchPaths ,
12651267 ) {
12661268 self . cmd . arg ( "--whole-archive" ) . arg ( "-l" ) . arg ( name) . arg ( "--no-whole-archive" ) ;
12671269 }
@@ -1414,7 +1416,7 @@ impl<'a> Linker for L4Bender<'a> {
14141416 & mut self ,
14151417 name : & str ,
14161418 _verbatim : bool ,
1417- _search_paths : & [ PathBuf ] ,
1419+ _search_paths : & SearchPaths ,
14181420 ) {
14191421 self . hint_static ( ) ;
14201422 self . cmd . arg ( "--whole-archive" ) . arg ( format ! ( "-l{name}" ) ) ;
@@ -1600,10 +1602,11 @@ impl<'a> Linker for AixLinker<'a> {
16001602 & mut self ,
16011603 name : & str ,
16021604 verbatim : bool ,
1603- search_paths : & [ PathBuf ] ,
1605+ search_paths : & SearchPaths ,
16041606 ) {
16051607 self . hint_static ( ) ;
1606- let lib = find_native_static_library ( name, verbatim, search_paths, self . sess ) ;
1608+ let lib =
1609+ find_native_static_library ( name, verbatim, search_paths. get ( self . sess ) , self . sess ) ;
16071610 self . cmd . arg ( format ! ( "-bkeepfile:{}" , lib. to_str( ) . unwrap( ) ) ) ;
16081611 }
16091612
@@ -1815,7 +1818,7 @@ impl<'a> Linker for PtxLinker<'a> {
18151818 & mut self ,
18161819 _name : & str ,
18171820 _verbatim : bool ,
1818- _search_paths : & [ PathBuf ] ,
1821+ _search_paths : & SearchPaths ,
18191822 ) {
18201823 panic ! ( "staticlibs not supported" )
18211824 }
@@ -1909,7 +1912,7 @@ impl<'a> Linker for BpfLinker<'a> {
19091912 & mut self ,
19101913 _name : & str ,
19111914 _verbatim : bool ,
1912- _search_paths : & [ PathBuf ] ,
1915+ _search_paths : & SearchPaths ,
19131916 ) {
19141917 panic ! ( "staticlibs not supported" )
19151918 }
0 commit comments