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/cgo: bad instructions in gcc_arm.S #17595

Closed
terrylai opened this issue Oct 26, 2016 · 5 comments
Closed

cmd/cgo: bad instructions in gcc_arm.S #17595

terrylai opened this issue Oct 26, 2016 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@terrylai
Copy link

terrylai commented Oct 26, 2016

Hello all,

My go version is 1.7.1.

My env variable is listed in the following:
export GOROOT=~/go
export GOOS=linux
export GOARCH=arm
export CC=/usr/local/arm-linux/bin/gcc
export CXX=/usr/local/arm-linux/bin/g++
export GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
build829110422=/tmp/go-build -gno-record-gcc-switches"
export CGO_ENABLED=1

I wanted to cross compile a go program but the following was returned:

go build
:
:

runtime/cgo

../../go/src/runtime/cgo/gcc_arm.S: Assembler messages:
../../go/src/runtime/cgo/gcc_arm.S:27: Error: bad instruction push {r4,r5,r6,r7,r8,r9,r10,r11,ip,lr}' ../../go/src/runtime/cgo/gcc_arm.S:37: Error: bad instructionpop {r4,r5,r6,r7,r8,r9,r10,r11,ip,pc}'

I checked the ../../go/src/runtime/cgo/gcc_arm.S file and it does exist but why it contains bad instructions?

BR,
Terry

@ianlancetaylor
Copy link
Contributor

What compiler and assembler do you have installed (cc --version, as --version)?

Show us the output of go build -x.

@ianlancetaylor ianlancetaylor added this to the Go1.8 milestone Oct 26, 2016
@terrylai
Copy link
Author

terrylai commented Oct 26, 2016

ubuntu@ubuntu:~$ /usr/local/arm-linux/bin/gcc --version
gcc (GCC) 3.2.1

ubuntu@ubuntu:~$ /usr/local/arm-linux/bin/as --version
GNU assembler 2.13.2

go build -x can build successfully. But the file output is of type x86, not arm.

@minux
Copy link
Member

minux commented Oct 26, 2016 via email

@minux
Copy link
Member

minux commented Oct 26, 2016 via email

@josharian josharian changed the title Bad instructions in gcc_arm.S cmd/cgo: bad instructions in gcc_arm.S Oct 31, 2016
@josharian josharian added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 31, 2016
@rsc
Copy link
Contributor

rsc commented Nov 2, 2016

We believe gcc 4.x will fix this. If not, please file a new issue. Thanks.

@rsc rsc closed this as completed Nov 2, 2016
@golang golang locked and limited conversation to collaborators Nov 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants