<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Chandler,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The patch looks good to me, although I’m wondering why Clang
needs to care what it was *<b>built</b>* to run on, as opposed to what it is
actually running on at runtime.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Cheers,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>James<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> llvm-commits-bounces@cs.uiuc.edu
[mailto:llvm-commits-bounces@cs.uiuc.edu] <b>On Behalf Of </b>Chandler Carruth<br>
<b>Sent:</b> 24 January 2012 11:59<br>
<b>To:</b> <llvm-commits@cs.uiuc.edu>; Eric Christopher<br>
<b>Subject:</b> [llvm-commits] PATCH: Add support for tracking and exposing the
host triple<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Attached is a patch to add support for tracking and exposing
the host triple. This is one of the many steps along the way to cleaning up the
Clang driver. In many places within Clang, we need to reason about the *host*,
not the target, in order to decide how to behave. For example, this is at issue
when deciding where within the host machine we should look for the target's
toolchain. While in some cases, there is a canonical location that the target
*always* uses, in other cases both can be relevant. Consider the Debian
multiarch case where we will often want to use
'/usr/lib/<host-triple>/gcc/<target-triple>/<version>/crtbegin.o'.
In other cases, we may need to check whether the host triple might contain a
toolchain capable of targeting our target. This happens frequently when working
in a bi-arch world, where the GCC installed under 'i386-pc-linux-gnu' is
actually capable of targeting 'x86_64-pc-linux-gnu' thanks to the '-m64' flag.<o:p></o:p></p>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal>Some time back an effort was undertaken which simply blanket
renamed 'Host' to 'Target' in many places. This didn't really address the
fundamental problem, and in my mind made things a bit more confusing. Thus in
most places in the driver, we treat the DefaultTargetTriple as the *host*
triple, compute the HostInfo from it, and then *modify* it to produce the
target triple. Ow. Other times, we modify it first, and assume that the
post-modification triple is still a viable host triple.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal>All of this gets simple if we simply have access to both
triples the entire time. We can make rational decisions about when we should
and should not use the host information or the target information. Also, it
will become immediately clear from the code which is in fact in use.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

<div>

<p class=MsoNormal>Again, this is just the first step, but it touches autoconf
and a bunch of other stuff so I wanted someone else to glance at it before I
checked it in. I'll also need someone to regenerate the config.h and the
configure scripts as I don't have easy access to the proper versions. If
someone can send me those patched files i can submit as one patch to keep the
build bots happy.<o:p></o:p></p>

</div>

</div>

</body>

</html>