-
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: clang doesn't support no-eliminate-unused-debug-types #7278
Labels
Comments
I want to reemphasize that Go 1.2 never passes -fno-eliminate-unused-debug-types to any compiler. please check the following: 1. are you sure you are really using Go 1.2? Have you tried to install the official binary distributions? 2. have you tried to unset GOROOT? (I suspect this the cause, you have a GOROOT pointing to an older Go installation.) What's the output of: go env go version go build -x demo.go |
I had multiple versions of go. I removed one of them (And found that I was setting the other in ~/.bash_profile). I removed GOROOT and GOBIN but kept GOPATH. The complaint is 'fatal error: 'unicode/unistr.h' file not found' I managed to get around this by adding the correct path to my $PATH variable before, but it is not appeasing cgo. Since I can't really test the fix you gave me, I'll just take your word for it. Later, when I get a chance, I'll test this out on an OSX install with no prior go versions. Thank you. |
I tried that already. It didn't work. The missing file is in the unicode library icu. This is on OSX by default, but does not have the headers. I had to install that via homebrew, which worked fine. The problem now is that go build cannot seem to find the include path, which I am appending to my $PATH. |
go env GOARCH="amd64" GOBIN="" GOCHAR="6" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/j/gopath" GORACE="" GOROOT="/usr/local/Cellar/go/1.2/libexec" GOTOOLDIR="/usr/local/Cellar/go/1.2/libexec/pkg/tool/darwin_amd64" TERM="dumb" CC="clang" GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common" CXX="clang++" CGO_ENABLED="1" go version go version go1.2 darwin/amd64 go build -x demo.go [j:go-mapnik]$ go build -x demo.go WORK=/var/folders/dz/z947gc557xj912qnc705m1bm0000gn/T/go-build007112971 mkdir -p $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ mkdir -p $WORK/github.com/fawick/go-mapnik/ cd /Users/j/gopath/src/github.com/fawick/go-mapnik/mapnik /usr/local/Cellar/go/1.2/libexec/pkg/tool/darwin_amd64/cgo -objdir $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -- -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ mapnik.go /usr/local/Cellar/go/1.2/libexec/pkg/tool/darwin_amd64/6c -F -V -w -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -I /usr/local/Cellar/go/1.2/libexec/pkg/darwin_amd64 -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_defun.c clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -print-libgcc-file-name clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_main.o -c $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_main.c clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_export.o -c $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_export.c clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/mapnik.cgo2.o -c $WORK/github.com/fawick/go-mapnik/mapnik/_obj/mapnik.cgo2.c clang++ -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/mapnik_c_api.cpp.o -c ./mapnik_c_api.cpp # github.com/fawick/go-mapnik/mapnik In file included from mapnik/mapnik_c_api.cpp:5: In file included from /usr/local/include/mapnik/agg_renderer.hpp:28: In file included from /usr/local/include/mapnik/feature_style_processor.hpp:27: In file included from /usr/local/include/mapnik/datasource.hpp:28: In file included from /usr/local/include/mapnik/params.hpp:28: /usr/local/include/mapnik/value_types.hpp:27:10: fatal error: 'unicode/unistr.h' file not found |
go env GOARCH="amd64" GOBIN="" GOCHAR="6" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/j/gopath" GORACE="" GOROOT="/usr/local/Cellar/go/1.2/libexec" GOTOOLDIR="/usr/local/Cellar/go/1.2/libexec/pkg/tool/darwin_amd64" TERM="dumb" CC="clang" GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common" CXX="clang++" CGO_ENABLED="1" go version go version go1.2 darwin/amd64 go build -x demo.go [j:go-mapnik]$ go build -x demo.go WORK=/var/folders/dz/z947gc557xj912qnc705m1bm0000gn/T/go-build007112971 mkdir -p $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ mkdir -p $WORK/github.com/fawick/go-mapnik/ cd /Users/j/gopath/src/github.com/fawick/go-mapnik/mapnik /usr/local/Cellar/go/1.2/libexec/pkg/tool/darwin_amd64/cgo -objdir $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -- -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ mapnik.go /usr/local/Cellar/go/1.2/libexec/pkg/tool/darwin_amd64/6c -F -V -w -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -I /usr/local/Cellar/go/1.2/libexec/pkg/darwin_amd64 -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_defun.c clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -print-libgcc-file-name clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_main.o -c $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_main.c clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_export.o -c $WORK/github.com/fawick/go-mapnik/mapnik/_obj/_cgo_export.c clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/mapnik.cgo2.o -c $WORK/github.com/fawick/go-mapnik/mapnik/_obj/mapnik.cgo2.c clang++ -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/github.com/fawick/go-mapnik/mapnik/_obj/ -o $WORK/github.com/fawick/go-mapnik/mapnik/_obj/mapnik_c_api.cpp.o -c ./mapnik_c_api.cpp # github.com/fawick/go-mapnik/mapnik In file included from mapnik/mapnik_c_api.cpp:5: In file included from /usr/local/include/mapnik/agg_renderer.hpp:28: In file included from /usr/local/include/mapnik/feature_style_processor.hpp:27: In file included from /usr/local/include/mapnik/datasource.hpp:28: In file included from /usr/local/include/mapnik/params.hpp:28: /usr/local/include/mapnik/value_types.hpp:27:10: fatal error: 'unicode/unistr.h' file not found |
I removed my homebrew version and I removed my GOROOT [j:go-mapnik]$ go env GOARCH="amd64" GOBIN="/Users/j/go/bin" GOCHAR="6" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/j/gopath" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" CC="gcc" GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-common" CGO_ENABLED="1" I ran this command: hg clone -u release https://code.google.com/p/go Then I tried to build demo.go [j:go-mapnik]$ go build demo.go # github.com/fawick/go-mapnik/mapnik clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types' I think I'm going to give up on this one. Thanks for your help guys. |
Please don't give up, you are very close. 1. remove every environment variable you set save GOPATH. You only need to set GOPATH. 2. If you have used homebrew, you are done 3. If you have installed go using the tarball, ensure /usr/local/go/bin is in your path 4. Ensure no over versions of Go are in your path. That is all that should be required. The root cause is a mixture of go installs on your machine. Once you resolve that the problem should cease. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by jacob.amrany:
The text was updated successfully, but these errors were encountered: