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

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


On 9/27/17, Joseph Myers <joseph@codesourcery.com> wrote:
> On Wed, 27 Sep 2017, H.J. Lu wrote:
>
>> > 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.
>
> I think the most useful test for this purpose (of assessing architecture
> support) is adding --enable-static-pie alongside --enable-profile in
> build-many-glibcs.py and seeing how the build goes.

I will do that.

>> 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
>
> The question should be what's best for the GNU system and the GNU
> toolchain as a whole, rather than minimizing the GCC driver changes.

PIE libc.a can be used to create both static executable and static PIE.
Also CCC from some OSVs are now default to PIE.  There libc.a is built
with PIE today.  We are discourage static executables.  I don't see the
need for a separate PIE copy of libc.a.  That is OSV has a choice to
either have PIE libc.a or non-PIE libc.a.  I am expecting PIE libc.a
is provided by more OSVs.

>> > The patch is missing documentation in install.texi of the new configure
>> > option and associated regeneration of INSTALL.
>>
>> Done.  I also updated NEWS.
>
> To me, both the install.texi and NEWS changes read as saying that programs
> such as ldconfig are built as PIEs.  That's a separate matter from

All static executables, including tests,  within glibc are built as
static PIE when
 --enable-static-pie is used.  That is how I noticed that
--eh-frame-hdr is needed
for static PIE.

> supporting user programs built as static PIEs.  I'd have thought the main
> point of this feature, which is the one that NEWS and install.texi should
> emphasize, is the support for user programs built as static PIEs.
>


-- 
H.J.



More information about the Libc-alpha mailing list