[comp.sys.mips] libraries and -G 0

alex@otter.acslab.umbc.edu (Alex S. Crain) (03/02/90)

	I'm trying to build the Andrew Toolkit on a DecStation and I'm
having some trouble. The Andrew Toolkit (An X toolkit from CMU) is
based on dynamic loading. One of the restriction of dynamic loading is
that the loaded objects are not able to use the GP register because
the linking is done incrementally, some of it after the executable is
created. This means that any libraries used to create loaded objects
(or linked to by the loaded objects) must not use the gp register.

	The usual solution to this problem is to have two sets of
libraries, one compiled -G 8 (Or a suitable default) and another -G 0
(No global pointer data), the latter having a _G0 suffix to the name.
On our 5400, for example, there is a library /usr/lib/libm_G0.a in
addition to the normal libm.a.

	Unfortunately, the _G0 suffix is misleading in this case,
because lib_G0.a is a symlink to libm.a which is *not* compiled -G 0
(why?), and in any case, there is no libc_G0.a or crt0_G0.o to
complete the set.

	Having source, I can (and have) generated libc_G0.a and
libm_G0.a, but it seems that source for crt0.o was not supplied. It is
possible that DEC (or Mips?) could provide these animals to ultrix
sites? This problem has cropped up on the andrew mailing list several
times so it is likely that it would be useful to others as well.
	
	Failing that, can some kind soul from mips send me a
description of what cdr0.s is supposed to look like, so that I can
write a suitable replacement? I don't intend to profile the code so I
only need the bare bones.

	ThanX in advance.

-- 
#################################		:alex.
#Disclamer: Anyone who agrees   #    University of Maryland Baltimore County
#with me deserves what they get.#	alex@umbc3.umbc.edu
#################################	


#################################		:alex.
#Disclamer: Anyone who agrees   #    University of Maryland Baltimore County
#with me deserves what they get.#	alex@umbc3.umbc.edu
#################################