Skip to content

Simplify Rust to Clang target conversion #2808

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

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

jorolf
Copy link
Contributor

@jorolf jorolf commented Apr 17, 2024

This change simplifies/generalizes the rust to clang target conversion and allows more targets to work. (e.g. riscv32i-unknown-none-elf)

Let me know if I'm missing something!

@pvdrz
Copy link
Contributor

pvdrz commented Apr 18, 2024

I like the spirit of this PR as the current code has been pretty much a "oh damn, this other target doesn't work, let me get some tape" kind of situation,

It also makes me think that we should have some dedicated type for the target triples. So instead of doing target.starts_with("architecture") we were able to do things like target.architecture == "architecture" or something.

Maybe using https://docs.rs/target-lexicon would be a good idea. It is an extra dependency, but it doesn't have other dependencies and it is well maintained IMHO.

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good improvement in any case. Maybe let's file a follow-up to moving to target-lexicon?

@emilio emilio added this pull request to the merge queue Apr 23, 2024
Merged via the queue into rust-lang:main with commit aa780db Apr 23, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants