Skip to content
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: cgo fails to compile packages with clang/Xcode 5.0 #6544

Closed
gopherbot opened this issue Oct 8, 2013 · 7 comments
Closed

cmd/cgo: cgo fails to compile packages with clang/Xcode 5.0 #6544

gopherbot opened this issue Oct 8, 2013 · 7 comments
Milestone

Comments

@gopherbot
Copy link

by prencher:

This was originally reported in issue #4829. I posted a comment on it, but as it has
been marked fixed, I don't know if that is monitored. If it is, please by all means
close this issue as a duplicate and accept my apology.

When trying to get packages that depend on cgo, I get the error "argument unused
during compilation: '-fno-eliminate-unused-debug-types'":

$ go get bazil.org/fuse
# bazil.org/fuse
clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

$ go version
go version devel +f4d1cb8d9a91 Thu Sep 19 22:34:33 2013 +1000 darwin/amd64

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

$ clang --version
Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
@ianlancetaylor
Copy link
Contributor

Comment 1:

Does anything change if you set the environment variable CC=clang before running "go
get"?

Labels changed: added priority-soon, go1.2maybe, removed priority-triage.

@gopherbot
Copy link
Author

Comment 2 by prencher:

Just tried it - That indeeds works without issue.
It would appear it by default tries to use the clang derived gcc on the system. I have
no $CC variable set normally, so perhaps a change in the default compiler used by cgo on
OS X is in order?

@ianlancetaylor
Copy link
Contributor

Comment 3:

We've changed the default compiler to clang on OS X 10.8.  We have kept it as gcc on OS
X 10.6.  In fact, that difference is the main reason we are building different binary
releases for 10.6 and 10.8.
What version of OS X are you using?

@gopherbot
Copy link
Author

Comment 4 by prencher:

I am using OS X 10.8.5, and I can confirm the issue is fixed.
The issue was caused by homebrew not applying the proper flags for the build it does
when installed 1.2rc1, and when I installed the 10.8 release binary I goofed on the path.
Sorry for the false alarm.

@davecheney
Copy link
Contributor

Comment 5:

Please raise a bug on the homebrew project. Their Go recipe is generating too many
support requests.

Status changed to Retracted.

@gopherbot
Copy link
Author

Comment 6 by prencher:

You bet.

@gopherbot
Copy link
Author

Comment 7 by prencher:

For anybody else running into this issue, please refer to
Homebrew/legacy-homebrew#23119.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants