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: Peter Rosin
Subject: Re: [PATCH 7/7] Prefer $NM @file over calculating the cmd line length.
Date: Sat, 11 Sep 2010 14:24:18 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

Den 2010-09-08 21:29 skrev Ralf Wildenhues:
> I guess I'm a bit put off by this patch in that it makes it harder on
> GNU/Linux to debug libtool by copying and pasting the commands that it
> outputs, because the response file will be invisible.  On this system,
> there's no advantage as long as the command line is not too long.
> 
> So, the question is whether to replace the patch with one that changes
> 
> -             if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le 
> -1; then
> +             if { test "$len" -lt "$max_cmd_len" \
> +                  || test "$max_cmd_len" -le -1; } \
> +                && $tool_conversion_not_needed_on_this_system; then
> 
> WDYT?
> 
> We can (and need to) find out during the next test cycle whether the nm
> @file is functional or not.

Hi!

Here's an update that avoids the normal branch if the tool conversion
mandates that the normal branch might not work, but only does so if the
@file branch is actually an alternative. The rational is that if the @file
branch doesn't exist, the alternative to not take the normal branch is the
old -r -o branch which has an equally bleak chance of success when tool
conversion is needed (but if only relative file names are passed in, tool
conversion probably isn't needed after all, so it is better to *try* the
normal branch than to give up all together).

Since the normal branch works and makes debugging easier (and probably is
faster) on MSYS, it is *not* avoided there (lazy style).

Ok to push?

Cheers,
Peter

>From 783a1f89bd69a76cf836c49a04a3a5e854725785 Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Sat, 11 Sep 2010 13:57:10 +0200
Subject: [PATCH 7/7] 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 stresstest.at when doing a cross from Cygwin
to MinGW using MinGW native tools (a.k.a. a "faked" cross).

Signed-off-by: Peter Rosin <address@hidden>
---
 ChangeLog                  |    9 +++++++++
 libltdl/config/ltmain.m4sh |   21 +++++++++++++++++----
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 564589d..89ec975 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-11  Peter Rosin  <address@hidden>
+
+       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 stresstest.at when doing a cross from Cygwin
+       to MinGW using MinGW native tools (a.k.a. a "faked" cross).
+
 2010-09-10  Peter Rosin  <address@hidden>
 
        Convert file name to toolchain format when invoking $NM.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 2b829d3..31e4a28 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -7341,10 +7341,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 | ~*)
+                 tool_conversion_needed_and_working=false
+                 eval cmd=\"$cmd1\"
+                 func_len " $cmd"
+                 len=$func_len_result
+                 ;;
+               *)
+                 tool_conversion_needed_and_working=:
+                 ;;
+             esac
+             if { test "$len" -lt "$max_cmd_len" \
+                  || test "$max_cmd_len" -le -1; } \
+                && ! $tool_conversion_needed_and_working
+             then
                func_show_eval "$cmd" 'exit $?'
                skipped_export=false
              elif test -n "$nm_file_list_spec"; then
-- 
1.7.1




reply via email to

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