Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/dist: detect FPUless ARMv7 platforms? #23274

alllexx88 opened this issue Dec 28, 2017 · 3 comments

cmd/dist: detect FPUless ARMv7 platforms? #23274

alllexx88 opened this issue Dec 28, 2017 · 3 comments


Copy link

@alllexx88 alllexx88 commented Dec 28, 2017

I'm trying to build Go on an FPUless ARMv7 platform:

[root@unknown src]$ cat /proc/cpuinfo
Processor       : ARMv7 Processor rev 0 (v7l)
processor       : 0
BogoMIPS        : 1599.07

processor       : 1
BogoMIPS        : 1595.80

Features        : swp half thumb fastmult edsp
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

Hardware        : Northstar Prototype
Revision        : 0000
Serial          : 0000000000000000

gccgo-go from GCC-7.2.0 is used as the bootstrap toolchain:

[root@unknown src]$ go version
go version go1.8.1 arm-buildroot-linux-uclibcgnueabi-gccgo (Buildroot 2017.08-g56f1bab-dirty) 7.2.0 linux/arm
[root@unknown src]$ go env
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build935653095=/tmp/go-build -gno-record-gcc-switches"

I tried both go1.9.2 and master branch. Here's build log for the latter:

[root@unknown src]$ GOROOT_FINAL=/opt/local CGO_ENABLED=1 GOROOT_BOOTSTRAP=/opt ./make.bash
Building Go cmd/dist using /opt.
Building Go toolchain1 using /opt.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
go tool dist: FAILED: /opt/src/golang/pkg/tool/linux_arm/go_bootstrap install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: signal: Illegal instruction

And here's a gdb log:

[root@unknown src]$ gdb /opt/src/golang/pkg/tool/linux_arm/go_bootstrap
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/src/golang/pkg/tool/linux_arm/go_bootstrap...done.
warning: Unsupported auto-load script at offset 0 in section .debug_gdb_scripts
of file /opt/src/golang/pkg/tool/linux_arm/go_bootstrap.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) run
Starting program: /opt/src/golang/pkg/tool/linux_arm/go_bootstrap

Program received signal SIGILL, Illegal instruction.
runtime.check () at /opt/local/src/runtime/runtime1.go:146
146                     i, i1 float32
(gdb) bt full
#0  runtime.check () at /opt/local/src/runtime/runtime1.go:146
        e = 0
        i = 0
        j = 0
        k = 0x0
        m = "\000\000\000"
        z = 0
#1  0x00062e94 in runtime.rt0_go () at /opt/local/src/runtime/asm_arm.s:149
No locals.
#2  0x00000000 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

The line /opt/local/src/runtime/asm_arm.s:149 is:

	BL	runtime·check(SB)

In go1.9.2 it crashes on BL runtime·check(SB) as well.

I should also note that uClibc-ng 1.0.27 is used as the libc.



This comment has been minimized.

Copy link

@davecheney davecheney commented Dec 28, 2017


This comment has been minimized.

Copy link

@alllexx88 alllexx88 commented Dec 29, 2017

The Go toolchain doesn’t expect v7 implementations to lack vfpv3 so your best bet, without patching the compiler, is to

export GOARM=5

To disable the use of hard fp

It works as a workaround, thank you! It'd be good for this to be detected automatically, at least during a native build

@bradfitz bradfitz changed the title ARM: go_bootstrap crashes with SIGILL on "BL runtime·check(SB)" in runtime/asm_arm.s cmd/dist: detect FPUless ARMv7 platforms? Dec 29, 2017
@bradfitz bradfitz added this to the Go1.11 milestone Dec 29, 2017

This comment has been minimized.

Copy link

@rsc rsc commented Jan 29, 2018

cmd/dist can and probably should check for this. I thought that's what it already did for GOARM detection, but maybe the detection needs refining.

@rsc rsc added the NeedsFix label Jan 29, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Unplanned Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.