]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove CPU capability workarounds for unsupported FreeBSD versions
authorMartin Möhrmann <moehrmann@google.com>
Wed, 6 Mar 2019 18:45:41 +0000 (19:45 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 7 Mar 2019 07:23:45 +0000 (07:23 +0000)
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>

src/runtime/os_freebsd_arm.go

index eb4de9bc2123d4c2b0d70d8b39071865764681ca..3edd381302d7df9567b28d3c60d0dcff436507ae 100644 (file)
@@ -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)
        }