Skip to content

Commit f8fe9af

Browse files
committed
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
1 parent 54b251f commit f8fe9af

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)