2011/7/26 K. Frank <[email protected]>:
> Hello niXman and Ruben!
>
> On Tue, Jul 26, 2011 at 3:26 PM, niXman <[email protected]> wrote:
>> Hi Ruben!
>> I also try to build libstdc++ with winpthreads and determined what neither
>> in mingw-runtime and winpthreads are not implemented the required functions
>> nanosleep() and clock_gettime().
>> I finally built it :)
>> You need to add flags to configure script: "--enable-threads=posix
>> --enable-libstdcxx-time=rt" and create library with empty implementation of
>> these functions and build a library from them named librt.a
>
> Some speculation on the nanosleep issue:
>
> My copy of thread.cc (the gcc implementation for std::thread) has some code
> protected by
>
>    #ifdef _GLIBCXX_USE_NANOSLEEP
>
> When I compile thread.cc (without doing anything special in my environment)
> _GLIBCXX_USE_NANOSLEEP appears not to be defined, and everything works.
> However, if I define _GLIBCXX_USE_NANOSLEEP, e.g., on the g++ command
> line, I get a compile-time error: "'::nanosleep' has not been declared".
>
> So I speculate that nanosleep is an "optional" facility, perhaps provided by 
> the
> linux pthreads or other unix-style library.
>
> Maybe if you can figure out where in your configuration _GLIBCXX_USE_NANOSLEEP
> gets turned on, and figure out some way to turn it off, you won't need
> it, and could
> avoid providing the dummy implementation for it.
>
> Just a thought...
>
>> niXman
>
> Good luck.
>
>>
>> 2011/7/26 Ruben Van Boxem <[email protected]>
>>>
>>> Isn't that email subject a mouthful :)
>>> ...
>>> These are all commits relating to setting some libstdc++ defines to enable
>>> threading. I'm hoping there's a simple !mingw-like check that's easy to fix
>>> in case of posix threaded gcc on all platforms, but the define relies on
>>> several features (all related to atomic and threading functions/features
>>> like nanosleep and condition variables) I do not know are available to us
>>> when using winpthreads.
>>> ...
>>>
>>> Ruben
>
> Ruben, thanks for keeping after this.  If there is anything you would like for
> me to test out when you think you have std::thread working, I'd be happy to
> give it a try.
>
>
> Best.
>
>
> K. Frank

Interesting.  My last test with winpthread an libstdc++ didn't shown
this issues about nanosleep (and this clock_time thing).

Both functions aren't present on a Windows native environment.  You
might can write emulation code for them, but they are not part of
standard runtime.

So I assume you have enabled here some linux specific parts, which
aren't supported.

Kai

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to