mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: renovate GOSSAHASH
Randomized feature enable/disable might be something we use to help users debug any problems with changed loop variable capture, and there's another CL that would like to use it to help in locating places where "fused" multiply add instructions change program behavior. This CL: - adds the ability to include an integer parameter (e.g. line number) - replumbed the environment variable into a flag to simplify go build cache management - but added an environment variable to allow flag setting through the environment - which adds the possibility of switching on a different variable (if there's one built-in for variable capture, it shouldn't be GOSSAHASH) - cleaned up the checking code - adds tests for all the intended behavior - removes the case for GSHS_LOGFILE; TBD whether we'll need to put that back or if there is another way. Change-Id: I8503e1bb3dbc4a743aea696e04411ea7ab884787 Reviewed-on: https://go-review.googlesource.com/c/go/+/443063 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: David Chase <drchase@google.com>
This commit is contained in:
parent
3ba3b4893f
commit
03f6d81fc7
6 changed files with 327 additions and 74 deletions
|
|
@ -180,6 +180,16 @@ func ParseFlags() {
|
|||
registerFlags()
|
||||
objabi.Flagparse(usage)
|
||||
|
||||
if gcd := os.Getenv("GOCOMPILEDEBUG"); gcd != "" {
|
||||
// This will only override the flags set in gcd;
|
||||
// any others set on the command line remain set.
|
||||
Flag.LowerD.Set(gcd)
|
||||
}
|
||||
|
||||
if Debug.Gossahash != "" {
|
||||
hashDebug = NewHashDebug("gosshash", Debug.Gossahash, nil)
|
||||
}
|
||||
|
||||
if Flag.MSan && !platform.MSanSupported(buildcfg.GOOS, buildcfg.GOARCH) {
|
||||
log.Fatalf("%s/%s does not support -msan", buildcfg.GOOS, buildcfg.GOARCH)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue