-
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: #define macro error with upstream go #20125
Comments
Referenced CL is https://golang.org/cl/35511. |
The problem is because GCC is generating this:
cgo is looking for an "error" on line not-str-lit:1, but it only sees a "note". |
I will see this within couple of days if the issue hasn't been closed in that time. Thanks. |
CL https://golang.org/cl/41910 mentions this issue. |
@ianlancetaylor I tried to solve this by finalizing #define values. (see the above patch) |
As noted on the CL the patch makes me nervous. What happens with clang or older GCC today? Do they succeed or fail on this test? |
Oh, the email notification was delayed.
It succeeds with clang. clang doesn't track macro expansions in error messages, as far as I can see. |
CL https://golang.org/cl/44290 mentions this issue. |
@hirochachacha I sent https://golang.org/cl/44290 as an alternate approach that fixes this bug. It doesn't address all the cases that your CL handles, but I feel more confident about its portability and correctness. Let me know what you think. |
thanks guys! I just tested it and works 🎉 |
Hi, I've been testing docker with upstream go, and ever since this cgo patch
89ff0b1, I've been unable to build the docker binaries.
The problem looks cgo related and I've created a small test below that can reproduce the issue.
What version of Go are you using (
go version
)?go 1.8.1 compiles without an error
upstream go since 89ff0b1 fails to compile
What operating system and processor architecture are you using (
go env
)?Fails on x86_64 as well, is easily reproducible below as long as you have the right linux header or ran in a container.
GOARCH="ppc64le"
GOBIN=""
GOEXE=""
GOHOSTARCH="ppc64le"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_ppc64le"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build967771292=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
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"
What did you do?
I was running docker CI with upstream go, but this should make the issue reproducible
What did you expect to see?
Hello, playground
"somenumbers"
done
What did you see instead?
could not determine kind of name for C.FS_IOC_FSGETXATTR
Any ideas would be helpful, Thanks!
The text was updated successfully, but these errors were encountered: