[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to compile AKCL for a SUN 3 using OS 4.0



Hi,

	A few days ago I sent a message to this list requesting
information on how to compile AKCL 1.79 on a SUN 3 running SUN OS 4.0.
I received one response from pc@linus.mitre.org (thanks by the way),
who suggested that I add "-Bstatic" to the CC definition in
h/sun3.defs in order to turn off the link with shared libraries which
has been made the default.  I tried to do that and ran into what at
this time appears to be a bug in the SUN C compiler and/or assembler
which resulted in hundreds of error messages from the assembler during
the 2nd compilation of cmpnew/cmptop.c.  The rest of this message
describes some of the other things I that tried and my final solution.

	I turned my attentions towards the possibility of using
various combinations of GNU software as replacements for the SUN
software.  The GNU 1.25 assembler did not like the code generated by
the SUN 4.0 C compiler.  I did not want to use GCC 1.30 on just that
file because I was uncertain about whether or not structures where
being passed (an incompatibility between the GNU & SUN compiler).  A
complete GNU system (compiler, assembler, and linker) doesn't work,
apparently because of a new symbol (__DYNAMIC) that SUN added to
/lib/crt0.o to indicate whether an executable uses shared libraries.
Using the GNU compiler and assembler also doesn't work because the SUN
linker still tries to link the executable with the shared library and
GCC doesn't understand the "-Bstatic" flag that SUN uses to tell the
linker to turn this off.  My solution was to make a special version of
the gcc driver program with "-Bstatic" the default.  To do this,
change the LINK_SPEC entry in gcc's config-sun4.h to the following and
remake only the gcc driver (from gcc.c).

#define LINK_SPEC "%{!e*:-e start} -dc -dp -Bstatic"

Install this new gcc driver somewhere in your path as gcc.mod and set
CC in h/sun3.defs to CC = gcc.mod ...  You can then go ahead and
compile AKCL as instructed in the README file.  The result
(eventually) is a saved_kcl which appears to be completely functional.

	I have already contacted SUN about the problem with their
software and hope to have at least a confirmation of the existence of
this bug shortly.

				Bill Bogstad
				bogstad@crabcake.cs.jhu.edu
				wjb@cogsci.psy.jhu.edu