[uClibc]uClibc/mipsel

Erik Andersen andersen at codepoet.org
Sat Feb 16 21:39:11 UTC 2002


On Fri Feb 15, 2002 at 07:17:02PM -0800, Geoffrey Espin wrote:
> 
> > With my patch, to follow, here is my current state for
> > uClibc/mipsel with 2.4.17+sf.net on Korva/Markham VR41xx:
> 
> Here it is.  The two files vfork.c & setjmp_aux.c were lifted
> from glibc.2.2.5 (.4 is same).
> 
> The fix for the pad/stack corruption is:
> 
> OLD    //memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
> NEW   memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));

Well, looks like sa_mask is not always a sigset_t for mips.  So
your fix should be fine.

> This is generic code, and I don't know quite why.  The preceding
> #ifdef __mips__'s for "struct sigaction" is bewildering, so using
> sizeof() on the variable seemed wisest... and eliminated the corruption.
> 
> I did try crt0.S/glibc:start.S stack alig" to no avail.
> If I did it correctly, it didn't make any difference.
> 
> The next pothole is mmap() which hopefully John R. can clarify.

Based on John's email, it looks like mips mmap calling semantics
differs from that of most other arches, so you need to create a 
uClibc/libc/sysdeps/linux/mips/_mmap.c file with just 

    #include <errno.h>
    #include <sys/types.h>
    #include <sys/syscall.h>

    _syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, 
	int, flags, int, fd, __off_t, offset);

That way (since the arch specific stuff comes later in the build)
you will override libc/sysdeps/linux/common/_mmap.o with the mips
specific one.  Want to try the above and see if it works?

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list