diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-04-19 09:50:01 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2019-04-22 01:20:16 +0000 |
commit | 5ee175e682980b02a33c673a6b54301032b762ab (patch) | |
tree | 8d620aa4bddb6f7b5403e9854adf7259a087cc7d | |
parent | 01c8062308e2c8cf0fe7b1577318f2227771ebf5 (diff) | |
download | go-5ee175e682980b02a33c673a6b54301032b762ab.tar.gz go-5ee175e682980b02a33c673a6b54301032b762ab.zip |
[release-branch.go1.11] cmd/link: require cgo support for TestSectionsWithSameName
The test doesn't really require cgo, but it does require that we know
the right flags to use to run the C compiler, and that is not
necessarily correct if we don't support cgo.
Fixes #31565
Change-Id: I04dc8db26697caa470e91ad712376aa621cf765d
Reviewed-on: https://go-review.googlesource.com/c/go/+/172981
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 4c236b9b097882f3aef8116e1ac9f65463bf6f01)
Reviewed-on: https://go-review.googlesource.com/c/go/+/173118
-rw-r--r-- | src/cmd/link/elf_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/link/elf_test.go b/src/cmd/link/elf_test.go index 9eb8d1a14b..3df9869284 100644 --- a/src/cmd/link/elf_test.go +++ b/src/cmd/link/elf_test.go @@ -34,6 +34,7 @@ func main() {} // with the same name. func TestSectionsWithSameName(t *testing.T) { testenv.MustHaveGoBuild(t) + testenv.MustHaveCGO(t) t.Parallel() objcopy, err := exec.LookPath("objcopy") @@ -77,7 +78,7 @@ func TestSectionsWithSameName(t *testing.T) { cflags := strings.Fields(string(cflagsb)) asmObj := filepath.Join(dir, "x.o") - t.Logf("%s %v -o %s %s", cc, cflags, asmObj, asmFile) + t.Logf("%s %v -c -o %s %s", cc, cflags, asmObj, asmFile) if out, err := exec.Command(cc, append(cflags, "-c", "-o", asmObj, asmFile)...).CombinedOutput(); err != nil { t.Logf("%s", out) t.Fatal(err) |