From 810e595e4e4d7a8dd10a694bb4103d694bebccaf Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Thu, 16 Sep 2021 22:29:29 -0700 Subject: [PATCH] cudatoolkit: fix build This is a workaround for a segfault in patchelf when attempting to set an empty rpath --- pkgs/development/compilers/cudatoolkit/common.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/cudatoolkit/common.nix b/pkgs/development/compilers/cudatoolkit/common.nix index c8a1964814e5..585277064ab1 100644 --- a/pkgs/development/compilers/cudatoolkit/common.nix +++ b/pkgs/development/compilers/cudatoolkit/common.nix @@ -193,11 +193,11 @@ stdenv.mkDerivation rec { --set-interpreter "''$(cat $NIX_CC/nix-support/dynamic-linker)" $i fi if [[ $i =~ libcudart ]]; then - rpath2= + patchelf --remove-rpath $i else rpath2=$rpath:$lib/lib:$out/jre/lib/amd64/jli:$out/lib:$out/lib64:$out/nvvm/lib:$out/nvvm/lib64 + patchelf --set-rpath "$rpath2" --force-rpath $i fi - patchelf --set-rpath "$rpath2" --force-rpath $i done < <(find $out $lib $doc -type f -print0) '';