public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PING^2: [PATCH] PR driver/81523: Make -static override -pie
@ 2017-08-07 16:02 H.J. Lu
  2017-08-08 21:46 ` Joseph Myers
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 2017-08-07 16:02 UTC (permalink / raw)
  To: Alan Modra; +Cc: GCC Patches, Joseph S. Myers

On Mon, Jul 31, 2017 at 7:04 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Jul 31, 2017 at 5:37 PM, Alan Modra <amodra@gmail.com> wrote:
>> On Mon, Jul 31, 2017 at 08:04:13AM -0700, H.J. Lu wrote:
>>> On Mon, Jul 24, 2017 at 10:24 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> > On Sun, Jul 23, 2017 at 8:14 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> >> -static and -pie together behave differently depending on whether GCC is
>>> >> configured with --enable-default-pie.  On x86, "-static -pie" fails to
>>> >> create executable when --enable-default-pie isn't used, but creates a
>>> >> static executable when --enable-default-pie is used.  This patch makes
>>> >> -static completely override -pie to create a static executable, regardless
>>> >> if --enable-default-pie is used to configure GCC.
>>> >>
>>> >> OK for master?
>>> >>
>>> >> H.J.
>>> >> --
>>> >> 2017-07-23  Alan Modra  <amodra@gmail.com>
>>> >>             H.J. Lu  <hongjiu.lu@intel.com>
>>> >>
>>> >> gcc/
>>> >>
>>> >>         PR driver/81523
>>> >>         * gcc.c (NO_PIE_SPEC): Delete.
>>> >>         (PIE_SPEC): Define as !no-pie/pie.  Move static|shared|r
>>> >>         exclusion..
>>> >>         (LINK_PIE_SPEC): ..to here.
>>> >>         * config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Correct
>>> >>         chain of crtbegin*.o selection, update for PIE_SPEC changes and
>>> >>         format.
>>> >>         (GNU_USER_TARGET_ENDFILE_SPEC): Similarly.
>>> >>         * config/sol2.h (STARTFILE_CRTBEGIN_SPEC): Similarly.
>>> >>         (ENDFILE_CRTEND_SPEC): Similarly.
>>> >>
>>> >
>>> > We need to add %{no-pie:} to LINK_COMMAND_SPEC to prevent an error
>>> > message when PIE isn't enabled by default.   Here is the updated patch with
>>> > a testcase.
>>> >
>>>
>>> PING.  I am enclosing the patch here.
>>
>> For anyone looking at this, the patch enclosed here is mine from
>> https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01678.html minus some PR
>> numbers and the powerpc specific part, plus testsuite (which looks to
>> me like HJ copied pie-static-1.c to pie-static-2.c then forgot to
>> change the order of -pie and -static), plus a tweak to
>> LINK_COMMAND_SPEC.  The LINK_COMMAND_SPEC change looks good to me,
>> except for the comment which doesn't exactly match the code.  That
>> change is necessary because I ignorantly removed %{no-pie:} from
>> LINK_PIE_SPEC without adding it back elsewhere.
>
> Here is the updated patch.
>

Hi Joseph,

Can you take a look at this patch:

https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00011.html

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PING^2: [PATCH] PR driver/81523: Make -static override -pie
  2017-08-07 16:02 PING^2: [PATCH] PR driver/81523: Make -static override -pie H.J. Lu
@ 2017-08-08 21:46 ` Joseph Myers
  2017-08-12 16:03   ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Myers @ 2017-08-08 21:46 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Alan Modra, GCC Patches

On Mon, 7 Aug 2017, H.J. Lu wrote:

> Hi Joseph,
> 
> Can you take a look at this patch:
> 
> https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00011.html

This patch is OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PING^2: [PATCH] PR driver/81523: Make -static override -pie
  2017-08-08 21:46 ` Joseph Myers
@ 2017-08-12 16:03   ` Alan Modra
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2017-08-12 16:03 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Richard Biener, Jakub Jelinek, H.J. Lu, GCC Patches

On Tue, Aug 08, 2017 at 09:45:49PM +0000, Joseph Myers wrote:
> On Mon, 7 Aug 2017, H.J. Lu wrote:
> > https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00011.html
> 
> This patch is OK.

Is this OK for gcc-7 and gcc-6 too?  I'm asking not just to fix
"-static -pie" on x86 but because I'd like to fix --enable-default-pie
for powerpc on the branches.  If this patch is accepted for the
branches then both it and my r251065 patch are simple cherry-picks.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-12 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 16:02 PING^2: [PATCH] PR driver/81523: Make -static override -pie H.J. Lu
2017-08-08 21:46 ` Joseph Myers
2017-08-12 16:03   ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).