junyer@whalre:~$ g++ -Wall -Werror foo.cc -o foo -lpthread junyer@whalre:~$ ./foo foo: pthread_rwlock_init(&lock, NULL): 0 foo: pthread_rwlock_wrlock(&lock): 0 foo: pthread_rwlock_unlock(&lock): 0 foo: pthread_rwlock_wrlock(&lock): 0 foo: pthread_rwlock_unlock(&lock): 0 foo: pthread_rwlock_destroy(&lock): 0 junyer@whalre:~$ g++ -Wall -Werror foo.cc -o foo -static -lpthread junyer@whalre:~$ ./foo foo: pthread_rwlock_init(&lock, NULL): 0 foo: pthread_rwlock_wrlock(&lock): 0 foo: pthread_rwlock_unlock(&lock): 0 ^C junyer@whalre:~$ g++ -Wall -Werror foo.cc -o foo -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive junyer@whalre:~$ ./foo foo: pthread_rwlock_init(&lock, NULL): 0 foo: pthread_rwlock_wrlock(&lock): 0 foo: pthread_rwlock_unlock(&lock): 0 foo: pthread_rwlock_wrlock(&lock): 0 foo: pthread_rwlock_unlock(&lock): 0 foo: pthread_rwlock_destroy(&lock): 0 junyer@whalre:~$
** Attachment added: "example" https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1450355/+attachment/4388114/+files/foo.cc -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1450355 Title: statically linking libpthread is problematic To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1450355/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs