Bug#837478: Static libraries - PIC or PIE?
On Mon, Nov 21, 2016 at 9:21 AM, Adrian Bunk <bunk@stusta.de> wrote:
> On Sat, Nov 19, 2016 at 07:12:19PM -0700, Phillip Hellewell wrote:
>>...
>> - Now tries to link a few of the libraries statically (e.g.,
>> libicuuc.a). ld blows up with a bunch of relocation R_X86_64_32S, blah
>> blah blah, recompile with -fPIC errors.
>
> The error message is misleading, PIE is sufficient.
Ah yes, it would be nice if gcc could alter this error message slightly.
>> All they know is that for some reason they can't link most libraries
>> statically without getting a bunch of weird errors. It could take hours of
>> research to figure out a workaround like -no-pie.
>
> Submitting a bug against release-notes for having everything PIE
> releated properly documented would make sense.
Agreed. I'll try to submit that if I remember and get time; unless
you beat me to it, which I wouldn't mind at all :)
>> Given that GCC 6 on Debian 9 now does PIE executables by default, I think
>> it becomes very necessary to consider that Debian out to build all static
>> libraries with -fPIE (or -fPIC).
>
> All static libraries in Debian will be recompiled with -fPIE before the
> release of stretch, for the ones where no uploads are happening for
> other reasons binNMUs will be done.
Awesome! That works for me :)
>> Otherwise you're going to get thousands
>> and thousands of users having no clue why they can't link anything
>> statically. Plus if you did that you wouldn't have to build everything
>> twice. Win-Win !!! So why not?
>
> Building all static libraries with -fPIC (not just -fPIE) would be an
> insane amount of work, since you don't want to also build the binaries
> with -fPIC.
I'm happy with -fPIE for the static libraries. Thanks!
Phillip
Reply to: