From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14294 invoked by alias); 22 Nov 2017 15:30:33 -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 14195 invoked by uid 89); 22 Nov 2017 15:30:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Nov 2017 15:30:12 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id vAMFU1HY014761 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 22 Nov 2017 10:30:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 89AD31E585; Wed, 22 Nov 2017 10:30:01 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 062261E4C4; Wed, 22 Nov 2017 10:29:41 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 22 Nov 2017 15:30:00 -0000 From: Simon Marchi To: Yao Qi Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] [testsuite] Pass -lpthread in libs In-Reply-To: <868teys5q7.fsf@gmail.com> References: <1510932166-11816-1-git-send-email-yao.qi@linaro.org> <868teys5q7.fsf@gmail.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 22 Nov 2017 15:30:01 +0000 X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00496.txt.bz2 On 2017-11-22 10:17, Yao Qi wrote: > Simon Marchi writes: > >> I am seeing: >> >> gdb compile failed, .../info-os.c:51:1: warning: control reaches end >> of non-void function [-Wreturn-type] >> >> with clang-6.0. Once I fix it, the test passes for me. > > Yes, it is another patch in my tree, to be posted. > >> >> Instead of passing -lpthread directly, it would probably be better to >> pass the >> "pthreads" option, like this: > > OK, how about the patch below? > > -- > Yao (齐尧) > > From c7392e6f937bf342daee99dfd5bcc6daf91af417 Mon Sep 17 00:00:00 2001 > From: Yao Qi > Date: Fri, 17 Nov 2017 13:04:10 +0000 > Subject: [PATCH] [testsuite] Pass pthreads in prepare_for_testing > > "pthreads" in the right flag to pass in prepare_for_testing to linker, > instead of additional_flags. Without this patch, the test case can't > be > complied by clang. > > gdb compile failed, clang: warning: -lpthread: 'linker' input unused > > gdb/testsuite: > > 2017-11-22 Yao Qi > > * gdb.base/info-os.exp: Pass pthreads. > * gdb.multi/multi-attach.exp: Likewise. > > diff --git a/gdb/testsuite/gdb.base/info-os.exp > b/gdb/testsuite/gdb.base/info-os.exp > index 574da26..3267eec 100644 > --- a/gdb/testsuite/gdb.base/info-os.exp > +++ b/gdb/testsuite/gdb.base/info-os.exp > @@ -28,7 +28,7 @@ if [gdb_skip_xml_test] then { > } > > # Compile test program. > -if { [prepare_for_testing "failed to prepare" $testfile $srcfile > {debug additional_flags=-lpthread}] } { > +if { [prepare_for_testing "failed to prepare" $testfile $srcfile > {debug pthreads}] } { > fail "cannot compile test program" > return -1 > } > diff --git a/gdb/testsuite/gdb.multi/multi-attach.exp > b/gdb/testsuite/gdb.multi/multi-attach.exp > index 9397f85..0e54b4f 100644 > --- a/gdb/testsuite/gdb.multi/multi-attach.exp > +++ b/gdb/testsuite/gdb.multi/multi-attach.exp > @@ -23,7 +23,7 @@ if {![can_spawn_for_attach]} { > return 0 > } > > -if {[prepare_for_testing "failed to prepare" $testfile $srcfile > {debug additional_flags=-lpthread}]} { > +if {[prepare_for_testing "failed to prepare" $testfile $srcfile > {debug pthreads}]} { > return -1 > } LGTM.