-
Notifications
You must be signed in to change notification settings - Fork 13.3k
i686-pc-windows-gnu fails to compile rsbegin #109996
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
Comments
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
@rustbot label -I-prioritize +P-medium -P-high |
This is a nice reproducer but the priority was reduced because the use seems very niche and/or unmotivated. Can you explain why compiling just |
I was surprised that building the sysroot for i686-pc-windows-gnu doesn't hit this. rsbegin.rs and rsend.rs should be compiled as part of building the sysroot for mingw targets. Turns out we always compile them with the bootstrap compiler: Line 574 in 0534655
The fix for this issue I think is to use |
Indeed, this could be problematic when this regression would be present in the stage0 compiler, or when Lines 213 to 216 in 0534655
FWIW, this was originally caught here which builds these startup objects with the stage1 compiler. I've never encountered any problems with this approach until now. |
The declaration for the static is here: rust/library/rtstartup/rsbegin.rs Line 57 in f5b8f44
So (since it is not Lines 396 to 400 in f5b8f44
So I don't think this qualifies as a regression. But there is a separate question: It looks like you have been using an unsupported configuration, and maybe found it useful? Maybe we should try to support this use case on those grounds? |
The mere presence of this check in MIR that is codegened is enough to cause rustc to record a use of the panic lang item. It doesn't matter that the check is removed by optimizations, rustc will check that the lang item is defined by this crate or any of it's dependencies. |
Ah! Adding |
Here's another reproducer using the bootstrap script: $ curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain nightly
$ source "$HOME/.cargo/env"
$ git clone https://github.com/rust-lang/rust.git
$ cd rust
$ ./configure --set build.rustc="$(which rustc)" --set build.cargo="$(which cargo)"
$ ./x.py build --target i686-pc-windows-gnu (this assumes So this is not an unsupported configuration, rsbegin/rsend is always compiled without optimizations and therefore this should still be considered a regression.
FWIW, the only reason I compile Rust from source is to support the 32-bit @mati865 Does this unwinding issue still occurs on the 32-bit LLVM targets when bootstrapping Rust natively? |
@bjorn3 @kleisauke Sorry I didn't respond on here for a while, I've been thinking about this and finally came up with something that I think works, if it is a bit ungraceful. |
@kleisauke yes, it was fixed by https://reviews.llvm.org/D136879 |
…ment, r=bjorn3 Only emit alignment checks if we have a panic_impl Fixes rust-lang#109996 r? `@bjorn3` because you commented that this situation could impact you as well
Reproducer
I tried this script:
I expected to see a successful complication.
Instead, this happened:
Passing
-Zmir-enable-passes=-CheckAlignment
seems to fix this, so it looks like a possible regression introduced in #98112.Version it worked on
It most recently worked on: rustc 1.70.0-nightly (ec2f40c 2023-03-30)
Version with regression
rustc --version --verbose
:@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
The text was updated successfully, but these errors were encountered: