From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7546 invoked by alias); 1 Mar 2010 22:46:22 -0000 Received: (qmail 7522 invoked by uid 22791); 1 Mar 2010 22:46:20 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Mar 2010 22:46:16 +0000 Received: from kpbe15.cbf.corp.google.com (kpbe15.cbf.corp.google.com [172.25.105.79]) by smtp-out.google.com with ESMTP id o21MkE20012296 for ; Mon, 1 Mar 2010 14:46:14 -0800 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by kpbe15.cbf.corp.google.com with ESMTP id o21MkCub017842 for ; Mon, 1 Mar 2010 14:46:13 -0800 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 9EBE084842; Mon, 1 Mar 2010 14:46:12 -0800 (PST) To: gdb-patches@sourceware.org Subject: [patch] Allow for libc containing libpthread in testsuite. Message-Id: <20100301224612.9EBE084842@ruffy.mtv.corp.google.com> Date: Mon, 01 Mar 2010 22:46:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00036.txt.bz2 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 * 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]]