From: Andrew Burgess <aburgess@broadcom.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <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.)
Date: Tue, 10 Dec 2013 16:10:00 -0000 [thread overview]
Message-ID: <52A73CE2.60002@broadcom.com> (raw)
In-Reply-To: <52A737EE.80800@redhat.com>
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"
next prev parent reply other threads:[~2013-12-10 16:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 14:43 [PATCH] Call get_compiler_info directly from test_compiler_info if needed Andrew Burgess
2013-12-10 15:07 ` Pedro Alves
2013-12-10 15:16 ` Andrew Burgess
2013-12-10 15:49 ` Pedro Alves
2013-12-10 16:10 ` Andrew Burgess [this message]
2013-12-10 16:26 ` Call get_compiler_info before test_compiler_info Pedro Alves
2013-12-10 17:10 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52A73CE2.60002@broadcom.com \
--to=aburgess@broadcom.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox