]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: support GODEBUGCPU for more Unix-like operating systems
authorMartin Möhrmann <moehrmann@google.com>
Sun, 28 Oct 2018 14:37:13 +0000 (15:37 +0100)
committerMartin Möhrmann <martisch@uos.de>
Sun, 28 Oct 2018 18:17:46 +0000 (18:17 +0000)
Adds AIX, DragonFly BSD, FreeBSD, NetBSD, OpenBSD and Solaris
to the list of operating systems where the GODEBUGCPU environment
variable will be parsed and interal/cpu features can be enabled
and disabled.

Updates #27218

Change-Id: I9cd99142e2a5147cb00ca57b581f049ea6ce8508
Reviewed-on: https://go-review.googlesource.com/c/145281
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Martin Möhrmann <martisch@uos.de>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/proc.go

index 844e0237157414889041ab12058b116defde13f0..365e516ec8a30feb2703da3d6dcbf4013343ad4f 100644 (file)
@@ -483,7 +483,8 @@ func cpuinit() {
        const prefix = "GODEBUGCPU="
        var env string
 
-       if GOOS == "linux" || GOOS == "darwin" {
+       switch GOOS {
+       case "aix", "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "solaris", "linux":
                cpu.DebugOptions = true
 
                // Similar to goenv_unix but extracts the environment value for