public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: Alexandre Oliva <oliva@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] hardened: use LD_PIE_SPEC only if defined
Date: Thu, 14 Dec 2023 15:06:47 -0500	[thread overview]
Message-ID: <ZXtgV_BWLvKrie4B@redhat.com> (raw)
In-Reply-To: <orwmtg36na.fsf@lxoliva.fsfla.org>

On Thu, Dec 14, 2023 at 04:50:49PM -0300, Alexandre Oliva wrote:
> 
> sol2.h may define LINK_PIE_SPEC and leave LD_PIE_SPEC undefined, but
> gcc.cc will only provide a LD_PIE_SPEC definition if LINK_PIE_SPEC is
> not defined, and then it uses LD_PIE_SPEC guarded by #ifdef HAVE_LD_PIE
> only.  Add LD_PIE_SPEC to the guard.
> 
> Regstrapped on x86_64-linux-gnu; also testing on sparc-solaris2.11.3,
> where I hit the problem and couldn't build a baseline to compare with.
> Ok to install?
 
OK, thanks.  Jakub notified me of this problem a few days ago and
I forgot about it, sorry :(.
 
> gcc/ChangeLog
> 
> 	* gcc.cc (process_command): Use LD_PIE_SPEC only if defined.
> ---
>  gcc/gcc.cc |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/gcc.cc b/gcc/gcc.cc
> index 701f5cdfb59c8..d5e02c11cb05d 100644
> --- a/gcc/gcc.cc
> +++ b/gcc/gcc.cc
> @@ -5008,7 +5008,7 @@ process_command (unsigned int decoded_options_count,
>      {
>        if (!any_link_options_p && !static_p)
>  	{
> -#ifdef HAVE_LD_PIE
> +#if defined HAVE_LD_PIE && defined LD_PIE_SPEC
>  	  save_switch (LD_PIE_SPEC, 0, NULL, /*validated=*/true, /*known=*/false);
>  #endif
>  	  /* These are passed straight down to collect2 so we have to break
> 
> -- 
> Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
>    Free Software Activist                   GNU Toolchain Engineer
> More tolerance and less prejudice are key for inclusion and diversity
> Excluding neuro-others for not behaving ""normal"" is *not* inclusive
> 

Marek


      reply	other threads:[~2023-12-14 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 19:50 Alexandre Oliva
2023-12-14 20:06 ` Marek Polacek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZXtgV_BWLvKrie4B@redhat.com \
    --to=polacek@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=oliva@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).