Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jun 2021 02:22:57 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 256897] lang/go: unable to build on armv7
Message-ID:  <bug-256897-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256897

            Bug ID: 256897
           Summary: lang/go: unable to build on armv7
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: dmgk@freebsd.org
          Reporter: brd@FreeBSD.org
                CC: jhb@FreeBSD.org, paulzhol@gmail.com
             Flags: maintainer-feedback?(dmgk@freebsd.org)
          Assignee: dmgk@freebsd.org

I have been trying to figure out why go won't build in an armv7 jail on a a=
rm64
builder (AWS Graviton2 instance w/ HW FP).

This is the error:

runtime: this CPU has no floating point hardware, so it cannot run
this GOARM=3D7 binary. Recompile using GOARM=3D5.

So I added some debugging:

diff --git a/src/runtime/os_freebsd.go b/src/runtime/os_freebsd.go
index 730973a202..2ff154ce32 100644
--- a/src/runtime/os_freebsd.go
+++ b/src/runtime/os_freebsd.go
@@ -405,6 +405,7 @@ func sysauxv(auxv []uintptr) {
                        timekeepSharedPage =3D
(*vdsoTimekeep)(unsafe.Pointer(val))
                }

+               print("calling archauxv with tag =3D ", tag, ", val =3D ", =
val,
"\n")
                archauxv(tag, val)
        }
}
diff --git a/src/runtime/os_freebsd_arm.go b/src/runtime/os_freebsd_arm.go
index 3feaa5e225..a894e7de5e 100644
--- a/src/runtime/os_freebsd_arm.go
+++ b/src/runtime/os_freebsd_arm.go
@@ -15,6 +15,7 @@ func checkgoarm() {
        if goarm > 5 && cpu.HWCap&_HWCAP_VFP =3D=3D 0 {
                print("runtime: this CPU has no floating point hardware, so=
 it
cannot run\n")
                print("this GOARM=3D", goarm, " binary. Recompile using
GOARM=3D5.\n")
+               print("cpu.HWCap=3D", cpu.HWCap, "; vfp=3D", _HWCAP_VFP, ".=
\n")
                exit(1)
        }
        if goarm > 6 && cpu.HWCap&_HWCAP_VFPv3 =3D=3D 0 {

and built a new bootstrap using github.com/dmgk/go-bootstrap repo.  Which
showed me that cpu.HWCap is 0:

Building Go cmd/dist using
/wrkdirs/usr/ports/lang/go/work/go-freebsd-arm7-bootstrap. ()
cmd/dist
calling archauxv with tag =3D 3, val =3D 65588
calling archauxv with tag =3D 4, val =3D 32
calling archauxv with tag =3D 5, val =3D 5
calling archauxv with tag =3D 6, val =3D 4096
calling archauxv with tag =3D 8, val =3D 0
calling archauxv with tag =3D 9, val =3D 471532
calling archauxv with tag =3D 7, val =3D 0
calling archauxv with tag =3D 24, val =3D 83886082
calling archauxv with tag =3D 15, val =3D 4294959023
calling archauxv with tag =3D 18, val =3D 1300139
calling archauxv with tag =3D 16, val =3D 4294958959
calling archauxv with tag =3D 17, val =3D 64
calling archauxv with tag =3D 19, val =3D 4
calling archauxv with tag =3D 20, val =3D 4294958944
calling archauxv with tag =3D 21, val =3D 12
calling archauxv with tag =3D 22, val =3D 4294959152
calling archauxv with tag =3D 23, val =3D 3
calling archauxv with tag =3D 27, val =3D 1
calling archauxv with tag =3D 28, val =3D 5
calling archauxv with tag =3D 29, val =3D 4294956876
calling archauxv with tag =3D 30, val =3D 55
calling archauxv with tag =3D 31, val =3D 4294956900
calling archauxv with tag =3D 32, val =3D 4294959088
runtime: this CPU has no floating point hardware, so it cannot run
this GOARM=3D7 binary. Recompile using GOARM=3D5.
cpu.HWCap=3D0; vfp=3D64.

So far I have tracked down these parts:

We never set cpu.HWCap here:
https://github.com/golang/go/blob/master/src/runtime/os_freebsd_arm.go#L34-=
L40

Because on FreeBSD we have_AT_HWCAP =3D 25
https://github.com/golang/go/blob/master/src/runtime/os_freebsd.go#L402-L419

I am not sure where to go from here.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-256897-7788>