-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Add LLD flags for MinGW #75483
Add LLD flags for MinGW #75483
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
FTR afb3aeb is preliminary commit to enable LLD by default with self-contained mode but it depends on adding heuristic to |
So, we don't generally use linker directly for non bare-metal targets given the state of #11937, but using it in self-contained mode only and avoiding shipping ancient gcc is a good motivation to make an exception, especially if the replacement is fresh |
Is |
@bors r+ |
📌 Commit c75f7f9 has been approved by |
⌛ Testing commit c75f7f9 with merge e019be06c2a36f6bbb0456fb9dce423d797cc859... |
@bors r- |
@petrochenkov #68647 is fixed in MSYS2 MinGW LLD packages and in upcoming LLVM 11 which Rust is hopefully going to use soon: #73526
At least when it comes to 64-bit LLD is generally usable for C/C++ code since few releases, for Rust since #72049 (but requires defining
TBH calling linker directly is basically the same as calling
LLD silently ignores |
@bors r+ |
📌 Commit c75f7f9 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Tested locally and this now works:
RUSTFLAGS="-Zlink-self-contained=yes -Clinker=rust-lld" cargo b
RUSTFLAGS="-Zlink-self-contained=no -Clinker=rust-lld -Zpre-link-arg=-Ld:/msys64/mingw64/x86_64-w64-mingw32/lib -Zpre-link-arg=-Ld:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0 -Zpre-link-arg=crt2.o" cargo b
This is "harmless" part of the changes to make possible linking with bare LLD with windows-gnu target. More debatable changes should follow in next PRs soon.