Skip to content

cmd/compile: relocation error when building some programs on linux/amd64 after dev.regabi merge #44330

@siebenmann

Description

@siebenmann

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

$ go version
go version devel +2f0da6d9e2 Wed Feb 17 01:29:54 2021 +0000 linux/amd64

This is the current git tip, but the problem happens from commit 8482559 onward (which merges the dev.regabi branch into main).

Does this issue reproduce with the latest release?

No.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/homes/hawklords/cks/.cache/go-build"
GOENV="/homes/hawklords/cks/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/homes/hawklords/cks/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/homes/hawklords/cks/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/data/code/go-lang/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/data/code/go-lang/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel +2f0da6d9e2 Wed Feb 17 01:29:54 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/homes/hawklords/cks/go/src/github.com/monsterxx03/gospy/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=/tmpfs/go-build1010952997=/tmp/go-build -gno-record-gcc-switches"

What did you do?

The simplest reproduction is:

cd /tmp
git clone https://github.com/monsterxx03/gospy
cd gospy
go build

(Unfortunately the program doesn't build as a module build with 'go install' due to a 'replace' directive in its go.mod.)

What did you expect to see?

The build works.

What did you see instead?

# github.com/monsterxx03/gospy
github.com/monsterxx03/gospy/pkg/term.NewTerm.func1·f: relocation target github.com/monsterxx03/gospy/pkg/term.NewTerm.func1 not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions