This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Allow for libc containing libpthread in testsuite.


Hi.

The libc for Android doesn't have libpthread, pthread functions live in libc.
This patch to gdb_compile_pthreads adds support for this.

For targets without any threading support this will slow things down
a bit in that one extra compile is done before the testsuite will conclude
that threading isn't supported.
I *could* add an istarget check,
but in the interests of avoiding such things I went with this.
It won't slow down targets with threads as I added "" to the end.
[Which raises the question: I wonder what kind of speed-up can be had
by moving -lpthread ahead of -lpthreads. It will improve the
S/N ratio of gdb.log on linux at least.]

I will check this in in a few days if there are no objections.

2010-03-01  Doug Evans  <dje@google.com>

	* lib/gdb.exp (gdb_compile_pthreads): Handle case where
	libc contains libpthread.

Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.139
diff -u -p -r1.139 gdb.exp
--- testsuite/lib/gdb.exp	24 Feb 2010 11:11:17 -0000	1.139
+++ testsuite/lib/gdb.exp	1 Mar 2010 22:26:05 -0000
@@ -1929,7 +1929,7 @@ proc gdb_compile {source dest type optio
 proc gdb_compile_pthreads {source dest type options} {
     set built_binfile 0
     set why_msg "unrecognized error"
-    foreach lib {-lpthreads -lpthread -lthread} {
+    foreach lib {-lpthreads -lpthread -lthread ""} {
         # This kind of wipes out whatever libs the caller may have
         # set.  Or maybe theirs will override ours.  How infelicitous.
         set options_with_lib [concat $options [list libs=$lib quiet]]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]