<div class="gmail_quote">On Mon, Jun 11, 2012 at 1:52 PM, Mikael Lyngvig <span dir="ltr"><<a href="mailto:mikael@lyngvig.org" target="_blank">mikael@lyngvig.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,</blockquote><div><br></div><div>Again, this is more of a topic for cfe-dev (copied). LLVM itself works very well on Windows; it's Clang that has issues.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br></div><div>[Synopsis: Mikael thinks Windows support is overlooked and that this is a strategic error. You can skip to the next mail now, if you'd like :-) Long, long, long mail follows.]<br></div></blockquote>
<div><br></div><div>Generally, I too would like to see much greater Windows support in Clang. However, most developers here are centered around Mac/Linux. It will take contributions from Windows people to improve this support (and also watch out for legal quagmires). It's not so much that LLVM/Clang developers actively choose not to support Windows, it's more that there are just not enough resources to improve the support.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br></div>
<div>Before I go on, I'd like to informally apologize for my many postings to this mailing list. I have no intentions of spamming it, but I still feel a need to grasp certain things that seem to be implied by the documentation or perhaps not described at all. Also, as a self-appointed LLVM/Clang Windows Evangelist, I'd like to keep Windows in your mental horizon so that we one day have full support for at the very least both 32-bit and 64-bit variants of Clang using the respective version of MinGW.</div>
<div><br></div><div>Very briefly put, I came from a background of Windows tools: OpenWatcom C++ (used to be the best optimizer on Windows), Microsoft Visual C++, and back in the ancient days of early DOS and NT, JPI, Borland, and Metaware C++. I had next to no experience with the MinGW toolchain and had only very little experience with actual use of GCC. So everything was pretty overwhelming at first. I started using C++ in 1990 so I am not exactly a newbie. I have been off the C++ path for a decade, though, because better languages have popped up (Python, then C#). I knew nothing about CMake and was, like most Windows users are going to be, a stranger to the whole ordeal of Unix-on-Windows (incl. Cygwin and MinGW).</div>
</div></blockquote><div><br></div><div>I don't know if I'd call MinGW "unix-on-windows." It's just a port of GCC with Windows headers/libraries. You don't need to use bash or any other unix programs.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div><br></div><div>I have so far tried pretty much every path in the maze that LLVM's support of Windows is: I*ve tried building with MSVC, I've tried building with Mingw64, I've tried building with a 64-bit edition of Clang, and now I am down to the last desirable choice: 32-bit MinGW. My 32-bit Clang++ is building as we speak. I tried with a 64-bit build of Clang, built using MinGW64, but it fails on some linker errors (the report about that erronously sent to this mailing list earlier today), so I hope, pray, and expect that at the very least, the 32-bit Clang++ built from MinGW32 will work as expected (that is, it is possible to compile and link and execute a non-trivial program using Clang32).</div>
</div></blockquote><div><br></div><div>MSVC ABI support in Clang is very incomplete as this point. MinGW32 support works fairly well, at least in my experience. MinGW64 is a bit of a problem at the moment because of GCC versions. Clang is hard-coded to search for headers in GCC version-specific locations. For the dgn version of MinGW64, GCC 4.7.1 is used (in the latest release), but Clang only looks up for up to 4.7.0 at the moment. That's why you're running into issues. If I manually setup paths, I can build C++ programs using Clang using the MinGW64 headers/libraries:</div>
<div><br></div><div>$ clang++ foo.cpp -o foo.exe -I "c:\mingw64\include\c++\4.7.1" -I "c:\mingw64\include\c++\4.7.1\x86_64-w64-mingw32" -I c:\mingw64\mingw\include</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div><br></div><div>But the past two weeks have been spent on setting up a Windows 7 x64 MinGW64 buildbot slave and then working a bit on my own project (I'm translating 25 KLOC of C# to C++ so as to be able to use LLVM as my backend) and then playing around with Clang.</div>
<div><br></div><div>My view is that the aspiring Clang++ Windows user is in for a nightmare reverse walk through a night time minefield with both eyes shut.</div></div></blockquote><div><br></div><div>Unfortunately, yes.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div><br></div><div>So, I am wondering if there is anything that can be done to help this situation? I'd love great ideas from you guys, even though I am getting rather used to getting no responses to my mails ;-) I am willing to invest considerable amount of time into helping with this, I just cannot do serious C++ coding at this point because I am yet too rusty in C++ and because I am busy, busy, busy with my own project (a compiler that uses LLVM as its backend).</div>
<div><br></div><div>I propose these things:</div><div><br></div><div>1. Priority is put into making MinGW64 work, if the problem I reported earlier today is related to LLVM/Clang (link time errors related to some section). This is not that important, though.</div>
<div>2. If nobody (including licenses) object to it, I'd like to make two unofficial Windows distributions of Clang: clang-3.2-win32 and clang-3.2-win64. Both would make use of the MinGW toolchains and both would be shipped as ready-made 7-zip archives that could be extracted anywhere and used directly from there without further installations. I am thinking of including the MinGW header files (once the warnings reported when they are included are gone) so as to produce a complete retail product that can be used without any technical knowledge of the LLVM and Clang components. I think this would bring lots and lots of attention to LLVM and Clang, and then hopefully pay off in skilled developers joining the cause. I am also thinking of setting up an automated build system so that they can be built once a day and automatically be published on my own website.</div>
</div></blockquote><div><br></div><div>As long as you do not violate any licenses, this should be fine. I would love to see such a distribution!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>3. I will eagerly hunt down every opportunity to document Windows specifics a bit more. I have received no feedback, whatsoever, on my Windows build document so I take it that it is not to the dev group's liking. So be it. Life goes on. But how about a Windows section in the FAQ? The word Windows isn't even mentioned?! Most of the stuff I've ran into ought to be easy to describe over the course of a couple of hours and then newcomers would save days and weeks of frustrations, dead ends, and mines exploding around them.</div>
</div></blockquote><div><br></div><div>To be honest, I just haven't looked at it in detail yet. I plan to, but most developers here are very busy and it takes time to get reviews. Please bump the topic after a couple days of no replies.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div>4. Please give me your ideas for how I can contribute to the Windows support without actually hacking on LLVM and Clang (yet)!</div></div></blockquote><div><br></div><div>File bugs for what doesn't work.</div><div>
<br></div><div>5. Full support for libc++ on Win32/Win64.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div><br></div><div>I know that you guys are awesomely skilled and are really great at what you are doing. No doubt about that. But I think you lack marketing/strategic thinking. Think of it a bit like I do:</div><div>
<br></div><div>1. 97.7 percent of the world's computer users are Windows users.</div><div>2. 2 percent of the world's computer users are Linux users.</div><div>3. 0.3 percent of the world's computer users use other Unices.</div>
</div></blockquote><div><br></div><div>And the vast majority of those Windows users will use MSVC instead of Clang. Most will get by just fine with the Microsoft compiler, and they have no reason to really choose Clang, unless they want it for better ISO C++ compliance, or cross-compiling.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div><br></div><div>The numbers are grasped out of thin air so as to illustrate my point: Windows ought to be a very high priority because it will eventually pay off handsomely by increasing the size of the developer group by a factor of ten, if only you play the cards right and offer neat, easy-to-use, convenient Windows support. Besides, it is my impression that the non-Windows support is in general pretty mature. Clang could very well step in as THE alternative to Microsoft Visual C++. OpenWatcom is slowly dying (very poor ISO C++ support) and Intel's C++ compiler is only used by specialists, as far as I can tell.<br>
</div></div></blockquote><div><br></div><div>Clang could definitely fill a niche market here, but it needs the support of talented Windows developers.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
</div><div><br></div><div>I suspect that some of you might hold the view that Windows users are noobs (something I've worked hard to confirm ;-) and that the really great guys are all doing Unix. Not so. Statistically speaking, the vast majority of coders out there are on Windows, so statistically speaking, the vast majority of the truly brilliant dev people are on Windows. So it makes a lot of sense trying to attract them! Not that I am implying that I myself are anywhere near brilliant. I'm just saying that overlooking Windows might be the greatest strategical debt you have incurred yet.</div>
</div></blockquote><div><br></div><div>I doubt that's the general feeling...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<div><br></div><div>P.S. Please think of the above as a wake-up call and my dedication to the great future that LLVM/Clang should have.</div><div><br></div><div><br></div><div>Cheers,</div><div>Mikael</div><div>-- Love Thy Frog (yes, frogs are worth loving, even though most people don't seem to grok that).<br>
</div></div><div><br></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><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>