Boost logo

Boost :

Subject: Re: [boost] clang on mingw
From: Edward Diener (eldiener_at_[hidden])
Date: 2014-03-03 20:40:39

On 3/3/2014 5:05 PM, Peter Dimov wrote:
> I got a response on this ticket; there was an ABI change in the MinGW
> version of g++, which is why the 3.4 version of LLVM/Clang doesn't work
> with mingw-g++ 4.8.1. (I actually knew that - the earlier versions
> crashed on some shared_ptr tests involving virtual base classes, and 4.8
> no longer does - but didn't connect the dots.)
> The suggestion was to switch to Clang 3.5 from SVN, and I tried, but the
> official MinGW g++ from, the one mingw-get installs and that I
> use, didn't work, due to a missing off_t definition. The other MingGW,
> mingw-w64, worked.

Which of the many download options on the MingW-x64 site ( ) did you use.

> Not out of the box though; see the ticket where I've
> listed the two trivial fixes that I needed to make.
> And the resulting clang++.exe does actually compile and pass all
> smart_ptr tests.

What instructions did you follow to build the latest clang with
MingW-x64 ? Was it also "cmake -G "MinGW Makefiles" ..\llvm" mentioned
in your bug report ?

> It also appears to support threads just fine. The only
> problem is that clang-linux.jam passes -mthreads to it, whereas the
> correct option is -pthread.

How did you substitute -mthreads with -pthread for clang-linux.jam ? My
technique is to copy the rule setup-threading from gcc.jam to
clang-linux.jam, change the windows case to have 'option = -pthread' and
invoke 'setup-threading' rather than 'gcc.setup-threading' in the rest
of the clang-linux.jam file. But I am not sure if I have to add a 'libs
= rt ' as is done in the default case.

> So that's good, on one hand - it's possible to use clang on Windows, if
> only for testing purposes - and not so good, on another, since this
> configuration is obviously neither tested nor supported by the Clang
> developers, or they'd have seen and fixed the build errors. :-)

Thanks for the post. I am very interested in getting the latest clang to
work on Window so I can use it to test Boost libraries.

Boost list run by bdawes at, gregod at, cpdaniel at, john at