libtool-patches
[Top][All Lists]
Advanced

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

[patch] list of input files if max_cmd_len exceeded


From: David Edelsohn
Subject: [patch] list of input files if max_cmd_len exceeded
Date: Wed, 13 Apr 2005 15:04:36 -0400

        If a link command is longer than $max_cmd_len, libtool currently
breaks up the link command into shorter subcommands by creating
intermediate reloadable object files.  Because of assumptions by libtool,
this does not work on all targets.  Additionally, some targets have the
ability to specify linker input files in a text file specified on the
command line, which is simpler than creating the reloadable object files.

        This patch adds a general libtool feature to specify input files
in a separate file, one input file per line, and uses that feature, if it
is enabled, when the command line is too long.  This patch also augments
libtool configure to enable that feature on AIX 4 and AIX 5.

        This feature is necessary for GCC to build libgfortran in some AIX
configurations.

        I would like to apply this feature to libtool so that it can be
backported to libtool in GCC.

Thanks, David


        * config/ltmain.m4sh (func_mode_link): If command exceeds
        max_cmd_len and file_list_spec exists, write list of input files
        to temporary file.
        * m4/libtool.m4 (_LT_LINKER_SHLIBS, aix[45]): Define file_list_spec.
        (_LT_LANG_CXX_CONFIG, aix[45]): Define file_list_spec.

Index: config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v
retrieving revision 1.60
diff -c -p -r1.60 ltmain.m4sh
*** config/ltmain.m4sh  7 Apr 2005 17:58:26 -0000       1.60
--- config/ltmain.m4sh  13 Apr 2005 18:36:17 -0000
*************** EOF
*** 5091,5096 ****
--- 5091,5110 ----
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
          :
+       elif test "X$file_list_spec" != X; then
+         # Write list of input files to temporary file.
+         filelist=$output_objdir/ltfilelist-$$
+         for obj in $libobjs
+         do
+           $echo $obj >> $filelist
+         done
+         eval libobjs=\"$file_list_spec$filelist\"
+         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+           cmds=$archive_expsym_cmds
+         else
+           cmds=$archive_cmds
+         fi
+         eval cmds=\"\$cmds~rm $filelist\"
        else
          # The command line is too long to link in one step, link piecewise
          # or, if using GNU ld and skipped_export is not :, use a linker
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.181
diff -c -p -r1.181 libtool.m4
*** m4/libtool.m4       12 Apr 2005 17:28:48 -0000      1.181
--- m4/libtool.m4       13 Apr 2005 18:36:17 -0000
*************** _LT_EOF
*** 3838,3843 ****
--- 3838,3844 ----
        _LT_TAGVAR(hardcode_direct, $1)=yes
        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
        _LT_TAGVAR(link_all_deplibs, $1)=yes
+       _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
  
        if test "$GCC" = yes; then
        case $host_os in aix4.[[012]]|aix4.[[012]].*)
*************** if test "$_lt_caught_CXX_error" != yes; 
*** 4808,4813 ****
--- 4809,4815 ----
          _LT_TAGVAR(hardcode_direct, $1)=yes
          _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
          _LT_TAGVAR(link_all_deplibs, $1)=yes
+         _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
  
          if test "$GXX" = yes; then
            case $host_os in aix4.[[012]]|aix4.[[012]].*)




reply via email to

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