-
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
proposal: cgo: c code can call c function that defined in another cgo package #19746
Comments
I managed to implement this feature with go1.7.5 with darwin/ios/linux/android. I have test that changeset in mac/ios/android os. Here is the changeset:
I do not know how to port this feature to go1.8 |
This seems like a bad idea and breaks backwards compatibility. Also, We do not accept changes on the issue tracker. Code must only come via https://golang.org/doc/contribute.html Even if this feature were approved, that code is not gofmt'd and does not have tests. Its detection of clang-vs-gcc is also overly simplistic. In the future, please wait for approval before sending code. |
I suggest you discuss on the mailing list about your actual problem before jumping to a solution. (See http://xyproblem.info/) For questions about Go, see https://golang.org/wiki/Questions. |
I add this feature to my own go1.7.5, so that I can write a rpc that can call objective c from golang function/call golang function from objective c in every package without write one line about complex cgo stuff. I do not understand why you guys do not even want to discuss it. "This seems like a bad idea and breaks backwards compatibility." I looks like I have to port those changs to go1.8 myself. if I want to upgrade to that golang version. |
Brad didn't say that we don't want to discuss it, he said that we want to discuss it on a mailing list instead of the issue tracker. Thanks. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.5 darwin/amd64
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/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m9/qtbxkp6s3p96fk54rln7qhj80000gp/T/go-build255881879=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
What did you do?
What did you expect to see?
Compile success.
What did you see instead?
Compile fail.
The text was updated successfully, but these errors were encountered: