Compiling GNU cc-1.37.1 under IRIX 3.3.1

Knobi der Rechnerschrat XBR2D96D at DDATHD21.BITNET
Wed Oct 31 20:33:15 AEST 1990


Hallo,

  I've fianlly succeded in installing GNU CC 1.37.1 (from prep.ai.mit.edu)
under IRIX 3.3.1. I had to change 7 files in the distribution. I've
included my diffs at the end of this message. Maybe someone with more
knowledge of gcc may have a look at them to see whether something is
missing or totally wrong.

 The main breakthrough (compared to my earlier mail) was the handling of
varargs. It turns out, that under 3.3.1 'va_list' is (depending on the exist-
ence of symbol _VA_ALIST_) typedefed in several instances (stdio.h, stdarg.h,
varargs.h). The solution was to move all occurences of "gvarargs.h" above
<stdio.h> and to define _VA_ALIST_ in va-mips.h for the SGI. This may
mean that you always have to include varags.h before stdio.h when using gcc.
(Question to SGI: Is it possible to keep the definition of va_list totally
in varargd.h ?).

 I've also changed the set of gcc-cpp's predefined symbols to conform with
the SGI cpp. I hope my list is complete. (Question: is there a way to tell
cpp to dump all its predefined symbols?).


Regards
Martin Knoblauch

TH-Darmstadt
Physical Chemistry 1
Petersenstrasse 20
D-6100 Darmstadt, FRG

BITNET: <XBR2D96D at DDATHD21>
-------------------------gcc-diffs for IRIX 3.3.1-------------------------
*** emit-rtl.oc Fri Feb  2 23:51:21 1990
--- emit-rtl.c  Tue Oct 30 15:39:57 1990
***************
*** 35,40 ****

  #include "config.h"
- #include <stdio.h>
  #include "gvarargs.h"
  #include "rtl.h"
  #include "regs.h"
--- 35,40 ----

  #include "config.h"
  #include "gvarargs.h"
+ #include <stdio.h>
  #include "rtl.h"
  #include "regs.h"
*** gcc.oc      Sat Jan  6 22:24:32 1990
--- gcc.c       Tue Oct 30 15:29:01 1990
***************
*** 118,121 ****
--- 118,122 ----
  */

+ #include "gvarargs.h"
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 125,129 ****
  #include "config.h"
  #include "obstack.h"
- #include "gvarargs.h"

  #ifdef USG
--- 126,129 ----
*** tree.oc     Tue Oct  3 05:01:09 1989
--- tree.c      Tue Oct 30 15:29:11 1990
***************
*** 34,41 ****

  #include "config.h"
  #include <stdio.h>
  #include "tree.h"
  #include "obstack.h"
- #include "gvarargs.h"
  #include "flags.h"

--- 34,41 ----

  #include "config.h"
+ #include "gvarargs.h"
  #include <stdio.h>
  #include "tree.h"
  #include "obstack.h"
  #include "flags.h"

*** stddef.oh   Thu Sep 21 06:00:22 1989
--- stddef.h    Tue Oct 30 14:31:12 1990
***************
*** 8,15 ****
  /* Unsigned type of `sizeof' something.  */

! #ifndef _SIZE_T       /* in case <sys/types.h> has defined it. */
! #define _SIZE_T
  typedef unsigned long size_t;
! #endif /* _SIZE_T */

  /* A null pointer constant.  */
--- 8,16 ----
  /* Unsigned type of `sizeof' something.  */

! /* _SIZE_T_ for _SIZE_T in  IRIX 3.3.1 */
! #ifndef _SIZE_T_      /* in case <sys/types.h> has defined it. */
! #define _SIZE_T_
  typedef unsigned long size_t;
! #endif /* _SIZE_T_ */

  /* A null pointer constant.  */
*** va-mips.oh  Wed Apr  5 22:26:50 1989
--- va-mips.h   Tue Oct 30 15:30:40 1990
***************
*** 7,10 ****
--- 7,15 ----
  /* ---------------------------------------- */

+ /* This is for IRIX 3.3.1 , M. Knoblauch */
+ #ifdef sgi
+ #define _VA_LIST_
+ #endif
+
  /* WARNING: THIS depends heavily on in register parameter
     passing conventions of the MIPS.  This is compatible with MIPS
*** config/tm-iris.oh   Tue Aug 29 22:28:58 1989
--- config/tm-iris.h    Wed Oct 31 08:28:48 1990
***************
*** 6,10 ****
  #define CPP_PREDEFINES "-Dunix -Dmips"
  #undef CPP_SPEC
! #define CPP_SPEC "-Dsgi -DSVR3 -Dhost_mips -DMIPSEB -DSYSTYPE_SYSV -DLANGUAGE_
C"

  #define STARTFILE_SPEC  \
--- 6,11 ----
  #define CPP_PREDEFINES "-Dunix -Dmips"
  #undef CPP_SPEC
! #define CPP_SPEC "-Dsgi -DSVR3 -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SYSV\
!  -D_SYSTYPE_SYSV -DLANGUAGE_C -D_LANGUAGE_C -D__EXTENSIONS__"

  #define STARTFILE_SPEC  \
*** config/xm-iris.oh   Mon Jul 24 22:58:12 1989
--- config/xm-iris.h    Wed Oct 31 08:29:25 1990
***************
*** 7,11 ****
  #define bcmp(a,b,c) memcmp (a,b,c)

! #ifdef __GNUC__
! #define alloca(n) __builtin_alloca(n)
! #endif
--- 7,13 ----
  #define bcmp(a,b,c) memcmp (a,b,c)

! /* already defined in xm-mips.h , M. Knoblauch
!  #ifdef __GNUC__
!  #define alloca(n) __builtin_alloca(n)
!  #endif
! */
----------------------------end of diffs------------------------------------



More information about the Comp.sys.sgi mailing list