Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org
Subject: Re: [PATCH] sim: tests: support .S/.c files
Date: Thu, 24 Mar 2011 05:38:00 -0000	[thread overview]
Message-ID: <AANLkTi=BZY3yCUWdMDPSi_K3Zq5ZvM4BVtOXoR5DEsUE@mail.gmail.com> (raw)
In-Reply-To: <20110323164236.GA21315@adacore.com>

On Wed, Mar 23, 2011 at 12:42 PM, Joel Brobecker wrote:
>> -     set comp_output [target_assemble $sourcefile ${name}.o "$as_options $global_as_options"]
>> -
>> -     if ![string match "" $comp_output] {
>> -         verbose -log "$comp_output" 3
>> -         fail "$mach $testname (assembling)"
>> -         continue
>> -     }
>> +     regsub {(^ *| +)([^ ]+)} "$as_options $global_as_options" { -Wa,\2} c_as_options
>>
>>       if ![info exists opts(ld,$mach)] {
>>           set opts(ld,$mach) $opts(ld)
>>       }
>> +     regsub {(^ *| +)([^ ]+)} "$opts(ld,$mach) $global_ld_options" { -Wl,\2} c_ld_options
>> +
>> +     if ![info exists opts(cc,$mach)] {
>> +         set opts(cc,$mach) $opts(cc)
>> +     }
>> +
>> +     if [string match "*.c" $sourcefile] {
>> +         set comp_output [target_compile $sourcefile ${name}.x "executable" \
>> +             [list "incdir=$srcdir/$subdir" "additional_flags=$c_as_options $c_ld_options $opts(cc,$mach) $global_cc_options"]]
>> +         set method "compiling/linking"
>> +     } else {
>> +         if [string match "*.S" $sourcefile] {
>> +             set comp_output [target_compile $sourcefile ${name}.o "object" \
>> +                 [list "incdir=$srcdir/$subdir" "additional_flags=$c_as_options"]]
>> +             set method "compiling"
>> +         } else {
>> +             set comp_output [target_assemble $sourcefile ${name}.o "$as_options $global_as_options"]
>> +             set method "assembling"
>> +         }
>> +
>> +         if ![string match "" $comp_output] {
>> +             verbose -log "$comp_output" 3
>> +             fail "$mach $testname (${method})"
>> +             continue
>> +         }
>
> It looks like you are not checking the output from the compilation
> of .c files, while you kept that check for all other files. Is that
> intentional?

mmm, that's not the case after all.  if you look at the wider context,
the .c statement will fall down to the *next* comp_output branch.

old code was basically:
- assemble
- check
- link
- check

new code is:
if (*.c) {
  - compile & link
} else {
  if (*.S) {
    - compile
  } else {
    - assemble
  }
  - check
  - link
}
-check

so that intended check isnt "removed" from the .c step, it's simply
made obsolete because the compiler driver (i.e. gcc) is allowed to
compile/link in one shot.
-mike


  parent reply	other threads:[~2011-03-24  3:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14  8:20 [PATCH] sim: tests: support .S files Mike Frysinger
2011-03-14 12:32 ` Pedro Alves
2011-03-14 21:06   ` Mike Frysinger
2011-03-14 21:23 ` [PATCH] sim: tests: support .S/.c files Mike Frysinger
2011-03-23 10:40   ` Mike Frysinger
2011-03-23 17:02   ` Joel Brobecker
2011-03-23 18:50     ` Mike Frysinger
2011-03-24  5:38     ` Mike Frysinger [this message]
2011-03-29  3:06   ` Mike Frysinger
2011-05-14 17:48   ` Mike Frysinger
2011-05-16 18:37     ` Joel Brobecker
2011-05-16 18:49       ` Mike Frysinger

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='AANLkTi=BZY3yCUWdMDPSi_K3Zq5ZvM4BVtOXoR5DEsUE@mail.gmail.com' \
    --to=vapier@gentoo.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=toolchain-devel@blackfin.uclinux.org \
    /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