http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49231
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-30 16:30:16 UTC --- See http://www.akkadia.org/drepper/no_static_linking.html If you still for whatever weird reason insist to link statically, for NPTL you need to -Wl,--whole-archive -lpthread -Wl,--no-whole-archive because if only some objects from libpthread are linked in, it can misbehave in various ways. In RHEL6 libpthread.a contains just one object ld -r linked together the whole normal libpthread.a contents, but in upstream glibc as well as older RHEL versions (no idea about other distros) you need to link as mentioned above.