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

Comments

@gopherbot
Copy link

commented Oct 8, 2013

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

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2013

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

This comment has been minimized.

Copy link
Author

commented Oct 8, 2013

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

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2013

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

This comment has been minimized.

Copy link
Author

commented Oct 8, 2013

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

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2013

Comment 5:

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

Status changed to Retracted.

@gopherbot

This comment has been minimized.

Copy link
Author

commented Oct 8, 2013

Comment 6 by prencher:

You bet.
@gopherbot

This comment has been minimized.

Copy link
Author

commented Oct 8, 2013

Comment 7 by prencher:

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

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015

@rsc rsc removed the go1.2maybe label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.