The blank lld package is unwrapped and does not have the proper rpath configuration, so the loader wouldn't find all libraries.
$ CC="$CC -fuse-ld=lld" crystal eval 'puts "hello"'
/home/johannes/.cache/crystal/crystal-run-eval.tmp: error while loading shared libraries: libpcre2-8.so.0: cannot open shared object file: No such file or directory
With this patch, everything works fine.
This is particularly relevant for EXPORT_CC in Makefile which configures to use lld.
The blank
lld
package is unwrapped and does not have the proper rpath configuration, so the loader wouldn't find all libraries.With this patch, everything works fine.
This is particularly relevant for
EXPORT_CC
inMakefile
which configures to uselld
.Ref: https://github.com/NixOS/nixpkgs/issues/24744#issuecomment-1067800940