<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jul 9, 2014 at 6:11 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 10/07/2014 01:22, Nico Weber wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
On Wed, Jul 9, 2014 at 3:01 PM, Edward Diener <<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.<u></u>com</a> <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@<u></u>tropicsoft.com</a>>> wrote:<br>

<br>
    On 7/9/2014 2:40 PM, Reid Kleckner wrote:<br>
<br>
        On Wed, Jul 9, 2014 at 7:09 AM, Edward Diener<br>
        <<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.<u></u>com</a><br>
        <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@<u></u>tropicsoft.com</a>><br></div>
        <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@<u></u>tropicsoft.com</a><div><div class="h5"><br>
        <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@<u></u>tropicsoft.com</a>>>> wrote:<br>
<br>
            I see where a build of clang on Windows using VC++<br>
        produces both<br>
            clang.exe and clang-cl.exe and that they are both the same<br>
            executables. Nonetheless depending on the -target ( or default<br>
            -target ) passed to the clang driver we have different build<br>
            expectations in Boost Build. In Windows When the target<br>
        mode is VC++<br>
            clang emulates VC++ in various ways and when the target<br>
        mode is<br>
            mingw/gcc clang emulates mingw/gcc. Even with the latter<br>
        on Windows<br>
            there are a few subtle differences from clang on Linux.<br>
        That is why<br>
            Boost Build needs to treat them differently from within<br>
        its .jam files.<br>
<br>
<br>
        What kinds of properties of a compiler do you normally check<br>
        in Boost<br>
        Build?  If you're willing to do a test compile, you can look<br>
        for '#if<br>
        defined(__clang__) && defined(_MSC_VER)' or '#if<br>
        defined(__clang__) &&<br>
        defined(__GNUC__)'.<br>
<br>
<br>
    That is another possibility which I will bring up in Boost Build.<br>
<br>
    Essentially we need to find out as easily as possible whether a<br>
    clang executable on Windows targets vc++ or gcc/mingw,<br>
<br>
<br>
I think going forward, the idea is that "clang" will try to be gcc-compatible (i.e. target minw), while "clang-cl" will try to be cl-compatible and targes vc++.<br>
</div></div></blockquote>
<br>
That's not quite right. The only difference between 'clang' and 'clang-cl' is in the way they parse the command-line and how they invoke tools, but either should be able to target any supported triple, cross-compile to Linux etc.<br>
</blockquote><div><br></div><div>Sure, but the defaults should be different, right?</div><div><br></div><div>(Once this is all figured out, there should probably be a page explaining how to get the msvs behavior with the clang driver, and how to get the gcc behavior with the clang-cl driver.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
'clang-cl' currently falls short of that and is hard-coded to target VC++ but 'clang' is already more or less able to do everything 'clang-cl' does.<br>
<br>
Then there's the question of the *default* target triple. We know for sure what it has to be for the cl driver mode -- no problem there, but there's still uncertainty around what the default triple should be for the standard clang.exe driver mode..<br>

<br>
Basically we need to pick a sane default target triple for 'clang.exe' on Windows and make sure all native Windows builds of clang default to that triple (regardless of whether they were produced by MSVC, MinGW or whatever). The fact we have binaries that differ only in default target triple is a leftover from when MSVC and MinGW produced functionally different clang binaries, which I fixed a couple of weeks ago in r211461:<br>

<br>
<br>
commit 2c57a610f4b339283f5e4f171bf0d5<u></u>b6b95f2b5a<br>
Author: Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>><br>
Date:   Sun Jun 22 04:31:15 2014 +0000<br>
<br>
    Enable WindowsToolChain on all native Windows builds<br>
<br>
    Make binaries built by MSVC, mingw and clang functionally equivalent. The<br>
    checks are trivially performed at runtime to eliminate functional differences<br>
    between supported configurations that used to be hard-coded.<br>
<br>
    git-svn-id: <a href="https://llvm.org/svn/llvm-project/cfe/trunk@211461" target="_blank">https://llvm.org/svn/llvm-<u></u>project/cfe/trunk@211461</a> 91177308-0d34-0410-b5e6-<u></u>96231b3b80d8<br>
<br>
<br>
So yes, we should avoid this awkward situation where we're ending up with 'clang.exe' binaries in the wild that differ *only* by their default target triple. Which default we choose doesn't matter much as long as there's consistency between all native Windows builds of clang.<br>
</blockquote><div><br></div><div>I think it makes sense that the default clang.exe triple is "gcc compatible", and that probably means it should be some mingw triple.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Alp.<br>
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
    while also taking into account the -target option on the command line.<br>
<br>
    BTW I could not find in the latest clang 3.5 documentation any<br>
    mention of the -target option. Likewise, and I am sure you have<br>
    heard it before, an alphabetical list of all clang options in the<br>
    documentation, with explanations for each one, would be greatly<br>
    appreciated.<br>
<br>
<br>
clang --help prints a list of all driver options, with at least some help text.<br>
<br>
<br>
<br>
    ______________________________<u></u>_________________<br>
    cfe-dev mailing list<br></div>
    <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a> <mailto:<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a>><br>
    <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><div class=""><br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</div></blockquote>
<br><div class="HOEnZb"><div class="h5">
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</div></div></blockquote></div><br></div></div>