Change:
I'm new to Rust and I try to compile a project with a (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 and it reports it's a bug, so I'm here. 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! <!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --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 rustc should be in the nightly mode rust code is in the rust/sel4-rust/ in directory will execute in directory <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Thank you for filing an issue! When I click that linked you posted, I get an error. Is it set that other people can view it?
Sorry, I have fixed the typo. Now the link should be right.(next time I will be more careful to check my issue)
The root of the issue is in the target definition file that the repository contains, however there are three other bugs that can be fixed in rustc: should not ICE when invalid external targets are being used; should report the actual target name/file in the error message, not the LLVM target name; target files are allowed to set the property.
The minimal target file to reproduce: with
( is a 404 )

Discussion:
if !custom_llvm_used && target_data_layout != llvm_data_layout { bug!( <del> "data-layout for builtin `{}` target, `{}`,  differs from LLVM default, `{}`", sess.target.llvm_target, target_data_layout, llvm_data_layout </del> <ins> "data-layout for target `{rustc_target}`, `{rustc_layout}`,  differs from LLVM target's `{llvm_target}` default layout, `{llvm_layout}`", rustc_target = sess.opts.target_triple, rustc_layout = target_data_layout, llvm_target = sess.target.llvm_target, llvm_layout = llvm_data_layout </ins> ); } }

key!(supported_sanitizers, SanitizerSet)?; key!(default_adjusted_cabi, Option<Abi>)?; <ins> if base.is_builtin { // This can cause unfortunate ICEs later down the line. return Err(format!("may not set is_builtin for targets not built-in")); } </ins> // Each field should have been read using `Json::remove_key` so any keys remaining are unused. let remaining_keys = obj.as_object().ok_or("Expected JSON object for target")?.keys(); Ok((

"executables": true, "has-elf-tls": true, "has-rpath": true, <del> "is-builtin": true, </del> "linker-is-gnu": true, "llvm-target": "x86_64-unknown-linux-gnu", "max-atomic-width": 64,

RUST_TARGET_PATH=. $(RUSTC) foo.rs --target=my-awesome-platform --crate-type=lib --emit=asm RUST_TARGET_PATH=. $(RUSTC) foo.rs --target=my-x86_64-unknown-linux-gnu-platform --crate-type=lib --emit=asm $(RUSTC) -Z unstable-options --target=my-awesome-platform.json --print target-spec-json > $(TMPDIR)/test-platform.json && $(RUSTC) -Z unstable-options --target=$(TMPDIR)/test-platform.json --print target-spec-json | diff -q $(TMPDIR)/test-platform.json - <ins> $(RUSTC) foo.rs --target=definitely-not-builtin-target 2>&1 | $(CGREP) 'may not set is_builtin' $(RUSTC) foo.rs --target=mismatching-data-layout </ins>

<ins> { "arch": "x86_64", "is-builtin": true, "data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128", "llvm-target": "x86_64-unknown-unknown-gnu", "target-pointer-width": "64" } </ins>

<ins> { "arch": "x86_64", "data-layout": "e-m:e-i64:16:32:64", "llvm-target": "x86_64-unknown-unknown-gnu", "target-pointer-width": "64" } </ins>