]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix AT_HWCAP auxv parsing on freebsd
authorYuval Pavel Zholkover <paulzhol@gmail.com>
Fri, 23 Mar 2018 14:53:26 +0000 (17:53 +0300)
committerIan Lance Taylor <iant@golang.org>
Fri, 23 Mar 2018 19:51:25 +0000 (19:51 +0000)
AT_HWCAP is not available on FreeBSD-11.1-RELEASE or earlier and the wrong const was used.
Use the correct value, and initialize hwcap with ^uint32(0) inorder not to fail the VFP tests.

Fixes #24507.

Change-Id: I5c3eed57bb53bf992b7de0eec88ea959806306b9
Reviewed-on: https://go-review.googlesource.com/102355
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/os_freebsd.go
src/runtime/os_freebsd_arm.go

index b09dc0443389d90420d341b07e9aeadd07da50c8..fafe7f470b432cf5cf4b01e6271154abfb1e691b 100644 (file)
@@ -380,7 +380,7 @@ func sysargs(argc int32, argv **byte) {
 const (
        _AT_NULL   = 0  // Terminates the vector
        _AT_PAGESZ = 6  // Page size in bytes
-       _AT_HWCAP  = 16 // CPU feature flags
+       _AT_HWCAP  = 26 // CPU feature flags
 )
 
 func sysauxv(auxv []uintptr) {
index a8581b1c8ea3d2dcb7310017b480f7f72358e884..f0d04244f37e8fd77d5e25050e892fd6d8f9288e 100644 (file)
@@ -10,8 +10,8 @@ const (
        _HWCAP_IDIVA = 1 << 17
 )
 
-var hwcap uint32 // set by archauxv
-var hardDiv bool // set if a hardware divider is available
+var hwcap = ^uint32(0) // set by archauxv
+var hardDiv bool       // set if a hardware divider is available
 
 func checkgoarm() {
        if goarm > 5 && hwcap&_HWCAP_VFP == 0 {