From: "H.J. Lu" <hjl.tools@gmail.com>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
Florian Weimer <fweimer@redhat.com>,
Siddhesh Poyarekar <siddhesh@sourceware.org>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] New option --enable-pie-programs
Date: Thu, 18 Nov 2021 05:41:34 -0800 [thread overview]
Message-ID: <CAMe9rOqj0tkG99jfDNELyHBXzQbve2CWDRO2OpHmSpZn5A13XQ@mail.gmail.com> (raw)
In-Reply-To: <c867421e-398e-d369-2c67-919bce3f6cda@gotplt.org>
On Thu, Nov 18, 2021 at 5:26 AM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
>
> On 11/18/21 18:19, Adhemerval Zanella wrote:
> >
> >
> > On 18/11/2021 09:42, H.J. Lu via Libc-alpha wrote:
> >> On Thu, Nov 18, 2021 at 1:24 AM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
> >>>
> >>> On 11/17/21 15:34, Siddhesh Poyarekar via Libc-alpha wrote:
> >>>> I suppose you're right. That is current behaviour with
> >>>> --enable-static-pie too; wouldn't a similar argument hold for
> >>>> --enable-static-pie=no? Or is the rationale in that case is that
> >>>> *static-pie* is disabled, not pie itself and hence the default PIE
> >>>> toolchain could get away with building PIE dynamic programs, just not
> >>>> static ones?
> >>>>
> >>>> I wonder if the clearer option is to have a new
> >>>> --enable-pie=<no|dynamic|yes/full>, where "no" disables PIE (even on
> >>>> default-PIE toolchains), "dynamic" enables PIE for dynamic programs and
> >>>> "full" or "yes" enables static-pie on architectures that support it,
> >>>> terminating with an error if it's not supported. --enable-static-pie=no
> >>>> could then imply --enable-pie=dynamic and could be deprecated. I don't
> >>>> remember if we have ever deprecated configure flags before.
> >>>>
> >>>> Even simpler, we could have just a yes/no option and enable static-pie
> >>>> transparently on architectures that support it, making an explicit
> >>>> --enable-static-pie=no equivalent to disabling all PIE. It may in
> >>>> theory break a use case but I don't know if there's actually a use case
> >>>> where one would strictly want only dynamic PIE and not static PIE.
> >>>
> >>> A third option (as we discussed offlist yesterday) could be to always
> >>> build glibc dynamic programs as PIE as long as the toolchain supports
> >>> it. Would non-distribution use cases be adversely affected by not
> >>> having an option to produce non-PIE glibc programs, e.g. iconvconfig,
> >>> getconf, etc.?
> >>
> >> How about --enable-default-pie?
>
> HJ, could you describe how you'd expect it to behave? Would it map to
> any of the options I describe above?
--enable-default-pie builds all dynamic programs, including tests, as PIE. If
compiler/target supports static PIE, it also builds static programs as PIE.
> > Another option would be to --enable-pie=<no,auto> where 'no' disables PIE
> > for both both static and dynamic installed programs and 'auto' checks
> > compiler support and enables for everything. I would like to provide less
> > options which results in less permutations to test.
>
> OK, that sounds like the two option alternative I described above.
>
> Siddhesh
--
H.J.
next prev parent reply other threads:[~2021-11-18 13:42 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 [this message]
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
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=CAMe9rOqj0tkG99jfDNELyHBXzQbve2CWDRO2OpHmSpZn5A13XQ@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@gotplt.org \
--cc=siddhesh@sourceware.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).