-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
bootstrap: Build with use-lld = true
fails under MSYS2 due to some path escaping issues
#137498
Comments
I didn't investigate this in detail yet, but I'll look during the week. |
I'd expect this to be a Rust regression, barely 3 days ago MSYS2 built Rust 1.85 with LLD for CLANG* environments. |
Huh, is this related to the issue next doors #137499 |
That's unrelated as the error is in std. This looks more like a bootstrap or rustc issue. My guess would be something changed with how bootstrap handles paths? Or maybe something in |
note that I tried to build 1.84.0 with LLD for all envs some time ago, but it failed for non-clang environments: msys2/MINGW-packages#23350 (comment) (it was with |
"Allow using self-contained LLD in bootstrap" did it. The question is why |
Feels like history repeats itself, last time I tried to switch to the new linker flavors in bootstrap, it also broke on Windows, IIRC 😆 I don't really develop on Windows, so it's a bit tricky for me to debug this. Maybe as a workaround I could use the new flavors in bootstrap only on Linux? |
The difference is in the flavor of "response files" generated when the command line is too long. rust/compiler/rustc_codegen_ssa/src/back/link.rs Line 1730 in c51b9b6
UPD: LLD for mingw has its own |
I looked at wrong source code 🤦 |
The only thing I'd mention here is that the breakage I fixed only appears if you have spaces (maybe some other special characters?) in the path: Passing POSIX escaping to something expecting 'windows' escaping will mostly work except with spaces(because you can't escape them with backslashes), while the reverse will break more obviously(because backslashes get interpreted as escapes): I don't know if there's any test cases currently that will exercise the combination of a response file and spaces in the path. And at least on the configuration I was working with (MSVC isntead of mingw) it looked like LLD was always using MSVC-style. |
Fixed in #137676. |
linker: Fix escaping style for response files on Windows If we use a С/С++ compiler as linker, then Posix-style escaping should be used. Also temporarily fixup rustbuild to not fail at least in common scenarios, until the bootstrap compiler is updated. Fixes rust-lang#137498
linker: Fix escaping style for response files on Windows If we use a С/С++ compiler as linker, then Posix-style escaping should be used. Also temporarily fixup rustbuild to not fail at least in common scenarios, until the bootstrap compiler is updated. Fixes rust-lang#137498
Rollup merge of rust-lang#137676 - petrochenkov:winresp, r=Kobzol linker: Fix escaping style for response files on Windows If we use a С/С++ compiler as linker, then Posix-style escaping should be used. Also temporarily fixup rustbuild to not fail at least in common scenarios, until the bootstrap compiler is updated. Fixes rust-lang#137498
The build fails soon after start with a log like this:
LLD cannot link correctly because the paths to object files that it sees are corrupted.
Removing
[rust] use-lld = true
fromconfig.toml
switches the linker to gnu and fixes the issue.This is a relatively recent regression (maybe in Rust, maybe in LLD package shipped by MSYS2), things worked ok 3-4 months ago.
The text was updated successfully, but these errors were encountered: