https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60662
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #5) > 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. nanosleep used to be defined in both libc.so and libpthread.so, so if you link with -lpthread then the definition in libpthread.so will be found (because of the order of libraries gcc passes to the linker) and you get a dependency on libpthread.so Recent versions of glibc only define it in libc.so