This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] pass -no_pie to LINK_GCC_C_SEQUENCE_SPEC on darwin



On 4 Dec 2011, at 20:19, Jack Howarth wrote:


On Sun, Dec 04, 2011 at 08:18:32PM +0100, Jakub Jelinek wrote:
On Sun, Dec 04, 2011 at 02:00:20PM -0500, Jack Howarth wrote:
at -m32/-m64 on x86_64-apple-darwin11 due to the -pie linker default. Iain had wanted
to leave these in place to encourage boehm-gc to be fixed but I doubt that is a realistic
goal in the near/middle term. Perhaps we could patch boehm-gc/ testsuite/lib/boehm-gc.exp
to pass -fno-pie on darwin (now that it is functional)?

I think we should just find a way to add -fno-pie... Are there any
flags that are added because we are doing gc that we can key off of?

-f{pic,PIC,pie,PIE,no-pic} aren't option that should have any effect on how
are binaries/shared libraries linked, these options control solely
compilation. -shared, -pie or lack of these options determines how are
things linked. So, either you should pass -no-pie or whatever linker option
you need to generate position dependent binaries by default, unless -shared
or -pie is specified, or you should add -no-pie or something similar, but
IMHO it shouldn't be -fno-pie, that is a compilation option/too similar to
them.

Jakub,
This isn't really an option on darwin11 and later since the linker defaults to
-pie and this results in warnings from the linker of the form...


ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no- pic) not allowed in code signed PIE, but used in _f from /var/tmp// ccVNy9V9.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

perhaps the question should be "why is this particualr code being built with non-default options?".
x86 darwin code should default to fPIC - so someone must be passing - mdynamic-no-pic or -fno-PIC etc.


(perhaps derived from the bootstrap usage of the "-mdynamic-no-pic" option - which suggests that this should be disabled for Darwin >= 11).

Iain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]