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/build: use LLD linker on linux-amd64-clang builder? #59482

Open
cherrymui opened this issue Apr 7, 2023 · 7 comments
Open

x/build: use LLD linker on linux-amd64-clang builder? #59482

cherrymui opened this issue Apr 7, 2023 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@cherrymui
Copy link
Member

The LLD linker is widely used by users. Occasionally there are some subtle differences in behavior between the C linkers (BFD, Gold, LLD), that cause issues for us (e.g. we may have assumptions based on the BFD linker's specific behavior (e.g. #59466), or we may uncover a bug in the C linker itself.)

As far as I can tell, we don't have much LLD coverage on the builders. I think it is probably good to have one. The linux-amd64-clang builder already uses LLVM based C compiler. So it may be a good fit. (gcc+lld is possible but probably not a popular configuration.)

Thoughts? Thanks.

cc @prattmic (was chatting with Michael about this the other day)

@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Apr 7, 2023
@gopherbot gopherbot added this to the Unreleased milestone Apr 7, 2023
@prattmic
Copy link
Member

prattmic commented Apr 7, 2023

I agree we should have a clang+lld builder. My question is whether we should also keep a builder with the existing configuration (is it clang+bfd or clang+gold?).

@mknyszek
Copy link
Contributor

mknyszek commented Apr 7, 2023

I'm going to guess that we should probably have builders for every popular C linker (or whatever we're willing to say we explicitly support).

Logistical question: what can this builder share with other builders? Could it, for example, share ./make.bash output?

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 7, 2023
@cherrymui
Copy link
Member Author

Now we build the toolchain without cgo, right? If so, the result of make.bash does not depend on the C linker at all. So we can share it.

Even if it still uses cgo, we probably can share. We just don't use LLD to link some tool binaries (the go command, the pprof command?), and that is probably fine, and we'll probably have the same coverage when linking test binaries.

@cherrymui
Copy link
Member Author

cherrymui commented Apr 7, 2023

We could have a builder for clang+bfd, if the builder resource is fine. I think that is probably also a popular configuration that users use.

@motiejus
Copy link
Contributor

motiejus commented Apr 8, 2023

For the record (this was mentioned in the linked issue, but worth repeating here) this exact combination would be very welcome for those of us who compile C/C++ files using zig cc, as Zig is actually clang+lld behind the scenes.

@motiejus
Copy link
Contributor

Related: #59666

@dmitshur
Copy link
Contributor

CC @golang/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants