This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PING: [PATCH] Add --enable-static-pie to build static PIE


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]