Position-independent code and Ubuntu 16.10

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Mon Feb 20 21:12:25 UTC 2017


Hello all,

Turns out my ldc2 compiler snap fails to work correctly on Ubuntu 16.10.  When 
linking programs it falls over with the following message:

/usr/bin/ld: /snap/ldc2/4/bin/../lib/libdruntime-ldc.a(errno.c.o): relocation 
R_X86_64_PC32 against symbol `__errno_location@@GLIBC_2.2.5' can not be used 
when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1

There's an upstream fix for this in progress, but I wanted to check my 
understanding of the situation regarding cleanbuild and classic snaps.

First, I'd thought that Ubuntu 16.04's GCC already generated 
position-independent code by default, but was this in fact only introduced with 
16.10 ... ?

Second, is this something that could be solved by snapcraft itself?  It's a bit 
unintuitive that one could do a `snapcraft cleanbuild` and find that in fact the 
snap won't work on a later Ubuntu release.

Thanks & best wishes,

     -- Joe




More information about the Snapcraft mailing list