Skip to content

CGO_ENABLED=0 build fails on go 1.12 #30986

Closed
@wrdls

Description

@wrdls

What version of Go are you using (go version)?

$ go version

go version go1.12.1 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

kernel version Output
$ uname -a

Linux thinkpad 5.0.3-arch1-1-ARCH #1 SMP PREEMPT Tue Mar 19 13:09:13 UTC 2019 x86_64 GNU/Linux

go env Output
$ go env

GOARCH="amd64"
GOBIN="/home/ward/go/bin"
GOCACHE="/home/ward/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ward/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ward/go/src/bitbucket.org/factionxyz/test-env/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build544707537=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ CGO_ENABLED=0 go build -a
# bitbucket.org/factionxyz/test-env
loadinternal: cannot find runtime/cgo

What did you expect to see?

Go compiles without issues like it did with 1.11.

$ CGO_ENABLED=0 ~/Downloads/go1.11.6.linux-amd64/bin/go build -a

What did you see instead?

Compilation exited with errors.

loadinternal: cannot find runtime/cgo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions