From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32200 invoked by alias); 10 Dec 2013 16:10:25 -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 32189 invoked by uid 89); 10 Dec 2013 16:10:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: mail-gw2-out.broadcom.com Received: from Unknown (HELO mail-gw2-out.broadcom.com) (216.31.210.63) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2013 16:10:22 +0000 Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw2-out.broadcom.com with ESMTP; 10 Dec 2013 08:15:19 -0800 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Tue, 10 Dec 2013 08:10:15 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.1.438.0; Tue, 10 Dec 2013 08:10:15 -0800 Received: from [10.177.73.57] (unknown [10.177.73.57]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 11DEA246A3; Tue, 10 Dec 2013 08:10:11 -0800 (PST) Message-ID: <52A73CE2.60002@broadcom.com> Date: Tue, 10 Dec 2013 16:10:00 -0000 From: Andrew Burgess User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: Call get_compiler_info before test_compiler_info. (was: Re: [PATCH] Call get_compiler_info directly from test_compiler_info if needed.) References: <52A728A0.1050208@broadcom.com> <52A72C70.5040305@redhat.com> <52A7303B.2080901@broadcom.com> <52A737EE.80800@redhat.com> In-Reply-To: <52A737EE.80800@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00379.txt.bz2 On 10/12/2013 3:49 PM, Pedro Alves wrote: > On 12/10/2013 03:16 PM, Andrew Burgess wrote: >> On 10/12/2013 3:00 PM, Pedro Alves wrote: > >> @@ -2027,10 +2027,6 @@ gdb_caching_proc skip_altivec_tests { >> >> # Make sure we have a compiler that understands altivec. >> set compile_flags {debug nowarnings} >> - if [get_compiler_info] { >> - warning "Could not get compiler info" >> - return 1 >> - } >> if [test_compiler_info gcc*] { >> set compile_flags "$compile_flags additional_flags=-maltivec" >> } elseif [test_compiler_info xlc*] { > > Before, the removed get_compiler_info would always overwrite > whatever was in the compiler_info before. Now, if the previous > call to get_compiler_info happened to get an $arg, > test_compiler_info will now reuse the wrong compiler_info. OK, I see. Here's a simpler solution that just adds the missing call to get_compiler_info. The example I found where this is an issue was: gdb.trace/pending.exp, which pre-patch fails to build for me (when I run just that test), but after the patch does run. There are probably other examples around. OK to apply? Thanks, Andrew gdb/testsuite/ChangeLog * lib/gdb.exp (gdb_compile_shlib): Call get_compiler_info before calling test_compiler_info. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2c1cf29..eddfb9d 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2812,6 +2812,14 @@ proc gdb_compile_pthreads {source dest type options} { proc gdb_compile_shlib {sources dest options} { set obj_options $options + set info_options "" + if { [lsearch -exact $options "c++"] >= 0 } { + set info_options "c++" + } + if [get_compiler_info ${info_options}] { + return -1 + } + switch -glob [test_compiler_info] { "xlc-*" { lappend obj_options "additional_flags=-qpic"