<div dir="rtl"><div dir="ltr">Indeed, mingw and pthreads have C++11 atomics, so building clang (with atomics) should be possible even in cross compilation. I have no idea what is the win from *not* using winpthreads, it is one small DLL file with BSD license.</div><div dir="ltr"><br></div><div dir="ltr">For context (does not matter to mingw as host for buiilding clang but matters for clang running with mingw environment), clang TLS implementation is not same as mingw so atomics do not work for clang+mingw pthreads unless you replace libstdc++ with libcxx compiled by clang. Even there may be troubles with mingw-compiled libraries.</div><div dir="ltr"><div dir="ltr"><br></div></div><div dir="ltr">libc++ could be built with mingw-w64. I had worked for a while with mingw-w64 distribution with the C++ includes and libstdc++ replaced by the libcxx files and dll respectively. It mostly works but there were many issues in tests. I'm not sure what is the value of this configuration unless it is start of road to independent clang-based 'gnu flavor' windows toolchain.</div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2014-09-24 9:06 GMT+03:00 Mueller-Roemer, Johannes Sebastian <span dir="ltr"><<a href="mailto:Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de" target="_blank">Johannes.Sebastian.Mueller-Roemer@igd.fraunhofer.de</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I would love to see libc++ working on Windows. In any case, I personally use MinGW with pthreads, as that supports std::thread etc. Yes, it uses
libwinpthread, but that shouldn’t really be an issue.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Johannes S. Mueller-Roemer, MSc<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Wiss. Mitarbeiter - Interactive Engineering Technologies (IET)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Fraunhofer-Institut für Graphische Datenverarbeitung IGD<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Fraunhoferstr. 5 | 64283 Darmstadt | Germany<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Tel +49 6151 155-606 | Fax +49 6151 155-139<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="mailto:johannes.mueller-roemer@igd.fraunhofer.de" target="_blank">johannes.mueller-roemer@igd.fraunhofer.de</a> | <a href="http://www.igd.fraunhofer.de" target="_blank">www.igd.fraunhofer.de</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<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""> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>Chandler Carruth<br>
<b>Sent:</b> Wednesday, September 24, 2014 03:02<br>
<b>To:</b> LLVM Developers Mailing List; clang-dev Developers; <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a>; Chris Bieneman; Reid Kleckner; David Majnemer; Alex Rosenberg; Zachary Turner<br>
<b>Subject:</b> [LLVMdev] RFC: LLVM should require a working C++11 <thread>, <mutex>, and <atomic><u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">AKA: MinGW + win32threads is holding LLVM (and all of its subprojects) back. We need to stop supporting this host platform.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm aware of essentially 2 reasonably important use cases for supporting MinGW + win32threads:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">1) Sane host toolchain on Windows that doesn't require downloading MSVC. (I'm dubious about the value of this one...)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">2) Cross-compiling a Windows clang.exe (and other tools) from a Linux (or other host) box.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Are there others? (And thanks to Reid for explaining these to me!)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm somewhat dubious about #1, but if we address #2 it will address any concerns with #1 anyways.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I would like to propose that we finish implementing libc++ sufficiently to host Clang on Windows using native Windows APIs to implement things. Then we document very clearly what is required to download the basic Windows SDK and cross compile
Clang (and any other tools) for Windows using just libc++ and the SDK. No need for MSVC bits, etc. Would this be acceptable?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If not, would it be acceptable to use libc++ on top of mingw (so just avoiding libstdc++)? I *really* don't want to spend lots of time going there because it seems like a low-value platform, but we can.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Anyways, I want to tease out anything else required here because if this is all we need, I think we can make it a reality and get to a much saner platform.<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>