[cfe-dev] Clang for Windows and Boost

Edward Diener eldlistmailingz at tropicsoft.com
Thu Mar 17 14:45:26 PDT 2011


On 3/17/2011 4:19 PM, Douglas Gregor wrote:
>
> On Mar 17, 2011, at 11:02 AM, Edward Diener wrote:
>
>> On 3/17/2011 1:39 PM, Douglas Gregor wrote:
>>>
>>> On Mar 17, 2011, at 9:37 AM, Larry Evans wrote:
>>>
>>>> On 03/17/11 11:04, Edward Diener wrote:
>>>>> Thanks to the help I received I have been able to build clang for
>>>>> Windows both using MingW and VC++ 10. Are either, or both, of these
>>>>> builds stable, in that they can be used for building Boost and other 3rd
>>>>> party libraries ?
>>>>>
>>>>> If so, I am going to try to get some of the Boost Build experts to
>>>>> supply a toolset for clang under Windows so it can be used to build and
>>>>> test Boost libraries under Windows. Currently the clang toolset support
>>>>> in Boost works only under Linux as I understand it.
>>>> Hi Edward,
>>>>
>>>> I had problems with using move and clang on linux:
>>>>
>>>>   http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013216.html
>>>>
>>>> I also tried a workaround using the libcxx; however, that also had
>>>> problems:
>>>>
>>>>   http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013246.html
>>>>
>>>> Hence, I don't think clang is usable on linux yet.
>>>
>>>
>>> This is horribly misleading. Clang is a perfectly reasonable C++98/03 compiler on Linux.
>>>
>>> The issues you ran into concern C++0x, where the world is much messier. The C++0x situation on Linux is admittedly frustrating because of library issues:
>>> 	- libstdc++<= 4.4 doesn't work with a C++0x compiler that implements the current WP's formulation of rvalue references. Jeffrey Yasskin provided a patch for this.
>>> 	- libc++ hasn't been fully ported to Linux
>>> 	- libstdc++>= 4.5 has an issue with generalized initializer lists; I worked around that problem in Clang, but I don't know if this is the last problem with these libraries or just the first.
>>
>> I am not concerned about Linux.
>>
>> Can clang built with MingW/MSYS ( or less probably VC++10 ) compile
>> Boost under Windows ?
>
> I would expect it to be possible with MinGW/MSYS, but not with VC++10. The basic problem is the C++ library headers: MinGW/MSYS uses libstdc++, which Clang can handle; VC++ has a lot of non-standard C++ in its headers that Clang does not currently handle. [*]

Then lets forget about clang with VC++10 headers. What about clang with 
MingW ? It should be very similar to gcc with MingW, but provide clang 
testing wjhen gcc does not work.

>
>> If so, can we get a toolset in Boost Build to use
>> clang under Windows so Boost libraries can be tested in Windows using
>> clang ?
>
>
> I think that would be great. I don't know if we have that expertise here in the Clang side of the world... there was work on Clang support in Boost.Build for Linux; perhaps that can be ported over to create a Boost.Build description for Clang on MinGW/MSYS.

I hope so. It would be great to use clang, along with gcc and msvc, to 
test Boost libaries on Windows. I was impressed that clang worked, 
whereas gcc and VC++ did not, on that code I posted in the Boost devel 
list and you verified with clang that the code is valid.

I admit I could go to a Linux distro on my multi-boot computer and try 
to build and use clang there but I like Windows much better, and avoid 
Linux development whenever I can. I always run into headaches in Linux, 
but each to their own.




More information about the cfe-dev mailing list