File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -713,6 +713,7 @@ fn link_natively(sess: &Session,
713
713
// linking executables as pie. Different versions of gcc seem to use
714
714
// different quotes in the error message so don't check for them.
715
715
if sess. target . target . options . linker_is_gnu &&
716
+ sess. linker_flavor ( ) != LinkerFlavor :: Ld &&
716
717
( out. contains ( "unrecognized command line option" ) ||
717
718
out. contains ( "unknown argument" ) ) &&
718
719
out. contains ( "-no-pie" ) &&
@@ -1008,8 +1009,9 @@ fn link_args(cmd: &mut Linker,
1008
1009
} else {
1009
1010
// recent versions of gcc can be configured to generate position
1010
1011
// independent executables by default. We have to pass -no-pie to
1011
- // explicitly turn that off.
1012
- if sess. target . target . options . linker_is_gnu {
1012
+ // explicitly turn that off. Not applicable to ld.
1013
+ if sess. target . target . options . linker_is_gnu
1014
+ && sess. linker_flavor ( ) != LinkerFlavor :: Ld {
1013
1015
cmd. no_position_independent_executable ( ) ;
1014
1016
}
1015
1017
}
You can’t perform that action at this time.
0 commit comments