This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
SH patches for glibc 2.3.2
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Wed, 26 Mar 2003 09:58:31 -0500
- Subject: SH patches for glibc 2.3.2
I needed three patches to the SH port to get the glibc tests to run. With
them, the results weren't too bad; I wouldn't call them good precisely...
I'm not sure quite how bad they really were because localedef couldn't build
de_DE.UTF-8 or ja_JP.EUC-JP in 32MB of RAM. The compiler ran out of memory
a time or two also.
I know at least these failures were unrelated:
make[1]: *** [/home/testing/sh-glibc/glibc/linuxthreads/tst-cancel-static] Error 1
make[1]: *** [/home/testing/sh-glibc/glibc/resolv/mtrace-tst-leaks] Error 2
make[1]: *** [/home/testing/sh-glibc/glibc/elf/reldep3.out] Error 1
make[1]: *** [/home/testing/sh-glibc/glibc/elf/neededtest.out] Error 4
make[1]: *** [/home/testing/sh-glibc/glibc/elf/neededtest2.out] Error 2
make[1]: *** [/home/testing/sh-glibc/glibc/elf/neededtest3.out] Error 2
make[1]: *** [/home/testing/sh-glibc/glibc/elf/reldep6.out] Error 143
make[1]: *** [/home/testing/sh-glibc/glibc/elf/reldep8.out] Error 134
make[1]: *** [/home/testing/sh-glibc/glibc/elf/circleload1.out] Error 37
make[1]: *** [/home/testing/sh-glibc/glibc/elf/check-textrel.out] Error 1
But at least the system came up and worked now, which it didn't without tese
patches.
Note that I don't actually speak SH assembly very well. If someone from the
SH community is on this list and could look over these patches...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
./
2003-03-26 Daniel Jacobowitz <drow at mvista dot com>
* sysdeps/unix/sysv/linux/sh/sysdep.h (SYSCALL_ERROR_HANDLER): For
bsrf, the label should be on the nop in the delay slot.
* sysdeps/unix/sysv/linux/sh/socket.S (__socket): Save and restore
the pr register around CENABLE/CDISABLE.
linuxthreads/
2003-03-26 Daniel Jacobowitz <drow at mvista dot com>
* sysdeps/unix/sysv/linux/sh/vfork.S (__vfork): Add the GOT address
for a GOT-relative access.
--- glibc-2.3.2/sysdeps/unix/sysv/linux/sh/sysdep.h.orig 2003-03-20 10:36:53.000000000 -0500
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/sh/sysdep.h 2003-03-20 10:37:17.000000000 -0500
@@ -125,8 +125,8 @@
mov r15,r14; \
mov.l 1f,r1; \
bsrf r1; \
- nop; \
- 2: mov r14,r15; \
+ 2: nop; \
+ mov r14,r15; \
lds.l @r15+,pr; \
mov.l @r15+,r1; \
mov.l r1,@r0; \
--- glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S.orig 2003-03-20 15:37:08.000000000 -0500
+++ glibc-2.3.2/linuxthreads/sysdeps/unix/sysv/linux/sh/vfork.S 2003-03-20 16:03:27.000000000 -0500
@@ -27,8 +27,11 @@
ENTRY (__vfork)
#ifdef SHARED
- mov.l .Lpthread_func, r0
- mov.l @(r0,r12), r0
+ mov.l .Lpthread_func, r3
+ mov.l .Lgot, r2
+ mova .Lgot, r0
+ add r2, r0
+ mov.l @(r0,r3), r0
#else
mov.l .Lpthread_create, r0
#endif
@@ -52,6 +55,8 @@
#ifdef SHARED
.Lpthread_func:
.long __libc_pthread_functions at GOTOFF
+.Lgot:
+ .long _GLOBAL_OFFSET_TABLE_
#else
.Lpthread_create:
.weak pthread_create
--- glibc-2.3.2/sysdeps/unix/sysv/linux/sh/socket.S.orig 2003-03-20 17:33:16.000000000 -0500
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/sh/socket.S 2003-03-20 17:36:56.000000000 -0500
@@ -94,7 +94,9 @@
#if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel:
/* Enable asynchronous cancellation. */
+ sts.l pr, @-r15
CENABLE
+ lds.l @r15+, pr
/* Do the system call trap. */
mov #+P(SOCKOP_,socket), r4
@@ -103,7 +105,9 @@
trapa #0x12
mov.l r0,@-r15
+ sts.l pr, @-r15
CDISABLE
+ lds.l @r15+, pr
mov.l @r15+,r0
/* Pop args off the stack */