mirror of
https://github.com/golang/go
synced 2024-10-14 11:53:56 +00:00
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/+/165799 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Martin Möhrmann <martisch@uos.de> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
9e72e604a6
commit
3b6216ed06
|
@ -11,16 +11,7 @@ const (
|
|||
_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() {
|
||||
// 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 {
|
||||
print("runtime: this CPU has no floating point hardware, so it cannot run\n")
|
||||
print("this GOARM=", goarm, " binary. Recompile using GOARM=5.\n")
|
||||
|
@ -44,7 +35,6 @@ func archauxv(tag, val uintptr) {
|
|||
switch tag {
|
||||
case _AT_HWCAP:
|
||||
cpu.HWCap = uint(val)
|
||||
goarmHWCap = cpu.HWCap
|
||||
case _AT_HWCAP2:
|
||||
cpu.HWCap2 = uint(val)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue