Skip to content

Commit

Permalink
cmd/dist: support dist tool for loong64
Browse files Browse the repository at this point in the history
Contributors to the loong64 port are:
  Weining Lu <luweining@loongson.cn>
  Lei Wang <wanglei@loongson.cn>
  Lingqin Gong <gonglingqin@loongson.cn>
  Xiaolin Zhao <zhaoxiaolin@loongson.cn>
  Meidan Li <limeidan@loongson.cn>
  Xiaojuan Zhai <zhaixiaojuan@loongson.cn>
  Qiyuan Pu <puqiyuan@loongson.cn>
  Guoqi Chen <chenguoqi@loongson.cn>

This port has been updated to Go 1.15.6:
  https://github.com/loongson/go

Updates #46229

Change-Id: I61dca43680d8e5bd3198a38577450a53f405a987
Reviewed-on: https://go-review.googlesource.com/c/go/+/342307
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
  • Loading branch information
XiaodongLoong authored and gopherbot committed May 1, 2022
1 parent fd6c556 commit edab07d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var okgoarch = []string{
"amd64",
"arm",
"arm64",
"loong64",
"mips",
"mipsle",
"mips64",
Expand Down Expand Up @@ -1554,6 +1555,7 @@ var cgoEnabled = map[string]bool{
"linux/amd64": true,
"linux/arm": true,
"linux/arm64": true,
"linux/loong64": true,
"linux/ppc64": false,
"linux/ppc64le": true,
"linux/mips": true,
Expand Down Expand Up @@ -1593,6 +1595,7 @@ var cgoEnabled = map[string]bool{
// filtered out of cgoEnabled for 'dist list'. See golang.org/issue/28944
var incomplete = map[string]bool{
"linux/sparc64": true,
"linux/loong64": true,
}

// List of platforms which are first class ports. See golang.org/issue/38874.
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/dist/buildtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ var ignorePrefixes = []string{
var ignoreSuffixes = []string{
"_arm64.s",
"_arm64.go",
"_loong64.s",
"_loong64.go",
"_riscv64.s",
"_riscv64.go",
"_wasm.s",
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/dist/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ func main() {
if elfIsLittleEndian(os.Args[0]) {
gohostarch = "mipsle"
}
case strings.Contains(out, "loongarch64"):
gohostarch = "loong64"
case strings.Contains(out, "riscv64"):
gohostarch = "riscv64"
case strings.Contains(out, "s390x"):
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/dist/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ func (t *tester) extLink() bool {
"darwin-amd64", "darwin-arm64",
"dragonfly-amd64",
"freebsd-386", "freebsd-amd64", "freebsd-arm",
"linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-ppc64le", "linux-mips64", "linux-mips64le", "linux-mips", "linux-mipsle", "linux-riscv64", "linux-s390x",
"linux-386", "linux-amd64", "linux-arm", "linux-arm64", "linux-loong64", "linux-ppc64le", "linux-mips64", "linux-mips64le", "linux-mips", "linux-mipsle", "linux-riscv64", "linux-s390x",
"netbsd-386", "netbsd-amd64",
"openbsd-386", "openbsd-amd64",
"windows-386", "windows-amd64":
Expand All @@ -1061,7 +1061,7 @@ func (t *tester) internalLink() bool {
// Internally linking cgo is incomplete on some architectures.
// https://golang.org/issue/10373
// https://golang.org/issue/14449
if goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" || goarch == "riscv64" {
if goarch == "loong64" || goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" || goarch == "riscv64" {
return false
}
if goos == "aix" {
Expand Down

0 comments on commit edab07d

Please sign in to comment.