[PATCH] D54378: Add Hurd triplet

Kristina Brooks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 10 17:48:35 PST 2018


kristina added a comment.

In https://reviews.llvm.org/D54378#1294499, @sthibaul wrote:

> I'm not sure to understand: do you mean to drop this patch entirely, so that llvm considers i386-pc-gnu as just a GNU-ish platform, and then Driver::getToolChain should special-case the Triple::UnknownOS and parse Triple::getTriple itself to call the Hurd code instead of the default toolchains::Generic_GCC case?


No, this patch is fine, aside from the part that involves the build system. `i386-pc-hurd-gnu` is fine as is, however, it seems that you want to be able to use `i386-pc-gnu` from Clang, if I understand correctly.

Take a look at: https://github.com/llvm-project/llvm-project-20170507/blob/master/clang/lib/Driver/

There's a lot of workarounds for a lot of various and bizzare cases, and while it is cluttered, you can resort to something similiar to what LLVM tools do and check `Argv0` and have `clang-hurd` or something along the lines, you can later pick that up and if your triple was specified, rewrite the `-triple` argument to the internal one used by LLVM. Or you can just do what I mentioned without any of that, though it may receive more pushback. In either case to invoke the compiler, the driver will construct a `-triple` argument which doesn't have to be the same as the one given to the driver. You have several opportunities to emit your LLVM triple there. There are some rather creative (read that as hacky) workarounds inside parts of the driver, and while I don't encourage going overboard with hacky approaches, it's possible to make something reasonable, like what I mentioned. You can definitely find a reasonable approach that works for you and does not cause problems.


Repository:
  rL LLVM

https://reviews.llvm.org/D54378





More information about the llvm-commits mailing list