Sophie

Sophie

distrib > * > 2009.0 > i586 > by-pkgid > 69e379c1c6a70ccc68c06279b36857c2 > files > 12

liblwp-devel-2.3-4mdv2009.0.i586.rpm

Some quick notes related to porting LWP to new platforms.

    src/process.S
	Support switching process stacks.

    src/lwp.c
	The lwp_stackbase is terribly dependent on how a process's memory is
	laid out. i.e. What address ranges are used by dynamic libraries,
	memory mapped files, the process stack, the process text and data
	segments etc.

Shared libraries are tested to work for i386, mips, sparc, and alpha
platforms.

The common problem is that either entry into savecontext or savecontext
calling back to the C-code generates a segfault. This is caused by mixing
of PIC with non-PIC (position independent code). When 'testlwp-static 1'
works fine, but 'testlwp 1' does not, check the assembly output generated
for the following C-code to see where the process.S assembly might break the
C-procedure calling convention for position independent code.

-call.c-------------------------------------
/* gcc -S -DPIC -fPIC -c call.c -o call.s */
void call(void (*fn)(void)) { fn(); }
--------------------------------------------