mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
623cc28540
On Ubuntu by default the compiler passes --as-needed to ld which means no DT_NEEDED entry is added for libpthread when building the TLS tests. This causes the test to fail as libpthread is required to look up TLS variables. Add calls to pthread_testcancel to make sure libpthread gets linked. gdb/testsuite/ChangeLog: 2013-07-18 Will Newton <will.newton@linaro.org> * gdb.threads/tls-nodebug.c: Call pthread_testcancel to ensure the test is linked against pthreads. * gdb.threads/tls-var-main.c: Likewise. * gdb.threads/tls-shared.c: Likewise.
12 lines
167 B
C
12 lines
167 B
C
|
|
#include <pthread.h>
|
|
|
|
__thread int i_tls = 1;
|
|
int foo ()
|
|
{
|
|
/* Ensure we link against pthreads even with --as-needed. */
|
|
pthread_testcancel();
|
|
return i_tls;
|
|
}
|
|
|