On Tue, Sep 24, 2013 at 01:13:53PM +0100, Jonathan Wakely wrote:
> > Try compiling that testcase with -static rather than -Wl,--as-needed.
> > You'll hit std::system_error just like you do here.  I believe that is
> > a libstdc++ bug, and can be solved by making libstdc++.a use strong
> > references to pthread symbols from std::thread::join() (and perhaps
> > other objects that provide c++ thread support, if there are such).
> 
> It's the std::thread constructor template that needs pthread_create.
> std::thread::join() needs pthread_join.

Are any references to that needed in libstdc++.so.6, or just in headers?
Having libstdc++.so.6 depend on libpthread.so is not a good idea, the
latter might be possible by just referencing pthread_* instead of
__gthread_* where you actually require it.

> It's complicated by the fact that the source code doesn't mention
> pthread_create, it uses __gthread_create instead, which is the weak
> reference.

If it requires pthread_{create,join} rather then it should be using
those rather than the wrappers, those are there just to not require
libpthread and just fail if it is not linked in.

> It has the huge disadvantage of breaking the ABI by removing symbols
> from libstdc++.so

That is not possible.

        Jakub

Reply via email to