On Fri, Jan 6, 2017 at 4:05 AM, Kedar Babar <kedartba...@gmail.com> wrote: > Thanks for looking in the issue. I run the go build with the -x, but no > where it is calling the gcc. Following is full output > > WORK=/tmp/go-build815513256 > mkdir -p $WORK/goresearch/mynet/_obj/ > mkdir -p $WORK/goresearch/mynet/_obj/exe/ > cd /home/administrator/GoWork/src/goresearch/mynet > CGO_LDFLAGS="-g" "-O2" "-lm" "-ldl" "-lstdc++" "-ll" "-lc++" "-lc" "-lexslt" > "-lgmalloc" "-lobjc" "-lpcap" "-lpthread" "-lSystem" "-ltls" "-lutil" "-lz" > "-lxml2" /usr/lib/go-1.6/pkg/tool/linux_amd64/cgo -objdir > $WORK/goresearch/mynet/_obj/ -importpath goresearch/mynet -- -I > $WORK/goresearch/mynet/_obj/ -std=gnu99 mynet.go > o64-clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments > -fmessage-length=0 -fno-common -I $WORK/goresearch/mynet/_obj/ -g -O2 > -std=gnu99 -o $WORK/goresearch/mynet/_obj/_cgo_main.o -c > $WORK/goresearch/mynet/_obj/_cgo_main.c > o64-clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments > -fmessage-length=0 -fno-common -I $WORK/goresearch/mynet/_obj/ -g -O2 > -std=gnu99 -o $WORK/goresearch/mynet/_obj/_cgo_export.o -c > $WORK/goresearch/mynet/_obj/_cgo_export.c > o64-clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments > -fmessage-length=0 -fno-common -I $WORK/goresearch/mynet/_obj/ -g -O2 > -std=gnu99 -o $WORK/goresearch/mynet/_obj/mynet.cgo2.o -c > $WORK/goresearch/mynet/_obj/mynet.cgo2.c > o64-clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments > -fmessage-length=0 -fno-common -o $WORK/goresearch/mynet/_obj/_cgo_.o > $WORK/goresearch/mynet/_obj/_cgo_main.o > $WORK/goresearch/mynet/_obj/_cgo_export.o > $WORK/goresearch/mynet/_obj/mynet.cgo2.o -g -O2 -lm -ldl -lstdc++ -ll -lc++ > -lc -lexslt -lgmalloc -lobjc -lpcap -lpthread -lSystem -ltls -lutil -lz > -lxml2 > /usr/lib/go-1.6/pkg/tool/linux_amd64/cgo -objdir > $WORK/goresearch/mynet/_obj/ -dynpackage main -dynimport > $WORK/goresearch/mynet/_obj/_cgo_.o -dynout > $WORK/goresearch/mynet/_obj/_cgo_import.go > o64-clang -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments > -fmessage-length=0 -fno-common -o $WORK/goresearch/mynet/_obj/_all.o > $WORK/goresearch/mynet/_obj/_cgo_export.o > $WORK/goresearch/mynet/_obj/mynet.cgo2.o -g -O2 -Wl,-r -nostdlib > /usr/lib/go-1.6/pkg/tool/linux_amd64/compile -o $WORK/goresearch/mynet.a > -trimpath $WORK -p main -buildid a01d97609ce6d71f052c7746576b9b68357f6099 -D > _/home/administrator/GoWork/src/goresearch/mynet -I $WORK -pack > $WORK/goresearch/mynet/_obj/_cgo_gotypes.go > $WORK/goresearch/mynet/_obj/mynet.cgo1.go > $WORK/goresearch/mynet/_obj/_cgo_import.go > pack r $WORK/goresearch/mynet.a $WORK/goresearch/mynet/_obj/_all.o # > internal > cd . > /usr/lib/go-1.6/pkg/tool/linux_amd64/link -o > $WORK/goresearch/mynet/_obj/exe/a.out -L $WORK -extld=o64-clang > -buildmode=exe -buildid=a01d97609ce6d71f052c7746576b9b68357f6099 > -extld=o64-clang $WORK/goresearch/mynet.a > # goresearch/mynet > /usr/lib/go-1.6/pkg/tool/linux_amd64/link: running o64-clang failed: exit > status 1 > ld: warning: ignoring file /tmp/go-link-989097505/000001.o, file was built > for unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being > linked (x86_64): /tmp/go-link-989097505/000001.o > Undefined symbols for architecture x86_64: > "_x_cgo_free", referenced from: > __cgo_free in go.o > "_x_cgo_init", referenced from: > __cgo_init in go.o > "_x_cgo_malloc", referenced from: > __cgo_malloc in go.o > "_x_cgo_notify_runtime_init_done", referenced from: > __cgo_notify_runtime_init_done in go.o > "_x_cgo_setenv", referenced from: > runtime._cgo_setenv in go.o > "_x_cgo_thread_start", referenced from: > __cgo_thread_start in go.o > "_x_cgo_unsetenv", referenced from: > runtime._cgo_unsetenv in go.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > > The above output states that it is creating the ELF file format, which it is > not able to understand. I tried different linker options also, but did not > succeed.
I'm not sure but I think this error means that you have an existing installed package that was built without using o64-clang. Try using `go build -a` to force all packages to be rebuilt. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.