-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: ignores arguments in $CC #14551
Comments
Your C compiler seems to be generating debug info that says that the size of the type "void*" is 8 bytes. cgo is complaining because you set GOARCH=arm, so cgo expects 4 byte pointers. Look closely at the compiler in
Are you sure that compiler will generate 32-bit ARM code? (I don't know who XCode works myself). You may want to run cgo with |
It helps me. I guess I understand the problem. $
Is this work as intended? |
|
You need to use misc/ios/clangwrap.sh as CC for darwin/arm
and darwin/arm64.
|
Yes. But is this desirable behavior? |
No, it's not. But the cgo tool does provide another way to specify compiler options, so it's not urgent. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version devel +ff27421 Sun Feb 28 11:06:40 2016 +0000 darwin/amd64
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hiro/.go"
GORACE=""
GOROOT="/Users/hiro/work/go"
GOTOOLDIR="/Users/hiro/work/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
(Use play.golang.org to provide a runnable example, if possible.)
$ CC="$(xcrun --sdk iphoneos --find clang) -arch armv7 -isysroot $(xcrun --sdk iphoneos --show-sdk-path)" GOARCH=arm go tool cgo -godefs input.go
input.go
No errors.
XCode 7.2.1 (latest)
Thank you.
The text was updated successfully, but these errors were encountered: