clang toolset on mingw passes -mthreads instead of -pthread
Can someone who is familiar with Boost.Build please look at the Clang toolset and figure out how can it be persuaded to use the correct -pthread option instead of -mthreads under Windows/MinGW?
On 6/11/2014 3:16 PM, Peter Dimov wrote:
Can someone who is familiar with Boost.Build please look at the Clang toolset and figure out how can it be persuaded to use the correct -pthread option instead of -mthreads under Windows/MinGW?
I am away from my home computer right now but I will push a local branch of Boost Build for clang under Windows/mingw when I get back ( another week ). I am not a Boost Build expert so whatever little I have done is just a hack based on others. I tried to get the Boost Build people interested in toolsets for clang on Windows in the past, but without success. Maybe you will be more successful. I wanted both a toolset for clang Windows/VC++ and clang Windows/mingw. The basic hack of clang Windows/mingw is to take 'rule setup-threading' from gcc.jam, add it to clang-linux.jam, change 'case windows : option = -mthreads ;' to 'case windows : option = -pthread ;', and then change every invocation in clang=linux.jam of 'gcc.setup-threading' to just 'setup=threading'.
On 06/13/2014 05:06 AM, Edward Diener wrote:
On 6/11/2014 3:16 PM, Peter Dimov wrote:
Can someone who is familiar with Boost.Build please look at the Clang toolset and figure out how can it be persuaded to use the correct -pthread option instead of -mthreads under Windows/MinGW?
I am away from my home computer right now but I will push a local branch of Boost Build for clang under Windows/mingw when I get back ( another week ).
I am not a Boost Build expert so whatever little I have done is just a hack based on others.
I tried to get the Boost Build people interested in toolsets for clang on Windows in the past, but without success. Maybe you will be more successful. I wanted both a toolset for clang Windows/VC++ and clang Windows/mingw.
The basic hack of clang Windows/mingw is to take 'rule setup-threading' from gcc.jam, add it to clang-linux.jam, change 'case windows : option = -mthreads ;' to 'case windows : option = -pthread ;', and then change every invocation in clang=linux.jam of 'gcc.setup-threading' to just 'setup=threading'.
I might be mistaken, but my recollection is that last time around, clang/windows support was a local change somebody worked on. There's no clang support for Windows in develop, and I'm not aware of any pull requests to add it. Further, I recall in our last discussion you indicated clang support for threading on windows is defective in some way and not worth pursuing further. If either of that's inaccurate, please post a link to a pull request, and I'll take a look. - Volodya
Vladimir Prus wrote:
I might be mistaken, but my recollection is that last time around, clang/windows support was a local change somebody worked on. There's no clang support for Windows in develop, and I'm not aware of any pull requests to add it. Further, I recall in our last discussion you indicated clang support for threading on windows is defective in some way and not worth pursuing further.
There are two things that can be described as "clang on Windows". One is clang-cl.exe, the clang that tries to emulate MSVC. It's not usable. Other is the plain clang++.exe, compiled to use MinGW. The second one uses the "clang.linux" toolset and works more or less fine except for the issue in the subject line.
participants (3)
-
Edward Diener
-
Peter Dimov
-
Vladimir Prus