https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60662

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
   Target Milestone|---                         |11.0

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I am able to reproduce this on Ubuntu 13.10, and it can be fixed by using
-Wl,--no-as-needed before -lpthread which ensures the executable is linked to
libpthread.so even though the linker thinks it's not needed.

I'm not sure why this_thread::sleep_for (which just calls nanosleep) causes
libpthread.so to get linked in, but ldd shows that there is a libpthread.so
dependency with it.

This should be fixed in GCC 11 which no longer uses pthread_once for
std::call_once.

Reply via email to