-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Ship MinGW-w64 runtime DLLs along with rust-lld.exe
for -pc-windows-gnu
targets
#128876
Conversation
This comment has been minimized.
This comment has been minimized.
a39d8ab
to
7fbb1cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bootstrap-wise, these changes look OK, but I don't know a lot about windows-gnu and don't have Windows prepared for testing this.
@jieyouxu could you please try to check it on Windows?
cc @mati865 |
I can try a bit later, but no guarantees to reproduce ci environment |
@Kobzol wait what am I supposed to be testing here? Or rather, what's the canonical example that I should try to build with a |
I suppose that the goal is to check whether LLD can be used on windows-gnu if you also meet all the requirements described in this PR's description 😅 @ColinFinck Could you describe some reproduction guide to make it easier to test whether this works as intended on Windows? |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@Kobzol @jieyouxu To reproduce the problem for the current Rust 1.80.0 release, follow these steps on a Windows Command Prompt (
This will show a message box about a DLL not being found, followed by a My PR fixes this by putting the missing DLLs into the right place. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
30aab08
to
f94c872
Compare
f94c872
to
a29b75a
Compare
This comment has been minimized.
This comment has been minimized.
…s-gnu` targets `rust-lld.exe` built for `x86_64-pc-windows-gnu` depends on `libgcc_s_seh-1.dll` and `libwinpthread-1.dll` from MinGW-w64. Until now, they were not shipped alongside `rust-lld.exe`, and you could not run `rust-lld.exe` on most systems. This problem didn't surface until now because: * Most targets don't use `rust-lld` by default. * Some people had these DLLs in their `PATH` from some other MinGW binary. * `rustup` used to add `bin` to the `PATH`, which contains these DLLs for `rustc.exe`. But it no longer does that: rust-lang/rustup@ce3c09a Fixes rust-lang#125809
a29b75a
to
71d98a8
Compare
☀️ Try build successful - checks-actions |
Ok, so if anyone wants to try this then they can install it locally using:
EDIT: updated the toolchain install command to add missing components. |
It's written in C, so it doesn't pull in libstdc++. LLVM (and therefore LLD) built by Rust has statically linked libstdc++. |
This comment was marked as resolved.
This comment was marked as resolved.
I think I missed some needed components from my install instructions. I've updated them. You may need to also use |
I can confirm whatever the CI built Works On My Machine™. So this LGTM (insofar as whatever the CI built is what the end users get)! Repro instructions:
then in PowerShell
seems to work without any missing DLL errors 👍 |
Feel free to also r=me. |
Can also confirm that the CI-built toolchain of this PR does exactly what it's supposed to do and fixes #125809 |
@rustbot ready |
AFAICT this is good to go, therefore: @bors r=Kobzol,petrochenkov,jieyouxu |
May the machine gods bless |
…lls, r=Kobzol,petrochenkov,jieyouxu Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` targets `rust-lld.exe` built for `x86_64-pc-windows-gnu` depends on `libgcc_s_seh-1.dll` and `libwinpthread-1.dll` from MinGW-w64. Until now, they were not shipped alongside `rust-lld.exe`, and you could not run `rust-lld.exe` on most systems. This problem didn't surface until now because: * Most targets don't use `rust-lld` by default. * Some people had these DLLs in their `PATH` from some other MinGW binary. * `rustup` used to add `bin` to the `PATH`, which contains these DLLs for `rustc.exe`. But it no longer does that: rust-lang/rustup@ce3c09a Fixes rust-lang#125809 try-job: dist-x86_64-mingw
Rollup of 7 pull requests Successful merges: - rust-lang#126985 (Implement `-Z embed-source` (DWARFv5 source code embedding extension)) - rust-lang#128349 (Enable `f16` on x86 and x86-64) - rust-lang#128876 (Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` targets) - rust-lang#129190 (Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs) - rust-lang#129257 (Allow rust staticlib to work with MSVC's /WHOLEARCHIVE) - rust-lang#129386 (Use a LocalDefId in ResolvedArg.) - rust-lang#129400 (Update `compiler_builtins` to `0.1.120`) r? `@ghost` `@rustbot` modify labels: rollup
Sorry, could not resist: https://youtu.be/EIWHvPP0U64?si=ZpitnEb2lNjQSSJ9 |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#127623 (fix: fs::remove_dir_all: treat internal ENOENT as success) - rust-lang#128876 (Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` targets) - rust-lang#129055 (Migrate `x86_64-fortanix-unknown-sgx-lvi` `run-make` test to rmake) - rust-lang#129386 (Use a LocalDefId in ResolvedArg.) - rust-lang#129400 (Update `compiler_builtins` to `0.1.120`) - rust-lang#129414 (Fix extern crates not being hidden with `doc(hidden)`) - rust-lang#129417 (Don't trigger refinement lint if predicates reference errors) - rust-lang#129433 (Fix a missing import in a doc in run-make-support) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#127623 (fix: fs::remove_dir_all: treat internal ENOENT as success) - rust-lang#128876 (Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` targets) - rust-lang#129055 (Migrate `x86_64-fortanix-unknown-sgx-lvi` `run-make` test to rmake) - rust-lang#129386 (Use a LocalDefId in ResolvedArg.) - rust-lang#129400 (Update `compiler_builtins` to `0.1.120`) - rust-lang#129414 (Fix extern crates not being hidden with `doc(hidden)`) - rust-lang#129417 (Don't trigger refinement lint if predicates reference errors) - rust-lang#129433 (Fix a missing import in a doc in run-make-support) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128876 - ColinFinck:rust-lld-with-runtime-dlls, r=Kobzol,petrochenkov,jieyouxu Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` targets `rust-lld.exe` built for `x86_64-pc-windows-gnu` depends on `libgcc_s_seh-1.dll` and `libwinpthread-1.dll` from MinGW-w64. Until now, they were not shipped alongside `rust-lld.exe`, and you could not run `rust-lld.exe` on most systems. This problem didn't surface until now because: * Most targets don't use `rust-lld` by default. * Some people had these DLLs in their `PATH` from some other MinGW binary. * `rustup` used to add `bin` to the `PATH`, which contains these DLLs for `rustc.exe`. But it no longer does that: rust-lang/rustup@ce3c09a Fixes rust-lang#125809 try-job: dist-x86_64-mingw
rust-lld.exe
built forx86_64-pc-windows-gnu
depends onlibgcc_s_seh-1.dll
andlibwinpthread-1.dll
from MinGW-w64. Until now, they were not shipped alongsiderust-lld.exe
, and you could not runrust-lld.exe
on most systems.This problem didn't surface until now because:
rust-lld
by default.PATH
from some other MinGW binary.rustup
used to addbin
to thePATH
, which contains these DLLs forrustc.exe
. But it no longer does that: rust-lang/rustup@ce3c09aFixes #125809
try-job: dist-x86_64-mingw