Skip to content

Invalid target files cause an ICE #86017

Closed
@Lslightly

Description

@Lslightly

I'm new to Rust and I try to compile a project with a build.sh.(I'm also new to that project and that project is not well organized.)

when I use Makefile to make, the process of making executes build.sh and it reports it's a bug, so I'm here.

build.sh

xargo build --target x86_64-sel4

I'm fresh here so if there is some information I don't provide, please tell me and I will try my best to provide it.

Thank you!

Code

here I couldn't provide the example code since I don't really know the minimal set of code to be compiled

the source code of the repo is in sel4-rust

rustc should be in the nightly mode

rust code is in the rust/sel4-rust/

make in sel4 directory will execute build.sh in rust/sel4-rust/ directory

<code>

Meta

rustc --version --verbose:

rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: x86_64-unknown-linux-gnu
release: 1.51.0
LLVM version: 11.0.1

Error output

error: internal compiler error: compiler/rustc_codegen_llvm/src/context.rs:151:13: data-layout for builtin `x86_64-unknown-unknown-gnu` target, `e-m:e-i64:64-f80:128-n8:16:32:64-S128`, differs from LLVM default, `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128`

error: aborting due to previous error

error: could not compile `core`
Backtrace

thread 'rustc' panicked at 'Box<Any>', /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/std/src/panic.rs:59:5
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_codegen_llvm::context::create_module
   8: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
   9: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
  10: rustc_codegen_llvm::base::compile_codegen_unit
  11: rustc_codegen_ssa::base::codegen_crate
  12: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  13: rustc_interface::passes::QueryContext::enter
  14: rustc_interface::queries::Queries::ongoing_codegen
  15: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  16: rustc_span::with_source_map
  17: rustc_interface::interface::create_compiler_and_run
  18: scoped_tls::ScopedKey<T>::set

To learn more, run the command again with --verbose.
error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.jtC88UquoXTV/Cargo.toml" "--target" "x86_64-sel4" "-p" "core"` failed with exit code: Some(101)
   0: error_chain::backtrace::imp::InternalBacktrace::new
   1: <error_chain::State as core::default::Default>::default
   2: <std::process::Command as xargo::extensions::CommandExt>::run
   3: xargo::sysroot::build
   4: xargo::sysroot::update
   5: xargo::main_inner
   6: std::sys_common::backtrace::__rust_begin_short_backtrace
   7: std::rt::lang_start::{{closure}}
   8: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/core/src/ops/function.rs:259:13
      std::panicking::try::do_call
             at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/std/src/panicking.rs:379:40
      std::panicking::try
             at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/std/src/panicking.rs:343:19
      std::panic::catch_unwind
             at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/std/src/panic.rs:431:14
      std::rt::lang_start_internal
             at /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/library/std/src/rt.rs:51:25
   9: main
  10: __libc_start_main
  11: _start

make: *** [Makefile:200: RUST] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions