[comp.windows.x] Gcc doesn't compile X11R4

strauss@AEROSPACE.AERO.ORG (04/08/90)

In article <55317@lll-winken.LLNL.GOV> you write:
>
>I am sure that someone out there has successfully installed X with
>gcc, and I would love to hear how you did it.  All the installation
>instructions claim large performance improvements if one uses the gcc
>compiler; are these for real?  
>

Well, I haven't done benchmarks, but I have compiled R4 using gcc, so I
will present what information I can.

First, I used gcc-1.37.1 on our Sun3s running SunOS 4.0.3. There are a
few things to be aware of:
	1) To compile with gcc all you need to do is make sure the line
HasGCC YES is in your sun.cf and gcc is in your normal paths.
	2) You must have run the "fixincludes" script that comes with
gcc. This makes a second copy of your include directory in
../lib/gcc-include which has replacement versions of several of the
header files. Basically, the script looks for certain "bad" sequences
in the header files that will break gcc, it then duplicates the header
and corrects the problem. It doesn't change your original sources and
only gcc looks in gcc-include so there is nothing to worry about when
you run them.
	3) If you use the gnu loader (gcc-ld) you will get statically
linked binaries. I have gcc-ld installed because you HAVE to use it for
g++. In order to compile I have to take out gcc-ld do the make then put
it back before any of our g++ users notice. ;-)
	4) This has been talked about many times, but the way SunOS
4.0.3 (fixed in 4.1 *sigh*) does shared libraries on set{u,g}id programs
is a little strange. If you don't place the libraries in /usr/lib then
they won't be found. I didn't want my /usr/lib cluttered up, so I
didn't place mine there. My solution was to statically link xterm and
xload to get around those problems. I did this by changing the Imakefile
for both of these to add -Bstatic for cc and -static for GCC, but you
could just relink by hand.
	5) It seems that puzzle and xterm (when you switch into Tek
mode) write to non-writable string constants. CC doesn't mind, but GCC
does, so the program crashes. I made minor modifications to the
Imakefiles to add -fwriteable-strings, to get around this problem.

That worked just fine for me. The compilation builds the libraries with
cc so that it can make the shared object format. The rest of the system
builds with GCC and I have no problems. Feel free to contact me via
email if you have further questions.

							- |Daryll

-------------------------------------------------------------------------------
Daryll Strauss          			f	The Aerospace Corp.
strauss@aero.org		      		n	Mail Stop: M1-102
...!uunet!aero.org!strauss			o	P.O. Box 92957
                                                r       Los Angeles, Ca. 90009
Suggestions for a quote to the address above.	d	(213) 336-9358
-------------------------------------------------------------------------------