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: [PATCH] [BZ #17841]: Build failure if compiler defaults to PIE


On Thu, May 28, 2015 at 7:59 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On 28 May 2015 06:05, H.J. Lu wrote:
>> To support building glibc with GCC 6 configured with --enable-default-pie,
>> which generates PIE by default, we need to build programs as PIE.  But
>> elf/tst-dlopen-aout must not be built as PIE since it tests dlopen on
>> ET_EXEC file and PIE is ET_DYN.
>
> i think you're going to need more patches than this to make it work.  Gentoo

What did you mean by "make it work"? I successfully built glibc with GCC 6
default to PIE and there were no regressions.

> has been building glibc this way for years though in our hardened project.
> we currently have:
> https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f14f39cfd7b959c806d822a2f6863873151f0a83
> https://sources.gentoo.org/sys-libs/glibc/files/2.20/glibc-2.20-hardened-inittls-nosysenter.patch
>
> and also this one (which your patch partially covers):
> https://sources.gentoo.org/sys-libs/glibc/files/2.17/glibc-2.17-hardened-pie.patch

I don't believe those changes are needed for GCC 6. I do have another
patch to build archives without PIE with GCC default to PIE.  But it
may be useful to have PIE archives so that people can build static
PIE with PIE achieves.

> although iirc, this one depends on changes in gcc itself related to producing
> pie by default.  it might need tweaking when aligning Gentoo's patches and the
> gcc-6 behavior.
>
>> OK for master?
>
> looks ok to me, but prob want to give time for others to comment
> -mike



-- 
H.J.


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