Commit 3b6216ed authored by Martin Möhrmann's avatar Martin Möhrmann Committed by Tobias Klauser

runtime: remove CPU capability workarounds for unsupported FreeBSD versions

This CL removes runtime code working around missing ARM processor capability
information in the auxiliary vector in older FreeBSD versions.

As announced in the Go 1.12 release notes Go 1.13 will require FreeBSD 11.2+
or FreeBSD 12.0+. These FreeBSD versions support CPU capability detection
through AT_HWCAP and AT_HWCAP2 values stored in the auxiliary vector.

Updates #27619

Change-Id: I2a457b578d35101a7a5fd56ae9b81b300ad17da4
Reviewed-on: https://go-review.googlesource.com/c/go/+/165799Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarYuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Martin Möhrmann <martisch@uos.de>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9e72e604
...@@ -11,16 +11,7 @@ const ( ...@@ -11,16 +11,7 @@ const (
_HWCAP_VFPv3 = 1 << 13 _HWCAP_VFPv3 = 1 << 13
) )
// AT_HWCAP is not available on FreeBSD-11.1-RELEASE or earlier.
// Default to mandatory VFP hardware support for arm being available.
// If AT_HWCAP is available goarmHWCap will be updated in archauxv.
// TODO(moehrmann) remove once all go supported FreeBSD versions support _AT_HWCAP.
var goarmHWCap uint = (_HWCAP_VFP | _HWCAP_VFPv3)
func checkgoarm() { func checkgoarm() {
// Update cpu.HWCap to match goarmHWCap in case they were not updated in archauxv.
cpu.HWCap = goarmHWCap
if goarm > 5 && cpu.HWCap&_HWCAP_VFP == 0 { if goarm > 5 && cpu.HWCap&_HWCAP_VFP == 0 {
print("runtime: this CPU has no floating point hardware, so it cannot run\n") print("runtime: this CPU has no floating point hardware, so it cannot run\n")
print("this GOARM=", goarm, " binary. Recompile using GOARM=5.\n") print("this GOARM=", goarm, " binary. Recompile using GOARM=5.\n")
...@@ -44,7 +35,6 @@ func archauxv(tag, val uintptr) { ...@@ -44,7 +35,6 @@ func archauxv(tag, val uintptr) {
switch tag { switch tag {
case _AT_HWCAP: case _AT_HWCAP:
cpu.HWCap = uint(val) cpu.HWCap = uint(val)
goarmHWCap = cpu.HWCap
case _AT_HWCAP2: case _AT_HWCAP2:
cpu.HWCap2 = uint(val) cpu.HWCap2 = uint(val)
} }
......
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