Skip to content

Illegal Instruction during early init on Armv7 (xcompiled from darwin/amd64) #18483

Closed
@jdizzle

Description

@jdizzle

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.6.3 darwin/amd64

installed via brew

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.6.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.6.3/libexec/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

However I am cross compiling for a linux arm7 system

GOARM=7
GOARCH=arm
GOOS=linux

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

// Our first program will print the classic "hello world"
// message. Here's the full source code.
package main

import "fmt"

func main() {
    fmt.Println("hello world")
}

What did you see instead?

The executable immediately crashes due to an illegal instruction signal. Here is the output of gdserver:

Program received signal SIGILL, Illegal instruction.
runtime.check () at /usr/local/Cellar/go/1.6.3/libexec/src/runtime/runtime1.go:152
152	/usr/local/Cellar/go/1.6.3/libexec/src/runtime/runtime1.go: No such file or directory.
(gdb) disass
Dump of assembler code for function runtime.check:
   0x00049f8c <+0>:	ldr	r1, [r10, #8]
   0x00049f90 <+4>:	cmp	sp, r1
   0x00049f94 <+8>:	bls	0x4a53c <runtime.check+1456>
   0x00049f98 <+12>:	str	lr, [sp, #-76]!	; 0xffffffb4
   0x00049f9c <+16>:	mov	r0, #0
   0x00049fa0 <+20>:	mov	r0, #0
   0x00049fa4 <+24>:	mov	r0, #0
   0x00049fa8 <+28>:	mov	r0, #0
   0x00049fac <+32>:	mov	r0, #0
   0x00049fb0 <+36>:	str	r0, [sp, #48]	; 0x30
   0x00049fb4 <+40>:	mov	r0, #0
   0x00049fb8 <+44>:	mov	r0, #0
   0x00049fbc <+48>:	mov	r1, #0
   0x00049fc0 <+52>:	mov	r0, #0
   0x00049fc4 <+56>:	mov	r1, #0
=> 0x00049fc8 <+60>:	vmov.f32	s0, #112	; 0x3f800000  1.0
   0x00049fcc <+64>:	vsub.f32	s0, s0, s0
   0x00049fd0 <+68>:	vstr	s0, [sp, #44]	; 0x2c
   0x00049fd4 <+72>:	vmov.f32	s0, #112	; 0x3f800000  1.0
   0x00049fd8 <+76>:	vsub.f32	s0, s0, s0
   0x00049fdc <+80>:	vstr	s0, [sp, #40]	; 0x28
   0x00049fe0 <+84>:	vmov.f64	d0, #112	; 0x3f800000  1.0
   0x00049fe4 <+88>:	vsub.f64	d0, d0, d0
   0x00049fe8 <+92>:	vstr	d0, [sp, #60]	; 0x3c
   0x00049fec <+96>:	vmov.f64	d0, #112	; 0x3f800000  1.0
   0x00049ff0 <+100>:	vsub.f64	d0, d0, d0
   0x00049ff4 <+104>:	vstr	d0, [sp, #52]	; 0x34
   0x00049ff8 <+108>:	mov	r0, #0
   0x00049ffc <+112>:	str	r0, [sp, #72]	; 0x48
   0x0004a000 <+116>:	mov	r0, #0
   0x0004a004 <+120>:	mov	r0, #0
   0x0004a008 <+124>:	mov	r0, #0
   0x0004a00c <+128>:	strb	r0, [sp, #36]	; 0x24
   0x0004a010 <+132>:	strb	r0, [sp, #37]	; 0x25
   0x0004a014 <+136>:	strb	r0, [sp, #38]	; 0x26
---Type <return> to continue, or q <return> to quit---q
Quit

It appears that the vmov.f32 instruction is not supported? I'm using a Cortex A9 chip, and the datasheet for the SoC shows the FPU. Is this possibly a software configuration issue on my end. I have ARM_THUMB=n in my kernel configuration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions