-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/compile: fails to run on some ARMv7 processors #14711
Comments
Can you find out what the illegal instruction is? It should work to run something like
|
Sure, see below:
|
My understand and experiments both suggest that we don't generate the mcr2 instruction. (I tried this:
so maybe somehow that's executing data that is not intended to be code? |
I know it's not directly helpful to the problem at hand, but
This is not necessary since Go 1.5, and in fact could be considered to be the wrong thing to do. To cross compile all that is necessary is |
Could you please make the original hello executable
available somewhere? I'd like to take a look. Thanks.
|
It seems the binary is completely corrupted. Section Headers: Symbol table '.debug_frame' contains 2659 entries: 6760c: dae04bb0 ble ff87a4d4 <(null)+0x387a405> |
I removed Go from my system, and preformed a fresh install. This time I took @davecheney advice and did not define GOARCH or GOARM on the install, only while building the executable.
This produces the expected result on the target when ran. |
Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (
go version
)?go version go1.6 linux/amd64
2. What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mjohn/workspace/gopath"
GORACE=""
GOROOT="/home/mjohn/software/go"
GOTOOLDIR="/home/mjohn/software/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
3. What did you do?
(Use play.golang.org to provide a runnable example, if possible.)
I am cross-compiling for ARMv7. I have a simple hello world program.
I built Go to cross-compile.
GOARCH=arm GOARM=7 GOOS=linux ./make.bash
Then compiled the code.
GOARCH=arm GOARM=7 GOOS=linux go build hello.go
The resulting executable runs on one ARMv7 board but fails on another with a different ARMv7 processor.
Processor where code runs:
Freescale i.MX53
Processor where code does not run:
Ti am3352
4. What did you expect to see?
./hello
Hello, tester
5. What did you see instead?
./hello
Illegal instruction
The text was updated successfully, but these errors were encountered: