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 devel +2287296 Wed Oct 12 08:03:00 2016 +0000 linux/amd64
go env
GOARCH="amd64" GOOS="linux" GOPATH="/home/rog/src/go" GOTOOLDIR="/home/rog/go/pkg/tool/linux_amd64" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build045198637=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1"
go build -buildmode plugin tst.go
where tst.go was:
package main func main() {} var Foo = 99
A built plugin binary.
# command-line-arguments 2016/10/12 10:58:11 cannot handle R_TLS_IE (sym runtime.memhash8) when linking internally
The text was updated successfully, but these errors were encountered:
I think the bug here is that the error message is not very good.
A plugin that does not export any symbols, which requires using import "C", is not very useful.
import "C"
Sorry, something went wrong.
@ianlancetaylor Where does this use import "C"? I see an exported symbol, "Foo".
I'm sorry, you're right, I got confused between this and -buildmode=c-shared.
Seems like -buildmode=plugin needs to force an external link, probably by changing mustLinkExternal in cmd/link/internal/ld/config.go.
mustLinkExternal
Agreed. Sending a CL.
CL https://golang.org/cl/30933 mentions this issue.
413afca
No branches or pull requests
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
where tst.go was:
What did you expect to see?
A built plugin binary.
What did you see instead?
The text was updated successfully, but these errors were encountered: