Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
MarimeGui opened this issue Nov 12, 2020 · 6 comments · Fixed by #78993
Closed

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

MarimeGui opened this issue Nov 12, 2020 · 6 comments · Fixed by #78993
Labels
A-target-specs Area: Compile-target specifications C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@MarimeGui
Copy link

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 !

@nunolucas
Copy link

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.

@jonas-schievink jonas-schievink added A-target-specs Area: Compile-target specifications C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 12, 2020
@jonas-schievink
Copy link
Contributor

cc @petrochenkov

@petrochenkov
Copy link
Contributor

I'll fix this today.

@petrochenkov
Copy link
Contributor

Fixed in #78993.

@parraman
Copy link

I hope this gets merged asap :-)

@petrochenkov
Copy link
Contributor

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

@petrochenkov petrochenkov reopened this Nov 13, 2020
@bors bors closed this as completed in 96fc0f4 Nov 15, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-target-specs Area: Compile-target specifications C-bug Category: This is a bug. 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.

5 participants