libtool-patches
[Top][All Lists]
Advanced

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

Re: piecewise linking with linear space complexity


From: Ralf Wildenhues
Subject: Re: piecewise linking with linear space complexity
Date: Wed, 18 Jul 2007 22:35:06 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hi Isidor,

* Isidor Zeuner wrote on Wed, Jul 18, 2007 at 04:32:07AM CEST:
> 
> You might be interested in my patch to reduce the space complexity for
> piecewise linking. See https://savannah.gnu.org/patch/index.php?6104

Thanks for the report and patch.  I agree that quadratic space
complexity is undesirable, and outweighs spawning more rm processes
(the linking itself is typically much more costly here).  We should
however strive to remove each file exactly once (to facilitate RM=rm
rather than RM='rm -f').

I'm currently testing the patch below.  OK to apply (if it shows
no problems)?

Cheers,
Ralf

2007-07-18  Ralf Wildenhues  <address@hidden>

        * libltdl/config/ltmain.m4sh (func_mode_link): Remove each
        intermediate relinked object after use, to avoid quadratic space
        complexity when linking partially.
        Report by Isidor Zeuner <address@hidden>.

Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.84
diff -u -r1.84 ltmain.m4sh
--- libltdl/config/ltmain.m4sh  12 Jul 2007 06:47:06 -0000      1.84
+++ libltdl/config/ltmain.m4sh  18 Jul 2007 20:28:24 -0000
@@ -6164,7 +6164,7 @@
                  else
                    # All subsequent reloadable object files will link in
                    # the last one created.
-                   eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist 
$last_robj\"
+                   eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist 
$last_robj~$RM $last_robj\"
                  fi
                  last_robj=$output_objdir/$output_la-${k}.$objext
                  k=`expr $k + 1`
@@ -6177,16 +6177,9 @@
              # reloadable object file.  All subsequent reloadable object
              # files will link in the last one created.
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-             eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist 
$last_robj\"
+             eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist 
$last_robj~$RM $last_robj\"
+             delfiles="$delfiles $output"
 
-             # Set up a command to remove the reloadable object files
-             # after they are used.
-             i=0
-             while test "$i" -lt "$k"
-             do
-               i=`expr $i + 1`
-               delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
-             done
            else
              output=
            fi
@@ -6199,6 +6192,9 @@
              # Append the command to create the export file.
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
              eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+             if test -n "$output"; then
+               eval concat_cmds=\"\$concat_cmds~$RM $last_robj\"
+             fi
            fi
 
            test -n "$save_libobjs" &&




reply via email to

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