[Bug libgcc/87189] libgcc/gthr-posix.h (__gthread_active_p) makes unwarranted assumptions about libpthread.a
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Sep 3 09:37:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87189
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is a glibc bug, coming up with a set of weakref checks for gthr.h that
would satisfy static linking of glibc and all possible combinations of included
vs. non-included objects is impossible.
E.g. Fedora/RHEL ld -r libpthread.a objects into a single exactly because of
this.
The other alternative is to add (for libpthread.a) dependencies in betweeh the
*.o objects so that a reasonable set is always linked together, or just link
with --whole-archive -lpthread --no-whole-archive.
There are many dups of this both on the gcc side and glibc side.
More information about the Gcc-bugs
mailing list