From patchwork Thu Jul 18 08:35:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 18409 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7469F20F44 for ; Thu, 18 Jul 2013 08:35:13 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf4163395yhz.7 for ; Thu, 18 Jul 2013 01:35:13 -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=qixGxOPMLO637tGVcCNLrXf6hVTq86zGcdGFZT/YO98=; b=k0pqFpW/pp5po5vSxc0AhdQXAP6dzaNLMzCyIJQ6kINGDhkE1F0MVNDQWxj/IqCCif fF0wyesNWwlJwwT5N39O88i9eUbXObOsPYPXmVMapB59lMa3olpP30w0US8PJc0H7T6K 5xR1UymBL1sQMcxK0GBGfA6+7Zt8Lm3Z/K1ZwJ9paQQ8+70ddjWJ0v3a/OWyfrQz6eJf HWC8q4OS91a5YPDluT4Z9G3k/hooLK68V51uNYqHY709p4gr+TdM6/u+t+Ap/zQF8huT s9Yd2m9tpCmZeYl7xMuRYBrqTadkCD6e/PVVvdDDHxAaJ1xEXVxy+v5qpJV5xTrcTEyX oGDQ== X-Received: by 10.236.156.33 with SMTP id l21mr5812359yhk.18.1374136512881; Thu, 18 Jul 2013 01:35:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.98 with SMTP id n2ls1244384qed.22.gmail; Thu, 18 Jul 2013 01:35:12 -0700 (PDT) X-Received: by 10.220.70.145 with SMTP id d17mr502073vcj.46.1374136512757; Thu, 18 Jul 2013 01:35:12 -0700 (PDT) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id q4si2536019vcf.32.2013.07.18.01.35.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Jul 2013 01:35:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.53 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.53; Received: by mail-vb0-f53.google.com with SMTP id p12so2078633vbe.40 for ; Thu, 18 Jul 2013 01:35:12 -0700 (PDT) X-Received: by 10.220.198.133 with SMTP id eo5mr3603207vcb.24.1374136512632; Thu, 18 Jul 2013 01:35:12 -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.220.149.77 with SMTP id s13csp213299vcv; Thu, 18 Jul 2013 01:35:11 -0700 (PDT) X-Received: by 10.180.20.228 with SMTP id q4mr7376954wie.1.1374136511228; Thu, 18 Jul 2013 01:35:11 -0700 (PDT) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by mx.google.com with ESMTPS id ll15si10426671wic.28.2013.07.18.01.35.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Jul 2013 01:35:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.180 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.212.180; Received: by mail-wi0-f180.google.com with SMTP id c10so2904164wiw.1 for ; Thu, 18 Jul 2013 01:35:10 -0700 (PDT) X-Received: by 10.194.249.195 with SMTP id yw3mr7055039wjc.65.1374136510363; Thu, 18 Jul 2013 01:35:10 -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 s19sm40225410wik.11.2013.07.18.01.35.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Jul 2013 01:35:09 -0700 (PDT) Message-ID: <51E7A8BB.1050908@linaro.org> Date: Thu, 18 Jul 2013 09:35:07 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH] gdb/testsuite/gdb.threads: Ensure TLS tests link against pthreads. X-Gm-Message-State: ALoCoQniuQTxUe9YUS4Mxv8F7nv/Lf0ZDq7ZQSfyde7rwbGFDrIwqzqHtx9M/IhBERldz6+vn331 X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.53 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 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 * 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/gdb.threads/tls-nodebug.c | 2 ++ gdb/testsuite/gdb.threads/tls-shared.c | 5 +++++ gdb/testsuite/gdb.threads/tls-var-main.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/gdb/testsuite/gdb.threads/tls-nodebug.c b/gdb/testsuite/gdb.threads/tls-nodebug.c index 73d96f0..d3b31b7 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug.c +++ b/gdb/testsuite/gdb.threads/tls-nodebug.c @@ -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; } diff --git a/gdb/testsuite/gdb.threads/tls-shared.c b/gdb/testsuite/gdb.threads/tls-shared.c index d4f8e5c..02b1308 100644 --- a/gdb/testsuite/gdb.threads/tls-shared.c +++ b/gdb/testsuite/gdb.threads/tls-shared.c @@ -1,6 +1,11 @@ + +#include + __thread int i_tls = 1; int foo () { + /* Ensure we link against pthreads even with --as-needed. */ + 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..afad945 100644 --- a/gdb/testsuite/gdb.threads/tls-var-main.c +++ b/gdb/testsuite/gdb.threads/tls-var-main.c @@ -15,8 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + int main (void) { + /* Ensure we link against pthreads even with --as-needed. */ + pthread_testcancel(); return 0; }