Commit 704f8318 authored by Yao Zhang's avatar Yao Zhang Committed by Minux Ma

cmd/dist: added support for GOARCH=mips64{,le}

Change-Id: I22ea3352ad0794fc611334c2f2ec5f1e894985ce
Reviewed-on: https://go-review.googlesource.com/14460Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: default avatarMinux Ma <minux@golang.org>
parent 15676b51
......@@ -54,6 +54,8 @@ var okgoarch = []string{
"amd64p32",
"arm",
"arm64",
"mips64",
"mips64le",
"ppc64",
"ppc64le",
}
......
......@@ -34,12 +34,14 @@ var bootstrapDirs = []string{
"compile/internal/arm64",
"compile/internal/big",
"compile/internal/gc",
"compile/internal/mips64",
"compile/internal/ppc64",
"compile/internal/x86",
"internal/gcprog",
"internal/obj",
"internal/obj/arm",
"internal/obj/arm64",
"internal/obj/mips",
"internal/obj/ppc64",
"internal/obj/x86",
"link",
......@@ -47,6 +49,7 @@ var bootstrapDirs = []string{
"link/internal/arm",
"link/internal/arm64",
"link/internal/ld",
"link/internal/mips64",
"link/internal/ppc64",
"link/internal/x86",
}
......
......@@ -745,6 +745,10 @@ func (t *tester) cgoTestSOSupported() bool {
// External linking not implemented on ppc64 (issue #8912).
return false
}
if t.goarch == "mips64le" || t.goarch == "mips64" {
// External linking not implemented on mips64.
return false
}
return true
}
......
......@@ -6,6 +6,8 @@ package main
import (
"bytes"
"debug/elf"
"encoding/binary"
"fmt"
"io/ioutil"
"os"
......@@ -438,6 +440,16 @@ func main() {
gohostarch = "ppc64le"
case strings.Contains(out, "ppc64"):
gohostarch = "ppc64"
case strings.Contains(out, "mips64"):
file, err := elf.Open(os.Args[0])
if err != nil {
fatal("failed to open %s to determine endianness: %v", os.Args[0], err)
}
if file.FileHeader.ByteOrder == binary.BigEndian {
gohostarch = "mips64"
} else {
gohostarch = "mips64le"
}
case gohostos == "darwin":
if strings.Contains(run("", CheckExit, "uname", "-v"), "RELEASE_ARM_") {
gohostarch = "arm"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment