[llvm-commits] PATCH: Add support for tracking and exposing the host triple

Chandler Carruth chandlerc at gmail.com
Tue Jan 24 09:41:45 PST 2012


On Tue, Jan 24, 2012 at 6:46 AM, James Molloy <james.molloy at arm.com> wrote:

>  Hi Chandler,****
>
> ** **
>
> The patch looks good to me, although I’m wondering why Clang needs to care
> what it was **built** to run on, as opposed to what it is actually
> running on at runtime.****
>
> ** **
>
> For example, I compile on RHE3 for RHE3, then run on RHE5. Clang should
> surely understand that it is hosted on RHE5 and act accordingly. So why is
> this information needed as a build time constant?
>

This was actually my biggest hesitation as well. It turns out that the only
parts of the host triple we could actually use profitably are those which
don't vary this much. We're mostly interested in linux vs. darwin vs.
windows, and the architecture.

However, I've thought more about this overnight, and I wonder if I can
deduce more of what I need from the target itself. Essentially, whenever we
are targeting an architecture which might be provided by a '-m32' or '-m64'
flag to another target's toolchain, we need to try both triples to locate
the toolchain. This is true even if neither is the host, so my original
plan doesn't actually work. =/

I'll just commit the cleanup parts of this w/o extending anything. We may
someday want to at least know the host OS, but that day isn't today.


PS: The case I like to use as a thought exercise for the design here is an
arm-hosted linux box with cross-toolchains for x86 and ppc64, but with the
x86 cross toolchain capable of targeting x86-64 via '-m64', and the ppc64
cross toolchain being capable of targeting ppc32 with '-m32'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120124/6beff6a4/attachment.html>


More information about the llvm-commits mailing list