This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PING: [PATCH] Add --enable-static-pie to build static PIE
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, nd <nd at arm dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 23 Oct 2017 15:27:10 -0700
- Subject: Re: PING: [PATCH] Add --enable-static-pie to build static PIE
- Authentication-results: sourceware.org; auth=none
On Thu, Oct 12, 2017 at 3:26 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On 10/12/17, Joseph Myers <joseph@codesourcery.com> wrote:
>> On Thu, 12 Oct 2017, H.J. Lu wrote:
>>
>>> Here is the updated patch. The main change is that gPcrt1.o is also
>>> added
>>> to create static PIE with -pg.
>>
>> The attached build-many-glibcs.py patch is definitely inappropriate for
>
> Oops. Here is the right patch.
>
>> master. If --enable-static-pie is approved, it would be appropriate to
>> build one or two additional glibc variants in build-many-glibcs.py with
>
> Sure.
>
>> this option. It is *not* appropriate to add it to all builds there,
>> because of how (as discussed) the option is different from
>> --enable-profile, changing how the normal static libc is built instead of
>> adding a new variable.
>>
>
> I will look into it after --enable-static-pie is merged.
>
PING.
The main issues with static PIE are
1. Many binutils targets don't handle PIE properly. I opened a few binutils
bugs for PIE.
2. Many assembly codes under sysdeps assumes PIC == SHARED.
I opened a glibc bug for it.
3. Some dl-machine.h files may not handle undefined weak symbols in PIE
properly. But we will never know for sure unless we build static PIE.
I'd like to add static PIE support to glibc, which works on i686 and x86-64.
I will help other target developers get static PIE working for his/her target.
Thanks.
--
H.J.