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
cgo const error on OS X 10.7 #1881
Labels
Comments
Comment 1 by kballard@apple.com: I accidentally filed this with the wrong account. Is there any way to edit it to use my customary account (kballard@gmail.com)? |
You would have to file it again, but you don't need to as this issue has already been reported. Please add any additional context to issue #1657 with your gmail account. Status changed to Duplicate. Merged into issue #1657. |
Is this really the same issue? issue #1657 appears to be a problem that arises in the test phase. My problem arises when trying to build the net package. |
Ok, now I've looked in /usr/include/netdb.h on an actual 10.7 system, and I find the exact same thing. /* valid flags for addrinfo (not a standard def, apps should not use it) */ #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define AI_MASK \ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ AI_ADDRCONFIG) #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ |
Comment 13 by kwal@google.com: I'm running the same build of OS X at home. As far as I can tell, the version of GCC that ships with the Lion dev tools either doesn't produce any EnumerationType DWARF entries, or is producing them in a way that debug/dwarf doesn't recognize. The dwarf.TagEnumerationType case in loadDWARF in cgo/gcc.go doesn't ever seem to get run. Without seeing these tags, cgo can determine the value for simple const defines (e.g. #define FOO 23) but not more complicated defines like AI_MASK. |
FYI, I'm seeing exactly this issue on OS X 10.6.7 I've attached my go/src/pkg/net as well. I compiled and ran the same test program as Kevin above, and got the same result: AI_MASK: 5127 Attachments:
|
Compiling go worked fine for me a few weeks ago, but crashes with this same error now. I've recently updated Xcode to the 4C104 build, version 4.2, released on June 6. I'm running OS/X 10.6.7. It seems likely that something changed in this release of Xcode. I also ran the AI_MASK test code: spark:golang$ cat test.c #include <stdlib.h> #include <netdb.h> #include <stdio.h> int main() { printf("AI_MASK: %d\n", AI_MASK); return 0; } spark:golang$ clang test.c -o test.o spark:golang$ ./test.o AI_MASK: 5127 I don't have a sense for where to start troubleshooting, but I'd be happy to try any experiments which would help diagnose the issue. |
This issue was closed by revision 9968090. Status changed to Fixed. |
rsc
added a commit
that referenced
this issue
May 11, 2015
««« CL 4607045 / 142f0bc0d6e7 cgo: handle new Apple LLVM-based gcc from Xcode 4.2 That gcc does not include enumerator names and values in its DWARF debug output. Create a data block from which we can read the values instead. Fixes #1881. R=iant CC=golang-dev https://golang.org/cl/4607045 »»» R=adg CC=golang-dev https://golang.org/cl/4708042
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by kballard@apple.com:
Attachments:
The text was updated successfully, but these errors were encountered: