Anyone using LLVM/Clang on Windows? If so did you have to do anything special to get it to work? I have not really looked into it much myself as the last time I did Windows was basically a no go. Any advice would be great thanks!
I've toyed with it a bit. The three biggest problems are probably the inability to link with libs that were compiled with MSVC (they are working on being able to make and consume libs that are MSVC compatible, but it isn't there yet), problems parsing Windows based source code (i.e. things knowingly or unknowingly relying on MSVC only extensions), and problems with some of the MS STL headers, particularly in 2012 type_traits and some non-conformant macro expansion behavior in MSVC that Clang hasn't emulated (so parsing headers using macros that rely on said expansion behavior fails). I have a patch proposed for the type_traits issues and am waiting for some feedback from Chandler on the patch. It has already been reviewed/signed off on by two others, so hopefully acceptance is close. I believe there are patches for the macro issue the floating around, but they haven't been committed since when one was it broke building gtest :(
We use LLVM on Windows in Rust. It works OK in general, but the biggest issue is that C++ zero-cost exceptions don't work. We'll have to implement our own workarounds for this at some point.
It would be a tremendous gain for the project if someone zipped up an all-in-one, ready to use package for Windows consisting of Clang and working standard libraries for C and C++. It doesnt (yet) need to be the new libc++ STL, a copy of the GCC libstdc++ libs would be enough.
I gave it a very quick look however got missing DLL messages (pthreadGC2) when trying to compile. I don't have the time to look into it today, hopefully over the Christmas break I will be able to get it working. If I do I will look at how sensible it is to maintain a similar Windows build. A standard Windows build available as an archive or an installer would be great.
EDIT: The error messages look like they may be related to Cygwin although I could be totally wrong on that, it is just the readme mentions Cygwin but nothing else :)
The solution is to install a very specific build of MinGW. See http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056..., where the recommended MinGW installation is "mingw-get-inst-20120426.exe". Then you must remove any other C compilers from your path and include this MinGW and llvm. On my Windows 7 x64 system I have three versions of Visual Studio and 2 other installations of MinGW, so I was careful to remove them all from my path. I created a pathclang.bat containing the following
set PATH=C:\Windows\system32;c:\MinGW32\bin;c:\llvm\bin
set CPATH=C:\MinGW32\include
I used Clang 3.1 to compile some small C programs on Windows, and the only problem I ran into was Clang defaulting the search paths based on the compiler used to build Clang itself. So, kind of goofy that Clang usage depends on whether you used MinGW or MSVC to build it (why isn't it compiling itself, anyway?), but easy enough to work around by adding the search paths on the command line.