Skip to content

Commit a115501

Browse files
[release-branch.go1.12] 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 <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> (cherry picked from commit 4c236b9) Reviewed-on: https://go-review.googlesource.com/c/go/+/173117
1 parent 323ac9c commit a115501

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cmd/link/elf_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func main() {}
3434
// with the same name.
3535
func TestSectionsWithSameName(t *testing.T) {
3636
testenv.MustHaveGoBuild(t)
37+
testenv.MustHaveCGO(t)
3738
t.Parallel()
3839

3940
objcopy, err := exec.LookPath("objcopy")
@@ -77,7 +78,7 @@ func TestSectionsWithSameName(t *testing.T) {
7778
cflags := strings.Fields(string(cflagsb))
7879

7980
asmObj := filepath.Join(dir, "x.o")
80-
t.Logf("%s %v -o %s %s", cc, cflags, asmObj, asmFile)
81+
t.Logf("%s %v -c -o %s %s", cc, cflags, asmObj, asmFile)
8182
if out, err := exec.Command(cc, append(cflags, "-c", "-o", asmObj, asmFile)...).CombinedOutput(); err != nil {
8283
t.Logf("%s", out)
8384
t.Fatal(err)

0 commit comments

Comments
 (0)