Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

armv7-sony-vita-newlibeabihf should be named thumbv7a-sony-vita-newlibeabihf #137422

Open
ChrisDenton opened this issue Feb 22, 2025 · 7 comments
Labels
A-targets Area: Concerning the implications of different compiler targets C-discussion Category: Discussion or questions that doesn't represent real issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ChrisDenton
Copy link
Member

Looking through our target names I notice armv7-sony-vita-newlibeabihf is actually a thumb target (it uses the llvm target thumbv7a-vita-eabihf). So I think it should be name thumbv7a-sony-vita-newlibeabihf to match our other thumb targets?

cc target maintainers: @nikarh @pheki @zetanumbers

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 22, 2025
@lolbinarycat lolbinarycat added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-targets Area: Concerning the implications of different compiler targets labels Feb 24, 2025
@jieyouxu jieyouxu added C-discussion Category: Discussion or questions that doesn't represent real issues. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 26, 2025
@zetanumbers
Copy link
Contributor

zetanumbers commented Feb 28, 2025

I mean you are kinda right. Ideally you could make thumbv7a-sony-vita-newlibeabihf and armv7a-sony-vita-newlibeabihf with thumb instructions disabled. Buuut why would we even need a vita target without thumb instructions anyway?

@zetanumbers
Copy link
Contributor

While renaming a target would break the old code, which I think is not justified just to make target name consistent.

@ChrisDenton
Copy link
Member Author

I'm not so interested in consistency just for consistencies sake. However, while targets triples are very far from well specified, we can (at least for Rust targets) rely on the the arch being right. So anything using the target triple to infer target properties has to know to make an exception for this one target.

@pheki
Copy link
Contributor

pheki commented Feb 28, 2025

I personally think it would be good to get this fixed, the earlier the better. The reason the target name doesn't match the arch is because the arch was originally set as armv7a.

I do agree with @zetanumbers' though, and would like to avoid breakage, especially around tooling (not too worried about code target_os is generally used for conditional compilation). I wonder if we could do something like what was done for wasm32-wasi:

  • duplicate the target into thumbv7a-sony-vita-newlibeabihf and deprecate the old target
  • fix tooling, docs, ci that use the old target name
    • for cargo vita, can we detect the nightly version and use the appropriate target?
  • remove the old target after a few months

@VelocityRa
Copy link

VelocityRa commented Mar 30, 2025

(it uses the llvm target thumbv7a-vita-eabihf)

There's no upstream LLVM target called thumbv7a-vita-eabihf so I'm wondering what this is referring to?

Sorry if out of topic, trying to find information on what ABI commercial PS Vita games abide by (how it differs from standard ARMv7 EABI) and run across this.

@pheki
Copy link
Contributor

pheki commented Mar 31, 2025

There's no upstream LLVM target called thumbv7a-vita-eabihf so I'm wondering what this is referring to?

We're in the process to change it, probably to thumbv7a-sony-vita-eabihf at #138426

You can read more about how target triples work in Clang/LLVM here: https://clang.llvm.org/docs/CrossCompilation.html#target-triple

So thumbv7a-sony-vita-eabihf would be:

  • arch: thumb
  • sub: v7a
  • vendor: sony
  • sys: vita
  • env: eabihf

sony and vita do not currently exist in upstream, so it gets parsed as unknown.

Sorry if out of topic, trying to find information on what ABI commercial PS Vita games abide by (how it differs from standard ARMv7 EABI) and run across this.

AFAIK there are some differences in definitions for C types, like:

  • char default to signed by default, while in Arm char defaults to unsigned
  • wide chars (wchar_t) are 16-bit

Not sure if there are other differences, you can find the target config we use for Rust here: https://github.com/rust-lang/rust/blob/2ea33b591050c4ca1a3752830b29112638faecf6/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs

@VelocityRa
Copy link

VelocityRa commented Mar 31, 2025

@pheki Thanks, I got some help for this from @CreepNT in the HENKaku Discord.

Besides what you said:

hard-float AAPCS (or rather, ATPCS)
r9 as callee-saved GPR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-targets Area: Concerning the implications of different compiler targets C-discussion Category: Discussion or questions that doesn't represent real issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants