We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
go version go1.10.1 darwin/amd64
Not test with the latest release.
go env
GOARCH="amd64" GOBIN="" GOCACHE="/Users/peer/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/peer/.golang" GORACE="" GOROOT="/usr/local/opt/go/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m1/2yvmbf5d64q7rh73rsqcph2c0000gn/T/go-build467835613=/tmp/go-build -gno-record-gcc-switches -fno-common"
I write a demo to reproducing the error.
I try to cross compile a plugin in macOS to ARM platform(RPi Zero W), but got an error.
$ git clone https://github.com/PeerXu/error-golang-cross-compile-with-plugin.git $ cd error-golang-cross-compile-with-plugin $ make GOOS=linux GOARCH=arm GOARM=5 go build -o plugin.so -buildmode=plugin plugin/plugin.go # command-line-arguments loadinternal: cannot find runtime/cgo /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 clang: error: invalid linker name in argument '-fuse-ld=gold' make: *** [all] Error 2
Compile pass without any error.
# command-line-arguments loadinternal: cannot find runtime/cgo /usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 clang: error: invalid linker name in argument '-fuse-ld=gold' make: *** [all] Error 2
The text was updated successfully, but these errors were encountered:
dupe of #18157
You need to install a C cross-compiler and then set the following environmental variables:
CGO_ENABLED=1 CC=replace-this-with-the-arm-cross-compiler
If you require further help please ask around in one of the places listed in https://github.com/golang/go/wiki/Questions as the bug tracker is only for bug reports.
Sorry, something went wrong.
Thank @AlexRouSg . Should I close this issue?
Yes
No branches or pull requests
What version of Go are you using (
go version
)?go version go1.10.1 darwin/amd64
Does this issue reproduce with the latest release?
Not test with the latest release.
What operating system and processor architecture are you using (
go env
)?What did you do?
I write a demo to reproducing the error.
I try to cross compile a plugin in macOS to ARM platform(RPi Zero W), but got an error.
What did you expect to see?
Compile pass without any error.
What did you see instead?
The text was updated successfully, but these errors were encountered: