aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoel Sing <joel@sing.id.au>2019-04-28 17:59:05 +1000
committerBrad Fitzpatrick <bradfitz@golang.org>2019-04-29 17:42:27 +0000
commit08b956f37846bd317aace534aa98dcd9353d868b (patch)
treee6981411a45035cba02e5ba363e7419f1d1686ba /src
parent9308637e3c2babcb3695d9f9673cf2a2b840362d (diff)
downloadgo-08b956f37846bd317aace534aa98dcd9353d868b.tar.xz
runtime: initialise cpu.HWCap on openbsd/arm64
OpenBSD does not provide auxv, however we still need to initialise cpu.HWCap. For now initialise it to the bare minimum, until some form of CPU capability detection is implemented or becomes available - see issue #31746. Updates #31656 Change-Id: I68c3c069319fe60dc873f46def2a67c9f3d937d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/174129 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/auxv_none.go1
-rw-r--r--src/runtime/os_openbsd_arm64.go11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/auxv_none.go b/src/runtime/auxv_none.go
index 3ca617b21e..3a560a1793 100644
--- a/src/runtime/auxv_none.go
+++ b/src/runtime/auxv_none.go
@@ -7,6 +7,7 @@
// +build !dragonfly
// +build !freebsd
// +build !netbsd
+// +build !openbsd !arm64
// +build !solaris
package runtime
diff --git a/src/runtime/os_openbsd_arm64.go b/src/runtime/os_openbsd_arm64.go
index 5130ce66c5..f15a95b653 100644
--- a/src/runtime/os_openbsd_arm64.go
+++ b/src/runtime/os_openbsd_arm64.go
@@ -4,6 +4,10 @@
package runtime
+import (
+ "internal/cpu"
+)
+
//go:nosplit
func cputicks() int64 {
// Currently cputicks() is used in blocking profiler and to seed runtime·fastrand().
@@ -11,3 +15,10 @@ func cputicks() int64 {
// TODO: need more entropy to better seed fastrand.
return nanotime()
}
+
+func sysargs(argc int32, argv **byte) {
+ // OpenBSD does not have auxv, however we still need to initialise cpu.HWCaps.
+ // For now specify the bare minimum until we add some form of capabilities
+ // detection. See issue #31746.
+ cpu.HWCap = 1<<1 | 1<<0 // ASIMD, FP
+}