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]
Other format: [Raw text]

Re: Build failure on hppa1.1-hp-hpux10.20: Arg list too long

[Get raw message]
> xgcc: installation problem, cannot exec
> `/xxx/gnu/gcc-3.1/objdir/gcc/collect2': Arg list too long
> </QUOTE>
> 
> Doubtlessly caused by my patch of last Monday:
> 
> 	http://gcc.gnu.org/ml/gcc-cvs/2001-11/msg00285.html

I think so.

> I assumed it to be neutral w.r.t. argument list length, but apparently I
> was mistaken.  I'll try to come up with a fix or else revert the
> libE77.{a|la} part of the patch.

You might look at defining MAKEOVERRIDES in the Makefile.  This can cut
in half the size of the environment exported by make when it runs gcc.  
Enclosed is a patch to pexecute.c to help debug exec failures.

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

--- pexecute.c.orig	Wed Aug  2 18:03:53 2000
+++ pexecute.c	Wed Sep 27 17:14:00 2000
@@ -653,6 +653,7 @@
 
 extern int execv ();
 extern int execvp ();
+extern char **environ;
 
 int
 pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
@@ -663,7 +664,7 @@
      char **errmsg_fmt, **errmsg_arg;
      int flags;
 {
-  int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv);
+  /* int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv); */
   int pid;
   int pdes[2];
   int input_desc, output_desc;
@@ -738,11 +739,31 @@
 	close (last_pipe_input);
 
       /* Exec the program.  */
-      (*func) (program, argv);
+      flags & PEXECUTE_SEARCH ? execvp (program, argv): execv (program, argv);
+      /* (*func) (program, argv); */
 
       fprintf (stderr, "%s: ", this_pname);
       fprintf (stderr, install_error_msg, program);
       fprintf (stderr, ": %s\n", xstrerror (errno));
+      {
+	char * const *p = argv;
+	int i = 0;
+	int total_arg_length = 0;
+	while (*p)
+	  {
+	    int len = strlen (*p);
+	    total_arg_length += len;
+	    fprintf (stderr, "arg%d: len = %u: %s\n", i++, len, *p++);
+	  }
+	for (p = environ; *p;)
+	  {
+	    int len = strlen (*p);
+	    total_arg_length += len;
+	    fprintf (stderr, "arg%d: len = %u: %s\n", i++, len, *p++);
+	  }
+	fprintf (stderr, "Total: %d arguments: %d characters\n", i,
+	  total_arg_length);
+      }
       exit (-1);
       /* NOTREACHED */
       return 0;


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