cmd/dist, internal/platform: enable internal linking feature and test on loong64

Change-Id: Ifea676e9eb44281465832fc4050f6286e50f4543
Reviewed-on: https://go-review.googlesource.com/c/go/+/533717
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
Reviewed-by: Qiqi Huang <huangqiqi@loongson.cn>
This commit is contained in:
limeidan 2023-10-09 17:32:03 +08:00 committed by abner chenc
parent d37a1bdd48
commit a2eb643cbf
3 changed files with 5 additions and 5 deletions

View file

@ -620,7 +620,7 @@ func setup() {
func mustLinkExternal(goos, goarch string, cgoEnabled bool) bool {
if cgoEnabled {
switch goarch {
case "loong64", "mips", "mipsle", "mips64", "mips64le":
case "mips", "mipsle", "mips64", "mips64le":
// Internally linking cgo is incomplete on some architectures.
// https://golang.org/issue/14449
return true

View file

@ -1169,7 +1169,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 == "loong64" || goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" || goarch == "riscv64" {
if goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" || goarch == "riscv64" {
return false
}
if goos == "aix" {
@ -1190,7 +1190,7 @@ func (t *tester) internalLinkPIE() bool {
}
switch goos + "-" + goarch {
case "darwin-amd64", "darwin-arm64",
"linux-amd64", "linux-arm64", "linux-ppc64le",
"linux-amd64", "linux-arm64", "linux-loong64", "linux-ppc64le",
"android-arm64",
"windows-amd64", "windows-386", "windows-arm":
return true

View file

@ -85,7 +85,7 @@ func FuzzInstrumented(goos, goarch string) bool {
func MustLinkExternal(goos, goarch string, withCgo bool) bool {
if withCgo {
switch goarch {
case "loong64", "mips", "mipsle", "mips64", "mips64le":
case "mips", "mipsle", "mips64", "mips64le":
// Internally linking cgo is incomplete on some architectures.
// https://go.dev/issue/14449
return true
@ -225,7 +225,7 @@ func InternalLinkPIESupported(goos, goarch string) bool {
switch goos + "/" + goarch {
case "android/arm64",
"darwin/amd64", "darwin/arm64",
"linux/amd64", "linux/arm64", "linux/ppc64le",
"linux/amd64", "linux/arm64", "linux/loong64", "linux/ppc64le",
"windows/386", "windows/amd64", "windows/arm", "windows/arm64":
return true
}