This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

ltconfig test for max cmd args slightly broken


The ltconfig test in the gcc 3.0 branch has a couple of minor problems.

For one thing, it subtracts the 1/4 safety factor instead of adding it.

It also fails to self terminate at around 1M as the comment implies.

This patch fixes it for me:

Index: ltconfig
===================================================================
RCS file: /cvs/gcc/gcc/ltconfig,v
retrieving revision 1.15.4.4
diff -u -r1.15.4.4 ltconfig
--- ltconfig	2001/04/20 09:27:24	1.15.4.4
+++ ltconfig	2001/05/10 22:52:35
@@ -777,6 +777,7 @@
 can_build_shared="$ac_cv_prog_cc_can_build_shared"
 
 # find the maximum length of command line arguments
+# Note: len = ((6 * 2**i) + 1) * 1.25
 echo "$progname:780: finding the maximum length of command line arguments" 1>&5
 echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6
 if test "${lt_cv_sys_max_cmd_len+set}" = set; then
@@ -787,7 +788,7 @@
   while test `$CONFIG_SHELL $0 --fallback-echo "X$testring" >/dev/null 2>&1` == `echo "X$testring" >/dev/null 2>&1` &&
           new_result=`expr "X$testring" : ".*" 2>&1` &&
           lt_cv_sys_max_cmd_len=$new_result &&
-          test $i != 32 # 1 MB should be enough
+          test $i != 18 # 1572865 should be enough
   do
     i=`expr $i + 1`
     testring=$testring$testring
@@ -796,7 +797,7 @@
   # add a significant safety factor because C++ compilers can tack on massive amounts
   # of additional arguments before passing them to the linker.  1/4 should be good.
   len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-  lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len`
+  lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len + $len`
 fi
 echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5
 echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]