This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] sim: tests: support .S/.c files


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]