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

Use gold as the linker on Linux #14

Open
jakepetroules opened this issue Jan 30, 2025 · 5 comments
Open

Use gold as the linker on Linux #14

jakepetroules opened this issue Jan 30, 2025 · 5 comments

Comments

@jakepetroules
Copy link
Collaborator

Doesn’t seem like using lld really works, so we need to use gold. This is also the status quo for Linux builds since swift-driver will pass -fuse-ld=gold if used as linker driver.

@al45tair
Copy link

al45tair commented Feb 4, 2025

Curious to know what the problem was with lld. There are community members pushing for more use of lld, and some Linux distros only have lld installed by default too.

@jakepetroules
Copy link
Collaborator Author

@neonichu might remember more details as to the specific issues here.

@neonichu
Copy link
Collaborator

neonichu commented Feb 5, 2025

Unfortunately, I don't remember, what I noted down at the time was this:

Some more info here: https://forums.swift.org/t/building-the-swift-project-on-linux-with-lld-instead-of-gold/73303/7

I think the problem I was running into is relocating protected symbols, so I guess we are currently using BFD

So I am assuming I was running into some of the problems described in that thread, but wasn't sure myself what it was concretely.

@compnerd
Copy link
Member

I think that we should favour the system linker - gold is now officially deprecated, and BFD is able to link the swift libraries. We should transition back towards using the system linker and let the Linux distribution decide whether that should be gold, bfd, or lld (or even mold or wild). Continuing to use clang as the linker driver basically means that all we need to do is drop the -use-ld=... and -fuse-ld=... flags from being added.

@jakepetroules
Copy link
Collaborator Author

@compnerd Seems reasonable. I copied this issue from a list we'd come up with a while back, so it's likely based on outdated observations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants