]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: omit X:framepointer in compile version
authorRuss Cox <rsc@golang.org>
Mon, 17 Jul 2017 14:45:27 +0000 (10:45 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 17 Jul 2017 16:36:49 +0000 (16:36 +0000)
Framepointer is the default now. Only print an X: list
if the settings are _not_ the default.

Before:

$ go tool compile -V
compile version devel +a5f30d9508 Sun Jul 16 14:43:48 2017 -0400 X:framepointer
$ go1.8 tool compile -V
compile version go1.8 X:framepointer
$

After:

$ go tool compile -V
compile version devel +a5f30d9508 Sun Jul 16 14:43:48 2017 -0400
$ go1.9 tool compile -V # imagined
compile version go1.9
$

Perpetuates #18317.

Change-Id: I981ba5c62be32e650a166fc9740703122595639b
Reviewed-on: https://go-review.googlesource.com/49252
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/main.go
src/cmd/internal/objabi/util.go
test/nosplit.go

index 5e3030297009c960464646b9c5ded275086ad138..2b61564ad8d8cb3819c85f8e371bcd3963a07a64 100644 (file)
@@ -104,7 +104,7 @@ func hidePanic() {
 
 func doversion() {
        p := objabi.Expstring()
-       if p == "X:none" {
+       if p == objabi.DefaultExpstring() {
                p = ""
        }
        sep := ""
index 811fdd33d4119bd48de1ffd9acbab7125dfb0380..1da05021f50855feb95b63424edfb4d915198942 100644 (file)
@@ -46,7 +46,6 @@ func Getgoextlinkenabled() string {
 }
 
 func init() {
-       framepointer_enabled = 1 // default
        for _, f := range strings.Split(goexperiment, ",") {
                if f != "" {
                        addexp(f)
@@ -80,7 +79,7 @@ func addexp(s string) {
 }
 
 var (
-       framepointer_enabled     int
+       framepointer_enabled     int = 1
        Fieldtrack_enabled       int
        Preemptibleloops_enabled int
        Clobberdead_enabled      int
@@ -100,6 +99,12 @@ var exper = []struct {
        {"clobberdead", &Clobberdead_enabled},
 }
 
+var defaultExpstring = Expstring()
+
+func DefaultExpstring() string {
+       return defaultExpstring
+}
+
 func Expstring() string {
        buf := "X"
        for i := range exper {
index 3244df53c5085ffa16622057da71f7f447faa609..989d8ccba77725b8df9cd183c5f36c89fa05d4bc 100644 (file)
@@ -198,6 +198,10 @@ func main() {
                goarch = runtime.GOARCH
        }
 
+       // Frame pointer is on by default now.
+       // golang.org/issue/18317.
+       return
+
        version, err := exec.Command("go", "tool", "compile", "-V").Output()
        if err != nil {
                bug()