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/go: spurious error message when external linking a pure Go program #31544
Comments
This also happens in module mode:
But it does not happen if the file name (hello.go) is given explicitly.
|
/cc @jayconrod @bcmills |
I can reproduce the failure. I'm bisecting it now to try to get some idea of how it broke. |
|
This is a result of the The decision in the go/src/cmd/go/internal/load/flag.go Line 43 in 19966e9
That field is set after the call to go/src/cmd/go/internal/load/pkg.go Lines 1962 to 1964 in 19966e9
However, by that point go/src/cmd/go/internal/load/pkg.go Line 511 in 19966e9
...and go/src/cmd/go/internal/load/pkg.go Line 1534 in 19966e9
|
@cherrymui, unless this is important for you for some reason, we'd like to postpone the fix to Go 1.14. It's subtle code. /cc @bcmills |
Change https://golang.org/cl/176217 mentions this issue: |
Sure, it is fine to postpone. |
We would like to propose to reconsider the priority fixing this issue. The implication of it is, that such Go binaries have no Preloaded (LD_PRELOAD) shared objects may rely on the fact that Go creates POSIX threads. |
I certainly think this should be fixed, but I'm not following the concern with LD_PRELOAD shared objects. I don't see how it would be possible to use an LD_PRELOAD with a pure Go program. |
@ianlancetaylor: The scenario is very specific, but has a serious impact on existing applications. A shared object of our (application performance monitoring) product is pre-loaded into Go processes to hook certain Go functions. Customers use As the issue causes |
OK, that seems not only specific but completely unsupported. Again, I think this bug should be fixed, but the Go team can't take any responsibility for keeping that kind of pre-loaded library working. |
What version of Go are you using (
go version
)?tip (3235f7c)
Does this issue reproduce with the latest release?
Yes, happens with Go 1.11, 1.12, and tip, but not with Go 1.10.
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
When using external linking for a pure Go program, the linker prints
loadinternal: cannot find runtime/cgo
message. The linking actually succeeded, and the generated binary works fine.What did you expect to see?
No error message, like with Go 1.10.
What did you see instead?
Spurious
loadinternal: cannot find runtime/cgo
error message.The text was updated successfully, but these errors were encountered: