Skip to content

Commit

Permalink
cmd/link: disable TestPIESize if CGO isn't enabled
Browse files Browse the repository at this point in the history
With CGO disabled, the test throws the following error:

elf_test.go:291: # command-line-arguments
    loadinternal: cannot find runtime/cgo

Change-Id: Iaeb183562ab637c714240b49e73078bdb791b35b
GitHub-Last-Rev: f8fe9afad5611411966413d17cb5874f7b0018a0
GitHub-Pull-Request: golang/go#43911
Reviewed-on: https://go-review.googlesource.com/c/go/+/286632
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
  • Loading branch information
nehaljwani authored and cherrymui committed Feb 1, 2021
1 parent 6ac91e4 commit 26e29aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cmd/link/elf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ func main() {

func TestPIESize(t *testing.T) {
testenv.MustHaveGoBuild(t)

// We don't want to test -linkmode=external if cgo is not supported.
// On some systems -buildmode=pie implies -linkmode=external, so just
// always skip the test if cgo is not supported.
testenv.MustHaveCGO(t)

if !sys.BuildModeSupported(runtime.Compiler, "pie", runtime.GOOS, runtime.GOARCH) {
t.Skip("-buildmode=pie not supported")
}
Expand Down

0 comments on commit 26e29aa

Please sign in to comment.