Skip to content
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

cmd/link: -pluginpath seems to no longer work with go1.13 #34143

Open
e-nikolov opened this issue Sep 6, 2019 · 3 comments
Open

cmd/link: -pluginpath seems to no longer work with go1.13 #34143

e-nikolov opened this issue Sep 6, 2019 · 3 comments
Labels
NeedsInvestigation WaitingForInfo
Milestone

Comments

@e-nikolov
Copy link

@e-nikolov e-nikolov commented Sep 6, 2019

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

$ go version
go version go1.13 linux/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="/home/enikolov/.cache/go-build"
GOENV="/home/enikolov/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="bitbucket.org/unchain/*"
GONOSUMDB="bitbucket.org/unchain/*"
GOOS="linux"
GOPATH="/home/enikolov/go"
GOPRIVATE="bitbucket.org/unchain/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/enikolov/.gvm/gos/go1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/enikolov/.gvm/gos/go1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build411225951=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go build -ldflags "-pluginpath=custom/path" -buildmode=plugin ./path/to/plugin

With go1.13 this seems to no longer map the packages to the custom path.

What did you expect to see?

I have the variable Version in my main package

With go 1.12 after running the strings utility on the produced binary, I would see this somewhere in the output:

custom/path.Version

What did you see instead?

With go1.13 I now see this instead:

path/to/plugin.Version

Could this be related to go modules?

@ianlancetaylor ianlancetaylor changed the title -pluginpath seems to no longer work with go1.13 cmd/link: -pluginpath seems to no longer work with go1.13 Sep 6, 2019
@ianlancetaylor ianlancetaylor added the NeedsInvestigation label Sep 6, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Sep 6, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
@ray2011
Copy link

@ray2011 ray2011 commented Mar 2, 2021

Has this problem be solved? It is inconvenient if we want to reload a plugin.

@saintdianabless
Copy link

@saintdianabless saintdianabless commented Jan 26, 2022

Am I using it the wrong way or is it still buggy?
WindowsTerminal_LOu7norgKK
image

@cherrymui
Copy link
Member

@cherrymui cherrymui commented Jan 26, 2022

What is the use case of -pluginpath? Does it affect the semantics of the program, besides changing some symbol names that can be inspected by tools (nm, objdump, strings)? @crawshaw what use cases did you have in mind? Thanks.

@seankhliao seankhliao added the WaitingForInfo label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation WaitingForInfo
Projects
None yet
Development

No branches or pull requests

7 participants