uClibc patches for sh-2
Paul Mundt
lethal at linux-sh.org
Wed Oct 18 02:13:50 PDT 2006
On Tue, Oct 17, 2006 at 03:20:07PM +0100, Mark Shinwell wrote:
> Paul Mundt wrote:
> >These bits I don't mind merging, however:
>
> I'm not sure whether you meant "do" or "don't" there :-)
>
I meant the bits regarding the trapa changes I don't have any issue with
;-)
> >>--- Rules.mak (revision 16216)
> >>+++ Rules.mak (working copy)
> >>@@ -345,9 +345,11 @@ ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
> >> # soft float encodings.
> >> ifneq ($(TARGET_ARCH),nios)
> >> ifneq ($(TARGET_ARCH),nios2)
> >>+ifneq ($(CONFIG_SH2),y)
> >> CFLAGS += -msoft-float
> >> endif
> >> endif
> >>+endif
> >
> >This is not really limited to SH-2, unless you know of some -msoft-float
> >patches for the other targets that I'm unaware of.
>
> You're saying that -msoft-float should be excluded for other SH variants
> as well, right? If so, what should be the correct test here?
>
Yes, we don't have any gcc support for any of the targets. I would simply
match ($(TARGET_ARCH),sh) instead. Generally we just don't turn the thing
on, so the issue doesn't really pop up for the other targets.
> >>Index: libc/sysdeps/linux/sh/crt1.S
> >>===================================================================
> >>--- libc/sysdeps/linux/sh/crt1.S (revision 16216)
> >>+++ libc/sysdeps/linux/sh/crt1.S (working copy)
> >>@@ -49,6 +49,11 @@ _start:
> >> mov r15, r6
> >>
> >> /* Push the fini func onto the stack */
> >>+#ifdef __ARCH_HAS_NO_MMU__
> >>+ /* ucLinux doesn't seem to provide a valid loader finalization
> >>+ function pointer. */
> >>+ mov #0, r4
> >>+#endif
> >> mov.l r4, at -r15
> >> mov.l L_fini,r0
> >> mov.l r0, at -r15
> >
> >Can you explain this change in more detail?
>
> I never did get to the bottom of this, although I suspect it's probably
> a kernel bug. The problem was this:
>
> if (__rtld_fini != NULL)
> (__rtld_fini)();
>
> failing in __uClibc_fini. Mike, thanks for the note about the macro.
>
Yes, it certainly looks like this is a bug elsewhere. I would rather not
have the libc hiding kernel bugs. Since we have to fix the kernel still
anyways, we can try and narrow it down there some more, this certainly
doesn't belong in the libc though.
> >>Index: libc/sysdeps/linux/sh/mmap.c
> >>===================================================================
> >>--- libc/sysdeps/linux/sh/mmap.c (revision 16216)
> >>+++ libc/sysdeps/linux/sh/mmap.c (working copy)
> >>@@ -26,9 +26,7 @@
> >> libc_hidden_proto(mmap)
> >>
> >> #ifdef HIOS
> >>-# define __SH_SYSCALL6_TRAPA "0x2E"
> >>-#else
> >>-# define __SH_SYSCALL6_TRAPA "0x15"
> >>+# define __SH_SYSCALL6_TRAPA 0x2E
> >> #endif
> >>
> >> #include <sys/syscall.h>
> >
> >Why?
>
> I'm not sure what you're asking here: this change is just because
> __SH_SYSCALL6_TRAPA will get defined now in bits/syscalls.h to the
> trap base plus six, unless it is predefined (which we use for the HIOS
> case, as before).
>
Ah, that's the part I was missing, thanks.
More information about the uClibc
mailing list