[clang] [llvm] [Triple] Make an target triple "os" for firmware (PR #176272)

Ian Anderson via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 16 13:27:37 PST 2026


ian-twilightcoder wrote:

> It looks to me like all of the handling specific to this "firmware" OS type is in Clang. Why not just use a triple like `arm64-apple-none` (arch-vendor-os) or whatever, and have a compiler option that enables the Clang behaviors you want here?
> 
> Using the triple for this seems like the wrong tool for the job to me. And I especially don't like the idea of introducing a new OS type that doesn't actually represent a specific OS. I realize target triples are already very weird and inconsistent, but I think we should avoid opening up a whole new angle of that if we can.

We want to use triple because that's the definition of what a "platform" is in Swift and in Xcode and Apple SDKs as well. There's already a `shadermodel` os which is more of a platform than a proper OS, so there's at least a little bit of precedent for OSType values not being perfectly specific OSes. We didn't want to reuse `none` because that already has semantics that don't match our firmware platform very well, and it would be a disruptive change for `apple-none` bare metal compilation to switch to the Darwin driver toolchain/os target info.

https://github.com/llvm/llvm-project/pull/176272


More information about the cfe-commits mailing list