[clang] [llvm] [Triple] Make an target triple "os" for firmware (PR #176272)
Ian Anderson via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 15 23:47:46 PST 2026
ian-twilightcoder wrote:
> > > > It is a little unusual in that it's not a specific os and kind of needs a specific vendor for it to have any meaning. Even apple-firmware isn't a specific os, It's more of a collection of os-like related platforms that we need some kind of common way to refer to in the compiler.
> > >
> > >
> > > Interesting. I think that this should be codified into the triple parsing and we should have tests to reject the invalid triples. Basically, it sounds like: `aarch64-unknown-none-firmware-coff` would not be a valid triple? (ARM64, no vendor extensions, no OS, PE/COFF object file for a firmware environment.
> >
> >
> > We wanted to use `firmware` as OS to represent the overall platform, and then use the environment to codify specific flavors. I think it should be easy enough to make the triple parser ignore a "firmware" os if the vendor isn't "apple" (or isn't "unknown"?).
>
> I think that it will need to be limited to the `apple` vendor. The `unknown` vendor is the generic vendor that is for everyone, so you will have to pass that through the GNU folks.
Alright, it's now limited to the `apple` vendor.
> Oh wait, this is limited to the Darwin platform? In that case, can we have some negative tests to ensure that something like aarch64-unknown-linux-firmware or aarch64-unknown-firmware is not processed as a valid triple?
https://github.com/llvm/llvm-project/pull/176272/files#diff-cfce857ccab5e6525bb5686e630631dc779f34257813e0efd03d3bd95b8aee96
https://github.com/llvm/llvm-project/pull/176272
More information about the cfe-commits
mailing list