[Debian-ports-devel] FTBFS caused by fun with -fPIC/-fPIE

John David Anglin dave.anglin at bell.net
Fri Nov 25 00:18:08 UTC 2016


On 2016-11-24, at 2:26 PM, Michael Cree wrote:

> On Tue, Nov 22, 2016 at 10:06:46PM +0100, Tino Mettler wrote:
>> my package syncevolution FTBFS on alpha[1]. It looks like the culprit is 
>> in the libsynthesis package. The libsynthesissdk.a is created from objects 
>> built with -fPIE, but just on alpha[2].
> 
> I see it compiles objects twice, once with -fPIC and once with -fPIE, and
> it links the -fPIC compiled objects into the shared library and the -fPIE
> objects into the static library (if I have followed the log correctly).
> That seems sensible.
> 
>> This seems to cause an error when linked with objects build with -PIC.
>> 
>> How should I handle this? Is this a toolchain bug on alpha? Is it caused
>> by a bug in upstream software?
> 
> Release arches (but not the ports arches) were switched to compile all
> executables with -fPIE by default by gcc-6, and I have seem some discussion  
> that dpkg now sets -fPIE for all arches, but there has been some fallout
> from that.  But I don't know what the issues are.  CCed the
> debian-ports-devel list to see if someone can enlighten us.

As I understand it, there are two approaches.  If gcc is built with --enable-default-pie,
everything it builds will be pie compatible.  The other approach is to compile executables
and archive libraries with -fPIE.  One problem with this is gcc does not automatically
compile the crtstuff startup object for executables with -fPIE.

This breaks the gnupg2 build on hppa.

Note that -fPIE implies by default -fPIC unless a backend overrides this behaviour.
I don't see that this is a problem on hppa except there is a performance hit using
position independent code.

Probably, we should build crtbeginT.o with -fPIC on hppa.  However, I didn't see that
other targets are doing this.

Dave
--
John David Anglin	dave.anglin at bell.net






More information about the Debian-ports-devel mailing list