This is the mail archive of the
mailing list for the GCC project.
Re: Patch to correct LINK_PIE_SPEC
On Mon, Nov 15, 2004 at 01:30:36PM +0100, Peter S. Mazinger wrote:
> > This is incorrect.
> > When you specify -nostdlib or -nostartfiles, you certainly want -pie
> > being passed down to ld if given to gcc. These options tell the compiler
> No I certainly don't want to, and if I want to, then I'll provide a way
> for it.
> > that you are taking care of using the appropriate start files and/or libraries.
> > Not passing -pie here would be very surprising and likely breaks
> > e.g. glibc which heavily uses -nostdlib and -nostartfiles and uses -pie
> > too.
> that is really glibc's problem ;)
No, it is a bug introduced by your patch.
> As solution for glibc (I use it on uclibc) it can always overwrite the
> above by either:
> $(LD) -pie
> $(GCC) -Wl,-pie (I think it uses it like this, could be though wrong)
> glibc used pie last time I checked on nscd only (could have changed
Why should it? GCC -pie option means:
1) pass -pie to the linker if it supports it
2) user appropriate startfiles and/or libraries for PIE generation
With gcc -pie -nostartfiles -nostdlibs only 1) applies, but gcc should
still do that. Of course gcc -Wl,-pie -nostartfiles -nostdlibs will work too,
assuming ld supports -pie, but nobody should be forced to use that.