Skip to content

'inconsistent target specification' on custom .json target #78981

Closed

Description

Hello everyone, this is my first Issue on the Rust project, let me know if I'm doing anthing wrong !

Problem

I am in the process of building a library/runtime for the Wii fully written in Rust. To acheive this goal, I need to cross-compile my library to a custom target I named powerpc-none-eabi.

The json file contains "target-endian": "big" and "data-layout": "E-m:e-p:32:32-i64:64-n32" along other lines to define the architecture.

Normally, the build completes without an issue.

On the latest nighlty, the compiler fails and return:

PS S:\Code\ppc_ill> cargo build -Z build-std=core,alloc --target .\powerpc-none-eabi.json --release
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target \\?\S:\Code\ppc_ill\powerpc-none-eabi.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
  --- stderr
  error: inconsistent target specification: "data-layout" claims architecture is big-endian, while "target-endian" is `little`

Of course, target-endian is set to big in the file, so this shouldn't happen.

Version it worked on

It most recently worked on:

rustc --version --verbose:

rustc 1.49.0-nightly (1773f60ea 2020-11-08)
binary: rustc
commit-hash: 1773f60ea5d42e86b8fdf78d2fc5221ead222bc1
commit-date: 2020-11-08
host: x86_64-pc-windows-msvc
release: 1.49.0-nightly

Version with regression

It fails on this nightly, currently latest at the time of writing:

rustc --version --verbose:

rustc 1.49.0-nightly (5404efc28 2020-11-11)
binary: rustc
commit-hash: 5404efc28a0cddee103ef6396c48ea71ff9631c8
commit-date: 2020-11-11
host: x86_64-pc-windows-msvc
release: 1.49.0-nightly

I can provide any file or other precision if necessary !

Thanks for reading my report !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-target-specsArea: Compile-target specificationsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions