libtool-patches
[Top][All Lists]
Advanced

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

PATCH: Piecewise linking and export_symbols_cmds


From: Boehne, Robert
Subject: PATCH: Piecewise linking and export_symbols_cmds
Date: Wed, 22 May 2002 17:00:18 -0500

Hello,

I've been having problems with piecewise linking under AIX 4.3.3
when the "nm" command line in $export_symbols_cmds is too large
to be executed.  This patch fixes it, and causes no regressions
on any tested systems.  Without it, Libtool dies trying to create
the export file for a very large (in number of object files) library.


2002-05-23  Robert Boehne  <address@hidden>

        * ltmain.in (Piecewise linking): Add a clause to skip creating
        the export file until the reloadable object file(s) have been
        created, then use them as input for $export_symbols_cmds.


-- 
Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  rboehne AT ricardo-us DOT com

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.297
diff -u -r1.297 ltmain.in
--- ltmain.in   21 May 2002 14:05:20 -0000      1.297
+++ ltmain.in   22 May 2002 21:55:43 -0000
@@ -3231,8 +3231,15 @@
            save_ifs="$IFS"; IFS='~'
            for cmd in $cmds; do
              IFS="$save_ifs"
-             $show "$cmd"
-             $run eval "$cmd" || exit $?
+             if len=`expr "X$cmd" : ".*"` &&
+              test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; 
then
+               $show "$cmd"
+               $run eval "$cmd" || exit $?
+             else
+               # The command line is too long to execute in one step.
+               $echo "using reloadable object files..."
+               skipped_export="YES"
+             fi
            done
            IFS="$save_ifs"
            if test -n "$export_symbols_regex"; then
@@ -3317,7 +3324,7 @@
          deplibs="$save_deplibs"
        fi
 
-       if len=`expr "X$cmds" : ".*"` &&
+       if test "X$skipped_export" != "XYES" && len=`expr "X$cmds" : ".*"` &&
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
          :
        else
@@ -3377,6 +3384,16 @@
          # 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\"
+
+         if test "X$skipped_export" = "XYES" ; then
+           $show "generating symbol list for \`$libname.la'"
+           export_symbols="$output_objdir/$libname.exp"
+           $run $rm $export_symbols
+           libobjs=$output
+           echo "\$libobjs is currently set to $libobjs"
+           # Append the command to create the export file.
+           eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+          fi
 
          # Set up a command to remove the reloadale object files
          # after they are used.

reply via email to

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