From: dbarnett@cs.tamu.edu (David Barnett)
Newsgroups: comp.sys.ibm.pc.rt,gnu.gcc.help
Subject: problem making gcc for RT, AIX 2.2.1
Summary: Assembly language output not recognized by my assembler.
Date: 14 Apr 92 23:16:50 GMT
Followup-To: comp.sys.ibm.pc.rt
Organization: Texas A&M University

I inherited an IBM PC/RT 6151-115 that was lying around the office, and
am trying to configure it with some useful software, starting with gcc.

Has anyone successfully built gcc 2.1 for the RT running AIX 2.2.1?  Am
I a fool for trying?

The configuration files that come with gcc seem to assume that the RT
will have AOS and the HighC (hc) compiler.  My system has neither -- it
uses AIX 2.2.1 and the bundled compiler.

I tweaked the config files as described below, and ran "make LANGUAGES=c".

There were a couple of "statement not reached" warnings in insn-emit.c,
which the installation notes say to ignore.  Other than that, the
compilation ran cleanly until it reached libgcc2.a.  The makefile used
the newly created gcc to compile libgcc2.c, but the assembler choked on
the output, emitting many "Invalid instruction mnemonic" errors before
giving up.

I suspect that gcc is targeting a different assembler than what I have,
but I don't know much about what's available for the RT.  Any help will
be greatly appreciated.


Here are the changes that I made to the config files:

First, I changed the 'configure' script to use my modified files:

*** configure.in	Tue Apr 14 14:48:51 1992
--- configure	Tue Apr 14 14:50:00 1992
***************
*** 592,597 ****
--- 592,602 ----
  		xm_file=xm-a29kunix.h
  		xmake_file=x-a29kunix
  		;;
+ 	romp-*-aix*)
+ 		xm_file=xm-romp-aix.h
+ 		tm_file=romp.h
+ 		xmake_file=x-romp-aix
+ 		;;
  	romp-*-aos*)
  		xm_file=xm-romp.h
  		tm_file=romp.h


Then, I changed the x-romp file so that it doesn't expect hc, and so that
the make will use the alloca distributed with gcc, and to increase cc's
symbol table size as suggested by someone whom I can't remember now.

*** x-romp	Wed Dec 11 05:48:00 1991
--- x-romp-aix	Tue Apr 14 17:18:50 1992
***************
*** 2,8 ****
  # being used.  -Hnocpp makes hc use its builtin preprocessor instead of
  # /lib/cpp.  gcc doesn't use <sys/ioctl.h>, so it doesn't matter whether
  # fixincludes has been run.
! CC=hc -Hnocpp
  
  # The default `make' on the RT doesn't define MAKE, so do it here.
  MAKE=make
--- 2,14 ----
  # being used.  -Hnocpp makes hc use its builtin preprocessor instead of
  # /lib/cpp.  gcc doesn't use <sys/ioctl.h>, so it doesn't matter whether
  # fixincludes has been run.
! #CC=hc -Hnocpp
  
  # The default `make' on the RT doesn't define MAKE, so do it here.
  MAKE=make
+ 
+ # No alloca in the AIX 2.2.1 libc.a, so use Doug Gwyn's portable version.
+ ALLOCA=alloca.o
+ 
+ # To prevent "symbol table full" errors
+ CFLAGS = -Nn5000 -Nd5000


And last, I created xm-romp-aix.h:
----------------------- begin xm-romp-aix.h -------------------
#include "xm-romp.h"

#define USG   /* Not sure this is really correct, but it
               * prevents cccp.c from trying to call getrlimit(),
               * which AIX 2.2.1 doesn't have.
               */

#ifndef __GNUC__
#define USE_C_ALLOCA
#define ONLY_INT_FIELDS
#endif
----------------------- end xm-romp-aix.h ---------------------

--
David Barnett
dbarnett@cs.tamu.edu
Newsgroups: comp.sys.ibm.pc.rt