From a85877edaf9c9bc0b7721fd353d77629f9dc5867 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 Jul 2005 08:45:57 +0000 Subject: [PATCH] * r3317 was wrong: grep should be applied to gcc's stderr, not stdout. svn path=/nixpkgs/trunk/; revision=3329 --- pkgs/build-support/gcc-wrapper/gcc-wrapper.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh index 0e5b90bb877c..4db12afb5ce8 100644 --- a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh @@ -113,8 +113,9 @@ if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then fi -# Call the real `gcc'. Filter out warnings about unused `-B' flags, -# since they confuse some programs. -@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} \ - | (grep -v 'file path prefix' || true) -exit ${PIPESTATUS[0]} +# Call the real `gcc'. Filter out warnings from stderr about unused +# `-B' flags, since they confuse some programs. Deep bash magic to +# apply grep to stderr (by swapping stdin/stderr twice). +(@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \ + | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3- +exit $?