libtool-patches
[Top][All Lists]
Advanced

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

[PATCH] Increase "Safety factor" when ARG_MAX is less than 40KB.


From: Peter O'Gorman
Subject: [PATCH] Increase "Safety factor" when ARG_MAX is less than 40KB.
Date: Tue, 02 Sep 2008 10:50:33 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Hi,

On an hpux10.20 system with ARG_MAX at 20KB, we still got "Arg list too
long" when linking. It worked when I edited the libtool script and set
max_cmd_len to 10K instead of 15.

For systems with a large value of ARG_MAX, setting max_cmd_len to 75%
still seems reasonable though.

Ok to push?

Peter
-- 
Peter O'Gorman
http://pogma.com
>From 87f8effdad00f84ffdd27803ac01fbd0e64d935d Mon Sep 17 00:00:00 2001
From: Peter O'Gorman <address@hidden>
Date: Tue, 2 Sep 2008 10:43:52 -0500
Subject: [PATCH] Increase "Safety factor" when ARG_MAX is less than 40KB.

* libltdl/m4/libtool.m4 (LT_CMD_MAX_LEN): set max_cmd_len to 50% of ARG_MAX if 
ARG_MAX is < 40KB, otherwise, set to 75%.
---
 ChangeLog             |    7 +++++++
 libltdl/m4/libtool.m4 |    6 +++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index af1f78b..07ece6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-02  Peter O'Gorman  <address@hidden>
+
+       Increase "Safety factor" when ARG_MAX is less than 40KB.
+
+       * libltdl/m4/libtool.m4 (LT_CMD_MAX_LEN): set max_cmd_len to 50%
+       of ARG_MAX if ARG_MAX is < 40KB, otherwise, set to 75%.
+
 2008-09-01  Peter O'Gorman  <address@hidden>
 
        Revert 75142db4f8afc65ba7aae0ed80ea0b35bd9cc382 (AIX libltdl
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 39ba996..34151ef 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1580,7 +1580,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+      if test $lt_cv_sys_max_cmd_len -gt 20480; then
+        lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+      else
+        lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 2`
+      fi
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-- 
1.5.4.1


reply via email to

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