Merge pull request #112449 from angerman/angerman/response-files
Add response file support when compiling with clang
This commit is contained in:
commit
6979a72840
|
@ -198,7 +198,15 @@ fi
|
|||
|
||||
PATH="$path_backup"
|
||||
# Old bash workaround, see above.
|
||||
|
||||
if (( "${NIX_CC_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then
|
||||
exec @prog@ "@<(printf "%q\n" \
|
||||
${extraBefore+"${extraBefore[@]}"} \
|
||||
${params+"${params[@]}"} \
|
||||
${extraAfter+"${extraAfter[@]}"})"
|
||||
else
|
||||
exec @prog@ \
|
||||
${extraBefore+"${extraBefore[@]}"} \
|
||||
${params+"${params[@]}"} \
|
||||
${extraAfter+"${extraAfter[@]}"}
|
||||
fi
|
||||
|
|
|
@ -160,6 +160,7 @@ stdenv.mkDerivation {
|
|||
local dst="$1"
|
||||
local wrapper="$2"
|
||||
export prog="$3"
|
||||
export use_response_file_by_default=${if isClang then "1" else "0"}
|
||||
substituteAll "$wrapper" "$out/bin/$dst"
|
||||
chmod +x "$out/bin/$dst"
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ stdenv.mkDerivation {
|
|||
src=$PWD
|
||||
'';
|
||||
buildPhase = ''
|
||||
"$CC" -std=c99 -O3 -o "expand-response-params" expand-response-params.c
|
||||
NIX_CC_USE_RESPONSE_FILE=0 "$CC" -std=c99 -O3 -o "expand-response-params" expand-response-params.c
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $prefix/bin
|
||||
|
|
Loading…
Reference in a new issue