[cfe-dev] libc++ MinGW build failure
Ruben Van Boxem
vanboxem.ruben at gmail.com
Sun Nov 11 09:53:45 PST 2012
2012/11/11 Howard Hinnant <hhinnant at apple.com>
>
> On Nov 11, 2012, at 12:31 PM, Ruben Van Boxem <vanboxem.ruben at gmail.com>
> wrote:
>
> > Hi,
> >
> > I wanted to take another look at libc++ on Windows,
>
> Thanks!
>
> > but I get a build failure due to (I think) libc++ itself:
> >
> > + clang++ -c -g -Os -fPIC -std=c++0x -fstrict-aliasing -Wall -Wextra
> -Wshadow -Wconversion -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2
> -Wstrict-overflow=4 -nostdinc++ -I../include ../src/condition_variable.cpp
> > In file included from ../src/condition_variable.cpp:10:
> > ../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()
> > ^
>
> Just looking at this first one: condition_variable is required to have a
> default constructor. condition_variable (in <__mutex_base>) is currently
> only implemented on top of pthread_cond_t, and does have a default
> constructor if pthread_cond_t exists. Does pthread_cond_t exist in your
> environment?
>
Yes, I rely on winpthreads to provide the stuff used by libc++ (I really
should take the time to learn all this and write a proper Win32
implementation, but I'm currently too lazy to do so ;-)). pthread_cond_t is
defined in pthread.h. I checked the preprocessed source (attached) and it
is indeed typedef'ed. This worked last time I updated the test results :/
Ruben
> Howard
>
>
> > ../include\condition_variable:121:24: note: member is declared here
> > condition_variable __cv_;
> > ^
> > ../include\__mutex_base:301:23: note: 'std::__1::condition_variable'
> declared here
> > class _LIBCPP_VISIBLE condition_variable
> > ^
> > In file included from ../src/condition_variable.cpp:11:
> > ../include\thread:433:11: error: no matching constructor for
> initialization of 'std::__1::mutex'
> > mutex __mut;
> > ^
> > ../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 ../src/condition_variable.cpp:11:
> > ../include\thread:434:24: error: no matching constructor for
> initialization of 'std::__1::condition_variable'
> > condition_variable __cv;
> > ^
> > ../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 ../src/condition_variable.cpp:10:
> > In file included from ../include\condition_variable:112:
> > ../include\memory:2087: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)
> > ^
> > ../include\memory:2369: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)) {}
> > ^
> > ../include\memory:3693: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)) {}
> > ^
> > ../include\memory:4272: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)...);
> > ^
> > ../include\memory:4631: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)...);
> > ^
> > ../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>()) {}
> > ^
> > ../include\memory:2075:9: note: member is declared here
> > _T2 __second_;
> > ^
> > ../include\__mutex_base:34:23: note: 'std::__1::mutex' declared here
> > class _LIBCPP_VISIBLE mutex
> > ^
> > 4 errors generated.
> >
> > This is with Clang 3.1. Any ideas?
> >
> > Thanks,
> >
> > Ruben
> >
> > PS: please keep me in CC, I am not subscribed to cfe-dev
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121111/f459fb9c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: condition_variable.zip
Type: application/zip
Size: 66672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121111/f459fb9c/attachment.zip>
More information about the cfe-dev
mailing list