Jakub suggests we use ld -r to build a libpthread.a that will conceivably work
with a static link (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33960#c9).
Should we do that?
*** Bug 5780 has been marked as a duplicate of this bug. ***
H.J. Lu 2012-09-06 23:25:45 UTC
The issue is GCC uses
1. Mark pthread_foo as weak.
2. Use a weak pthread_xxxx to check if thread is active.
3. It does
With libpthread.a, there is no guarantee that linking in
archive member for pthread_xxxx will also include archive
member for pthread_foo. When it happens, static executable
crashes when calling pthread_foo. We can add
But it may lead to bad static executable hehavior. The
list of pthread_foo is
Discussion thread starts here:
Roland McGrath makes comments here that he'd like to see a better solution:
Detailed notes on new APIs to solve this issue:
*** Bug 21777 has been marked as a duplicate of this bug. ***