[PATCH] D54378: Add Hurd triplet

Kristina Brooks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 10 06:53:54 PST 2018


kristina added a comment.

In https://reviews.llvm.org/D54378#1294216, @rengolin wrote:

> 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


Yes but my concern comes from possible confusion with Glibc based Linux targets which are one of the "main" targets supported by LLVM. Either adding `hurd` or `mach` somewhere would be sufficient to disambiguate it from others, and yes I'm aware that they have a somewhat free format but they convey some sort of information, ie. with Linux targets `gnu` implies GNU/Glibc-based userland, so going by that convention one could easily assume that said triple simply implies GNU/Glibc/ELF userland. I think simply using `gnu` is too ambiguous, especially considering this is being added as an experimental target.


https://reviews.llvm.org/D54378





More information about the llvm-commits mailing list