ldc-developers / ldc2.snap

Snap package definition for LDC, the LLVM-based D compiler
11 stars 4 forks source link

Prevent snapcraft patching RPATH for library dependencies #122

Closed WebDrake closed 3 years ago

WebDrake commented 3 years ago

By default snapcraft will rewrite the RPATH of binaries to link against libraries in the core snap. However, the prebuilt binaries used in the LDC package are designed and expected to link against host system libs. To allow them to do this we need to explicitly instruct snapcraft using the no-patchelf build attribute.

For background see: https://forum.snapcraft.io/t/librt-so-1-undefined-symbol-clock-nanosleep/16246/2

This should allow LTO builds with LDC >= 1.21.0 to work on more recent systems (e.g. Ubuntu 20.04+).

Fixes https://github.com/ldc-developers/ldc2.snap/issues/121