From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21947 invoked by alias); 7 Jun 2013 18:40:21 -0000 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 Received: (qmail 21931 invoked by uid 89); 7 Jun 2013 18:40:21 -0000 X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-wg0-f46.google.com (HELO mail-wg0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 07 Jun 2013 18:40:20 +0000 Received: by mail-wg0-f46.google.com with SMTP id l18so3319259wgh.1 for ; Fri, 07 Jun 2013 11:40:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=GfvDtOyawC5Oiut7lXyJGnhb6yl+pB8FOdfEbCM8qIk=; b=MsMZEQvSoWsNpBREBBqzL3ti5GqtbkV7ZDutzGfl3rB3tqhee6nTJb4wHpo6KCYJph coiNDuGstDcnYuSIyu9w5B3CIOEgOVIn05Qw4jldQpOoqa3BKAdHWoeXX71KaJs4sKQB xUShV84v7BOkUbpjDRxBjejbqYjJPQXSLZOY+Bilt6blO5bybINdKGbqRkN8G/GlHlIh uK14NinwjKcnPV1/olpVPN/83g1UwORIobOFMvQ6UwPOJszre+miDeN+TqgIG6p+Xqvu Br/mOJKAjXkI2deelARMxYdLPdjo+dzxS13y/qTx7ZurnyFM8UQ0E84tjNoXUwhiAWfT 06qA== X-Received: by 10.180.91.131 with SMTP id ce3mr2501344wib.55.1370630418397; Fri, 07 Jun 2013 11:40:18 -0700 (PDT) Received: from localhost.localdomain (cpc11-seac20-2-0-cust84.7-2.cable.virginmedia.com. [81.108.156.85]) by mx.google.com with ESMTPSA id fu14sm63668wic.0.2013.06.07.11.40.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Jun 2013 11:40:17 -0700 (PDT) Message-ID: <51B22910.7010208@linaro.org> Date: Fri, 07 Jun 2013 18:41:00 -0000 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH] gdb/testsuite/gdb.threads: Make sure TLS tests link against pthreads. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlMks98xy6CgQCyuffDBztMqM1K4iq42TG+1Owtcp+r5T6sCfgJJMI6oS6nUPPpSkwyOd6L X-SW-Source: 2013-06/txt/msg00173.txt.bz2 On Ubuntu the compiler passes --as-needed to the linker which means no DT_NEEDED entry is added for libpthread when building the TLS tests. This causes the test to fail as a libpthread is required to look up TLS variables. Add some calls to pthread functions to make sure libpthread is linked. gdb/testsuite/ChangeLog: 2013-06-07 Will Newton * gdb.threads/tls-nodebug.c: Call pthread_self to ensure the test is linked against pthreads. * gdb.threads/tls-var-main.c: Likewise. * gdb.threads/tls-shared.c: Call pthread_testcancel to ensure the test is linked against pthreads. --- gdb/testsuite/gdb.threads/tls-nodebug.c | 2 +- gdb/testsuite/gdb.threads/tls-shared.c | 4 ++++ gdb/testsuite/gdb.threads/tls-var-main.c | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.threads/tls-nodebug.c b/gdb/testsuite/gdb.threads/tls-nodebug.c index 73d96f0..10aa8c8 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug.c +++ b/gdb/testsuite/gdb.threads/tls-nodebug.c @@ -6,5 +6,5 @@ __thread int thread_local = 42; int main(void) { - return 0; + return pthread_self(); } diff --git a/gdb/testsuite/gdb.threads/tls-shared.c b/gdb/testsuite/gdb.threads/tls-shared.c index d4f8e5c..1ef7949 100644 --- a/gdb/testsuite/gdb.threads/tls-shared.c +++ b/gdb/testsuite/gdb.threads/tls-shared.c @@ -1,6 +1,10 @@ + +#include + __thread int i_tls = 1; int foo () { + pthread_testcancel(); return i_tls; } diff --git a/gdb/testsuite/gdb.threads/tls-var-main.c b/gdb/testsuite/gdb.threads/tls-var-main.c index 34a2522..4728ea3 100644 --- a/gdb/testsuite/gdb.threads/tls-var-main.c +++ b/gdb/testsuite/gdb.threads/tls-var-main.c @@ -15,8 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + int main (void) { - return 0; + return pthread_self(); } -- 1.8.1.4