1
1
use super :: command:: Command ;
2
2
use super :: symbol_export;
3
+ use crate :: back:: link:: SearchPaths ;
3
4
use crate :: errors;
4
5
use rustc_span:: symbol:: sym;
5
6
@@ -175,7 +176,7 @@ pub trait Linker {
175
176
& mut self ,
176
177
name : & str ,
177
178
verbatim : bool ,
178
- search_paths : & [ PathBuf ] ,
179
+ search_paths : & SearchPaths ,
179
180
) ;
180
181
fn link_staticlib_by_path ( & mut self , path : & Path ) ;
181
182
fn link_whole_staticlib_by_path ( & mut self , path : & Path ) ;
@@ -496,7 +497,7 @@ impl<'a> Linker for GccLinker<'a> {
496
497
& mut self ,
497
498
name : & str ,
498
499
verbatim : bool ,
499
- search_paths : & [ PathBuf ] ,
500
+ search_paths : & SearchPaths ,
500
501
) {
501
502
self . hint_static ( ) ;
502
503
let target = & self . sess . target ;
@@ -508,7 +509,8 @@ impl<'a> Linker for GccLinker<'a> {
508
509
// -force_load is the macOS equivalent of --whole-archive, but it
509
510
// involves passing the full path to the library to link.
510
511
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 ) ;
512
514
self . linker_arg ( & lib) ;
513
515
}
514
516
}
@@ -842,7 +844,7 @@ impl<'a> Linker for MsvcLinker<'a> {
842
844
& mut self ,
843
845
name : & str ,
844
846
verbatim : bool ,
845
- _search_paths : & [ PathBuf ] ,
847
+ _search_paths : & SearchPaths ,
846
848
) {
847
849
self . cmd . arg ( format ! ( "/WHOLEARCHIVE:{}{}" , name, if verbatim { "" } else { ".lib" } ) ) ;
848
850
}
@@ -1073,7 +1075,7 @@ impl<'a> Linker for EmLinker<'a> {
1073
1075
& mut self ,
1074
1076
name : & str ,
1075
1077
verbatim : bool ,
1076
- _search_paths : & [ PathBuf ] ,
1078
+ _search_paths : & SearchPaths ,
1077
1079
) {
1078
1080
// not supported?
1079
1081
self . link_staticlib_by_name ( name, verbatim) ;
@@ -1261,7 +1263,7 @@ impl<'a> Linker for WasmLd<'a> {
1261
1263
& mut self ,
1262
1264
name : & str ,
1263
1265
_verbatim : bool ,
1264
- _search_paths : & [ PathBuf ] ,
1266
+ _search_paths : & SearchPaths ,
1265
1267
) {
1266
1268
self . cmd . arg ( "--whole-archive" ) . arg ( "-l" ) . arg ( name) . arg ( "--no-whole-archive" ) ;
1267
1269
}
@@ -1414,7 +1416,7 @@ impl<'a> Linker for L4Bender<'a> {
1414
1416
& mut self ,
1415
1417
name : & str ,
1416
1418
_verbatim : bool ,
1417
- _search_paths : & [ PathBuf ] ,
1419
+ _search_paths : & SearchPaths ,
1418
1420
) {
1419
1421
self . hint_static ( ) ;
1420
1422
self . cmd . arg ( "--whole-archive" ) . arg ( format ! ( "-l{name}" ) ) ;
@@ -1600,10 +1602,11 @@ impl<'a> Linker for AixLinker<'a> {
1600
1602
& mut self ,
1601
1603
name : & str ,
1602
1604
verbatim : bool ,
1603
- search_paths : & [ PathBuf ] ,
1605
+ search_paths : & SearchPaths ,
1604
1606
) {
1605
1607
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 ) ;
1607
1610
self . cmd . arg ( format ! ( "-bkeepfile:{}" , lib. to_str( ) . unwrap( ) ) ) ;
1608
1611
}
1609
1612
@@ -1815,7 +1818,7 @@ impl<'a> Linker for PtxLinker<'a> {
1815
1818
& mut self ,
1816
1819
_name : & str ,
1817
1820
_verbatim : bool ,
1818
- _search_paths : & [ PathBuf ] ,
1821
+ _search_paths : & SearchPaths ,
1819
1822
) {
1820
1823
panic ! ( "staticlibs not supported" )
1821
1824
}
@@ -1909,7 +1912,7 @@ impl<'a> Linker for BpfLinker<'a> {
1909
1912
& mut self ,
1910
1913
_name : & str ,
1911
1914
_verbatim : bool ,
1912
- _search_paths : & [ PathBuf ] ,
1915
+ _search_paths : & SearchPaths ,
1913
1916
) {
1914
1917
panic ! ( "staticlibs not supported" )
1915
1918
}
0 commit comments