mirror of https://github.com/golang/go.git
cmd/go: whitelist -v as a compiler and linker flag
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>
This commit is contained in:
parent
377567edd0
commit
b65934f237
|
|
@ -94,6 +94,7 @@ var validCompilerFlags = []*regexp.Regexp{
|
||||||
re(`-?-stdlib=([^@\-].*)`),
|
re(`-?-stdlib=([^@\-].*)`),
|
||||||
re(`-w`),
|
re(`-w`),
|
||||||
re(`-x([^@\-].*)`),
|
re(`-x([^@\-].*)`),
|
||||||
|
re(`-v`),
|
||||||
}
|
}
|
||||||
|
|
||||||
var validCompilerFlagsWithNextArg = []string{
|
var validCompilerFlagsWithNextArg = []string{
|
||||||
|
|
@ -127,6 +128,7 @@ var validLinkerFlags = []*regexp.Regexp{
|
||||||
re(`-shared`),
|
re(`-shared`),
|
||||||
re(`-?-static([-a-z0-9+]*)`),
|
re(`-?-static([-a-z0-9+]*)`),
|
||||||
re(`-?-stdlib=([^@\-].*)`),
|
re(`-?-stdlib=([^@\-].*)`),
|
||||||
|
re(`-v`),
|
||||||
|
|
||||||
// Note that any wildcards in -Wl need to exclude comma,
|
// Note that any wildcards in -Wl need to exclude comma,
|
||||||
// since -Wl splits its argument at commas and passes
|
// since -Wl splits its argument at commas and passes
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ var goodCompilerFlags = [][]string{
|
||||||
{"-I", "世界"},
|
{"-I", "世界"},
|
||||||
{"-framework", "Chocolate"},
|
{"-framework", "Chocolate"},
|
||||||
{"-x", "c"},
|
{"-x", "c"},
|
||||||
|
{"-v"},
|
||||||
}
|
}
|
||||||
|
|
||||||
var badCompilerFlags = [][]string{
|
var badCompilerFlags = [][]string{
|
||||||
|
|
@ -132,6 +133,7 @@ var goodLinkerFlags = [][]string{
|
||||||
{"-l", "世界"},
|
{"-l", "世界"},
|
||||||
{"-L", "framework"},
|
{"-L", "framework"},
|
||||||
{"-framework", "Chocolate"},
|
{"-framework", "Chocolate"},
|
||||||
|
{"-v"},
|
||||||
{"-Wl,-framework", "-Wl,Chocolate"},
|
{"-Wl,-framework", "-Wl,Chocolate"},
|
||||||
{"-Wl,-framework,Chocolate"},
|
{"-Wl,-framework,Chocolate"},
|
||||||
{"-Wl,-unresolved-symbols=ignore-all"},
|
{"-Wl,-unresolved-symbols=ignore-all"},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue