Tom,

>>> That also sounds reasonable.  Is nm -S more portable than size?
>> 
>> Neither Solaris nor IRIX nm have it.  size isn't particularly portable,
>> either: there are many variations in output format.
[...]
> In case we ever need it, here's a patch to access nm -S.

sorry for the very late response, but a couple of comments.

> +# Call pass if symbol size is ok, otherwise fail.
> +# example: /* { dg-final { object-symbol-size main <= 54 } } */
> +proc object-symbol-size { args } {

This needs to be documented in doc/sourcebuild.texi (Final Actions).  We
made a concerted effort to document the testsuite and should keep it
that way.

> +    # Find nm like we find g++ in g++.exp.
> +    if ![info exists nm]  {
> +     set nm [findfile $base_dir/../../../binutils/nm \
> +             $base_dir/../../../binutils/nm \
> +             [findfile $base_dir/../../nm $base_dir/../../nm \
> +              [findfile $base_dir/nm $base_dir/nm \
> +               [transform nm]]]]
> +     verbose -log "nm is $nm"
> +    }

Please move this to a separate proc like gnat.exp (find_gnatclean).

> +    upvar 2 name testcase
> +    set testcase [lindex $testcase 0]
> +    set output_file "[file rootname [file tail $testcase]].o"
> +    set output [remote_exec host "$nm" "-S $output_file"]
> +    set status [lindex $output 0]
> +    if { $status != 0 } {
> +        error "object-symbol-size: $nm failed"
> +        return
> +    }

As I said, nm -S is completely unportable.  I'd rather at least try if
we can cope with the differences in size output format instead, or
use a hook here that allows to use different implementations.

Thanks for doing this.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to