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

H.J. Lu hjl.tools@gmail.com
Wed Sep 27 08:30:00 GMT 2017


On 9/26/17, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 26 Sep 2017, H.J. Lu wrote:
>
>> Any objections?
>
> This is a complicated feature; it clearly needs someone to do a detailed
> technical review before it can go in, however long that takes.  It's only
> borderline-obvious patches one might consider committing after a while in
> the absence of objections but without review or relevant maintainership.
>
> Perhaps you could expand more on the design and the rationale for the

Dynamic linker, ld.so, is a standalone program which can be loaded at
any address.  This patch adds a configure option, --enable-static-pie,
to embed the part of ld.so in static executable to create static position
independent executable (static PIE).

> choices made?  Why are x86_64 configure changes needed, for example?

This checks for linker fix:

https://sourceware.org/bugzilla/show_bug.cgi?id=21782

> What changes might other architectures need to support this feature (when

Static PIE should work on all architectures which support PIE.

> would an architecture need or not need architecture-specific configure
> changes, etc.), and have you tried a build-many-glibcs.py run with this
> option passed to all the builds to see how other architectures do?  Why

build-many-glibcs.py has no regressions.  But I didn't try --enable-static-pie
with build-many-glibcs.py.  I encourage target maintainers to give
hjl/pie/static
branch a try.

> build libc.a with -fPIE rather than building a separate PIE copy of libc.a
> (i.e., making this a bit more like --enable-profile as an option to build
> an additional library variant) and making GCC use that separate copy in
> the static-PIE case?
>

No separate PIE copy of libc.a, is used for static PIE to minimize
GCC driver change.  To improve system security, glibc can be built with
--enable-static-pie, and the same libc.a can be used to build both static
executable and static PIE.

> The patch is missing documentation in install.texi of the new configure
> option and associated regeneration of INSTALL.

Done.  I also updated NEWS.

Here is the updated patch.

Thanks.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-enable-static-pie-configure-option-to-build-stat.patch
Type: text/x-patch
Size: 21614 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170927/f378e5be/attachment.bin>


More information about the Libc-alpha mailing list