]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: whitelist -v as a compiler and linker flag
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 29 May 2018 15:10:39 +0000 (17:10 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 29 May 2018 17:14:17 +0000 (17:14 +0000)
It's harmless, and can be useful to see what's happening under the hood.

Fixes #24593.

Change-Id: Iacff378471e86c33aa048161cd65c504709fb339
Reviewed-on: https://go-review.googlesource.com/115075
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/internal/work/security.go
src/cmd/go/internal/work/security_test.go

index 5c67aa945eff71d0fd926adf2b35240c8df89e5f..880f4fdc791a367122e9ce848eb1262e661b8139 100644 (file)
@@ -94,6 +94,7 @@ var validCompilerFlags = []*regexp.Regexp{
        re(`-?-stdlib=([^@\-].*)`),
        re(`-w`),
        re(`-x([^@\-].*)`),
+       re(`-v`),
 }
 
 var validCompilerFlagsWithNextArg = []string{
@@ -127,6 +128,7 @@ var validLinkerFlags = []*regexp.Regexp{
        re(`-shared`),
        re(`-?-static([-a-z0-9+]*)`),
        re(`-?-stdlib=([^@\-].*)`),
+       re(`-v`),
 
        // Note that any wildcards in -Wl need to exclude comma,
        // since -Wl splits its argument at commas and passes
index bd898c9de6c17dabd670df76d5799363235753cb..15eeff9b4b4bcfcf38e1d6878e391754229ca43e 100644 (file)
@@ -57,6 +57,7 @@ var goodCompilerFlags = [][]string{
        {"-I", "世界"},
        {"-framework", "Chocolate"},
        {"-x", "c"},
+       {"-v"},
 }
 
 var badCompilerFlags = [][]string{
@@ -132,6 +133,7 @@ var goodLinkerFlags = [][]string{
        {"-l", "世界"},
        {"-L", "framework"},
        {"-framework", "Chocolate"},
+       {"-v"},
        {"-Wl,-framework", "-Wl,Chocolate"},
        {"-Wl,-framework,Chocolate"},
        {"-Wl,-unresolved-symbols=ignore-all"},