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.
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