Open ranmocy opened 1 year ago
Relevant code: https://github.com/rust-lang/rust/blob/2036fdd24f77d607dcfaa24c48fbe85d3f785823/compiler/rustc_codegen_llvm/src/back/archive.rs#L388
Looks like one of these tools has generated a .a archive in a format we don't expect?
Hi @jyn514 I'm totally unfamiliar with LLVM and Rust compiler. Is there any information I could grab from my side that would help debugging?
The most helpful information would be the archive it panics on and the contents of that archive (this is related to paths to even tar -tf foo.a
would be enough). Unfortunately there's not a ton of debug logging in this part of the compiler, so I'm not sure how you could find out the name of the archive; maybe RUSTC_LOG=rustc_codegen_ssa,rustc_codegen_llvm
will show something useful?
I'm experiencing this same issue - I've tried using RUSTC_LOG=rustc_codegen_ssa,rustc_codegen_llvm
, however I get a large amount of output and I'm not sure how to decipher it into something useful. If anyone has any insight on how I could contribute more information I'd be happy to help further diagnose this.
I've tried to reproduce this but can't seem to - I've installed the cross-compilation toolchains, and the additional targets through rustup, with a simple "Hello, world" binary crate then running these commands doesn't cause an error. Are you still running into this?
Relabeling issues which don't have a runnable reproduction (as opposed to not having a minimized one) to the new label S-needs-repro. @rustbot label +S-needs-repro -E-needs-mcve
I've now come across this ICE as well, both in 1.78 and 1.79 stable.
Env setup
Code
Meta
rustc +nightly --version --verbose
:Error output
Backtrace
``` thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_codegen_llvm/src/back/archive.rs:388:67 stack backtrace: Compiling libssh2-sys v0.2.23 Compiling openssl v0.10.45 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic 3:::build
4: rustc_codegen_ssa::back::link::link_binary
5: ::link
6: ::link
7: rustc_span::with_source_map::, rustc_interface::interface::run_compiler, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.70.0-nightly (2036fdd24 2023-03-27) running on aarch64-apple-darwin
note: compiler flags: --crate-type lib -C opt-level=s -C panic=abort -C linker-plugin-lto -C codegen-units=1 -C debuginfo=0 -C linker=aarch64-unknown-linux-gnu-gcc -C strip=symbols
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
error: could not compile `openssl-sys` (lib)
```