]> Git Repo - binutils.git/commitdiff
gdb/testsuite/gdb.threads: Ensure TLS tests link against pthreads.
authorWill Newton <[email protected]>
Thu, 18 Jul 2013 15:49:22 +0000 (15:49 +0000)
committerWill Newton <[email protected]>
Thu, 18 Jul 2013 15:49:22 +0000 (15:49 +0000)
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  <[email protected]>

* 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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/tls-nodebug.c
gdb/testsuite/gdb.threads/tls-shared.c
gdb/testsuite/gdb.threads/tls-var-main.c

index 47b7f6bcbf4e74c4c2c9a473c4ce8ade597f25ab..473c326add6099b1baf290bc663b1f3f782d7c1a 100644 (file)
@@ -1,3 +1,10 @@
+2013-07-18  Will Newton  <[email protected]>
+
+       * 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.
+
 2013-07-18  Yao Qi  <[email protected]>
 
        * lib/future.exp (gdb_default_target_compile): Use tail name
index 73d96f0f3cdc15c9dd012533b457f71e4b031cdd..d3b31b7609c717cd1aaeb2f1576cfbe5e5551748 100644 (file)
@@ -6,5 +6,7 @@ __thread int thread_local = 42;
 
 int main(void)
 {
+  /* Ensure we link against pthreads even with --as-needed.  */
+  pthread_testcancel();
   return 0;
 }
index d4f8e5cc6e092f437e8863bf4e2d694684ce79ab..02b13083ab9331aa44ab03cd3a2dee6d171bffb7 100644 (file)
@@ -1,6 +1,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;
 }
 
index 34a25227065ecc50dd37a740843dfb912cd18b58..afad94539f1480c39215e990502d6a744c70387b 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include <pthread.h>
+
 int
 main (void)
 {
+  /* Ensure we link against pthreads even with --as-needed.  */
+  pthread_testcancel();
   return 0;
 }
This page took 0.076291 seconds and 4 git commands to generate.