Re: Position-independent code and Ubuntu 16.10
On 22/02/17 00:39, Joseph Rushton Wakeling wrote: OK, fair enough. In my case I think it was the C-library parts of the D standard library that were being compiled without PIC. Seems OK to assume this may have been a project-specific thing, then (which is now fixed upstream). Just for the record: this issue is fixed in the most recent revision of the package. Seth, thanks for your help and advice! -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Position-independent code and Ubuntu 16.10
On 22/02/17 00:08, Seth Arnold wrote: Libraries are usually compiled as position independent code; this has not changed. OK, fair enough. In my case I think it was the C-library parts of the D standard library that were being compiled without PIC. Seems OK to assume this may have been a project-specific thing, then (which is now fixed upstream). -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Position-independent code and Ubuntu 16.10
On Tue, Feb 21, 2017 at 11:01:48PM +0100, Joseph Rushton Wakeling wrote: > OK, thanks for the clarification. So this raises the question ... > can/should snapcraft ensure this option is used when building snap packages? > > It's obviously not an issue for most apps, but any snap exposing a > development library in any way is presumably going to risk being unusable on > 16.10 or later if the package author doesn't realize this is necessary. Position independent executables have been supported for many years; the recent change was to make this the default output format, so that we can increase the amount of system services and programs that can benefit from the address space layout randomization exploit mitigation. Fixed-position executables continue to be supported and we have no plans to forbid them. Libraries are usually compiled as position independent code; this has not changed. As far as I know, only nginx and the linux kernel were affected by these changes. (Sorry kernel developers. I know git bisect is harder.) Thanks signature.asc Description: PGP signature -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Position-independent code and Ubuntu 16.10
On 21/02/17 22:47, Seth Arnold wrote: On Mon, Feb 20, 2017 at 10:12:25PM +0100, Joseph Rushton Wakeling wrote: 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 ... ? Correct, this was changed for 16.10: https://wiki.ubuntu.com/YakketyYak/ReleaseNotes#GCC OK, thanks for the clarification. So this raises the question ... can/should snapcraft ensure this option is used when building snap packages? It's obviously not an issue for most apps, but any snap exposing a development library in any way is presumably going to risk being unusable on 16.10 or later if the package author doesn't realize this is necessary. -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Position-independent code and Ubuntu 16.10
On Mon, Feb 20, 2017 at 10:12:25PM +0100, Joseph Rushton Wakeling wrote: > 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 ... ? Correct, this was changed for 16.10: https://wiki.ubuntu.com/YakketyYak/ReleaseNotes#GCC Thanks signature.asc Description: PGP signature -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Position-independent code and Ubuntu 16.10
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 -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft