[PATCH] D110900: Triple: Add RedHat vendor

Harald van Dijk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 16:27:02 PDT 2021


hvdijk added a comment.

In D110900#3043521 <https://reviews.llvm.org/D110900#3043521>, @tstellar wrote:

> It picks the first triple from the list that is installed on your system.  So if you also have an x86_64-linux-gnu gcc installation on your system, it will pick that one over x86_64-redhat-linux.

Ah, okay, but that is how LLVM behaves today as well, is it not? LLVM can either be configured for x86_64-redhat-linux, in which case it will not be seen as a GNU environment, or it can be configured for x86_64-redhat-linux-gnu, in which case the x86_64-redhat-linux installation will be found but will not be preferred. Whichever way is used by Red Hat today, as long as that remains the same it should not get in the way of D109837 <https://reviews.llvm.org/D109837>, and that can then be improved further here in whatever way works best. I interpreted your comments on that other diff as making this is a prerequisite for it, but that should not be necessary, I think?

So you would like to have a triple that causes the `x86_64-redhat-linux` GCC installation to be preferred over all others, but that still ensures LLVM sees it as a GNU triple. There are basically two alternatives then, the first is making sure that `x86_64-redhat-linux` is seen as a GNU triple, which is what you are going for here. A possibly radical alternative suggestion: could we instead change the way the GCC installation to use is determined? This might seem like overkill if the Red Hat special case would be the only benefit, but I think it might actually be a welcome improvement for other systems as well to reduce unnecessary stat-ing when the GCC target name and LLVM target name do not use the same spelling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110900/new/

https://reviews.llvm.org/D110900



More information about the llvm-commits mailing list