uClibc patches for sh-2

Mark Shinwell shinwell at codesourcery.com
Tue Oct 17 14:20:07 UTC 2006


Paul Mundt wrote:
> These bits I don't mind merging, however:

I'm not sure whether you meant "do" or "don't" there :-)

>> --- 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?

>> 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.

>> 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).

Mark



More information about the uClibc mailing list