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

x/tools/cmd/compilebench: loadinternal: cannot find runtime/cgo #63383

Closed
qiulaidongfeng opened this issue Oct 5, 2023 · 5 comments
Closed
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. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@qiulaidongfeng
Copy link
Member

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

$ go version
1.21.1

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

What did you do?

go install golang.org/x/tools/cmd/compilebench@latest
compilebench -alloc

What did you expect to see?

Normal benchmark.

What did you see instead?

loadinternal: cannot find runtime/cgo

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Oct 5, 2023
@gopherbot gopherbot added this to the Unreleased milestone Oct 5, 2023
@prattmic
Copy link
Member

prattmic commented Oct 6, 2023

cc @golang/compiler

@prattmic prattmic added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. compiler/runtime Issues related to the Go compiler and/or runtime. labels Oct 6, 2023
@cherrymui
Copy link
Member

Could you show the complete output? What platform do you run on?

loadinternal: cannot find runtime/cgo this line is just a print, not an error. Do you still get the benchmark results?

@cherrymui cherrymui added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 6, 2023
@qiulaidongfeng
Copy link
Member Author

Run on Linux/amd64
output:

BenchmarkTemplate 1 266844474 ns/op 358912000 user-ns/op
BenchmarkUnicode 1 125062571 ns/op 139210000 user-ns/op
BenchmarkGoTypes 1 1731786734 ns/op 2655056000 user-ns/op
BenchmarkCompiler 1 97326266 ns/op 107688000 user-ns/op
BenchmarkSSA 1 11858574099 ns/op 18812607000 user-ns/op
BenchmarkFlate 1 129268703 ns/op 180482000 user-ns/op
BenchmarkGoParser 1 252441849 ns/op 389266000 user-ns/op
BenchmarkReflect 1 623183863 ns/op 978348000 user-ns/op
BenchmarkTar 1 230124921 ns/op 321653000 user-ns/op
BenchmarkXML 1 251384006 ns/op 382333000 user-ns/op
BenchmarkLinkCompiler 1 501002715 ns/op 730779000 user-ns/op
loadinternal: cannot find runtime/cgo
BenchmarkExternalLinkCompiler 1 1502519909 ns/op 1492371000 user-ns/op
BenchmarkLinkWithoutDebugCompiler 1 242237716 ns/op 257949000 user-ns/op
BenchmarkStdCmd 1 122730287736 ns/op
BenchmarkHelloSize 1 804035 text-bytes 14624 data-bytes 203368 bss-bytes 1284840 exe-bytes
BenchmarkCmdGoSize 1 11216349 text-bytes 305074 data-bytes 235440 bss-bytes 16734189 exe-bytes

see https://github.com/golang/go/blob/master/src/cmd/link/internal/ld/lib.go#L450,It seems that it was printed by the link. Is this an error in the link or is it the debugging information for the link?

@cherrymui
Copy link
Member

It is just a diagnostic message the linker prints. It is not an error. It should still generate the correct program.

That said, since #31544 is fixed, we probably could arrange compilebench to pass a more correct configuration to avoid this.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/533855 mentions this issue: cmd/compilebench: pass linker flags to prebuild

@golang golang locked and limited conversation to collaborators Oct 9, 2024
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. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants