Created attachment 33142 [details]
Forwarding Debian bug https://bugs.debian.org/749290
$ g++ thread.cpp -pthread -std=c++11 -o thread
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
On linux it runs fine
Created attachment 33143 [details]
force dependency on pthread_create
Something like this would force the user to link to libpthread (turning a runtime error into a linktime error) and would force the linker to pull in the required symbol.
Date: Wed Aug 13 18:40:10 2014
New Revision: 213922
* include/std/thread (thread::_M_start_thread): Declare new overload.
(thread::thread<_Callable, _Args...>): Call new overload with an
explicit reference to pthread_create.
* src/c++11/thread.cc (thread::_M_start_thread): Add new overload.
* config/abi/pre/gnu.ver: Export new function.
This should be fixed on trunk, it would be great if someone can test it.
FYI according to , Matthias Klose backported  but it didn't fix the issue.
Samuel Thibault did fix it with  on libpthread side.
The asm solution that Matthias applied to the Debian 4.8 branch should ensure that libpthread.so gets linked to, and so I would expect the __gthread_active_p() test that looks for __pthread_key_create to succeed even without Samuel's change.
Please consider replying to its recipients.
Ah I see, so Samuel's change is needed to make __gthread_active_p work on Hurd. We could have changed __gthread_active_p (as we've done e.g. for Bionic) but there's no point now.