Pass -fpie to the Darwin linker
Jakub Jelinek
jakub@redhat.com
Fri Jun 1 23:09:00 GMT 2007
On Fri, Jun 01, 2007 at 03:57:05PM -0700, Geoffrey Keating wrote:
>
> Pretty obvious. I added the testcase because there doesn't seem to be
> any test that involves linking a PIE executable.
>
> Bootstrapped and tested on powerpc-darwin8. I also checked that GCC
> does try to pass -pie to the linker.
Not so obvious, at least it diverges from what is done on other OSes.
-fpie and -fPIE are compilation options like -fpic or -fPIC.
gcc -pie option (which is passed through to ld, see
LINK_PIE_SPEC) is a link option, similar to -shared.
Using -fpic on a command line doesn't imply -shared either.
Jakub
More information about the Gcc-patches
mailing list