aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-01-04 12:43:25 -0800
committerIan Lance Taylor <iant@golang.org>2021-01-05 13:48:59 -0800
commita9f76d03bbc791cb55e4e0658f23efd0103ea9b0 (patch)
tree29505078464b7c8342c58d2309490a5657805da8 /libgo
parentdb7ce388dcef50f11af9717570e1e49415733d43 (diff)
downloadgcc-a9f76d03bbc791cb55e4e0658f23efd0103ea9b0.zip
gcc-a9f76d03bbc791cb55e4e0658f23efd0103ea9b0.tar.gz
gcc-a9f76d03bbc791cb55e4e0658f23efd0103ea9b0.tar.bz2
internal/cpu: more build fixes for Go1.16beta1 release
Some files were missing from the libgo copy of internal/cpu, because they used to only declare CacheLinePadSize which libgo gets from goarch.sh. Now they also declare doinit, so copy them over. Adjust cpu_other.go. Fix the amd64p32 build by adding a build constraint to cpu_no_name.go. Fixes PR go/98493 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/281472
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/internal/cpu/cpu_arm.go2
-rw-r--r--libgo/go/internal/cpu/cpu_mips.go10
-rw-r--r--libgo/go/internal/cpu/cpu_mips64x.go2
-rw-r--r--libgo/go/internal/cpu/cpu_mipsle.go10
-rw-r--r--libgo/go/internal/cpu/cpu_no_name.go1
-rw-r--r--libgo/go/internal/cpu/cpu_other.go3
-rw-r--r--libgo/go/internal/cpu/cpu_ppc64x.go23
-rw-r--r--libgo/go/internal/cpu/cpu_wasm.go10
-rw-r--r--libgo/go/internal/cpu/cpu_x86.go2
9 files changed, 63 insertions, 0 deletions
diff --git a/libgo/go/internal/cpu/cpu_arm.go b/libgo/go/internal/cpu/cpu_arm.go
index 7324e7b..06962cf 100644
--- a/libgo/go/internal/cpu/cpu_arm.go
+++ b/libgo/go/internal/cpu/cpu_arm.go
@@ -4,6 +4,8 @@
package cpu
+// const CacheLinePadSize = 32
+
// arm doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2.
// These are initialized by archauxv() and should not be changed after they are
// initialized.
diff --git a/libgo/go/internal/cpu/cpu_mips.go b/libgo/go/internal/cpu/cpu_mips.go
new file mode 100644
index 0000000..48755b6
--- /dev/null
+++ b/libgo/go/internal/cpu/cpu_mips.go
@@ -0,0 +1,10 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+// const CacheLinePadSize = 32
+
+func doinit() {
+}
diff --git a/libgo/go/internal/cpu/cpu_mips64x.go b/libgo/go/internal/cpu/cpu_mips64x.go
index af10a50..58fbd3d 100644
--- a/libgo/go/internal/cpu/cpu_mips64x.go
+++ b/libgo/go/internal/cpu/cpu_mips64x.go
@@ -6,6 +6,8 @@
package cpu
+// const CacheLinePadSize = 32
+
// This is initialized by archauxv and should not be changed after it is
// initialized.
var HWCap uint
diff --git a/libgo/go/internal/cpu/cpu_mipsle.go b/libgo/go/internal/cpu/cpu_mipsle.go
new file mode 100644
index 0000000..48755b6
--- /dev/null
+++ b/libgo/go/internal/cpu/cpu_mipsle.go
@@ -0,0 +1,10 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+// const CacheLinePadSize = 32
+
+func doinit() {
+}
diff --git a/libgo/go/internal/cpu/cpu_no_name.go b/libgo/go/internal/cpu/cpu_no_name.go
index ce1c37a..f028a92 100644
--- a/libgo/go/internal/cpu/cpu_no_name.go
+++ b/libgo/go/internal/cpu/cpu_no_name.go
@@ -4,6 +4,7 @@
// +build !386
// +build !amd64
+// +build !amd64p32
package cpu
diff --git a/libgo/go/internal/cpu/cpu_other.go b/libgo/go/internal/cpu/cpu_other.go
index d0f1f2e..ba3c42a 100644
--- a/libgo/go/internal/cpu/cpu_other.go
+++ b/libgo/go/internal/cpu/cpu_other.go
@@ -7,6 +7,8 @@
// +build !amd64p32
// +build !arm
// +build !arm64
+// +build !mips
+// +build !mipsle
// +build !mips64
// +build !mips64le
// +build !ppc
@@ -14,6 +16,7 @@
// +build !ppc64le
// +build !riscv64
// +build !s390x
+// +build !wasm
package cpu
diff --git a/libgo/go/internal/cpu/cpu_ppc64x.go b/libgo/go/internal/cpu/cpu_ppc64x.go
new file mode 100644
index 0000000..0a48f6a
--- /dev/null
+++ b/libgo/go/internal/cpu/cpu_ppc64x.go
@@ -0,0 +1,23 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ppc ppc64 ppc64le
+
+package cpu
+
+// const CacheLinePadSize = 128
+
+func doinit() {
+ options = []option{
+ {Name: "darn", Feature: &PPC64.HasDARN},
+ {Name: "scv", Feature: &PPC64.HasSCV},
+ {Name: "power9", Feature: &PPC64.IsPOWER9},
+ }
+
+ osinit()
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
diff --git a/libgo/go/internal/cpu/cpu_wasm.go b/libgo/go/internal/cpu/cpu_wasm.go
new file mode 100644
index 0000000..c9ab4ca
--- /dev/null
+++ b/libgo/go/internal/cpu/cpu_wasm.go
@@ -0,0 +1,10 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+// const CacheLinePadSize = 64
+
+func doinit() {
+}
diff --git a/libgo/go/internal/cpu/cpu_x86.go b/libgo/go/internal/cpu/cpu_x86.go
index 9aa5c3a..338d909 100644
--- a/libgo/go/internal/cpu/cpu_x86.go
+++ b/libgo/go/internal/cpu/cpu_x86.go
@@ -6,6 +6,8 @@
package cpu
+// const CacheLinePadSize = 64
+
// cpuid is implemented in cpu_x86.s.
func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)