mirror of https://github.com/golang/go.git
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
This commit is contained in:
parent
54b251f542
commit
f8fe9afad5
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue