2013/6/24 Ruben Van Boxem <[email protected]>
> Hi,
>
> I've brought this up before, but for some reason the issue hasn't
> magically solved itself over time.
>
> LLVM provides a feature-complete C++ standard library that can be used
> with Clang. I spent a lot of time hacking together some basic Windows
> support, and it remained so for now.
>
> Recently, libc++ was modified to allow linking with libsupc++ for the
> low-level stuff, which means fulll blown Windows support for libc++ might
> be a lot closer than you think.
>
> The issue, which has been long-standing, is the following:
> some C++ template magic fails because there's something defined oddly in
> winpthreads. See the error at the bottom of this message.
> The first error points to
>
> https://github.com/llvm-mirror/libcxx/blob/master/include/condition_variable#L158
> and says the member variable '__cv' cannot be initialized. Checking where
> that member is defined, I find:
> https://github.com/llvm-mirror/libcxx/blob/master/include/__mutex_base#L304
>
> Which defines this '__cv' as 'pthread_cond_t', which leads me to
>
> http://sourceforge.net/p/mingw-w64/code/HEAD/tree/trunk/mingw-w64-libraries/winpthreads/include/pthread.h#l267
>
> The pthreads author and C++ Guru/Expert/Standard Committe member said this
> to help:
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-November/025737.html
>
> Note the new Clang build I say could work does in fact not work.
>
In fact I am a fool and it does work. Clang 3.3 compiles the libc++ source
files just fine as before.
Please ignore my pleas for attention.
Ruben
>
> Also note I once did not have this problem, so something either changed on
> winpthreads or libc++ side, I am not sure.
>
> Attached is the preprocessed source for the file that fails to compile.
>
> Please help me fix this. This would bring much joy to Windows Clang
> enthousiasts and open up a very nice can of worms, uh, users. In part
> because libc++ is actually complete, as opposed to libstdc++, and I find it
> much easier to fix, which is accomodated by the friendly maintainer Howard.
>
> Thanks!
>
> Ruben
>
> PS: here is the error log:
>
> In file included from
> M:\Development\Source\libcxx\src\condition_variable.cpp:10:
> M:\Development\Source\libcxx\include\condition_variable:158:25: error:
> constructor for 'std::__1::condition_variable_any' must explicitly
> initialize the member '__cv_' which does not have a default
> constructor
> condition_variable_any::condition_variable_any()
> ^
> M:\Development\Source\libcxx\include\condition_variable:121:24: note:
> member is declared here
> condition_variable __cv_;
> ^
> M:\Development\Source\libcxx\include\__mutex_base:301:24: note:
> 'std::__1::condition_variable' declared here
> class _LIBCPP_TYPE_VIS condition_variable
> ^
> In file included from
> M:\Development\Source\libcxx\src\condition_variable.cpp:11:
> M:\Development\Source\libcxx\include\thread:435:11: error: no matching
> constructor for initialization of 'std::__1::mutex'
> mutex __mut;
> ^
> M:\Development\Source\libcxx\include\__mutex_base:48:5: note: candidate
> constructor not viable: requires 1 argument, but 0 were provided
> mutex(const mutex&);// = delete;
> ^
> In file included from
> M:\Development\Source\libcxx\src\condition_variable.cpp:11:
> M:\Development\Source\libcxx\include\thread:436:24: error: no matching
> constructor for initialization of 'std::__1::condition_variable'
> condition_variable __cv;
> ^
> M:\Development\Source\libcxx\include\__mutex_base:314:5: note: candidate
> constructor not viable: requires 1 argument, but 0 were provided
> condition_variable(const condition_variable&); // = delete;
> ^
> In file included from
> M:\Development\Source\libcxx\src\condition_variable.cpp:10:
> In file included from
> M:\Development\Source\libcxx\include\condition_variable:112:
> M:\Development\Source\libcxx\include\memory:2090:40: error: constructor
> for
> 'std::__1::__libcpp_compressed_pair_imp<std::__1::allocator<std::__1::mutex>,
> std::__1::mutex, 1>' must explicitly
> initialize the member '__second_' which does not have a default
> constructor
> _LIBCPP_INLINE_VISIBILITY explicit
> __libcpp_compressed_pair_imp(_T1_param __t1)
> ^
> M:\Development\Source\libcxx\include\memory:2372:11: note: in
> instantiation of member function
> 'std::__1::__libcpp_compressed_pair_imp<std::__1::allocator<std::__1::mutex>,
> std::__1::mutex,
> 1>::__libcpp_compressed_pair_imp' requested here
> : base(_VSTD::forward<_T1_param>(__t1)) {}
> ^
> M:\Development\Source\libcxx\include\memory:3701:12: note: in
> instantiation of member function
> 'std::__1::__compressed_pair<std::__1::allocator<std::__1::mutex>,
> std::__1::mutex>::__compressed_pair'
> requested here
> : __data_(_VSTD::move(__a)) {}
> ^
> M:\Development\Source\libcxx\include\memory:4280:26: note: in
> instantiation of member function
> 'std::__1::__shared_ptr_emplace<std::__1::mutex,
> std::__1::allocator<std::__1::mutex>
> >::__shared_ptr_emplace' requested here
> ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
> ^
> M:\Development\Source\libcxx\include\memory:4639:12: note: in
> instantiation of function template specialization
> 'std::__1::shared_ptr<std::__1::mutex>::make_shared<>' requested here
> return shared_ptr<_Tp>::make_shared(_VSTD::forward<_Args>(__args)...);
> ^
> M:\Development\Source\libcxx\include\condition_variable:159:14: note: in
> instantiation of function template specialization
> 'std::__1::make_shared<std::__1::mutex, >' requested here
> : __mut_(make_shared<mutex>()) {}
> ^
> M:\Development\Source\libcxx\include\memory:2078:9: note: member is
> declared here
> _T2 __second_;
> ^
> M:\Development\Source\libcxx\include\__mutex_base:34:24: note:
> 'std::__1::mutex' declared here
> class _LIBCPP_TYPE_VIS mutex
> ^
> 4 errors generated.
> lib\CMakeFiles\cxx.dir\build.make:125: recipe for target
> `lib/CMakeFiles/cxx.dir/__/src/condition_variable.cpp.obj' failed
> mingw32-make[2]: ***
> [lib/CMakeFiles/cxx.dir/__/src/condition_variable.cpp.obj] Error 1
> CMakeFiles\Makefile2:108: recipe for target `lib/CMakeFiles/cxx.dir/all'
> failed
> mingw32-make[1]: *** [lib/CMakeFiles/cxx.dir/all] Error 2
> makefile:115: recipe for target `all' failed
> mingw32-make: *** [all] Error 2
>
> ----------------------------------------------------
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public