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

[PATCH] Fix argument line overflow


Hi,

The loop in Makefile:

	echo "static const char *const all_files[] = {" >> tmp-gtyp.h
	gf="$(GTFILES)"; \
	for f in $$gf; do \
	echo "\"$$f\", "; done >> tmp-gtyp.h

yields a segfault on Solaris 2.5.1 because of a too long list in $(GTFILES).

The attached patch splits the list into 2 chunks.  Bootstrapped on 
sparc-sun-solaris2.5.1 and x86_64-suse-linux.  OK for mainline?


2005-06-08  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* Makefile.in (GTFILES2): New variable split from...
	 (GTFILES): ...here.
	(s-gtyp-gen): Treat GTFILES2 the same as GTFILES.
	

-- 
Eric Botcazou
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1501
diff -u -r1.1501 Makefile.in
--- Makefile.in	7 Jun 2005 19:51:21 -0000	1.1501
+++ Makefile.in	8 Jun 2005 06:46:38 -0000
@@ -2634,9 +2634,11 @@
   $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
   $(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \
   $(srcdir)/tree-ssa-operands.h $(srcdir)/tree-ssa-operands.c \
-  $(srcdir)/tree-profile.c $(srcdir)/rtl-profile.c $(srcdir)/tree-nested.c \
-  $(out_file) \
-  @all_gtfiles@
+  $(srcdir)/tree-profile.c $(srcdir)/rtl-profile.c $(srcdir)/tree-nested.c
+
+# $(GTFILES) has grown too big for older systems (e.g. Solaris 2.5.1) with
+# no virtually infinite line support.
+GTFILES2 = $(out_file) @all_gtfiles@
 
 GTFILES_FILES_LANGS = @all_gtfiles_files_langs@
 GTFILES_FILES_FILES = @all_gtfiles_files_files@
@@ -2678,6 +2680,9 @@
 	gf="$(GTFILES)"; \
 	for f in $$gf; do \
 	echo "\"$$f\", "; done >> tmp-gtyp.h
+	gf2="$(GTFILES2)"; \
+	for f in $$gf2; do \
+	echo "\"$$f\", "; done >> tmp-gtyp.h
 	echo " NULL};" >> tmp-gtyp.h
 	echo "static const char *const lang_dir_names[] = { \"c\", " >> tmp-gtyp.h
 	gf="$(GTFILES_LANG_DIR_NAMES)"; \

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