[comp.sys.sun] Lightweight process help

mhyman@sun.com (Marco S. Hyman) (01/18/89)

It is a known problem: bug ID 1011141.  To fix:

 - become root on the machine containing /usr/lib/liblwp.a
 - cp /usr.lib/liblwp.a /usr/lib/liblwp.a.bak
 - cd /tmp
 - Create the file fix.s with two lines:
   .globl REGOFFSET
   REGOFFSET=8
 - cc -c fix.s
 - cp /usr/lib/liblwp.a . (still in /tmp)
 - ar u liblwp.a fix.o
 - mv liblwp.a /usr/lib
 - chmod 644 /usr/lib/liblwp.a
 - ranlib /usr/lib/liblwp.a

This procedure (and a version for Sun-4's) is in the Dec88 Software
Technical Bulletin, Page 2250-2251.

--marc
......
Marco S. Hyman
UUCP:	...!sun!sfsun!hsfmsh!mhyman
Domain:	sfsun!hsfmsh!mhyman@sun.com

schwartz@boulder.colorado.edu (Michael Schwartz) (01/18/89)

In article <982@noao.UUCP>, gillies@noao.edu (Kim Gillies X246) writes:
> ...
> Does anybody know where REGOFFSET lives?

This was a problem with Sun's release -- they forgot to include the file
that contains this symbol in the release.  Release 4.0.1 supposedly fixes
the problem.  In the meantime, you can get around it as follows.

Create a file called lwpfix.s containing
	.globl	REGOFFSET
REGOFFSET = 8

Then, assemble it (cc -c lwpfix.s) and add it to your lwp library:
	ar u /usr/lib/liblwp.a lwpfix.o

(or, of course, you could just link this file in directly with your
program).

That was the fix for Sun 3's.  For Sun 4's, put the following in lwpfix.s
and add the assembled file to your library:
	.globl	SP_OFFSET
	.globl	PC_OFFSET
	.globl	Y_OFFSET
	.globl	G2_OFFSET
	.globl	O0_OFFSET
	.globl	CKSTKOVERHEAD
SP_OFFSET = 64
PC_OFFSET = 72
Y_OFFSET = 84
G2_OFFSET = 16
O0_OFFSET = 40
CKSTKOVERHEAD = 10240

 - Mike Schwartz
   Dept. of Computer Science
   U. Colorado - Boulder