]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: require cgo support for TestSectionsWithSameName
authorIan Lance Taylor <iant@golang.org>
Fri, 19 Apr 2019 16:50:01 +0000 (09:50 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 19 Apr 2019 17:03:55 +0000 (17:03 +0000)
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>

src/cmd/link/elf_test.go

index 9eb8d1a14b25560518e262218cd468e98b8c87b8..3df9869284b85f1f0a230484eebd8e51293c82e1 100644 (file)
@@ -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)