diff --git a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh index d514b57e28a..51916ccdd4a 100644 --- a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh +++ b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh @@ -92,6 +92,15 @@ if test "$dontLink" != "1"; then fi fi +# As a very special hack, if the arguments are just `-v', then don't +# add anything. This is to prevent `gcc -v' (which normally prints +# out the version number and returns exit code 0) from printing out +# `No input files specified' and returning exit code 1. +if test "$*" = "-v"; then + extraAfter=() + extraBefore=() +fi + # Optionally print debug info. if test "$NIX_DEBUG" = "1"; then echo "original flags to @gccProg@:" >&2