Skip to content

plugin: can't use plugin package in linkobj builds #33820

@steeve

Description

@steeve

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

$ go1.13rc1 version
go version go1.13rc1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/steeve/Library/Caches/go-build"
GOENV="/Users/steeve/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/steeve/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/steeve/sdk/go1.13rc1"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/steeve/sdk/go1.13rc1/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/steeve/hdrgenerator/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bs/51dlb_nn5k35xq9qfsxv9wc00000gr/T/go-build596961202=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ cat test.go
package main

import _ "plugin"

func main() {}
$ go1.13rc1 tool compile -pack -o test.a -linkobj test.link.a test.go

$ go1.13rc1 tool link -o test test.link.a
test.link.a: missing package data entry

# this couldn't work, but I tested it anyway
$ go1.13rc1 tool link -o test test.a
/Users/steeve/sdk/go1.13rc1/pkg/tool/darwin_amd64/link: test.a: not package main

What did you expect to see?

A successful link.

What did you see instead?

test.link.a: missing package data entry

Related issue

Misc

It is also not possible to use buildmode=plugin in linkobj builds.

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.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions