Darwin: Amend pie options when linking mdynamic-no-pic.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 6 Dec 2021 13:17:10 +0000 (13:17 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 8 Dec 2021 19:47:17 +0000 (19:47 +0000)
commit1c1563fb8ff227590eb5ab0fc3d22f3b0a57c241
treee755d46bd85d2716f426e83299dd8ba1b5038c40
parentdda85bc274e1148a0c576a8cb085bffadd0e54ab
Darwin: Amend pie options when linking mdynamic-no-pic.

On i686 Darwin from macOS 10.7 onwards the default is to
link executables as PIE, which conflicts with code generated
using mdynamic-no-pic.  Rather than warn about this and then
get the user to add -Wl,-no_pie, we can inject this in the
link specs.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:

* config/darwin.h (DARWIN_PIE_SPEC): Add -no_pie when
linking mdynamic-no-pic code on macOS > 10.7.
gcc/config/darwin.h