From 254d63baa78741fe415e58361ddc3e10a311458c Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Fri, 18 Mar 2016 17:14:23 -0400 Subject: [PATCH] cmd/go: add s390x support Minimum architecture of z196 required so that GCC can assemble gcc_s390x.S in runtime/cgo. Change-Id: I603ed2edd39f826fb8193740ece5bd11d18c3dc5 Reviewed-on: https://go-review.googlesource.com/20876 Reviewed-by: Ian Lance Taylor --- src/cmd/go/build.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 3f9537834c..6a43e60219 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -377,7 +377,7 @@ func buildModeInit() { fatalf("-buildmode=pie not supported by gccgo") } else { switch platform { - case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", + case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x", "android/amd64", "android/arm", "android/arm64", "android/386": codegenArg = "-shared" default: @@ -391,7 +391,7 @@ func buildModeInit() { codegenArg = "-fPIC" } else { switch platform { - case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le": + case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x": default: fatalf("-buildmode=shared not supported on %s\n", platform) } @@ -409,7 +409,7 @@ func buildModeInit() { codegenArg = "-fPIC" } else { switch platform { - case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le": + case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x": buildAsmflags = append(buildAsmflags, "-D=GOBUILDMODE_shared=1") default: fatalf("-linkshared not supported on %s\n", platform) @@ -3025,6 +3025,8 @@ func (b *builder) gccArchArgs() []string { return []string{"-m64"} case "arm": return []string{"-marm"} // not thumb + case "s390x": + return []string{"-m64", "-march=z196"} } return nil }