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: external linking is not reproducible on some platforms #46334

Open
mdempsky opened this issue May 24, 2021 · 1 comment
Open

cmd/link: external linking is not reproducible on some platforms #46334

mdempsky opened this issue May 24, 2021 · 1 comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@mdempsky
Copy link
Member

I've noticed that running go build -a -v -toolexec='toolstash -cmp' std cmd fails on ppc64le, because some binaries (e.g., cmd/pprof) report differences.

I haven't investigated much yet, but as a hunch I suspect it's related to ppc64le not supporting internal linking for cgo. E.g., cmd/pprof depends on net (which uses cgo) and fails, but cmd/gofmt passes. Also, I'm not able to reproduce the issue when cross-building either ppc64le->amd64 or amd64->ppc64le (where both modes disable cgo), or if I build natively on ppc64le with CGO_ENABLED=0.

Notably though, go build -ldflags=-linkmode=external -toolexec='toolstash -cmp' cmd/pprof does not fail on amd64. So maybe the non-determinism is specific to the external linker used on my ppc64le system vs my amd64 system.

Happy to run additional experiments to help narrow down the cause of failure.

My ppc64le system is running Fedora 34, with GCC 11.0.1 and GNU ld 2.35.1-41.fc34. The amd64 test system is a Google corp workstation.

/cc @cherrymui @rsc

@mdempsky mdempsky added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 24, 2021
@mdempsky mdempsky added this to the Backlog milestone May 24, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label May 24, 2021
@cherrymui
Copy link
Member

cherrymui commented May 24, 2021

Yeah, see also CL https://go-review.googlesource.com/c/go/+/253157 . That fails on a few platforms with external linking (including PPC64, if I recall correctly). In the past I have fixed some platforms (e.g. https://go-review.googlesource.com/c/go/+/250944 on macOS) but in general there still need more work.

@cherrymui cherrymui changed the title x/tools/cmd/toolstash: toolstash -cmp reports differences linking some binaries on ppc64le cmd/link: external linking is not reproducible on some platforms May 24, 2021
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
Status: Triage Backlog
Development

No branches or pull requests

3 participants