[comp.windows.x] SUN4 frustrations!

x-window@uni-paderborn.de (X-Window (TARGON/SUN)) (05/04/90)

In article <4507@uceng.UC.EDU> schriste@uceng.UC.EDU (Steven V. Christensen) writes:

   AAARRRRGGGGHHH!!!

   After getting the X11R4 release, complete with fixes 1-11, I tried
   to compile it for my SparcStation 4.0.3.

   Hurrah! Everything compiled!

   I typed "xinit", and great!! I got the grey screen and X cursor, along with
   the xterm window.

   I tried the TMW manager, and there my joys ended. I got:

   xinit:  connection to X server lost.

   and the world shut down (i.e. I was logged off).

[...]

   I know zilch about the Xsun code; could someone please tell me
   what I can do to fix this?

When I compiled X11R4 the first time on a Sparc with gcc, I had
exactly the same problem. Even if I only tried to start xlogo, the
server crashed.  I don't know the real reason for the problem, but I
fixed it by saying

#define ServerCcCmd cc
#define ServerCDebugFlags -O

in mit/config/site.def  (and another make World :-)). I tried gcc
without optimization and gcc -g too, but with the same bad results.
With cc we had no problems with the server. On our Sun 3/50's is it
possible to use gcc without any problem. 

If anyone knows, how to use gcc for compiling the server, please let
me know.
	
Thanks, Swen

--
Swen Th"ummler
X-Window Betreuung
Universit"at Paderborn
swen@informatik.uni-paderborn.de

TRANLE@INTELLICORP.COM (Minh Tran-Le) (05/07/90)

> When I compiled X11R4 the first time on a Sparc with gcc, I had
> exactly the same problem. Even if I only tried to start xlogo, the
> server crashed.  I don't know the real reason for the problem, but I
> fixed it by saying
> 
> #define ServerCcCmd cc
> #define ServerCDebugFlags -O
> 
> in mit/config/site.def  (and another make World :-)). I tried gcc
> without optimization and gcc -g too, but with the same bad results.
> With cc we had no problems with the server. On our Sun 3/50's is it
> possible to use gcc without any problem. 
> 
> If anyone knows, how to use gcc for compiling the server, please let
> me know.
> 	
> Thanks, Swen
> 

The sun4 gcc version seems to have trouble with returning structures
(-fpcc-struct-return) in a way that is compatible with sun4 cc program.  With
that incompatibility the X server will break when it tries to access the rgb
database with the ndbm functions.

There is a few solutions to that problem:

1) use sun standard cc compiler with -O2 to get the maximum optimization out of
   it. 

2) If you have the source code to the dbm library then just recompile it with
   the gcc compiler.

3) You can use the gnu gdbm library which provide ndbm functionality but the
   database file produced has different format.

4) find out all the calls to ndbm functions in the server code and compile them
   with the standard cc compiler.

Minh Tran-Le.

arpanet: tranle@intellicorp.com
uucp:    ..sun!icmv!mtranle
-------

guy@auspex.auspex.com (Guy Harris) (05/09/90)

>1) use sun standard cc compiler with -O2 to get the maximum optimization out of
>   it. 

Err, umm:

	1) "-O" is equivalent to "-O2" in SunOS 4.x on a SPARC-based
	   machine;

	2) "the maximum optimization" is "-O4", although, to quote the
	   manual page, "neither -O3 nor -O4 should be used when
	   compiling either device drivers, or programs that modify
	   external variables from within signal handlers;" I don't know
	   if that'll break any X11 code or not.

BTW, if you have a 68K-based Sun and are running 4.0[.x], it might be
interesting to see what performance difference results from compiling
with "-O2" ("-O" is equivalent to "-O2" in 4.1 on 68K-based machines);
it worked when I tried it, but I didn't do any performance comparison.

kaleb@mars.jpl.nasa.gov (Kaleb Keithley) (05/09/90)

In article <3322@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>1) use sun standard cc compiler with -O2 to get the maximum optimization out of
>>   it. 
>
>Err, umm:
>	2) "the maximum optimization" is "-O4", although, to quote the
>	   manual page, "neither -O3 nor -O4 should be used when
>	   compiling either device drivers, or programs that modify
>	   external variables from within signal handlers;" I don't know
>	   if that'll break any X11 code or not.

I have compiled the entire R4 (mit tape) with -O4 on my Sun SS1; the only 
gotcha was MenuButton.c in the Athena widgets, which broke the optimizer 
and had to be "hand" compiled at -O2.  I have over a month now, and nothing 
has broken yet.

kaleb@mars.jpl.nasa.gov            Jet Propeller Labs
Kaleb Keithley

spelling and grammar flames > /dev/null