From 5b147122d6094b792a027b892884b994fe77a4d6 Mon Sep 17 00:00:00 2001 From: Vladimir Stefanovic Date: Wed, 19 Oct 2016 17:55:10 +0200 Subject: [PATCH] cmd/dist: add support for GOARCH=mips{,le} Change-Id: I6e24d22eada190e9aa2adc161be7a753c8e5054b Reviewed-on: https://go-review.googlesource.com/31514 Run-TryBot: Brad Fitzpatrick Reviewed-by: Cherry Zhang --- src/cmd/compile/main.go | 3 +++ src/cmd/dist/build.go | 2 ++ src/cmd/dist/buildtool.go | 2 ++ src/cmd/dist/util.go | 5 +++++ src/cmd/link/main.go | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/cmd/compile/main.go b/src/cmd/compile/main.go index 4376eda6a9..c3c0b6a068 100644 --- a/src/cmd/compile/main.go +++ b/src/cmd/compile/main.go @@ -9,6 +9,7 @@ import ( "cmd/compile/internal/arm" "cmd/compile/internal/arm64" "cmd/compile/internal/gc" + "cmd/compile/internal/mips" "cmd/compile/internal/mips64" "cmd/compile/internal/ppc64" "cmd/compile/internal/s390x" @@ -36,6 +37,8 @@ func main() { arm.Init() case "arm64": arm64.Init() + case "mips", "mipsle": + mips.Init() case "mips64", "mips64le": mips64.Init() case "ppc64", "ppc64le": diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 7a132f0d5e..6fb7884560 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -1107,6 +1107,8 @@ var cgoEnabled = map[string]bool{ "linux/arm64": true, "linux/ppc64": false, "linux/ppc64le": true, + "linux/mips": false, + "linux/mipsle": false, "linux/mips64": true, "linux/mips64le": true, "linux/s390x": true, diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go index d5ca804306..b0b9b2579d 100644 --- a/src/cmd/dist/buildtool.go +++ b/src/cmd/dist/buildtool.go @@ -37,6 +37,7 @@ var bootstrapDirs = []string{ "cmd/compile/internal/arm", "cmd/compile/internal/arm64", "cmd/compile/internal/gc", + "cmd/compile/internal/mips", "cmd/compile/internal/mips64", "cmd/compile/internal/ppc64", "cmd/compile/internal/s390x", @@ -59,6 +60,7 @@ var bootstrapDirs = []string{ "cmd/link/internal/arm", "cmd/link/internal/arm64", "cmd/link/internal/ld", + "cmd/link/internal/mips", "cmd/link/internal/mips64", "cmd/link/internal/ppc64", "cmd/link/internal/s390x", diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go index bbf3b75b5b..e2f22dfe44 100644 --- a/src/cmd/dist/util.go +++ b/src/cmd/dist/util.go @@ -445,6 +445,11 @@ func main() { if elfIsLittleEndian(os.Args[0]) { gohostarch = "mips64le" } + case strings.Contains(out, "mips"): + gohostarch = "mips" + if elfIsLittleEndian(os.Args[0]) { + gohostarch = "mipsle" + } case strings.Contains(out, "s390x"): gohostarch = "s390x" case gohostos == "darwin": diff --git a/src/cmd/link/main.go b/src/cmd/link/main.go index 74357d5853..a9aeb1e6bb 100644 --- a/src/cmd/link/main.go +++ b/src/cmd/link/main.go @@ -10,6 +10,7 @@ import ( "cmd/link/internal/arm" "cmd/link/internal/arm64" "cmd/link/internal/ld" + "cmd/link/internal/mips" "cmd/link/internal/mips64" "cmd/link/internal/ppc64" "cmd/link/internal/s390x" @@ -45,6 +46,8 @@ func main() { arm.Init() case "arm64": arm64.Init() + case "mips", "mipsle": + mips.Init() case "mips64", "mips64le": mips64.Init() case "ppc64", "ppc64le":