Skip to content

Commit 26e29aa

Browse files
nehaljwanicherrymui
authored andcommitted
cmd/link: disable TestPIESize if CGO isn't enabled
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: f8fe9af GitHub-Pull-Request: #43911 Reviewed-on: https://go-review.googlesource.com/c/go/+/286632 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> Trust: Matthew Dempsky <[email protected]>
1 parent 6ac91e4 commit 26e29aa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cmd/link/elf_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ func main() {
226226

227227
func TestPIESize(t *testing.T) {
228228
testenv.MustHaveGoBuild(t)
229+
230+
// We don't want to test -linkmode=external if cgo is not supported.
231+
// On some systems -buildmode=pie implies -linkmode=external, so just
232+
// always skip the test if cgo is not supported.
233+
testenv.MustHaveCGO(t)
234+
229235
if !sys.BuildModeSupported(runtime.Compiler, "pie", runtime.GOOS, runtime.GOARCH) {
230236
t.Skip("-buildmode=pie not supported")
231237
}

0 commit comments

Comments
 (0)