From bfc6a73cba1fc60203c56d1efa604c543c517d2a Mon Sep 17 00:00:00 2001 From: dinkypumpkin Date: Tue, 25 Mar 2014 08:15:31 +0000 Subject: [PATCH] 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 --- Library/ENV/4.3/cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index b4cc177b4d..67bb0df07d 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -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