On Thursday 02 June 2016 21:02:58 Ted Unangst wrote:
> Trying to build anything with go 1.6 results in an error.
> 
> $ go build hello.go
> package main
>         imports runtime: C source files not allowed when not using cgo or
>       SWIG: atomic_amd64x.c defs.c float.c heapdump.c lfstack.c malloc.c
>       mcache.c mcentral.c mem_openbsd.c mfixalloc.c mgc0.c mheap.c msize.c
>       os_openbsd.c panic.c parfor.c proc.c runtime.c signal.c
>       signal_amd64x.c signal_unix.c stack.c string.c sys_x86.c
> $ go version
> go version go1.6.2 openbsd/amd64
> 
> Seven flavors of stackoverflow questions provide seven different answers,
> but none of them seem particularly relevant.

Works fine for me:

$ go version
go version go1.6.2 openbsd/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="openbsd"
GOOS="openbsd"
GOPATH="/home/joel/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/openbsd_amd64"
GO15VENDOREXPERIMENT="1"
CC="cc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="c++"
CGO_ENABLED="1"
$ go run hello.go
hello world

The libtls/gotls regress also runs/passes (which uses cgo) and make regress 
passed on both i386 and amd64 when I did the update to 1.6.2.

I suspect a local environment issue - what does `go env` say?

Have you got a GOROOT or GOARCH/GOHOSTARCH exported?

The list of C files is also curious - those look like parts of the old Go 
runtime (Go 1.4 and earlier), which it should not be trying to build (or even 
know anything about). Actually, this looks like you're invoking the go 1.6.2 
binary with a GOROOT pointing at the go-bootstrap environment...

Reply via email to