From: Martin Möhrmann Date: Wed, 6 Mar 2019 18:45:41 +0000 (+0100) Subject: runtime: remove CPU capability workarounds for unsupported FreeBSD versions X-Git-Tag: go1.13beta1~1165 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3b6216ed0601c81fe42c2a4738d419afccb62163;p=gostls13.git 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 Reviewed-by: Yuval Pavel Zholkover Reviewed-by: Tobias Klauser Run-TryBot: Martin Möhrmann TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/os_freebsd_arm.go b/src/runtime/os_freebsd_arm.go index eb4de9bc21..3edd381302 100644 --- a/src/runtime/os_freebsd_arm.go +++ b/src/runtime/os_freebsd_arm.go @@ -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) }