Repository navigation
Linking with LLD fails (on Windows) but only in 32-bit (due to space in path) #78686
Description
Activity
- addedregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
on Nov 2, 2020 - addedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Nov 2, 2020 This looks awfully like #76466.
The cause of #76466 is entirely unrelated to this issue: llvm/llvm-project@928e9e1
- addedA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesO-windowsOperating system: WindowsOperating system: WindowsO-x3232 bit ABI for x86-6432 bit ABI for x86-64
on Nov 2, 2020 - addedP-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Nov 4, 2020 Assigning
P-highas discussed as part of the Prioritization Working Group procedure and removingI-prioritize.- removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Nov 4, 2020 Visiting for P-high review.
There are a number of questions this issue raises for me.
- Was this really a regression? The reporter says this scenario had worked for them in the past, but also says they're not sure they were using
lldin the past, so its possible that this specific combination (i.e. of usinglldatop 32-bit Windows) has never worked... - Regardless of whether its a regression or not, its definitely a bug
- But I don't know whether it should be a P-high bug.
- My personal suspicion is that resolving this will be a matter of figuring out what's specifically wrong in the 32-bit target handling; i.e. the hard part is probably in identifying where things are going wrong, but once we find that, the fix will probably obvious.
I'd like to find this an owner, the hardest part is probably finding someone who already has an environment set up for building for this target (32-bit windows).
- Was this really a regression? The reporter says this scenario had worked for them in the past, but also says they're not sure they were using
the hardest part is probably finding someone who already has an environment set up for building for this target (32-bit windows).
32-bit Windows MSVC to be specific 😄
@rustbot modify labels: -O-windows +O-windows-msvc
- addedO-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: Windowsand removedO-windowsOperating system: WindowsOperating system: Windows
on Dec 9, 2022 Just following up on my note from 2022-12-09 above: I'm not sure we have enough interest in this issue for us to keep it at P-high.
I haven't downgraded it to P-medium yet, but I probably will do so the next time I see it in the P-high triage (which is supposed to happen quarterly)
I have tried on a recent-ish nightly:
- on a windows x64 host, with an i686 target (like it seems is the case in the OP)
- having a 32bit LLVM 16.0.0-rc3
lld-link.exe, in a folder with spaces - having the project in a folder with spaces
- having the nightly rustup toolchain in a folder with spaces
And the issue doesn't reproduce,
lldseemed to link the executable correctly. Maybe things were fixed since this issue was opened ?@Boscop are you still able to reproduce this issue ? Do you maybe have a link to a project where we can reproduce the issue, or ensure it doesn't reproduce anymore.
- addedO-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)O-x86_32Target: x86 processors, 32 bit (like i686-*) (also known as IA-32, i386, i586, i686)Target: x86 processors, 32 bit (like i686-*) (also known as IA-32, i386, i586, i686)and removed
on Oct 25, 2023 Visited during the compiler team's P-high review. @Boscop have you hit this recently?
The lld codepath which sets the quoting style for COFF images hasn't changed in 6 years. I believe this bug is not actually related to the WASM issue mentioned above.
Since we do not have a repro or any other indication this is still a problem, I'm closing for now.
If anyone does run into this again, please let us know and we'll re-open. Thanks!
Well, it's been two and a half years but I think I have also run into this issue on 64bit Windows. LLD works fine with no spaces in the build path, but breaks when there are spaces. Similar error messages to op's.
# .cargo/config.toml [target.x86_64-pc-windows-gnu] rustflags = ["-C", "link-arg=-fuse-ld=lld"]
Windows version:
Microsoft Windows [Version 10.0.19045.6466]ld.lld --version LLD 22.1.2 (https://github.com/llvm/llvm-project 1ab49a973e210e97d61e5db6557180dcb92c3e98) (compatible with GNU linkers)cargo +stable-x86_64-pc-windows-gnu --version cargo 1.94.1 (29ea6fb6a 2026-03-24)
The 32-bit build of my DLL fails to build with nightly-2020-10-19 when linking with LLD.
It was building fine with nightly-2020-04-12, but I'm not sure if I was using LLD back then already.
LLD seems to have problems with a space in my rustup path, but it used to work before, also building for 32-bit!
My rustup folder is
D:\Program Files\.multirust, but it tries to useFiles\.multirust.Btw, this DLL builds fine in 64-bit with this nightly!
At first I posted on the forum:
https://users.rust-lang.org/t/linking-with-lld-fails-but-only-in-32-bit-due-to-space-in-path/50521
Apparently it was only fixed for Wasm: #77543 (comment)