cmd/dist: don't pass -linkmode=auto

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>
This commit is contained in:
Austin Clements 2023-05-17 15:10:51 -04:00
parent 18ffa7185d
commit 408f7a4663
1 changed files with 7 additions and 2 deletions

View 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