https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96817
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- I'm also going to start using Glibc's __libc_single_threaded instead of __gthread_active_p() for deciding whether to use atomics for reference counting in shared_ptr and the old std::string. Once reference counting no longer depends on whether we're linked to libpthread it won't be so costly to just link libstdc++.so to libpthread.so unconditionally, so that std::thread Just Works without needing to use -pthread and __gthread_active_p() is always true.