File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ impl Command {
109
109
110
110
// extensions
111
111
112
+ pub fn get_args ( & self ) -> & [ OsString ] {
113
+ & self . args
114
+ }
115
+
112
116
pub fn take_args ( & mut self ) -> Vec < OsString > {
113
117
mem:: replace ( & mut self . args , Vec :: new ( ) )
114
118
}
Original file line number Diff line number Diff line change @@ -668,7 +668,9 @@ fn link_natively(sess: &Session,
668
668
// is safe because if the linker doesn't support -no-pie then it should not
669
669
// default to linking executables as pie. Different versions of gcc seem to
670
670
// use different quotes in the error message so don't check for them.
671
- if out. contains ( "unrecognized command line option" ) && out. contains ( "-no-pie" ) {
671
+ if out. contains ( "unrecognized command line option" ) &&
672
+ out. contains ( "-no-pie" ) &&
673
+ cmd. get_args ( ) . iter ( ) . any ( |e| e. to_string_lossy ( ) == "-no-pie" ) {
672
674
info ! ( "linker output: {:?}" , out) ;
673
675
warn ! ( "Linker does not support -no-pie command line option. Retrying without." ) ;
674
676
for arg in cmd. take_args ( ) {
You can’t perform that action at this time.
0 commit comments