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

How should avr-unknown-gnu-atmega328 be parsed? #63

Open
sunfishcode opened this issue Oct 19, 2020 · 2 comments
Open

How should avr-unknown-gnu-atmega328 be parsed? #63

sunfishcode opened this issue Oct 19, 2020 · 2 comments

Comments

@sunfishcode
Copy link
Member

avr-unknown-gnu-atmega328 is a new target in rustc. "atmega328" isn't recognized by LLVM's Triple or GNU autotools so it's unclear how to categorize it. I posted here asking for clarification.

@sunfishcode
Copy link
Member Author

sunfishcode commented Feb 16, 2021

The initial description said "This target system is gnu, as it uses the AVR-GCC frontend along with avr-binutils. The target triple ABI is 'atmega328'."

Calling gnu a "system" and putting it in the operating-system position might suggest that gnu is the operating system, however in the language of triples, gnu is already the name of an environment, and the triple format doesn't work well with names that have different meanings in different positions—some triple parsers don't support it at all. Consequently, I think it makes sense to say that gnu is the environment here, with the operating system being unknown.

That leaves the atmega328 field. The guidance is that atmega328 is not a binary format. But we don't currently have anything else in the syntax that can go after an environment.

So my current thinking is that we need to interpret atmega328 as a new syntactic concept in triples, maybe called "environment modifiers", making the full format for "triple" look like this: arch-vendor-os-env-envmodifier-binfmt. In terms of the target-lexicon API, gnu-atmega328 would be represented as a new Environment field, GnuAtmega328.

@madsmtm
Copy link
Contributor

madsmtm commented Nov 11, 2024

The target might be renamed, see rust-lang/rust#131651 (MCP rust-lang/compiler-team#800)

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

No branches or pull requests

2 participants