🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Raj Manandhar Tue, 01 Sep 1992 23:22
gcc 1.41 Ultrix/VAX configuration bug
#1038
Author: Raj Manandhar
Date: Tue, 01 Sep 1992 23:22
95 lines
4292 bytes
I installed gcc 1.41 (obtained in diff form along with gcc-1.40 from
prep.ai.mit on the 29th of August) on a DEC VAXStation II running
Ultrix 3.1 (sorry). There is a bug in the file config/tm-vax.h, which
is included in config/tm-ultrix.h, which is what the symlink tm.h
points to, and a bug in either gcc.c or config/tm-ultrix.h.

The bug in config/tm-vax.h is a curly-brace closing problem in the
define LIB_SPEC. It did not exist in gcc 1.40, which did not make this
define. There isn't a lot of documentation for specs other than the
comments in the source, so I am not sure if my fix preserves the
intent, but at least the compiler driver runs. Here is a patch:

--- config/tm-vax.h~	Sat Aug 29 10:51:54 1992
+++ config/tm-vax.h	Sun Aug 30 20:16:33 1992
@@ -30,8 +30,8 @@
    Note that there are no profiling libraries for g-format.  */
 
 #define LIB_SPEC "%{mg:%{lm:-lmg} -lcg \
-  %{p:%eprofiling not supported with -mg\n\
-  %{pg:%eprofiling not supported with -mg\n}\
+  %{p:%eprofiling not supported with -mg\n}\
+  %{pg:%eprofiling not supported with -mg\n}}\
  %{!mg:%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
 
 /* Print subsidiary information on the compiler version in use.  */


The second bug is related to line 4 of config/tm-ultrix.h, which looks
like:

#define CPP_PREDEFINES " -Dvax -Dunix -Dultrix -Dbsd4_2 -D__vax -D__unix -D__ultrix -D__bsd4_2"

You'll notice the leading space in the string. There was no such space
in gcc1.40, which also did not have some of the predefines here.
Unfortunately, the gcc.c is not very intelligent in parsing this
string when used in a %P spec, so that gcc ends up trying to run
gcc-cpp with arguments that correctly include CPP_PREDEFINES with
double underscores appropriately prefixed and suffixed, but
incorrectly begin with a single isolated double underscore caused by
the leading space. gcc-cpp considers this double underscore to be the
input file name, which results in an illegal argument combination when
it gets to the input and output file names that gcc specifies when
calling gcc-cpp.  The quick fix is to remove the leading blank. I took
this to be a bug in gcc.c, though, so here is a patch to make it only
put in double underscores when defining:

--- gcc.c.orig	Mon Aug 31 17:04:40 1992
+++ gcc.c	Mon Aug 31 16:30:47 1992
@@ -1331,6 +1331,7 @@
 	      char *x = (char *) alloca (strlen (CPP_PREDEFINES) * 2 + 1);
 	      char *buf = x;
 	      char *y = CPP_PREDEFINES;
+	      static int in_def=0, have_spc=0;
 
 	      /* Copy all of CPP_PREDEFINES into BUF,
 		 but put __ after every -D and at the end of each arg,  */
@@ -1338,6 +1339,7 @@
 		{
 		  if (! strncmp (y, "-D", 2))
 		    {
+		      in_def = 1;
 		      *x++ = '-';
 		      *x++ = 'D';
 		      *x++ = '_';
@@ -1346,8 +1348,12 @@
 		    }
 		  else if (*y == ' ' || *y == 0)
 		    {
-		      *x++ = '_';
-		      *x++ = '_';
+		      if (in_def)
+			{
+			  in_def = 0;
+			  *x++ = '_';
+			  *x++ = '_';
+		        }
 		      if (*y == 0)
 			break;
 		      else


I'm not sure why I put the have_spc flag in; maybe you can do
something useful with it.

I discovered these problems when making gnulib and the stage 1
compiler. With these patches I am able to go all the way up to the
stage 3 compiler without any problems, so I think gcc 1.41 now works.

Despite these minor problems, I would like to say that previous
versions of gcc that I have used on the Sun worked very well. Thanks
for some excellent products.

Raj Manandhar (617) 495-8348 or -2038           raj@cfa272.harvard.edu
Harvard-Smithsonian Center for Astrophysics     ...!harvard!cfa272!raj
60 Garden Street, Cambridge, MA 02138           raj%cfa272@cfa.bitnet
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads