Skip to content

error: internal compiler error: unexpected failure on resolving external static #13325

Closed
@farcaller

Description

@farcaller
extern {
  static StackBase: *u32;
  fn main();
}

#[link_section=".isr_vector_temp"]
static ISRVectors: &'static [u32] = &'static [
  StackBase as u32,
  main as u32,
];

fails with the following backtrace:

task 'rustc' failed at 'expected item, found foreign item cortex_isr::StackBase::StackBase (id=5)', /private/tmp/rust-7IAC/src/libsyntax/ast_map.rs:256
stack backtrace:
   1:        0x1048ccce4 - rt::backtrace::imp::write::hd10102b8c011e5c0a8b::v0.11.pre
   2:        0x104830716 - rt::unwind::begin_unwind_inner::h2aba2baaa74b26e6EIb::v0.11.pre
   3:        0x10482f8b7 - rt::unwind::begin_unwind_fmt::h09a087409081b5ebOHb::v0.11.pre
   4:        0x10401cbc0 - ast_map::Map::expect_item::h33e65f1cbe4a9690f3v::v0.11.pre
   5:        0x102391110 - middle::check_const::CheckItemRecursionVisitor$LT$$x27a$GT$.Visitor$LT$$LP$$RP$$GT$::visit_expr::ha1037e3d217f65f58Av::v0.11.pre
   6:        0x102391488 - middle::check_const::CheckItemRecursionVisitor$LT$$x27a$GT$.Visitor$LT$$LP$$RP$$GT$::visit_expr::ha1037e3d217f65f58Av::v0.11.pre
   7:        0x102391303 - middle::check_const::CheckItemRecursionVisitor$LT$$x27a$GT$.Visitor$LT$$LP$$RP$$GT$::visit_expr::ha1037e3d217f65f58Av::v0.11.pre
   8:        0x102391294 - middle::check_const::CheckItemRecursionVisitor$LT$$x27a$GT$.Visitor$LT$$LP$$RP$$GT$::visit_expr::ha1037e3d217f65f58Av::v0.11.pre
   9:        0x10238ffc0 - middle::check_const::CheckItemRecursionVisitor$LT$$x27a$GT$.Visitor$LT$$LP$$RP$$GT$::visit_item::hb181d9d02abb2808dAv::v0.11.pre
  10:        0x10238ecbc - middle::check_const::check_item_recursion::h46ce87da219f30a8qzv::v0.11.pre
  11:        0x10238b156 - middle::check_const::check_item::h6a7ac223917469a2kpv::v0.11.pre
  12:        0x10238b841 - middle::check_const::check_item::h6a7ac223917469a2kpv::v0.11.pre
  13:        0x10238e2a1 - middle::check_const::check_crate::h2d887eb065573c56Gov::v0.11.pre
  14:        0x10237103f - util::common::time::h8a9a37f5ab167269hpg::v0.11.pre
  15:        0x1027810e2 - driver::driver::phase_3_run_analysis_passes::ha2daf3ece9edb1f1Ree::v0.11.pre
  16:        0x102787243 - driver::driver::compile_input::hf4855bb3e4401cfdODe::v0.11.pre
  17:        0x1027ab4ce - run_compiler::hc72c45483cbf8cefC5l::v0.11.pre
  18:        0x1027bf0fd - main_args::closure.91691
  19:        0x1027bd912 - monitor::closure.91576
  20:        0x1027b94bb - task::TaskBuilder::try::closure.91351
  21:        0x101f7d78c - task::spawn_opts::closure.7923
  22:        0x1048c8108 - rt::task::Task::run::closure.41788
  23:        0x1048d29fc - rust_try
  24:        0x1048c7f87 - rt::task::Task::run::h83564328e5810a07HB9::v0.11.pre
  25:        0x101f7d60f - task::spawn_opts::closure.7895
  26:        0x1048cb6c6 - rt::thread::thread_start::h66f4963f837dbe56oga::v0.11.pre
  27:     0x7fff8f91f899 - _pthread_body
  28:     0x7fff8f91f72a - _pthread_struct_init

Trying to port the following C code:

__attribute__ ((section(".isr_vector")))
void (* const isr_vector_table[])(void) = {
    &_stack_base,
    main,             // Reset
    ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions