-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE in librustc_codegen_llvm when building kernel #59548
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
triage: P-high, removing I-nominated tag since there is little to discuss beyond P-highness. Important next step is to create an isolated test case (either a crate, or ideally, a single file or even snippet that reproduces on play.rust-lang.org), so that we do not risk losing track of the problematic code from an external repository. |
Will do, I suspect it's related to referencing a |
Confirmed: Using a minimal reproduction with the following files (Cargo.toml files omitted for brevity)
extern crate depfoo;
fn main() {
println!("{:p}", &depfoo::EXTERN);
}
#![feature(linkage)]
#[linkage="external"]
pub static EXTERN: u32 = 0; Results in the ICE:
|
ah, this may be a known limitation of did this code use to compile under a previous version of Rust? |
Don't know - this was a new piece of code (the reference to the linkage-marked variable was added as part of moving to an xargo-based build) |
triage: Assigning to self to look into whether this is known limitation of |
So there's a couple interesting things here: First: the ICE itself originates here: rust/src/librustc_codegen_llvm/consts.rs Lines 100 to 106 in 4680580
... rust/src/librustc_codegen_llvm/consts.rs Lines 119 to 123 in 4680580
i.e., the ICE is happening because we aren't providing a rust/src/librustc_codegen_llvm/consts.rs Line 263 in 4680580
So one option would be to attempt to figure out some Second: one would imagine we should be issuing the diagnostic complaining about the type at the point where the attribute is attached to the item; i.e., at the point where we are compiling |
Okay so it turns out that its pretty trivial to fix the first problem I mentioned above. I'll have a PR up with that shortly. It is probably also easy to fix the second problem, but such a change is a little bit more risky, since it will "break" hypothetical code that compiles today (namely, code that defines a static with some |
…stic, r=petrochenkov Fix linkage diagnostic so it doesn't ICE for external crates Fix linkage diagnostic so it doesn't ICE for external crates (As a drive-by improvement, improved the diagnostic to indicate *why* `*const T` or `*mut T` is required.) Fix rust-lang#59548 Fix rust-lang#61232
…stic, r=petrochenkov Fix linkage diagnostic so it doesn't ICE for external crates Fix linkage diagnostic so it doesn't ICE for external crates (As a drive-by improvement, improved the diagnostic to indicate *why* `*const T` or `*mut T` is required.) Fix rust-lang#59548 Fix rust-lang#61232
Basic issue while I start digging deeper into the issue. Compiling the kernel in https://github.com/thepowersgang/rust_os/tree/4eefae2ce0db2ba62714dbedc31094a756275651 using xargo causes rustc to ICE in
librustc_codegen_llvm
In cleaning up for commit, I've isolated it to https://github.com/thepowersgang/rust_os/blob/4eefae2ce0db2ba62714dbedc31094a756275651/Kernel/main/main.rs#L34, which causes the ICE if uncommented.
The text was updated successfully, but these errors were encountered: