1 2 3 4 5 6 7 8 9 10 11
#include <pthread.h> __thread int i_tls = 1; int foo () { /* Ensure we link against pthreads even with --as-needed. */ pthread_testcancel(); return i_tls; }