File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ impl Command {
109109
110110 // extensions
111111
112+ pub fn get_args ( & self ) -> & [ OsString ] {
113+ & self . args
114+ }
115+
112116 pub fn take_args ( & mut self ) -> Vec < OsString > {
113117 mem:: replace ( & mut self . args , Vec :: new ( ) )
114118 }
Original file line number Diff line number Diff line change @@ -668,7 +668,9 @@ fn link_natively(sess: &Session,
668668 // is safe because if the linker doesn't support -no-pie then it should not
669669 // default to linking executables as pie. Different versions of gcc seem to
670670 // 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" ) {
672674 info ! ( "linker output: {:?}" , out) ;
673675 warn ! ( "Linker does not support -no-pie command line option. Retrying without." ) ;
674676 for arg in cmd. take_args ( ) {
You can’t perform that action at this time.
0 commit comments