]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: don't pass -linkmode=auto
authorAustin Clements <austin@google.com>
Wed, 17 May 2023 19:10:51 +0000 (15:10 -0400)
committerAustin Clements <austin@google.com>
Fri, 19 May 2023 01:37:34 +0000 (01:37 +0000)
This is the default value of this flag, so passing it clutters up
debugging output. This also makes it clearer which tests are running
with a default configuration.

Change-Id: If793934829c79f087c7a6e3fa8f64dc33959c213
Reviewed-on: https://go-review.googlesource.com/c/go/+/496176
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/dist/test.go

index 132542cde17517affb13b5ae27c26bcdf221d459..fe818036b5548462605d9aaffc177b4569f304b8 100644 (file)
@@ -1096,7 +1096,11 @@ func (t *tester) registerCgoTests(heading string) {
                        variant:   variant,
                        pkg:       "cmd/cgo/internal/" + subdir,
                        buildmode: buildmode,
-                       ldflags:   "-linkmode=" + linkmode,
+               }
+               var ldflags []string
+               if linkmode != "auto" {
+                       // "auto" is the default, so avoid cluttering the command line for "auto"
+                       ldflags = append(ldflags, "-linkmode="+linkmode)
                }
 
                if linkmode == "internal" {
@@ -1110,7 +1114,7 @@ func (t *tester) registerCgoTests(heading string) {
                        // cgoTest we want static linking.
                        gt.buildmode = ""
                        if linkmode == "external" {
-                               gt.ldflags += ` -extldflags "-static -pthread"`
+                               ldflags = append(ldflags, `-extldflags "-static -pthread"`)
                        } else if linkmode == "auto" {
                                gt.env = append(gt.env, "CGO_LDFLAGS=-static -pthread")
                        } else {
@@ -1118,6 +1122,7 @@ func (t *tester) registerCgoTests(heading string) {
                        }
                        gt.tags = append(gt.tags, "static")
                }
+               gt.ldflags = strings.Join(ldflags, " ")
 
                t.registerTest("cgo:"+subdir+":"+variant, heading, gt, opts...)
                return gt