diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index f68cdd107111..d22d51f52360 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -645,10 +645,12 @@ checkPhase() { patchELF() { # Patch all ELF executables and shared libraries. header "patching ELF executables and libraries" - find "$prefix" \( \ - \( -type f -a -name "*.so*" \) -o \ - \( -type f -a -perm +0100 \) \ - \) -print -exec patchelf --shrink-rpath {} \; + if test -e "$prefix"; then + find "$prefix" \( \ + \( -type f -a -name "*.so*" \) -o \ + \( -type f -a -perm +0100 \) \ + \) -print -exec patchelf --shrink-rpath {} \; + fi stopNest }