Skip to content
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

Unsupported crate type results in ICE #50993

Closed
hellow554 opened this issue May 23, 2018 · 7 comments · Fixed by #51035
Closed

Unsupported crate type results in ICE #50993

hellow554 opened this issue May 23, 2018 · 7 comments · Fixed by #51035
Assignees
Labels
A-codegen Area: Code generation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@hellow554
Copy link
Contributor

hellow554 commented May 23, 2018

rustc --version; cat lib.rs; env RUST_BACKTRACE=1 rustc --emit asm lib.rs --crate-type dylib -O --target thumbv7em-none-eabihf
rustc 1.28.0-nightly (cb20f68d0 2018-05-21)
#![no_std]
pub fn pete() -> u32 {
        2
}
warning: dropping unsupported crate type `dylib` for target `thumbv7em-none-eabihf`

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:467
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:350
   7: rust_begin_unwind
             at libstd/panicking.rs:328
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::panicking::panic
             at libcore/panicking.rs:51
  10: rustc_codegen_llvm::base::write_metadata
  11: rustc::util::common::time
  12: rustc_codegen_llvm::base::codegen_crate
  13: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  14: rustc::util::common::time
  15: rustc_driver::driver::phase_4_codegen
  16: rustc_driver::driver::compile_input::{{closure}}
  17: rustc::ty::context::tls::enter_context
  18: <std::thread::local::LocalKey<T>>::with
  19: rustc::ty::context::TyCtxt::create_and_enter
  20: rustc_driver::driver::compile_input
  21: rustc_driver::run_compiler_with_pool
  22: syntax::with_globals
  23: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  24: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  25: rustc_driver::run
  26: rustc_driver::main
  27: std::rt::lang_start::{{closure}}
  28: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  29: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  30: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:374
             at libstd/rt.rs:58
  31: main
  32: __libc_start_main
  33: <unknown>
query stack during panic:
end of query stack

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.28.0-nightly (cb20f68d0 2018-05-21) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type dylib
@hellow554
Copy link
Contributor Author

This does not happen on either stable or beta, only nightly.

@cuviper cuviper added A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 23, 2018
@nikomatsakis
Copy link
Contributor

@hellow554 if it's easy for you, any chance you could bisect with this tool?

https://github.com/rust-lang-nursery/cargo-bisect-rustc

That would help us pinpoint precisely what introduced the fault. But this is presumably a simple fix...

@hellow554
Copy link
Contributor Author

Sorry, i was a little bit too sloppy.
On stable it does not crash, but just because stable does not know the target thumv7em-none-eabi.
Beta does indeed crash as well on the same error.
I think #51035 will fix the problem, let's see. Hadn't time to do a bisect yet

@oli-obk
Copy link
Contributor

oli-obk commented May 25, 2018

Oh... this might be a new bug entiretly then. Most likely a bisection would point to the PR that added said targets

bors added a commit that referenced this issue May 26, 2018
Don't ICE if crate has no valid crate types left

fixes #50993
@hellow554
Copy link
Contributor Author

I can confirm, that your patch fixes the ICE :) thanks @oli-obk .

The question is, what is it supposed to do now. I creates a .s file, but it remains mostly empty (so no assembly is generated for that function). Is that what it is supposed to do?

@oli-obk
Copy link
Contributor

oli-obk commented May 29, 2018

I have no idea. Is that problematic?

@hellow554
Copy link
Contributor Author

Not at all, I'm just curious to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants