RUNPATH is ignored when nix-ld-rs is enabled
Hi! It seems like nix-ld-rs is ignoring RPATH and binaries are linked to whatever libraries nix-ld exposes instead.
```
❯ /nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash
/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash: symbol lookup error: /run/current-system/sw/share/nix-ld/lib/libc.so.6: undefined symbol: __tunable_is_initialized, version GLIBC_PRIVATE
❯ patchelf --print-rpath /nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash
/nix/store/9y8pmvk8gdwwznmkzxa6pwyah52xy3nk-glibc-2.38-27/lib
❯ strace -e openat /nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash
openat(AT_FDCWD, "/run/current-system/sw/share/nix-ld/lib/glibc-hwcaps/x86-64-v3/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/sw/share/nix-ld/lib/glibc-hwcaps/x86-64-v2/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/sw/share/nix-ld/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/run/current-system/sw/share/nix-ld/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash: symbol lookup error: /run/current-system/sw/share/nix-ld/lib/libc.so.6: undefined symbol: __tunable_is_initialized, version GLIBC_PRIVATE
+++ exited with 127 +++
```
关闭于 2024-06-10 1 条评论