[comp.unix.ultrix] GCC/G++ under Ultrix 4.0

mra@srchtec.uucp (Michael Almond) (09/20/90)

In article <574@creatures.cs.vt.edu> lat@creatures.cs.vt.edu (Laurie Zirkle) writes:
>In article <68294@lll-winken.LLNL.GOV> hbrand@lll-crg.llnl.gov (Hal Brand) writes:
>>I am trying to build the GCC 1.37.1 compilier on a DECStation 5000
>>under Ultrix 4.0A.  After editing Makefile and doing a "gcc.config
>>decstation", the "make" dies while cc-ing the file symout.c due to a
>>"typedef unsigned log size_t;" in ./stddef.h. Looking at
>>/usr/include/stdlib.h, I edited ./stddef.h to be conditional on _SIZE_T_
>>instead of _SIZE_T, restarted the make, and everything ran to completion.
>>Doing the "make stage1" also worked. However, doing the:
>>          make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
>>dies quickly. The first thing done is:
>>          stage1/gcc [stuff omitted]  -c    `echo ./gcc.c | sed 's,^\./,,'`
>>This gives the errors:
>>   /usr/include/sys/file.h:125: warning: garbage at end of #ifdef argument
>>   cc1: Invalid option `-g'
>>   In file included from gvarargs.h:9, from gcc.c:127:
>>   va-mips.h:68: conflicting types for `va_list'
>>   /usr/include/stdio.h:154: previous declaration of `va_list'
>>   *** Error code 1
>
>I can't offer you help, but I have run into something similar.  Like you,
>I changed _SIZE_T to SIZE_T_, but I also changed typedef unsigned long size_t
>to typedef unsigned int size_t (I believe that was done for the 3100 - I saw
>a message in the gnu.gcc group a while back to that effect).
>

All of these problems stem from DEC's decision to change its #defines so that
multiple inclusions of .h files does not "double define" various variables, etc.
The va_list problem can be solved by modifying va-mips.h so that the define
around va_list uses _VA_LIST_.  I'm certain that the 5000 problem is the same.
You can use grep on /usr/include to find out what the defines should be based
on what is in the gcc code.

However, if you plan to compile G++ you'll have different problems.  There
is a macro called something like _TXTOFF which uses one argument on the
VAXstations, but uses two on a DECstation.  I don't know enough about these
interal things to know what to give for this second argument, and I'm not
sure where to look to learn what should go there.

If you have problems finding out the #define's for va_list and 5000 stuff,
just let me know and I'll do my best to help you out.

BTW, I posted in the gnu.* groups about the g++ problems and got only one
response from a guy who wants to start an installation and take a crack
at the problems.

Good luck!


---
Michael R. Almond                                 mra@srchtec.uucp (registered)
search technology, inc.                           gatech.edu!stiatl!srchtec!mra
Atlanta, Georgia                                  (404) 441-1457 (work)

mathisen@dali.cs.montana.edu (Jaye Mathisen) (09/21/90)

In article <216@srchtec.UUCP> mra@srchtec.uucp (Michael Almond) writes:
>In article <574@creatures.cs.vt.edu> lat@creatures.cs.vt.edu (Laurie Zirkle) writes:
>>In article <68294@lll-winken.LLNL.GOV> hbrand@lll-crg.llnl.gov (Hal Brand) writes:
>>>I am trying to build the GCC 1.37.1 compilier on a DECStation 5000
>>>under Ultrix 4.0A.  After editing Makefile and doing a "gcc.config
>>>decstation", the "make" dies while cc-ing the file symout.c due to a
>>>"typedef unsigned log size_t;" in ./stddef.h. Looking at
>>>/usr/include/stdlib.h, I edited ./stddef.h to be conditional on _SIZE_T_
>>>instead of _SIZE_T, restarted the make, and everything ran to completion.



Cheap cop-out way that works is to remove/rename the supplied stddef.h, and
use the one supplied with Ultrix 4.0



>>>Doing the "make stage1" also worked. However, doing the:
>>>          make CC=stage1/gcc CFLAGS="-g -O -Bstage1/"
>>>dies quickly. The first thing done is:
>>>          stage1/gcc [stuff omitted]  -c    `echo ./gcc.c | sed 's,^\./,,'`
>>>This gives the errors:
>>>   /usr/include/sys/file.h:125: warning: garbage at end of #ifdef argument

This is because the line is something like:

#ifdef FOO || defined(KERNEL)

and should be

#if defined(FOO) || defined(KERNEL)

I think it's a little creeping ansi-ism...


>>>   cc1: Invalid option `-g'


The -g problem comes from the fact that as far as I know, not too much
work hasa been completed in allowing GCC to mess around with debugging, because
of MIPS's weird Object file format...  Simplest just to not compile with
-g...