Hello all,

I've encountered a couple of further issues with the ldc2 compiler snap when it's installed on a 14.04 system. I'm sharing here to confirm if these are indeed ABI issues which might be fixable in terms of how snapcraft constructs the package.

The first [1] relates to zlib, which is included as part of the D standard library. This is built from a copy of the zlib C source and linked in to the rest of the library.

However, if I try to build a program that makes use of the zlib library modules, linking fails with the following error:

/usr/bin/gcc zlibtest.o -o zlibtest -L/snap/ldc2/x1/bin/../lib -lphobos2-ldc -ldruntime-ldc -Wl,--gc-sections -lrt -ldl -lpthread -lm -m64 /usr/bin/ld: /snap/ldc2/x1/bin/../lib/libphobos2-ldc.a(zutil.c.o): unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1

This matches the error message observed in a past Ubuntu issue related to binutils: https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/1545653

which would suggest that there's a problematic mismatch between the binutils used to build snap packages versus the one available on 14.04.

The second issue [2] relates to a plugin for the gold linker that is built for LDC to enable it to use link-time optimization. This works fine on 16.04, 16.10 and 17.04, but requesting LTO on 14.04 results in linking failing:

/usr/bin/gcc hello.o -o hello -Xlinker -plugin -Xlinker /snap/ldc2/x1/lib/LLVMgold-ldc.so -Xlinker -plugin-opt=O0 -L/snap/ldc2/x1/bin/../lib -lphobos2-ldc -ldruntime-ldc -Wl,--gc-sections -lrt -ldl -lpthread -lm -m64 /usr/bin/ld: /snap/ldc2/x1/lib/LLVMgold-ldc.so: error loading plugin: /snap/core/current/lib/x86_64-linux-gnu/libpthread.so.0: symbol __libc_vfork, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1

... which looks to me like it is probably a mismatch between the libc used to build the plugin, versus the libc of either the host system or the core snap?

I would presume that both the above would need a fix either snapcraft-side or core snap side ... ? Can anyone advise/assist?

Thanks & best wishes,

    -- Joe

[1] https://github.com/ldc-developers/ldc2.snap/issues/17
[2] https://github.com/ldc-developers/ldc2.snap/issues/18

--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft

Reply via email to