From patchwork Fri Jun 7 18:40:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 17691 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E03E42395F for ; Fri, 7 Jun 2013 18:40:20 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bv4sf1987070qab.6 for ; Fri, 07 Jun 2013 11:40:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:message-id :date:from:user-agent:mime-version:to:cc:subject:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=GfvDtOyawC5Oiut7lXyJGnhb6yl+pB8FOdfEbCM8qIk=; b=OG1in1yYJm2iJFMnbiKOLG96ZYT/fVyTrNiyNktzzXbGPU9I/vhge9CepPjD/WDcR9 n5PL1T5QmFVfKBCJ03IUR9Wl+pK7p9dLMutBTwqfIAqdDaf2VOkpIgh5W+OdeoiNKaxd ojUonujPEDTYCJFulw22261TzgGlK2yfkHdgHUgu3UC1xt0ch3LkcmZpPsmzHBMDbQMR 3UmY/2rAuJchO8E7gzgll3yUe1i/veqjcmoOspSOJcCaHA9Rzv36/d5Osvs8NHF6EJXy R8MhEF56A/szPw8ZbQq6JxRo9wOMPUpSYO7x15cM3kssOEj5/Iea/MLYkzQcDNz8dJ7h jEJg== X-Received: by 10.236.134.132 with SMTP id s4mr24136585yhi.56.1370630420540; Fri, 07 Jun 2013 11:40:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.5 with SMTP id lg5ls1974149qeb.21.gmail; Fri, 07 Jun 2013 11:40:20 -0700 (PDT) X-Received: by 10.52.155.67 with SMTP id vu3mr20581560vdb.94.1370630420272; Fri, 07 Jun 2013 11:40:20 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id p8si24845vdv.5.2013.06.07.11.40.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Jun 2013 11:40:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id id13so2992754vcb.37 for ; Fri, 07 Jun 2013 11:40:20 -0700 (PDT) X-Received: by 10.58.29.42 with SMTP id g10mr1359562veh.59.1370630420096; Fri, 07 Jun 2013 11:40:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp125633vcb; Fri, 7 Jun 2013 11:40:19 -0700 (PDT) X-Received: by 10.194.179.102 with SMTP id df6mr36490539wjc.42.1370630419016; Fri, 07 Jun 2013 11:40:19 -0700 (PDT) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [2a00:1450:400c:c05::22b]) by mx.google.com with ESMTPS id uq8si3111wjc.87.2013.06.07.11.40.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Jun 2013 11:40:19 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22b is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=2a00:1450:400c:c05::22b; Received: by mail-wi0-f171.google.com with SMTP id hm9so1622038wib.4 for ; Fri, 07 Jun 2013 11:40:18 -0700 (PDT) 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 19:40:16 +0100 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. X-Gm-Message-State: ALoCoQnQtQ5duH7YglBLADmQoaO2E7/+YZ5M0EQasuBZ1T72+O+pvUja68/35uOz1m73F9ljl5Ln X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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(); }