cc: don't add linker arguments if only -v passed.

Supports configure scripts (e.g., mplayer) that use "gcc -v" to
identify compiler.

Closes Homebrew/homebrew#27793.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
dinkypumpkin 2014-03-25 08:15:31 +00:00 committed by Mike McQuaid
parent 25c7b49eee
commit bfc6a73cba

View File

@ -73,6 +73,12 @@ class Cmd
end
end
def args
if @args.length == 1 and @args[0] == '-v'
# Don't add linker arguments if -v passed as sole option. This stops gcc
# -v with no other arguments from outputting a linker error. Some
# software uses gcc -v (wrongly) to sniff the GCC version.
return @args.dup
end
if !cccfg?("O") || tool == "ld" || configure?
args = @args.dup
else