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] Fix pr80044, -static and -pie insanity, and pr81170


On Tue, Jul 18, 2017 at 07:49:48AM -0700, H.J. Lu wrote:
> The difference is with --enable-default-pie, the gcc driver doesn't pass
> both -pie and -static ld when "-static -pie" is used.   Does your change
> pass both -pie and -static ld when "-static -pie" is used?

Again, as I said in the original post: "In both cases you now will
have -static completely overriding -pie".

That means "gcc -pie -static" and "gcc -static -pie" just pass
"-static" to ld, and select the appropriate startup files for a static
executable, when configured with --disable-default-pie.  Which is what
happens currently for --enable-default-pie.

None of this is rocket science.  I know what I'm doing where the
linker and startup files are concerned, and I'm comfortable with the
gcc specs language.  The patch is simple!  It should be easy to
review, except for trying to understand the "-" lines.  Yet it has sat
unreviewed for nearly four weeks.  And it fixes a powerpc
--enable-default-pie bootstrap failure (pr81295).

Joseph, would you please take a look?
https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01678.html

I know there is more to do in this area, for example, it seems to me
that the HAVE_LD_PIE definition of GNU_USER_TARGET_STARTFILE_SPEC is
good for !HAVE_LD_PIE, and similarly for GNU_USE_TARGET_ENDFILE_SPEC.
And yes, I propagated that duplication into rs6000/sysv4.h, which
needs some serious tidying.  rs6000/sysv4.h linux support ought to be
using the gnu-user.h defines rather than copying them, something I've
told Segher I'll look at after this patch goes in.

-- 
Alan Modra
Australia Development Lab, IBM


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