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: C package compile fails on Mac OS 10.9 #5791

Closed
eaigner opened this issue Jun 26, 2013 · 8 comments
Closed

cmd/cgo: C package compile fails on Mac OS 10.9 #5791

eaigner opened this issue Jun 26, 2013 · 8 comments

Comments

@eaigner
Copy link
Contributor

eaigner commented Jun 26, 2013

Compiling C packages on 10.9 produce the following error

    clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

When adding the `unused-arguments` C flag to the package file

    #cgo CFLAGS: -Qunused-arguments

it results in new errors

    could not determine kind of name for C.cl_scandesc
    could not determine kind of name for C.cl_engine_free
    could not determine kind of name for C.GoString
    could not determine kind of name for C.cl_strerror
    could not determine kind of name for C.cl_init
    could not determine kind of name for C.cl_load
    could not determine kind of name for C.cl_engine_compile
@davecheney
Copy link
Contributor

Comment 1:

This is not unexpected. Could you please attach the entire build log.

Status changed to WaitingForReply.

@eaigner
Copy link
Contributor Author

eaigner commented Jun 26, 2013

Comment 2:

How do I get the entire log? The output generated above is all I get, even with the `-v`
flag on.

@eaigner
Copy link
Contributor Author

eaigner commented Jun 26, 2013

Comment 3:

Here's the log including the `-x` flag
Eriks-MacBook-Pro:clam eaigner$ go build -v -x
WORK=/var/folders/xm/nbnqyf1x79q_44rpc4fqw_dm0000gn/T/go-build623485076
github.com/eaigner/clam
mkdir -p $WORK/github.com/eaigner/clam/_obj/
mkdir -p $WORK/github.com/eaigner/
cd /Users/eaigner/Go/src/github.com/eaigner/clam
pkg-config --cflags libclamav
pkg-config --libs libclamav
/usr/local/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/github.com/eaigner/clam/_obj/ --
-g -O2 -I/usr/local/Cellar/clamav/0.97.7/include -I $WORK/github.com/eaigner/clam/_obj/
engine.go
# github.com/eaigner/clam
clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

@gopherbot
Copy link

Comment 4 by bridgeyman:

Is there a workaround? I am running into this compiling github.com/mattn/go-sqlite3.

@davecheney
Copy link
Contributor

Comment 5:

@4, if this is related to the original issue, please try patching
https://code.google.com/p/go/source/detail?r=000ecca1178d67c9b482d3fb0b6a1bc4aeef2472
into your install.
If it is unrelated the original issue, and remembering that currently OS X 10.9 is not
shipping yet, please raise a new issue for sqlite.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 7:

Try running CC=clang make.bash

Status changed to Duplicate.

@gopherbot
Copy link

Comment 8 by mazdak@chango.com:

Using CC=clang to build Go source works, but it causes the following problem:
lookup_unix.go:64: cannot use _Ctype_size_t(bufSize) (type C.size_t) as type C.ulong in
function argument

@gopherbot
Copy link

Comment 9 by mazdak@chango.com:

To clarify, There is a mother thread about this as well:
https://golang.org/issue/5926?c=8
There is a temporary solution for the compilation

@golang golang locked and limited conversation to collaborators Jun 24, 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
Development

No branches or pull requests

4 participants