public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR lto/70258: [6 Regression] flag_pic is cleared for PIE in lto_post_options
@ 2016-03-16 21:47 H.J. Lu
  2016-03-17 10:00 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2016-03-16 21:47 UTC (permalink / raw)
  To: gcc-patches

Since PIE implies PIC, we should set flag_pic to flag_pie for PIE in
LTO.

Tested on x86-64.  OK for trunk?

H.J.
---
	PR lto/70258
	* lto-lang.c (lto_post_options): Set flag_pic to flag_pie for
	PIE.
---
 gcc/lto/lto-lang.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 691e9e2..b5efe3a 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -836,7 +836,7 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
       /* If -fPIC or -fPIE was used at compile time, be sure that
          flag_pie is 2.  */
       flag_pie = MAX (flag_pie, flag_pic);
-      flag_pic = 0;
+      flag_pic = flag_pie;
       break;
 
     case LTO_LINKER_OUTPUT_EXEC: /* Normal executable */
-- 
2.5.0

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

* Re: [PATCH] PR lto/70258: [6 Regression] flag_pic is cleared for PIE in lto_post_options
  2016-03-16 21:47 [PATCH] PR lto/70258: [6 Regression] flag_pic is cleared for PIE in lto_post_options H.J. Lu
@ 2016-03-17 10:00 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2016-03-17 10:00 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GCC Patches

On Wed, Mar 16, 2016 at 10:47 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Since PIE implies PIC, we should set flag_pic to flag_pie for PIE in
> LTO.
>
> Tested on x86-64.  OK for trunk?

Ok.  I wonder if we need to do sth to flag_shlib here as well?

Richard.

> H.J.
> ---
>         PR lto/70258
>         * lto-lang.c (lto_post_options): Set flag_pic to flag_pie for
>         PIE.
> ---
>  gcc/lto/lto-lang.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
> index 691e9e2..b5efe3a 100644
> --- a/gcc/lto/lto-lang.c
> +++ b/gcc/lto/lto-lang.c
> @@ -836,7 +836,7 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
>        /* If -fPIC or -fPIE was used at compile time, be sure that
>           flag_pie is 2.  */
>        flag_pie = MAX (flag_pie, flag_pic);
> -      flag_pic = 0;
> +      flag_pic = flag_pie;
>        break;
>
>      case LTO_LINKER_OUTPUT_EXEC: /* Normal executable */
> --
> 2.5.0
>

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

end of thread, other threads:[~2016-03-17 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 21:47 [PATCH] PR lto/70258: [6 Regression] flag_pic is cleared for PIE in lto_post_options H.J. Lu
2016-03-17 10:00 ` Richard Biener

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).