rust-lang / rust-lang/rustc_codegen_cranelift

Compiling with Cranelift leads to Error 101

Open
#1,561 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-debuginfo C-bug O-arm O-macos
Dominant language
Rust
Stars
2.1k
Forks
157
Avg merge
1d 19h
Merged PRs (30d)
3

Description

Code
fn main() {}
Meta

rustc --version --verbose:

rustc 1.87.0-nightly (e16a049ad 2025-03-03)
binary: rustc
commit-hash: e16a049adbf94d610787430b6efdf31d896dc5b6
commit-date: 2025-03-03
host: aarch64-apple-darwin
release: 1.87.0-nightly
LLVM version: 20.1.0
Error output

rustc-ice-2025-03-04T20_05_39-91243.txt

warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/lore/Development/Advent of Code/2020/day15/Cargo.toml
workspace: /Users/lore/Development/Advent of Code/2020/Cargo.toml
   Compiling day15 v0.1.0 (/Users/lore/Development/Advent of Code/2020/day15)

thread 'rustc' panicked at compiler/rustc_codegen_cranelift/src/debuginfo/object.rs:89:14:
called `Result::unwrap()` on an `Err` value: Error("unimplemented relocation Relocation { offset: 32, symbol: SymbolId(14), addend: 0, flags: Generic { kind: Relative, encoding: Generic, size: 32 } }")
stack backtrace:
   0:        0x1128539d0 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h3959b7980ed3e272
   1:        0x10fff9f34 - core::fmt::write::haac92234bb96457c
   2:        0x112848104 - std::io::Write::write_fmt::h10a0cd5a63e727ee
   3:        0x112853890 - std::sys::backtrace::BacktraceLock::print::h55be4a34b934b0dd
   4:        0x112855ec0 - std::panicking::default_hook::{{closure}}::h766f3df9e3afc821
   5:        0x112855b88 - std::panicking::default_hook::h7c33a87c20ef2e6c
   6:        0x110aaf3cc - std[db59b894259804f0]::panicking::update_hook::<alloc[bcada68f88f3824a]::boxed::Box<rustc_driver_impl[b8773bc631419c9c]::install_ice_hook::{closure#1}>>::{closure#0}
   7:        0x1128567f0 - std::panicking::rust_panic_with_hook::he752a00b5ed52782
   8:        0x1128564a0 - std::panicking::begin_panic_handler::{{closure}}::hecf0d4de334165ab
   9:        0x112853e6c - std::sys::backtrace::__rust_end_short_backtrace::h6604ea774ca6d31d
  10:        0x112856168 - _rust_begin_unwind
  11:        0x1154b78fc - core::panicking::panic_fmt::hdc0765de8316649c
  12:        0x1154b7d54 - core::result::unwrap_failed::hc36c25cb3fd4c2ca
  13:        0x1067f4654 - <cranelift_object[9ac6d1e9ae562095]::backend::ObjectProduct as rustc_codegen_cranelift[db9f0bf133b168d8]::debuginfo::object::WriteDebugInfo>::add_debug_reloc
  14:        0x10682477c - <rustc_codegen_cranelift[db9f0bf133b168d8]::unwind_module::UnwindModule<cranelift_object[9ac6d1e9ae562095]::backend::ObjectModule>>::finish
  15:        0x1068028a8 - rustc_codegen_cranelift[db9f0bf133b168d8]::driver::aot::run_aot
  16:        0x106828a58 - <rustc_codegen_cranelift[db9f0bf133b168d8]::CraneliftCodegenBackend as rustc_codegen_ssa[1cac79964c70214d]::traits::backend::CodegenBackend>::codegen_crate
  17:        0x111327580 - <rustc_interface[aaf83fe338feb43f]::queries::Linker>::codegen_and_build_linker
  18:        0x110a60568 - rustc_interface[aaf83fe338feb43f]::passes::create_and_enter_global_ctxt::<core[ebe7a8d70bd6893b]::option::Option<rustc_interface[aaf83fe338feb43f]::queries::Linker>, rustc_driver_impl[b8773bc631419c9c]::run_compiler::{closure#0}::{closure#2}>
  19:        0x110aac190 - rustc_interface[aaf83fe338feb43f]::interface::run_compiler::<(), rustc_driver_impl[b8773bc631419c9c]::run_compiler::{closure#0}>::{closure#1}
  20:        0x110a9e2d8 - std[db59b894259804f0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[aaf83fe338feb43f]::util::run_in_thread_with_globals<rustc_interface[aaf83fe338feb43f]::util::run_in_thread_pool_with_globals<rustc_interface[aaf83fe338feb43f]::interface::run_compiler<(), rustc_driver_impl[b8773bc631419c9c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  21:        0x110ab2e24 - <<std[db59b894259804f0]::thread::Builder>::spawn_unchecked_<rustc_interface[aaf83fe338feb43f]::util::run_in_thread_with_globals<rustc_interface[aaf83fe338feb43f]::util::run_in_thread_pool_with_globals<rustc_interface[aaf83fe338feb43f]::interface::run_compiler<(), rustc_driver_impl[b8773bc631419c9c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[ebe7a8d70bd6893b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  22:        0x11286104c - std::sys::pal::unix::thread::Thread::new::thread_start::hec3ba9ad0c005bd4
  23:        0x1888502e4 - __pthread_deallocate

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: please make sure that you have updated to the latest nightly

note: please attach the file at `/Users/lore/Development/Advent of Code/2020/rustc-ice-2025-03-04T20_02_05-91133.txt` to your bug report

note: compiler flags: --crate-type bin -C opt-level=3 -C panic=abort -C embed-bitcode=no -Z codegen-backend=cranelift -C codegen-units=1 -C strip=symbols -C target-cpu=native

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

thread '<unnamed>' panicked at compiler/rustc_codegen_cranelift/src/debuginfo/object.rs:89:14:
called `Result::unwrap()` on an `Err` value: Error("unimplemented relocation Relocation { offset: 32, symbol: SymbolId(14), addend: 0, flags: Generic { kind: Relative, encoding: Generic, size: 32 } }")
stack backtrace:
   0:        0x1128539d0 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h3959b7980ed3e272
   1:        0x10fff9f34 - core::fmt::write::haac92234bb96457c
   2:        0x112848104 - std::io::Write::write_fmt::h10a0cd5a63e727ee
   3:        0x112853890 - std::sys::backtrace::BacktraceLock::print::h55be4a34b934b0dd
   4:        0x112855ec0 - std::panicking::default_hook::{{closure}}::h766f3df9e3afc821
   5:        0x112855b88 - std::panicking::default_hook::h7c33a87c20ef2e6c
   6:        0x110aaf3cc - std[db59b894259804f0]::panicking::update_hook::<alloc[bcada68f88f3824a]::boxed::Box<rustc_driver_impl[b8773bc631419c9c]::install_ice_hook::{closure#1}>>::{closure#0}
   7:        0x1128567f0 - std::panicking::rust_panic_with_hook::he752a00b5ed52782
   8:        0x1128564a0 - std::panicking::begin_panic_handler::{{closure}}::hecf0d4de334165ab
   9:        0x112853e6c - std::sys::backtrace::__rust_end_short_backtrace::h6604ea774ca6d31d
  10:        0x112856168 - _rust_begin_unwind
  11:        0x1154b78fc - core::panicking::panic_fmt::hdc0765de8316649c
  12:        0x1154b7d54 - core::result::unwrap_failed::hc36c25cb3fd4c2ca
  13:        0x1067f4654 - <cranelift_object[9ac6d1e9ae562095]::backend::ObjectProduct as rustc_codegen_cranelift[db9f0bf133b168d8]::debuginfo::object::WriteDebugInfo>::add_debug_reloc
  14:        0x10682477c - <rustc_codegen_cranelift[db9f0bf133b168d8]::unwind_module::UnwindModule<cranelift_object[9ac6d1e9ae562095]::backend::ObjectModule>>::finish
  15:        0x1067fcd90 - rustc_codegen_cranelift[db9f0bf133b168d8]::driver::aot::module_codegen::{closure#0}
  16:        0x1067a0bd4 - std[db59b894259804f0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_codegen_cranelift[db9f0bf133b168d8]::driver::aot::module_codegen::{closure#0}, core[ebe7a8d70bd6893b]::result::Result<rustc_codegen_cranelift[db9f0bf133b168d8]::driver::aot::ModuleCodegenResult, alloc[bcada68f88f3824a]::string::String>>
  17:        0x1067a9310 - <<std[db59b894259804f0]::thread::Builder>::spawn_unchecked_<rustc_codegen_cranelift[db9f0bf133b168d8]::driver::aot::module_codegen::{closure#0}, core[ebe7a8d70bd6893b]::result::Result<rustc_codegen_cranelift[db9f0bf133b168d8]::driver::aot::ModuleCodegenResult, alloc[bcada68f88f3824a]::string::String>>::{closure#1} as core[ebe7a8d70bd6893b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  18:        0x11286104c - std::sys::pal::unix::thread::Thread::new::thread_start::hec3ba9ad0c005bd4
  19:        0x1888502e4 - __pthread_deallocate

error: could not compile `day15` (bin "day15")

Caused by:
  process didn't exit successfully: `/Users/lore/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/rustc --crate-name day15 --edition=2024 day15/src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=227 --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=abort -C embed-bitcode=no -Z codegen-backend=cranelift -C codegen-units=1 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=9419ec99a32d1390 -C extra-filename=-2d5b922cfd183f72 --out-dir '/Users/lore/Development/Advent of Code/2020/target/release/deps' -C strip=symbols -L 'dependency=/Users/lore/Development/Advent of Code/2020/target/release/deps' -Ctarget-cpu=native` (exit status: 101)
Backtrace

warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/lore/Development/Advent of Code/2020/day15/Cargo.toml
workspace: /Users/lore/Development/Advent of Code/2020/Cargo.toml
   Compiling day15 v0.1.0 (/Users/lore/Development/Advent of Code/2020/day15)

thread 'rustc' panicked at compiler/rustc_codegen_cranelift/src/debuginfo/object.rs:89:14:
called `Result::unwrap()` on an `Err` value: Error("unimplemented relocation Relocation { offset: 32, symbol: SymbolId(14), addend: 0, flags: Generic { kind: Relative, encoding: Generic, size: 32 } }")
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: <cranelift_object::backend::ObjectProduct as rustc_codegen_cranelift::debuginfo::object::WriteDebugInfo>::add_debug_reloc
   4: <rustc_codegen_cranelift::unwind_module::UnwindModule<cranelift_object::backend::ObjectModule>>::finish
   5: rustc_codegen_cranelift::driver::aot::run_aot
   6: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
   7: <rustc_interface::queries::Linker>::codegen_and_build_linker
   8: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
   9: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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: please make sure that you have updated to the latest nightly

note: please attach the file at `/Users/lore/Development/Advent of Code/2020/rustc-ice-2025-03-04T20_05_39-91243.txt` to your bug report

note: compiler flags: --crate-type bin -C opt-level=3 -C panic=abort -C embed-bitcode=no -Z codegen-backend=cranelift -C codegen-units=1 -C strip=symbols -C target-cpu=native

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

thread '<unnamed>' panicked at compiler/rustc_codegen_cranelift/src/debuginfo/object.rs:89:14:
called `Result::unwrap()` on an `Err` value: Error("unimplemented relocation Relocation { offset: 32, symbol: SymbolId(14), addend: 0, flags: Generic { kind: Relative, encoding: Generic, size: 32 } }")
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: <cranelift_object::backend::ObjectProduct as rustc_codegen_cranelift::debuginfo::object::WriteDebugInfo>::add_debug_reloc
   4: <rustc_codegen_cranelift::unwind_module::UnwindModule<cranelift_object::backend::ObjectModule>>::finish
   5: rustc_codegen_cranelift::driver::aot::module_codegen::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: could not compile `day15` (bin "day15")

Caused by:
  process didn't exit successfully: `/Users/lore/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/rustc --crate-name day15 --edition=2024 day15/src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=227 --crate-type bin --emit=dep-info,link -C opt-level=3 -C panic=abort -C embed-bitcode=no -Z codegen-backend=cranelift -C codegen-units=1 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=9419ec99a32d1390 -C extra-filename=-2d5b922cfd183f72 --out-dir '/Users/lore/Development/Advent of Code/2020/target/release/deps' -C strip=symbols -L 'dependency=/Users/lore/Development/Advent of Code/2020/target/release/deps' -Ctarget-cpu=native` (exit status: 101)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the reported nightly Rust toolchain, minimal program, and Cranelift flags. Start at compiler/rustc_codegen_cranelift/src/debuginfo/object.rs:89 and follow add_debug_reloc through unwind_module::finish, using the reported unimplemented relocation as the focus. Done means the same build no longer panics with Error 101.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.