[comp.sys.hp] GCC on HPUX - is it possible?

schultz@mmm.UUCP (John C Schultz) (05/10/89)

Trying to compile GCC 1.34 on HPUX (Version 6.something) fails in
toplev.c seemingly because the macro definitions are too long for the
HPUX compiler.  Does anyone have suggestions? patches? sympathy?

In addition to the normal reasons for using GCC, twm (Tom's Window
Manager) for X11 won't compile under the HPUX compiler and we were
hoping gcc would do better.  

-- 
 john c. schultz   schultz@3M.Com   ..!uiucuxc!mmm!schultz  (612) 733-4047
           3M Center, Bldg 518-1-1, St. Paul, MN 55144-1000
  The opinions expressed herein are, as always, my own and not 3M's.

milburn@me10.lbl.gov (John Milburn) (05/15/89)

In article <1263@mmm.UUCP> schultz@mmm.UUCP (John C Schultz) writes:

>In addition to the normal reasons for using GCC, twm (Tom's Window
>Manager) for X11 won't compile under the HPUX compiler and we were
>hoping gcc would do better.  

I had no problem compiling the X11R3 version of twm using the hpux native
compiler. The binary from this rev works fine with the hp distributed
R2 server.

John Milburn
Lawrence Berkeley Laboratory
INTERNET:  JEMilburn@lbl.gov     UUCP:  {...}!ucbvax!lbl.gov!JEMilburn
DECNet:    LBL::JEMilburn        SnailMail: 1 Cyclotron Road 46-161
Ma Bell:    (415) 486-6969                   Berkeley, Ca. 94720

mev@hpfcdc.HP.COM (Mike Vermeulen) (05/15/89)

> Trying to compile GCC 1.34 on HPUX (Version 6.something) fails in
> toplev.c seemingly because the macro definitions are too long for the
> HPUX compiler.  Does anyone have suggestions? patches? sympathy?

I picked up a copy of gcc 1.34 and tried to make it compile on my hp-ux 6.5
system.  It died with a syntax error in toplev.c.  I narrowed my problem down
to the following:

   1. toplev.c includes /usr/include/sys/param.h which has the following:

	#define FLOAT 		FLOAT_M320
	#define FLOAT_M320 	5

   2. rtl.h includes the following

	#define DEF_RTL_EXPR(ENUM, NAME, FORMAT)   ENUM ,

   3. rtl.def has a long list of uses of DEF_RTL_EXPR including the following
      on line 492:

	DEF_RTL_EXPR(FLOAT, "float", "e")

The combination of these three macros causes the preprocessor to create an
invalid enum declaration:

	enum rtx_code {
	   UNKNOWN,
   	   NIL,
		/*etc*/
	   5,
		/*etc*/
	}

Which the compile complains about.  One simple workaround is to get rid of the
FLOAT name collision by adding #undef FLOAT after the inclusion of
<sys/param.h> in toplev.c.  After doing this my copy of gcc 1.34 compiles
without complaint.

stroyan@hpfcdc.HP.COM (Mike Stroyan) (05/16/89)

> In addition to the normal reasons for using GCC, twm (Tom's Window
> Manager) for X11 won't compile under the HPUX compiler and we were
> hoping gcc would do better.  

I find that hard to imagine.  Until a few weeks ago, (when Tom moved on
to Solbourne), twm was being developed on the HP-UX compiler.

Mike Stroyan, stroyan@hpfcla.hp.com

ross@ziebmef.uucp (Ross Ridge) (05/17/89)

In article <1263@mmm.UUCP> you write:
>Trying to compile GCC 1.34 on HPUX (Version 6.something) fails in
>toplev.c seemingly because the macro definitions are too long for the
>HPUX compiler.  Does anyone have suggestions? patches? sympathy?

Well, I got GCC 1.34 going on an old HP 9000 Series 200 computer
running HP-UX 2.1 (quite different from the 2.1 they had for the 800
series). Our compiler would acctually dump core trying to compile toplev.c
(we managed to convince it to pre-process the file no problems,
however.) Our solution was to cross compile the compiler on another
computer (a VAX running BSD4.3). You probably don't have to go to that
extream with your system. Try using GCC's cpp to pre-process toplev.c
and pass that code to your normal compiler. If you're only having
problems with toplev.c you can make GCC's cpp by entering "make cpp".

>In addition to the normal reasons for using GCC, twm (Tom's Window
>Manager) for X11 won't compile under the HPUX compiler and we were
>hoping gcc would do better.  

Actually the only thing we ever gave our compiler trouble was GCC
itself...

							Ross Ridge
-- 
 l/                   attcan!tmsoft!ziebmef!ross			 //
[OO]                   					                [oo]
-()-                                                                    -()-
 db                     6502 assembly forever!                           //

merworth@cs.utexas.edu (Boyd Merworth) (06/09/89)

In article <5570184@hpfcdc.HP.COM>, stroyan@hpfcdc.HP.COM (Mike Stroyan) writes:
> > In addition to the normal reasons for using GCC, twm (Tom's Window
> > Manager) for X11 won't compile under the HPUX compiler and we were
> > hoping gcc would do better.  
> 
> I find that hard to imagine.  Until a few weeks ago, (when Tom moved on
> to Solbourne), twm was being developed on the HP-UX compiler.
> 
> Mike Stroyan, stroyan@hpfcla.hp.com

I have found, after a loooong discussion with HP, that the optimizer
could be causing several problems under HPUX 6.5.  I missed the first
part of this discussion but have run into several problems when
compiling GNU software.  By turning off optimization, the compiles
worked.  In particular gcc-1.35 and gnu-emacs.  I also run X11R3 which
I built under HPUX 6.5.
-- 
Boyd Merworth
The University of Texas at Austin
Department of Computer Sciences, TAY 2.124, Austin, Texas 78712
merworth@cs.utexas.edu		{harvard,gatech,uunet}!cs.utexas.edu!merworth