[PATCH] D54378: Add Hurd triplet

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 10 06:21:20 PST 2018


rengolin added a comment.

In https://reviews.llvm.org/D54378#1294215, @kristina wrote:

> I'm not sure how GCC does it but this seems pretty out of line in comparison to all other targets, GNU makes sense to indicate that the target uses a GNU (usually with Glibc) userland but there's no indication of the kernel, which would be something like `mk` or `mach`. In which case I think `i386-pc-mach-gnu` or something along the lines would make sense, unless this is absolutely needed for compatibility reasons?


Hi Kristina,

Triples are not always triples, they're actually tuples, and that raises a huge number of issues, for example, in "target-pc-gnu", is that the environment, the OS or both?

Unfortunately, this mess exists for a very long time in toolchains that cannot be rebuilt in OSs that cannot choose a triple that is actually a quadruple.

>From Hurd's own porting guidelines [1], "target-pc-gnu" is the triple they use, so there's not much we can do to change that.

The only problem from this patch is if people forget the OS part, for example, write "target-gnu" instead of "target-linux-gnu". Before, that'd throw an error, now it'll match with Hurd. It's hard to avoid hand typos in triples and have a sane code, but automated systems could end up generating "target--gnu" which is still parsed as Hurd.

Honestly, I don't think there is a way to fix this one other than asking Hurd to change their triple to "target-pc-hurd-gnu", but I don't think that would spawn a conversation that would end well. :)

cheers,
--renato

[1] https://www.gnu.org/software/hurd/hurd/porting/guidelines.html


https://reviews.llvm.org/D54378





More information about the llvm-commits mailing list