This is the mail archive of the gcc@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]

Re: ar: arg list too long


> On Thu, Jan 25, 2001 at 02:51:25PM -0500, Roger Collins wrote:
> > 
> > Still working on making this work on svr4 (UnixWare 2.1).
> > Now I get this:
> > make[4]: execvp: ar: Arg list too long.
> > Any ideas?

I was faced with a similar problem on an old vax running ultrix.  The current
version of GNU make exports command line arguments.  This can lead to large
environments in recursive makes.  I wrote a small patch to change this
behaviour.  I have enclosed the patch.

Another technique with GNU make is to include MAKEOVERRIDES= on the
command line.  This prevents the command line arguments from being
added to the variable MAKEFLAGS which is also exported.  A patch to
do this was recently added to the gcc Makefile.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-01-16  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* file.c (snap_deps): Add special target .EXPORT_COMMAND_VARIABLES.
	* variable.c (export_command_variables): New variable.
	(target_environment): Don't export command line variables unless
	export_command_variables is true.
	* variable.h (export_command_variables): Prototype.

--- file.c.orig	Tue Jun 20 10:00:16 2000
+++ file.c	Tue Jan 16 15:18:19 2001
@@ -509,6 +509,10 @@
   if (f != 0 && f->is_target)
     export_all_variables = 1;
 
+  f = lookup_file (".EXPORT_COMMAND_VARIABLES");
+  if (f != 0 && f->is_target)
+    export_command_variables = 1;
+
   f = lookup_file (".IGNORE");
   if (f != 0 && f->is_target)
     {
--- variable.c.orig	Fri May 19 12:36:08 2000
+++ variable.c	Tue Jan 16 15:42:51 2001
@@ -573,7 +573,7 @@
   define_variable ("+F", 2, "$(notdir $+)", o_automatic, 1);
 }
 
-int export_all_variables;
+int export_all_variables, export_command_variables;
 
 /* Create a new environment for FILE's commands.
    If FILE is nil, this is for the `shell' function.
@@ -668,6 +668,10 @@
 		      && v->origin != o_env && v->origin != o_env_override)
 		    continue;
 
+		  if (! export_all_variables && ! export_command_variables
+		      && v->origin == o_command)
+		    continue;
+
 		  if (*p != '_' && (*p < 'A' || *p > 'Z')
 		      && (*p < 'a' || *p > 'z'))
 		    continue;
--- variable.h.orig	Thu Feb 24 13:59:14 2000
+++ variable.h	Tue Jan 16 15:11:47 2001
@@ -135,3 +135,5 @@
 extern char **target_environment PARAMS ((struct file *file));
 
 extern int export_all_variables;
+
+extern int export_command_variables;

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