Skip to content

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

Closed
@MarimeGui

Description

@MarimeGui

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 !

Activity

nunolucas

nunolucas commented on Nov 12, 2020

@nunolucas

I was also having the some issue and tracked it to this: dc004d4#diff-aa810a3be0834da891b171a8b04b09d0d3bbb76ac27c757cd232235099e062d2R1309

That commit broke the equivalence between "target_endian" and "target-endian" by adding a case to the key!() macro without the replace line for it.

added
A-target-specsArea: Compile-target specifications
C-bugCategory: This is a bug.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Nov 12, 2020
jonas-schievink

jonas-schievink commented on Nov 12, 2020

@jonas-schievink
Contributor
petrochenkov

petrochenkov commented on Nov 12, 2020

@petrochenkov
Contributor

I'll fix this today.

petrochenkov

petrochenkov commented on Nov 12, 2020

@petrochenkov
Contributor

Fixed in #78993.

parraman

parraman commented on Nov 12, 2020

@parraman

I hope this gets merged asap :-)

petrochenkov

petrochenkov commented on Nov 13, 2020

@petrochenkov
Contributor

(Reopening because #78993 isn't merged yet.)

added a commit that references this issue on Nov 15, 2020

Rollup merge of rust-lang#78993 - petrochenkov:specdash, r=oli-obk

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

Metadata

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

      Participants

      @jonas-schievink@MarimeGui@petrochenkov@parraman@nunolucas

      Issue actions

        'inconsistent target specification' on custom .json target · Issue #78981 · rust-lang/rust