Merge pull request #245282 from reckenrode/gccStdenv-fix

cc-wrapper: use a temporary file for reponse file
This commit is contained in:
Weijia Wang 2023-08-02 11:04:25 +02:00 committed by GitHub
commit 7c1239a54a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,10 +246,13 @@ if [[ -e @out@/nix-support/cc-wrapper-hook ]]; then
fi
if (( "${NIX_CC_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then
exec @prog@ @<(printf "%q\n" \
responseFile=$(mktemp --tmpdir cc-params.XXXXXX)
trap 'rm -f -- "$responseFile"' EXIT
printf "%q\n" \
${extraBefore+"${extraBefore[@]}"} \
${params+"${params[@]}"} \
${extraAfter+"${extraAfter[@]}"})
${extraAfter+"${extraAfter[@]}"} > "$responseFile"
@prog@ "@$responseFile"
else
exec @prog@ \
${extraBefore+"${extraBefore[@]}"} \