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

------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to