@@ -98,7 +98,7 @@ pub struct Library {
98
98
pub frameworks : Vec < String > ,
99
99
pub framework_paths : Vec < PathBuf > ,
100
100
pub include_paths : Vec < PathBuf > ,
101
- pub rpaths : Vec < PathBuf > ,
101
+ pub ld_options : Vec < String > ,
102
102
pub defines : HashMap < String , Option < String > > ,
103
103
pub version : String ,
104
104
_priv : ( ) ,
@@ -558,7 +558,7 @@ impl Library {
558
558
libs : Vec :: new ( ) ,
559
559
link_paths : Vec :: new ( ) ,
560
560
include_paths : Vec :: new ( ) ,
561
- rpaths : Vec :: new ( ) ,
561
+ ld_options : Vec :: new ( ) ,
562
562
frameworks : Vec :: new ( ) ,
563
563
framework_paths : Vec :: new ( ) ,
564
564
defines : HashMap :: new ( ) ,
@@ -669,16 +669,29 @@ impl Library {
669
669
self . include_paths . push ( PathBuf :: from ( inc) ) ;
670
670
}
671
671
}
672
- "-rpath" => {
673
- if let Some ( rpath) = iter. next ( ) {
674
- let meta = format ! ( "rustc-link-arg=-Wl,-rpath,{}" , rpath) ;
675
- config. print_metadata ( & meta) ;
676
- self . rpaths . push ( PathBuf :: from ( rpath) ) ;
677
- }
678
- }
679
672
_ => ( ) ,
680
673
}
681
674
}
675
+
676
+ let mut linker_options = words
677
+ . iter ( )
678
+ . filter ( |arg| arg. starts_with ( "-Wl," ) )
679
+ . filter ( |arg| {
680
+ let option = & arg[ 4 ..] ;
681
+ for handled in & [ "-framework" , "-isystem" , "-iquote" , "-idirafter" ] {
682
+ if option. starts_with ( handled) {
683
+ return false ;
684
+ }
685
+ }
686
+
687
+ true
688
+ } ) ;
689
+
690
+ while let Some ( option) = linker_options. next ( ) {
691
+ let meta = format ! ( "rustc-link-arg={}" , option) ;
692
+ config. print_metadata ( & meta) ;
693
+ self . ld_options . push ( option. to_string ( ) ) ;
694
+ }
682
695
}
683
696
684
697
fn parse_modversion ( & mut self , output : & str ) {
0 commit comments