-
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
LLVM error with fat LTO and Rust 1.67.0 to Rust 1.69.0 on Windows #107781
Comments
Similar problem when compiling a PyO3 project. In my case, it only occur on Windows x86.
|
The errors are related to SEH exception handling, which is only used on Windows. I don't have a Windows machine so can't debug this directly. I'd suggest to run |
I'd like to confirm I'm also seeing this issue on Windows with rustc 1.67.1 (MSVC) x86_64. I can reproduce the issue with LTO set to both
I've run the command as described and produced a collection of |
I can reproduce with (Assigning to myself to keep track of this.) |
What is the recommended workaround to build release binaries on Windows? Is there a way how to keep using LTO for non-Windows targets? (Sorry for the newbie question. 🙈) I am using the following profile (our Cargo.toml): [profile.release]
codegen-units = 1
incremental = true
lto = true
opt-level = 3 |
Found the answers. TL;DR: Cargo does not support per-target profiles yet. You can use env variables (e.g. |
LLVM 16 upgrade PRs I was able to found, for anybody trying to keep track of the progress: |
We observed a similar issue when building release for Windows (using Rust 1.66). Changing lto settings did not help. Problem did disappear with 1.68. |
My problem is resolved on rust v1.68.0. Though I don't know why. |
Sorry for my mistake, we just found out our issue disappeared with 1.68 as well. |
Can anyone still reproduce this? If not I'll go ahead and close this, especially as nightly is now on LLVM 16, which should address the root cause. |
My compiling problem is resolved in nightly (1.70.0). |
Can confirm my issue is resolved with the latest 1.70.0 nightly as well. Shall I close this issue as resolved? |
Thanks everyone for confirming! |
While compiling a large Rust binary on Windows I ran into an unusual LLVM error:
I don't know how to produce a more minimal example. My experimenting so far has found that it only happens if all of these conditions are met:
The regular
release
profile does not trigger the error, even when all other conditions are met.The version of the binary (Lighthouse) built doesn't seem to matter too much, tags
v3.4.0
andv3.4.0-tree.2
both trigger the same error.Lighthouse is open source and can be compiled locally (see build deps). It takes about 10 minutes on a fast machine to compile with the
maxperf
profile. The exact command I've been using to test is:You can also see a failed compilation on our public CI here.
Meta
info for 1.67.0:
info for 1.66.1:
info for 1.68.0 beta:
info for nightly:
MSVC info (not sure if this is relevant):
Error from 1.68.0-beta.2
Error from 1.69.0-nightly (2023-02-06)
The text was updated successfully, but these errors were encountered: