Earlier quoted context omitted.
There are up to 7 components in a triple, but not all are used at once, the general format is: - - - But there's also , see below. Note that there are both canonical and non-canonical triples in use. Canonical triples are output by `config.guess` or `config.sub`; non-canonical triples are input to `config.sub` and used as prefixes for commands. The field (1st) is what you're running on, and on some systems it include…
Nah I dunno where you're getting your information from but LLVM only supports 5 components. See the code starting at line 1144 here: https://llvm.org/doxygen/Triple_8cpp_source.html The components are arch-vendor-os-environment-objectformat. It's absolutely full of special cases and hacks. Really at this point I think the only sane option is an explicit list of fixed strings. I think Rust does that.
The underlying problem with target triples is that architecture-vendor-system isn't sufficient to uniquely describe the relevant details for specifying a toolchain, so the necessary extra information has been somewhat haphazardly added to the format. On top of that, since the relevance of some of the information is questionable for some tasks (especially the vendor field), different projects have chosen not to care about subtle differences, so the normalization of a triple is different between different projects.
LLVM's definition is not more or less correct than gcc's here, nor are these the only definitions floating around.