VAX Ultrix bootstrap failure with gcc-2.96

John David Anglin dave@hiauly1.hia.nrc.ca
Fri Jun 2 10:31:00 GMT 2000


> > The $ in identifier messages are complaining about lines like
> > 
> > #if     defined(__GFLOAT) || CC$gfloat
> > 
> > which occur in limits.h (syslimits.h) and math.h in the gcc include
> > directory.  The identifier CC$gfloat is something the VAX ANSI C
> > compiler defines.  Probably, this should be nuked when the includes
> > are fixed.  It obviously isn't needed in the gcc include directory.
> 
> I agree.  Could you come up with an entry for inclhack.def?  It will
> be easier for you since you have access to the header files.  I'll
> guess at an appropriate pattern:
> 
> fix = {
>   hackname = vax_math_ifdefs;
>   files = limits.h;
>   files = math.h;
>   select = "^#if.*||[ \t]+CC$[a-z]+";
>   sed = "/^#if/s/||[ \t][ \t]*CC$[a-z][a-z]*//g";
> };
> 
> This will undoubtedly need refinement to do the right thing in all cases.

Here is a patch for the above and also a number of other include hacks
which I have found over the years.  I have tried to ensure that the additions
will not conflict with headers on other systems.  In some cases, it is
possible select is overly restrictive.

The VAX Ultrix version of float.h contains the identifier CC$gfloat.  However,
float.h is replaced by a version generated by enquire.  The enquire version
doesn't contain GFLOAT support.  I will try to build a GFLOAT version
of enquire and merge the two if possible.  It should be a good test of
the GFLOAT capability of gcc.

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

--- sys-protos.h.orig	Wed Dec 16 15:58:24 1998
+++ sys-protos.h	Fri Jun  2 13:00:45 2000
@@ -445,7 +445,11 @@
 extern struct group *         getgrent(void);
 extern struct group *         getgrgid(gid_t);
 extern struct group *         getgrnam(const char *);
+#ifdef bsd4_2 /* ??? */
+extern int                    getgroups(int, int *);
+#else
 extern int                    getgroups(int, gid_t *);
+#endif
 extern struct hostent *       gethostbyaddr(/* ??? */);
 extern struct hostent *       gethostbyname(/* ??? */);
 extern struct hostent *       gethostent(/* ??? */);
--- fixinc/inclhack.def.orig	Fri Jun  2 10:43:12 2000
+++ fixinc/inclhack.def	Fri Jun  2 13:07:36 2000
@@ -517,6 +517,65 @@
 
 
 /*
+ *  The VAX Ultrix 4.3 file limits.h is a symbolic link to sys/limits.h.
+ *  Replace limits.h with a file that includes sys/limits.h.
+ */
+fix = {
+    hackname = AAB_ultrix_limits;
+    files    = limits.h;
+    mach     = "vax-*-ultrix*";
+    replace  =
+'/*	@(#)limits.h				*/
+/* This file was generated by fixincludes	*/
+\#ifndef _LIMITS_INCLUDED
+\#define _LIMITS_INCLUDED
+\#include <sys/limits.h>
+\#endif /* _LIMITS_INCLUDED */
+';
+};
+
+
+/*
+ *  The VAX ULTRIX 4.3 version of memory.h duplicates definitions
+ *  present in strings.h.  Replace memory.h with a file that includes
+ *  strings.h to prevent problems from multiple inclusion.
+ */
+fix = {
+    hackname = AAB_ultrix_memory;
+    files    = memory.h;
+    mach     = "vax-*-ultrix*";
+    replace  =
+'/*	@(#)memory.h				*/
+/* This file was generated by fixincludes	*/
+\#ifndef _MEMORY_INCLUDED
+\#define _MEMORY_INCLUDED
+\#include <strings.h>
+\#endif /* _MEMORY_INCLUDED */
+';
+};
+
+
+/*
+ *  The VAX Ultrix 4.3 file string.h is a symbolic link to strings.h.
+ *  Replace string.h link with a file that includes strings.h to prevent
+ *  problems from multiple inclusion.
+ */
+fix = {
+    hackname = AAB_ultrix_string;
+    files    = string.h;
+    mach     = "vax-*-ultrix*";
+    replace  =
+'/*	@(#)string.h				*/
+/* This file was generated by fixincludes	*/
+\#ifndef _STRING_INCLUDED
+\#define _STRING_INCLUDED
+\#include <strings.h>
+\#endif /* _STRING_INCLUDED */
+';
+};
+
+
+/*
  *  sys/wait.h on AIX 3.2.5 puts the declaration of wait3 before the
  *  definition of struct rusage, so the prototype added by fixproto fails.
  */
@@ -1495,7 +1554,9 @@
 fix = {
     hackname = nested_ultrix;
     files    = rpc/svc.h;
+    files    = sys/ioctl.h;
     sed      = "s@^\\( \\*\tint protocol;  \\)/\\*@\\1*/ /*@";
+    sed      = "/^\\/\\* #define SIOCSCREEN/s@/\\* screend@*//* screend@";
 };
 
 
@@ -2695,6 +2756,24 @@
 
 
 /*
+ *  Add missing prototype for lstat and define for S_ISLNK
+ *  in Ultrix V4.3 sys/stat.h.
+ */
+fix = {
+    hackname = ultrix_stat;
+    files  = sys/stat.h;
+    select = "@\\(#\\)stat\\.h.*6\\.1.*\\(ULTRIX\\)";
+    sed    = "/^#define[ \t]S_IFPORT[ \t]*S_IFIFO$/a\\\n"
+		"\\\n"
+		"/* macro to test for symbolic link */\\\n"
+		"#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)\\\n"
+		"\n";
+    sed    = "/^[ \t]*fstat(),$/a\\\n"
+		"\tlstat(),\n";
+};
+
+
+/*
  *  Check for superfluous `static' (in Ultrix 4.2)
  *  On Ultrix 4.3, includes of other files (r3_cpu.h,r4_cpu.h) is broken.
  */
@@ -2709,6 +2788,21 @@
 
 
 /*
+ *  Add once-only latch to Ultrix V4.3 strings.h.
+ */
+fix = {
+    hackname = ultrix_strings;
+    files  = strings.h;
+    select = "@\\(#\\)strings\\.h.*6\\.1.*\\(ULTRIX\\)";
+    sed    = "/^#ifndef[ \t]_SIZE_T_$/i\\\n"
+		"#ifndef _STRINGS_INCLUDED\\\n"
+		"#define _STRINGS_INCLUDED\n";
+    sed    = "/^#endif.*__STDC__.*\\/$/a\\\n"
+		"#endif /* _STRINGS_INCLUDED */\n";
+};
+
+
+/*
  *  Fix multiple defines for NULL.  Sometimes, we stumble into \r\n
  *  terminated lines, so accommodate these.  Test both ways.
  */
@@ -2791,6 +2885,19 @@
 };
 
 
+/*
+ * Strip "|| CC$gfloat" from VAX Ultrix math headers.
+ */
+fix = {
+  hackname = vax_ultrix_math_ifdef;
+  files = float.h;
+  files = math.h;
+  files = sys/limits.h;
+  select = "^#if.*\\|\\|[ \t]+CC\\$[a-z]+";
+  sed = "/^#if/s/||[ \t][ \t]*CC$[a-z][a-z]*//";
+};
+
+
 /*
  *  Make VxWorks header which is almost gcc ready fully gcc ready.
  */


More information about the Gcc-patches mailing list