Bug#837478: Static libraries - PIC or PIE?
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.
>...
> 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.
> 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.
> 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.
> Thanks,
> Phillip
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
Reply to: