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

Closed
e-nikolov opened this issue Sep 6, 2019 · 4 comments
Closed

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

e-nikolov opened this issue Sep 6, 2019 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@e-nikolov
Copy link

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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 6, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Sep 6, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@ray2011
Copy link

ray2011 commented Mar 2, 2021

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

@qycyfjy
Copy link

qycyfjy commented Jan 26, 2022

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

@cherrymui
Copy link
Member

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 Issue is not actionable because of missing required information, which needs to be provided. label Jun 15, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

8 participants