From 14996789a1803ebef231f5d7ce6193a76ac0f9b1 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Tue, 28 Dec 2021 11:04:36 +0800 Subject: [PATCH] Check link type based on expanded parameters So far we've ignored response files in arguments, and did not check linkType against expanded parameters. This means if we have `-static` in a @reponse-file, linkType will not be set to `-static` as we never check against the expanded arguments from response files. --- pkgs/build-support/bintools-wrapper/ld-wrapper.sh | 2 +- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh index 2f96480f80c1..fb01c5096d5b 100644 --- a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh @@ -30,7 +30,7 @@ expandResponseParams "$@" if [[ -n "${NIX_LINK_TYPE_@suffixSalt@:-}" ]]; then linkType=$NIX_LINK_TYPE_@suffixSalt@ else - linkType=$(checkLinkType "$@") + linkType=$(checkLinkType "${params[@]}") fi if [[ "${NIX_ENFORCE_PURITY:-}" = 1 && -n "${NIX_STORE:-}" diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index aa25de336418..1220841162c3 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -31,7 +31,7 @@ cxxLibrary=1 cInclude=1 expandResponseParams "$@" -linkType=$(checkLinkType "$@") +linkType=$(checkLinkType "${params[@]}") declare -i n=0 nParams=${#params[@]}