libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 7/7] Prefer $NM @file over calculating the cmd line length.


From: Ralf Wildenhues
Subject: Re: [PATCH 7/7] Prefer $NM @file over calculating the cmd line length.
Date: Thu, 16 Sep 2010 19:25:46 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Peter,

* Peter Rosin wrote on Mon, Sep 13, 2010 at 10:03:10AM CEST:
> Ok to push this time?

Okay.

I think it ought to be possible to clean up the logic a bit further, to
make it easier to follow when you read the whole paragraph of code, but
such a cleanup is just as good to make alongside the eval fixes, and
early in the release cycle.

BTW, how about s/try_normal_branch/nm_tool_conversion_needed/ and swap
yes and no?  Strictly optional, and only if you prefer that.

Thanks,
Ralf

> Subject: [PATCH] Prefer $NM @file when the toolchain isn't native to $build.
> 
> * libltdl/config/ltmain.m4sh (func_mode_link): Avoid calculating
> the command line length and take the @file branch *if* the file
> names needs to be converted for the toolchain and the @file
> branch works.  Fixes problems in stresstest.at when doing a cross
> from Cygwin to MinGW using MinGW native tools (a.k.a. a "faked"
> cross), and for the specific case of MSVC on Cygwin it makes the
> test pass.

> --- a/libltdl/config/ltmain.m4sh
> +++ b/libltdl/config/ltmain.m4sh
> @@ -7349,10 +7349,23 @@ EOF
>           save_ifs="$IFS"; IFS='~'
>           for cmd1 in $cmds; do
>             IFS="$save_ifs"
> -           eval cmd=\"$cmd1\"
> -           func_len " $cmd"
> -           len=$func_len_result
> -           if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; 
> then
> +           # Take the normal branch if the nm_file_list_spec branch
> +           # doesn't work or if tool conversion is not needed.
> +           case $nm_file_list_spec~$to_tool_file_cmd in
> +             *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
> +               try_normal_branch=yes
> +               eval cmd=\"$cmd1\"
> +               func_len " $cmd"
> +               len=$func_len_result
> +               ;;
> +             *)
> +               try_normal_branch=no
> +               ;;
> +           esac
> +           if test $try_normal_branch = yes \
> +              && { test "$len" -lt "$max_cmd_len" \
> +                   || test "$max_cmd_len" -le -1; }
> +           then
>               func_show_eval "$cmd" 'exit $?'
>               skipped_export=false
>             elif test -n "$nm_file_list_spec"; then




reply via email to

[Prev in Thread] Current Thread [Next in Thread]