Skip to content

main.main: relocation target mypkg/pkg.Test[go.shape.int_0] not defined #49524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zllangct opened this issue Nov 11, 2021 · 2 comments
Closed

Comments

@zllangct
Copy link

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

$ go version
go version devel go1.18-d76b1ac3e1 Thu Nov 11 13:58:28 2021 +0000 darwin/amd64

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/....../Library/Caches/go-build"
GOENV="/....../Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/......../go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/......../go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/......./sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/......./sdk/gotip/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.18-d76b1ac3e1 Thu Nov 11 13:58:28 2021 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="............"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8s/qvy8nhvd0b932fq8lzb116j80000gn/T/go-build262027237=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

image

pkg.go:

package pkg

func Test[T int](in int) {}

go.mod:

module mypkg

go 1.18

main.go:

package main

import (
	"mypkg/pkg"
)

func main() {
	pkg.Test[int](1)
}

What did you see instead?

# command-line-arguments
main.main: relocation target mypkg/pkg.Test[go.shape.int_0] not defined
@randall77
Copy link
Contributor

Something weird going on with completely empty bodies. Should be easy to fix.

@randall77 randall77 self-assigned this Nov 11, 2021
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/363395 mentions this issue: cmd/compile: ensure stenciled function bodies are nonempty

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants