[uClibc] runtime fix for correct casts
Alan Hourihane
alanh at fairlite.demon.co.uk
Thu Feb 5 11:56:38 UTC 2004
On Wed, Feb 04, 2004 at 07:36:18PM -0700, Manuel Novoa III wrote:
> Hello,
>
> On Wed, Feb 04, 2004 at 10:10:44PM +0000, Alan Hourihane wrote:
> > I need this to build correctly on 64bit platforms.
> >
> > Alan.
> >
> > --- extra/locale/gen_wctype.c.old 2004-02-04 22:08:55.000000000 +0000
> > +++ extra/locale/gen_wctype.c 2004-02-04 22:09:00.000000000 +0000
> > @@ -442,8 +442,8 @@
> > }
> > wct[c/2] |= d;
> >
> > - l = towlower(c) - c;
> > - u = towupper(c) - c;
> > + l = (long)(int) towlower(c) - c;
> > + u = (long)(int) towupper(c) - c;
> > ult[c] = 0;
> > if (l || u) {
> > if ((l != (short)l) || (u != (short)u)) {
>
> Well, I'll apply it for now. But if all goes well, by April the world
> will finally be rid of this truly awful code. :-)
I also need these to build correctly on alpha.
Alan.
--- libc/sysdeps/linux/common/llseek.c.old 2004-02-05 09:33:01.000000000 +0000
+++ libc/sysdeps/linux/common/llseek.c 2004-02-05 09:32:49.000000000 +0000
@@ -49,14 +49,13 @@
return(loff_t)(INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32),
(off_t) (offset & 0xffffffff), &result, whence) ?: result);
}
-weak_alias(__libc_lseek64, llseek)
-weak_alias(__libc_lseek64, lseek64)
#else
extern __off_t __libc_lseek(int fildes, off_t offset, int whence);
loff_t __libc_lseek64(int fd, loff_t offset, int whence)
{
return(loff_t)(__libc_lseek(fd, (off_t) (offset & 0xffffffff), whence));
}
-weak_alias(__libc_lseek, llseek)
-weak_alias(__libc_lseek, lseek64)
#endif
+weak_alias(__libc_lseek64, llseek)
+weak_alias(__libc_lseek64, lseek64)
+
--- libc/sysdeps/linux/alpha/brk.S.old 2004-02-05 11:49:06.000000000 +0000
+++ libc/sysdeps/linux/alpha/brk.S 2004-02-05 11:53:27.000000000 +0000
@@ -24,16 +24,17 @@
#include <features.h>
#define _ERRNO_H
#include <bits/errno.h>
+#include <sys/syscall.h>
#ifdef __PIC__
.section .bss
.align 3
- .globl __curbrk
-__curbrk: .skip 8
- .type __curbrk, at object
- .size __curbrk,8
+ .globl ___brk_addr
+___brk_addr: .skip 8
+ .type ___brk_addr, at object
+ .size ___brk_addr,8
#else
-.comm __curbrk, 8
+.comm ___brk_addr, 8
#endif
.text
@@ -70,9 +71,9 @@
xor $16, $0, $1
bne $1, $err0
- /* Update __curbrk and return cleanly. */
+ /* Update ___brk_addr and return cleanly. */
mov $31, $0
-$ok: stq $16, __curbrk
+$ok: stq $16, ___brk_addr
addq $30, 8, $30
ret
More information about the uClibc
mailing list