This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Pass -fpie to the Darwin linker
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Geoffrey Keating <gkeating at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Jun 2007 19:08:43 -0400
- Subject: Re: Pass -fpie to the Darwin linker
- References: <20070601225705.1472565F3554@geoffk5.apple.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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