cc-wrapper: Fix support for qtbase-setup-hook

Revert https://github.com/NixOS/nixpkgs/pull/27657#issuecomment-318161946
due to https://github.com/NixOS/nixpkgs/pull/28021#issuecomment-321045542

authored by Orivej Desh and committed by Robin Gloster 771f28ba 25c12d0a

+8 -5
+8 -5
pkgs/build-support/cc-wrapper/ld-wrapper.sh
··· 132 132 for path in "$dir"/*; do 133 133 file="${path##*/}" 134 134 if [ "${libs[$file]:-}" ]; then 135 - libs["$file"]= 136 - if [ -z "${rpaths[$dir]:-}" ]; then 137 - rpaths["$dir"]=1 138 - extraAfter+=(-rpath "$dir") 139 - fi 135 + # This library may have been provided by a previous directory, 136 + # but if that library file is inside an output of the current 137 + # derivation, it can be deleted after this compilation and 138 + # should be found in a later directory, so we add all 139 + # directories that contain any of the libraries to rpath. 140 + rpaths["$dir"]=1 141 + extraAfter+=(-rpath "$dir") 142 + break 140 143 fi 141 144 done 142 145 done