From: "Fāng-ruì Sòng" <maskray@google.com>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
Florian Weimer <fweimer@redhat.com>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] New option --enable-pie-programs
Date: Tue, 23 Nov 2021 17:04:35 -0800 [thread overview]
Message-ID: <CAFP8O3JX=cqcdxWZnVphk-OAq5FonPdA-xHZRyUQV3vq7PLQYA@mail.gmail.com> (raw)
In-Reply-To: <20211122234027.hgw4e6rjkqp3rqom@google.com>
On Mon, Nov 22, 2021 at 3:40 PM Fangrui Song <maskray@google.com> wrote:
>
> On 2021-11-18, H.J. Lu via Libc-alpha wrote:
> >On Thu, Nov 18, 2021 at 10:09 AM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
> >>
> >> On 11/18/21 23:28, H.J. Lu wrote:
> >> >> How do you see --disable-default-pie behaving with a compiler that
> >> >> produces PIE by default? That is, in case where
> >> >> libc_cv_cc_default_pie=yes? Should it add -fno-pie or leave it as is?
> >> >>
> >> >
> >> > It should add -fno-pie by default when building programs.
> >> >
> >>
> >> In that case I'm inclined towards --enable-default-pie=yes being the new
> >> default since AFAIK at least Ubuntu will have to start adding
> >> --enable-default-pie to its flags to maintain its current state with its
> >> default-pie toolchain. With Fedora too I think we'd prefer to build PIE
> >> by default and I suspect other distros would be OK with that too.
> >>
> >> Those that don't could add --disable-default-pie to continue maintaining
> >> status quo. This is a step forward security-wise IMO.
> >>
> >
> >Sounds reasonable to me.
>
> As a bonus, --enable-default-pie matches the GCC configure option name:)
>
> As of the auto mode which adds neither -fno-pic nor -fpie, I think it is
> unnecessary. --enable-default-pie + --disable-default-pie are sufficient.
>
> ---
>
> I think --enable-default-pie is the majority in the Linux world, so
> perhaps someone may want to make it the default in the upstream GCC.
I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103398
("configure: Enable --enable-default-pie by default for Linux"), but
it has been closed.
Anyone might want to chime in?
> After one or two llvm-project releases, I'll adjust my Clang patch
> https://reviews.llvm.org/D113372 to default to PIE.
next prev parent reply other threads:[~2021-11-24 1:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 13:52 Siddhesh Poyarekar
2021-11-16 13:58 ` Florian Weimer
2021-11-16 15:17 ` Siddhesh Poyarekar
2021-11-17 8:39 ` Florian Weimer
2021-11-17 8:50 ` Siddhesh Poyarekar
2021-11-17 9:10 ` Florian Weimer
2021-11-17 10:04 ` Siddhesh Poyarekar
2021-11-18 9:24 ` Siddhesh Poyarekar
2021-11-18 12:42 ` H.J. Lu
2021-11-18 12:49 ` Adhemerval Zanella
2021-11-18 13:26 ` Siddhesh Poyarekar
2021-11-18 13:41 ` H.J. Lu
2021-11-18 16:36 ` Siddhesh Poyarekar
2021-11-18 16:44 ` H.J. Lu
2021-11-18 16:49 ` Siddhesh Poyarekar
2021-11-18 16:56 ` H.J. Lu
2021-11-18 17:54 ` Siddhesh Poyarekar
2021-11-18 17:58 ` H.J. Lu
2021-11-18 18:09 ` Siddhesh Poyarekar
2021-11-18 18:18 ` H.J. Lu
2021-11-22 23:40 ` Fangrui Song
2021-11-24 1:04 ` Fāng-ruì Sòng [this message]
2021-11-24 1:27 ` Siddhesh Poyarekar
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='CAFP8O3JX=cqcdxWZnVphk-OAq5FonPdA-xHZRyUQV3vq7PLQYA@mail.gmail.com' \
--to=maskray@google.com \
--cc=fweimer@redhat.com \
--cc=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@gotplt.org \
/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).