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

plugin: Open on OSX results in linker warning #21776

Closed
edaniels opened this issue Sep 6, 2017 · 15 comments
Closed

plugin: Open on OSX results in linker warning #21776

edaniels opened this issue Sep 6, 2017 · 15 comments
Milestone

Comments

@edaniels
Copy link
Contributor

edaniels commented Sep 6, 2017

Please answer these questions before submitting your issue. Thanks!

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

go version go1.9 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/eric/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_t/slphnkrx1yn27w46fsxxgtsh0000gn/T/go-build715028725=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Built a package with plugin.Open being used.
Code:

package main

import "plugin"

func main() {
	plugin.Open("test")
}

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

No linker warning

What did you see instead?

# command-line-arguments
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in type..eqfunc.[106]string from /var/folders/_t/slphnkrx1yn27w46fsxxgtsh0000gn/T/go-link-423239180/go.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie

Not an issue in 1.8.3. I understand that plugins do not work in macos but they should not produce any warnings since plugin is a std package.

@hirochachacha
Copy link
Contributor

Fixed by 88a1e85

@odeke-em odeke-em changed the title Using plugin.Open on macos results in linker warning plugin: Open on OSX results in linker warning Sep 6, 2017
@odeke-em odeke-em added this to the Go1.10 milestone Sep 6, 2017
@odeke-em
Copy link
Member

odeke-em commented Sep 6, 2017

Thank you @hirochachacha for the fix and for mentioning that it is fixed

@edaniels, as @hirochachacha mentioned, this issue is fixed on tip/latest on master.

Before fix

screen shot 2017-09-06 at 4 57 48 pm

After fix

screen shot 2017-09-06 at 4 58 48 pm

I'll close this issue, please reopen if it returns.

@odeke-em odeke-em closed this as completed Sep 6, 2017
@hirochachacha
Copy link
Contributor

@odeke-em Thank you for your confirmation.

@mmindenhall
Copy link

I'm also running into this, and noticed the issue was tagged in 1.10 milestone, but 1.9.1. Is that an oversight, or will this fix automatically get included in 1.9.1?

@ianlancetaylor ianlancetaylor modified the milestones: Go1.9.1, Go1.10 Sep 12, 2017
@ianlancetaylor
Copy link
Contributor

Reopening to consider whether it should be fixed in 1.9.

My impression, though, is that plugins don't work on MacOS in 1.9 anyhow, in which case fixing this in 1.9 seems pointless. Am I wrong about that?

@edaniels
Copy link
Contributor Author

You are correct. For me it's just noise in my daily workflow. If the fix mentioned was not intrusive, then it would be nice to have this in 1.9.1. I have seen other people on my team mention it and they typically think something went wrong.

@mmindenhall
Copy link

The plugins don't work in MacOS, but until this bug, we were able to build binaries from MacOS with GOOS=linux.

@mmindenhall
Copy link

Actually, I should clarify.

Our team are all using Macbooks. Our project includes support for a plugin, but we don't have any tests implemented in that package. So in go1.8 we were able to build and run our binary (without a plugin), as well as all of our tests on a Mac. We were also able to build linux binaries from a Mac, that we could run on a linux device to load and test the plugin.

In go1.9 we can no longer build our project on a Mac due to this bug. So this is blocking us from upgrading to 1.9...hence the desire to see the fix in go1.9.1.

@hirochachacha
Copy link
Contributor

comment out + build tags don't work for you?
Plus, this is just a warning. It doesn't prevent building a binary.

@edaniels
Copy link
Contributor Author

We'd need to restructure the code to use build tags which is fine. In general we look for the plugin on all platforms by a generic name. We use a fallback piece of code if the plugin is not found.

@mmindenhall
Copy link

@hirochachacha, yes, there are workarounds. But can we not expect a regression to be fixed in the next point release rather than the next major? Especially since your fix was a single-line change that can easily be cherry-picked into 1.9.1?

@hirochachacha
Copy link
Contributor

@mmindenhall I'm not a judge. Maybe go team will decide.

@crawshaw
Copy link
Member

I don't have a strong opinion on this. It's a line of noise in the -v output, so not something I'd consider important enough to risk in a point release.

@rsc
Copy link
Contributor

rsc commented Oct 13, 2017

I'm fairly uncomfortable with a subtle change like this, especially just to make a warning disappear, especially for use of plugin, which is quite experimental. I think people using plugin will probably just have to live with the warning.

Not for Go 1.9.2.

Closing because already fixed.

@rsc rsc closed this as completed Oct 13, 2017
@rsc rsc modified the milestones: Go1.9.2, Go1.10 Oct 13, 2017
@guoger
Copy link

guoger commented Oct 26, 2017

It's still somewhat annoying, especially running go test ./... that produces this warning repeatedly. Any workaround to suppress the warning? thx! I'm using OSX 10.11.6

@golang golang locked and limited conversation to collaborators Oct 26, 2018
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

9 participants