From 771f28bac804dfb6ebf99122bfe4e5393d9c278d Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Wed, 9 Aug 2017 09:02:55 +0000 Subject: 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 --- pkgs/build-support/cc-wrapper/ld-wrapper.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/cc-wrapper/ld-wrapper.sh b/pkgs/build-support/cc-wrapper/ld-wrapper.sh index 8db64a38e383..d0a1d5a0ddb7 100644 --- a/pkgs/build-support/cc-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/ld-wrapper.sh @@ -132,11 +132,14 @@ if [ "$NIX_@infixSalt@_DONT_SET_RPATH" != 1 ]; then for path in "$dir"/*; do file="${path##*/}" if [ "${libs[$file]:-}" ]; then - libs["$file"]= - if [ -z "${rpaths[$dir]:-}" ]; then - rpaths["$dir"]=1 - extraAfter+=(-rpath "$dir") - fi + # This library may have been provided by a previous directory, + # but if that library file is inside an output of the current + # derivation, it can be deleted after this compilation and + # should be found in a later directory, so we add all + # directories that contain any of the libraries to rpath. + rpaths["$dir"]=1 + extraAfter+=(-rpath "$dir") + break fi done done -- cgit 1.4.1