crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.39k stars 1.62k forks source link

Fix `shell.nix` use `llvmPackages.bintools` with wrapper for rpath config #14583

Closed straight-shoota closed 4 months ago

straight-shoota commented 5 months ago

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.

Ref: https://github.com/NixOS/nixpkgs/issues/24744#issuecomment-1067800940