Skip to content

Commit 3b6216e

Browse files
martischtklauser
authored andcommitted
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 <[email protected]> Reviewed-by: Yuval Pavel Zholkover <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Run-TryBot: Martin Möhrmann <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 9e72e60 commit 3b6216e

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/runtime/os_freebsd_arm.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,7 @@ const (
1111
_HWCAP_VFPv3 = 1 << 13
1212
)
1313

14-
// AT_HWCAP is not available on FreeBSD-11.1-RELEASE or earlier.
15-
// Default to mandatory VFP hardware support for arm being available.
16-
// If AT_HWCAP is available goarmHWCap will be updated in archauxv.
17-
// TODO(moehrmann) remove once all go supported FreeBSD versions support _AT_HWCAP.
18-
var goarmHWCap uint = (_HWCAP_VFP | _HWCAP_VFPv3)
19-
2014
func checkgoarm() {
21-
// Update cpu.HWCap to match goarmHWCap in case they were not updated in archauxv.
22-
cpu.HWCap = goarmHWCap
23-
2415
if goarm > 5 && cpu.HWCap&_HWCAP_VFP == 0 {
2516
print("runtime: this CPU has no floating point hardware, so it cannot run\n")
2617
print("this GOARM=", goarm, " binary. Recompile using GOARM=5.\n")
@@ -44,7 +35,6 @@ func archauxv(tag, val uintptr) {
4435
switch tag {
4536
case _AT_HWCAP:
4637
cpu.HWCap = uint(val)
47-
goarmHWCap = cpu.HWCap
4838
case _AT_HWCAP2:
4939
cpu.HWCap2 = uint(val)
5040
}

0 commit comments

Comments
 (0)