1
1
use super :: command:: Command ;
2
2
use super :: symbol_export;
3
- use crate :: back:: link:: SearchPaths ;
4
3
use crate :: errors;
5
4
use rustc_span:: symbol:: sym;
6
5
@@ -172,13 +171,7 @@ pub trait Linker {
172
171
fn link_framework_by_name ( & mut self , _name : & str , _verbatim : bool , _as_needed : bool ) {
173
172
bug ! ( "framework linked with unsupported linker" )
174
173
}
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 ) ;
182
175
fn link_staticlib_by_path ( & mut self , path : & Path , whole_archive : bool ) ;
183
176
fn include_path ( & mut self , path : & Path ) ;
184
177
fn framework_path ( & mut self , path : & Path ) ;
@@ -482,13 +475,7 @@ impl<'a> Linker for GccLinker<'a> {
482
475
self . cmd . arg ( "-framework" ) . arg ( name) ;
483
476
}
484
477
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 ) {
492
479
self . hint_static ( ) ;
493
480
let colon = if verbatim && self . is_gnu { ":" } else { "" } ;
494
481
if !whole_archive {
@@ -497,8 +484,7 @@ impl<'a> Linker for GccLinker<'a> {
497
484
// -force_load is the macOS equivalent of --whole-archive, but it
498
485
// involves passing the full path to the library to link.
499
486
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 ) ) ;
502
488
} else {
503
489
self . linker_arg ( "--whole-archive" ) ;
504
490
self . cmd . arg ( format ! ( "-l{colon}{name}" ) ) ;
@@ -825,13 +811,7 @@ impl<'a> Linker for MsvcLinker<'a> {
825
811
self . cmd . arg ( format ! ( "{}{}" , name, if verbatim { "" } else { ".lib" } ) ) ;
826
812
}
827
813
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 ) {
835
815
let prefix = if whole_archive { "/WHOLEARCHIVE:" } else { "" } ;
836
816
let suffix = if verbatim { "" } else { ".lib" } ;
837
817
self . cmd . arg ( format ! ( "{prefix}{name}{suffix}" ) ) ;
@@ -1064,13 +1044,7 @@ impl<'a> Linker for EmLinker<'a> {
1064
1044
self . cmd . arg ( "-l" ) . arg ( name) ;
1065
1045
}
1066
1046
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 ) {
1074
1048
self . cmd . arg ( "-l" ) . arg ( name) ;
1075
1049
}
1076
1050
@@ -1243,13 +1217,7 @@ impl<'a> Linker for WasmLd<'a> {
1243
1217
self . cmd . arg ( "-l" ) . arg ( name) ;
1244
1218
}
1245
1219
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 ) {
1253
1221
if !whole_archive {
1254
1222
self . cmd . arg ( "-l" ) . arg ( name) ;
1255
1223
} else {
@@ -1396,13 +1364,7 @@ impl<'a> Linker for L4Bender<'a> {
1396
1364
bug ! ( "dylibs are not supported on L4Re" ) ;
1397
1365
}
1398
1366
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 ) {
1406
1368
self . hint_static ( ) ;
1407
1369
if !whole_archive {
1408
1370
self . cmd . arg ( format ! ( "-PC{name}" ) ) ;
@@ -1580,20 +1542,13 @@ impl<'a> Linker for AixLinker<'a> {
1580
1542
self . cmd . arg ( format ! ( "-l{name}" ) ) ;
1581
1543
}
1582
1544
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 ) {
1590
1546
self . hint_static ( ) ;
1591
1547
if !whole_archive {
1592
1548
self . cmd . arg ( format ! ( "-l{name}" ) ) ;
1593
1549
} else {
1594
1550
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 ) ) ;
1597
1552
self . cmd . arg ( arg) ;
1598
1553
}
1599
1554
}
@@ -1792,13 +1747,7 @@ impl<'a> Linker for PtxLinker<'a> {
1792
1747
panic ! ( "external dylibs not supported" )
1793
1748
}
1794
1749
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 ) {
1802
1751
panic ! ( "staticlibs not supported" )
1803
1752
}
1804
1753
@@ -1880,13 +1829,7 @@ impl<'a> Linker for LlbcLinker<'a> {
1880
1829
panic ! ( "external dylibs not supported" )
1881
1830
}
1882
1831
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 ) {
1890
1833
panic ! ( "staticlibs not supported" )
1891
1834
}
1892
1835
@@ -1977,13 +1920,7 @@ impl<'a> Linker for BpfLinker<'a> {
1977
1920
panic ! ( "external dylibs not supported" )
1978
1921
}
1979
1922
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 ) {
1987
1924
panic ! ( "staticlibs not supported" )
1988
1925
}
1989
1926
0 commit comments