failed to build iconv-go with cgo when ccache enabled

235 views
Skip to first unread message

foqq...@gmail.com

unread,
Sep 24, 2014, 10:41:56 PM9/24/14
to golan...@googlegroups.com
$ go build -x
WORK=/tmp/go-build160366351
mkdir -p $WORK/github.com/djimenez/
cd /home/taoliu/gocode/src/github.com/djimenez/iconv-go
CGO_LDFLAGS="-g" "-O2" /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/djimenez/iconv-go/_obj/ -- -I $WORK/github.com/djimenez/iconv-go/_obj/ converter.go
/usr/local/go/pkg/tool/linux_amd64/6c -F -V -w -trimpath $WORK -I $WORK/github.com/djimenez/iconv-go/_obj/ -I /usr/local/go/pkg/linux_amd64 -o $WORK/github.com/djimenez/iconv-go/_obj/_cgo_defun.6 -D GOOS_linux -D GOARCH_amd64 $WORK/github.com/djimenez/iconv-go/_obj/_cgo_defun.c
ccache -I . gcc -fPIC -m64 -pthread -fmessage-length=0 -print-libgcc-file-name
/usr/local/go/pkg/tool/linux_amd64/6g -o $WORK/github.com/djimenez/iconv-go.a -trimpath $WORK -p github.com/djimenez/iconv-go -D _/home/taoliu/gocode/src/github.com/djimenez/iconv-go -I $WORK -pack ./iconv.go ./reader.go ./writer.go
./reader.go:10: undefined: Converter

$ go version
go version go1.3 linux/amd64
$ uname -a
Linux todd-pc 3.2.0-56-generic #86-Ubuntu SMP Wed Oct 23 09:20:45 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

# My ccache configurations
export USE_CCACHE=1
export CCACHE_DIR=~/tmp/ccache
ccache -M 40G > /dev/null
export CC="ccache gcc"
export CXX="ccache g++"

Dave Cheney

unread,
Sep 25, 2014, 12:09:49 AM9/25/14
to golan...@googlegroups.com
Does the build work if you don't use ccache ?

foqq...@gmail.com

unread,
Sep 25, 2014, 1:02:18 AM9/25/14
to golan...@googlegroups.com
Yes, build succeeded if ccache was disabled

在 2014年9月25日星期四UTC+8下午12时09分49秒,Dave Cheney写道:

Dave Cheney

unread,
Sep 25, 2014, 1:06:33 AM9/25/14
to foqq...@gmail.com, golang-nuts

One pragmatic solution is to not use cache, but if that isn't acceptable, please post the entire output of go install -x so we can see exactly where the build process is going wrong.

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/nk_NGh679jo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

foqq...@gmail.com

unread,
Sep 25, 2014, 2:13:29 AM9/25/14
to golan...@googlegroups.com, foqq...@gmail.com
Thanks for your advice. No ccache is acceptable for me. Actually it was enabled by accident (it's enabled in my env for a previous project which has a number of cpp files to compile).

在 2014年9月25日星期四UTC+8下午1时06分33秒,Dave Cheney写道:
Reply all
Reply to author
Forward
0 new messages