Re: Static libraries - PIC or PIE?
On Sun, Oct 23, 2016 at 12:29:42PM +0200, Bálint Réczey wrote:
> Hi Ardian,
Hi Bláint, ;-)
> 2016-10-23 10:18 GMT+02:00 Adrian Bunk <firstname.lastname@example.org>:
> > Hi Bálint,
> > there is some confusion regarding how static libraries should be
> > compiled now.
> > Your bugs (e.g. #837350) say "Please build libfoo.a with -fPIC".
> > Why do these say -fPIC and not -fPIE?
> I suggest using -fPIC, because then the shared libraries would be
> usable in shared (PIC) libraries libraries, too.
you have created a lot of confusion by mixing two separate issues.
One of the worst examples:
#837658 libfl-dev: Please build libfl_pic.a with -fPIC
#841203 nmu: flex_2.6.1-1
A _pic.a library compiled without -fPIC sounds like a clear bug,
and a binNMU that will recompile it with -fPIE won't fix that bug.
> This in many cases also simplify debian/rules.
No, it would actually make building static libraries a real pain.
Think of a normal source package building shared libraries,
static libraries and some programs.
How do you want to tell the build system of the package that it should
build the static libraries with -fPIC, but not the programs?
> I also suggested changing the policy #837478.
Unless I misunderstand something, current policy is perfectly fine
for the PIE change, and your claims in #837478 that building static
libraries with -fPIC would be required for PIE binaries are not
> > My current understanding is that a binNMU would recompile the the static
> > library with PIE (not PIC), and that this is sufficient.
> In most of the cases this would be sufficient, but at the time I filed the
> bugs the default was -no-pie, thus it was not an option.
It is clear that the binNMUs have to happen after the change.
It would have created less confusion to not file bugs in cases where no
maintainer action is required, ask the release team to schedule binNMUs
for the static libraries known to need them immediately after the
compiler change, and announce on debian-devel-announce that some
transient build failures might be observed immediately after the
compiler change until the binNMUs are done.
I'll sort out what binNMUs are required later today.
> I'm OK with performing binnmu-s and decreasing the severity of the 'solved'
> bugs to wishlist.
With the exception of special cases like #837658 a binNMU will
completely solve it, and there is no point in having wishlist
bugs for something not really permitted by policy.
"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