diff options
author | Jan Seidel <tuxus@gentoo.org> | 2003-01-23 21:53:00 +0000 |
---|---|---|
committer | Jan Seidel <tuxus@gentoo.org> | 2003-01-23 21:53:00 +0000 |
commit | 72213475f06fde33e3fc73ec2e03db3e00b7446d (patch) | |
tree | 099d1c3799b91ea6e745ca9f39c79e4999bca5ad /sys-libs/glibc | |
parent | A linux distribution isn't complete without elm? (diff) | |
download | historical-72213475f06fde33e3fc73ec2e03db3e00b7446d.tar.gz historical-72213475f06fde33e3fc73ec2e03db3e00b7446d.tar.bz2 historical-72213475f06fde33e3fc73ec2e03db3e00b7446d.zip |
Add a MIPS patch
Diffstat (limited to 'sys-libs/glibc')
-rw-r--r-- | sys-libs/glibc/ChangeLog | 5 | ||||
-rw-r--r-- | sys-libs/glibc/files/2.3.1/glibc-2.3.1-inline-syscall-mips.patch | 268 | ||||
-rw-r--r-- | sys-libs/glibc/glibc-2.3.1-r3.ebuild | 4 |
3 files changed, 137 insertions, 140 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog index e43d84f6221a..463ea9aa750c 100644 --- a/sys-libs/glibc/ChangeLog +++ b/sys-libs/glibc/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for sys-libs/glibc # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.39 2003/01/15 23:14:06 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.40 2003/01/23 21:53:00 tuxus Exp $ + + 23 Jan 2003; Jan Seidel <tuxus@gentoo.org> glibc-2.3.1-r3.ebuild : + Add MIPS inline-syscall-mips patch 16 Jan 2003; Martin Schlemmer <azarah@gentoo.org> glibc-2.3.1-r3.ebuild : diff --git a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-inline-syscall-mips.patch b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-inline-syscall-mips.patch index 4ec07a387678..deee1c2df9ec 100644 --- a/sys-libs/glibc/files/2.3.1/glibc-2.3.1-inline-syscall-mips.patch +++ b/sys-libs/glibc/files/2.3.1/glibc-2.3.1-inline-syscall-mips.patch @@ -1,159 +1,160 @@ -Index: sysdeps/unix/sysv/linux/mips/sysdep.h -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/mips/sysdep.h,v -retrieving revision 1.2 -diff -u -u -r1.2 sysdep.h --- libc/sysdeps/unix/sysv/linux/mips/sysdep.h 6 Jul 2001 04:56:18 -0000 1.2 -+++ libc/sysdeps/unix/sysv/linux/mips/sysdep.h 21 Oct 2002 10:33:16 -0000 -@@ -33,4 +33,243 @@ ++++ libc/sysdeps/unix/sysv/linux/mips/sysdep.h 13 Jan 2003 20:35:27 -0000 +@@ -33,4 +33,242 @@ # define SYS_ify(syscall_name) __NR_/**/syscall_name #endif ++#ifndef __ASSEMBLER__ ++ ++/* Define a macro which expands into the inline wrapper code for a system ++ call. */ +#undef INLINE_SYSCALL -+#define INLINE_SYSCALL(name, nr, args...) inline_syscall##nr(name, args) ++#define INLINE_SYSCALL(name, nr, args...) \ ++ ({ INTERNAL_SYSCALL_DECL(err); \ ++ long result_var = INTERNAL_SYSCALL (name, err, nr, args); \ ++ if ( INTERNAL_SYSCALL_ERROR_P (result_var, err) ) \ ++ { \ ++ __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err)); \ ++ result_var = -1L; \ ++ } \ ++ result_var; }) ++ ++#undef INTERNAL_SYSCALL_DECL ++#define INTERNAL_SYSCALL_DECL(err) long err ++ ++#undef INTERNAL_SYSCALL_ERROR_P ++#define INTERNAL_SYSCALL_ERROR_P(val, err) ((long) (err)) + -+#define __SYSCALL_CLOBBERS "$1", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25" ++#undef INTERNAL_SYSCALL_ERRNO ++#define INTERNAL_SYSCALL_ERRNO(val, err) (val) + -+#define inline_syscall0(name,dummy...) \ ++#undef INTERNAL_SYSCALL ++#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args) ++ ++#define internal_syscall0(name, err, dummy...) \ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a3 asm("$7"); \ -+ unsigned long _sys_result; \ ++ long _sys_result; \ + \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "li\t$2, %2\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set reorder" \ -+ : "=&r" (__v0), "=r" (__a3) \ ++ : "=r" (__v0), "=r" (__a3) \ + : "i" (SYS_ify(name)) \ -+ : "$4", "$5", "$6", __SYSCALL_CLOBBERS); \ -+ \ -+ if ( __a3 ) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ : __SYSCALL_CLOBBERS); \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + -+#define inline_syscall1(name,arg1) \ ++#define internal_syscall1(name, err, arg1) \ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a0 asm("$4") = (unsigned long) arg1; \ -+ register unsigned long __a3 asm("$7"); \ -+ unsigned long _sys_result; \ ++ long _sys_result; \ + \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a0 asm("$4") = (long) arg1; \ ++ register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "li\t$2, %3\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set reorder" \ -+ : "=&r" (__v0), "=r" (__a3) \ ++ : "=r" (__v0), "=r" (__a3) \ + : "r" (__a0), "i" (SYS_ify(name)) \ -+ : "$5", "$6", __SYSCALL_CLOBBERS); \ -+ \ -+ if ( __a3 ) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ : __SYSCALL_CLOBBERS); \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + -+ -+ -+#define inline_syscall2(name,arg1,arg2) \ ++#define internal_syscall2(name, err, arg1, arg2) \ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a0 asm("$4") = (unsigned long) arg1; \ -+ register unsigned long __a1 asm("$5") = (unsigned long) arg2; \ -+ register unsigned long __a3 asm("$7"); \ -+ unsigned long _sys_result; \ ++ long _sys_result; \ + \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a0 asm("$4") = (long) arg1; \ ++ register long __a1 asm("$5") = (long) arg2; \ ++ register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "li\t$2, %4\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set\treorder" \ -+ : "=&r" (__v0), "=r" (__a3) \ ++ : "=r" (__v0), "=r" (__a3) \ + : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \ -+ : "$6", __SYSCALL_CLOBBERS); \ -+ \ -+ if ( __a3 ) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ : __SYSCALL_CLOBBERS); \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + -+#define inline_syscall3(name,arg1,arg2,arg3) \ ++#define internal_syscall3(name, err, arg1, arg2, arg3) \ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a0 asm("$4") = (unsigned long) arg1; \ -+ register unsigned long __a1 asm("$5") = (unsigned long) arg2; \ -+ register unsigned long __a2 asm("$6") = (unsigned long) arg3; \ -+ register unsigned long __a3 asm("$7"); \ -+ unsigned long _sys_result; \ -+ \ ++ long _sys_result; \ ++ \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a0 asm("$4") = (long) arg1; \ ++ register long __a1 asm("$5") = (long) arg2; \ ++ register long __a2 asm("$6") = (long) arg3; \ ++ register long __a3 asm("$7"); \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "li\t$2, %5\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set\treorder" \ -+ : "=&r" (__v0), "=r" (__a3) \ ++ : "=r" (__v0), "=r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ + : __SYSCALL_CLOBBERS); \ -+ \ -+ if (__a3 ) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + -+#define inline_syscall4(name,arg1,arg2,arg3,arg4) \ ++#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a0 asm("$4") = (unsigned long) arg1; \ -+ register unsigned long __a1 asm("$5") = (unsigned long) arg2; \ -+ register unsigned long __a2 asm("$6") = (unsigned long) arg3; \ -+ register unsigned long __a3 asm("$7") = (unsigned long) arg4; \ -+ unsigned long _sys_result; \ -+ \ ++ long _sys_result; \ ++ \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a0 asm("$4") = (long) arg1; \ ++ register long __a1 asm("$5") = (long) arg2; \ ++ register long __a2 asm("$6") = (long) arg3; \ ++ register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "li\t$2, %5\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set\treorder" \ -+ : "=&r" (__v0), "+r" (__a3) \ ++ : "=r" (__v0), "+r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \ + : __SYSCALL_CLOBBERS); \ -+ \ -+ if ( __a3 ) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + -+#define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \ ++#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a0 asm("$4") = (unsigned long) arg1; \ -+ register unsigned long __a1 asm("$5") = (unsigned long) arg2; \ -+ register unsigned long __a2 asm("$6") = (unsigned long) arg3; \ -+ register unsigned long __a3 asm("$7") = (unsigned long) arg4; \ -+ unsigned long _sys_result; \ -+ \ ++ long _sys_result; \ ++ \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a0 asm("$4") = (long) arg1; \ ++ register long __a1 asm("$5") = (long) arg2; \ ++ register long __a2 asm("$6") = (long) arg3; \ ++ register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "lw\t$2, %6\n\t" \ @@ -163,29 +164,26 @@ diff -u -u -r1.2 sysdep.h + "syscall\n\t" \ + "addiu\t$29, 32\n\t" \ + ".set\treorder" \ -+ : "=&r" (__v0), "+r" (__a3) \ ++ : "=r" (__v0), "+r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ -+ "m" ((unsigned long)arg5) \ ++ "m" ((long)arg5) \ + : __SYSCALL_CLOBBERS); \ -+ \ -+ if (__a3 != 0) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + -+#define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \ ++#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a0 asm("$4") = (unsigned long) arg1; \ -+ register unsigned long __a1 asm("$5") = (unsigned long) arg2; \ -+ register unsigned long __a2 asm("$6") = (unsigned long) arg3; \ -+ register unsigned long __a3 asm("$7") = (unsigned long) arg4; \ -+ unsigned long _sys_result; \ -+ \ ++ long _sys_result; \ ++ \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a0 asm("$4") = (long) arg1; \ ++ register long __a1 asm("$5") = (long) arg2; \ ++ register long __a2 asm("$6") = (long) arg3; \ ++ register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "lw\t$2, %6\n\t" \ @@ -197,29 +195,26 @@ diff -u -u -r1.2 sysdep.h + "syscall\n\t" \ + "addiu\t$29, 32\n\t" \ + ".set\treorder" \ -+ : "=&r" (__v0), "+r" (__a3) \ ++ : "=r" (__v0), "+r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ -+ "m" ((unsigned long)arg5), "m" ((unsigned long)arg6) \ ++ "m" ((long)arg5), "m" ((long)arg6) \ + : __SYSCALL_CLOBBERS); \ -+ \ -+ if ( __a3 ) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + -+#define inline_syscall7(name,arg1,arg2,arg3,arg4,arg5,arg6,arg7) \ ++#define internal_syscall7(name, err, arg1, arg2, arg3, arg4, arg5, arg6, arg7)\ +({ \ -+ register unsigned long __v0 asm("$2") = SYS_ify(name); \ -+ register unsigned long __a0 asm("$4") = (unsigned long) arg1; \ -+ register unsigned long __a1 asm("$5") = (unsigned long) arg2; \ -+ register unsigned long __a2 asm("$6") = (unsigned long) arg3; \ -+ register unsigned long __a3 asm("$7") = (unsigned long) arg4; \ -+ unsigned long _sys_result; \ -+ \ ++ long _sys_result; \ ++ \ ++ { \ ++ register long __v0 asm("$2"); \ ++ register long __a0 asm("$4") = (long) arg1; \ ++ register long __a1 asm("$5") = (long) arg2; \ ++ register long __a2 asm("$6") = (long) arg3; \ ++ register long __a3 asm("$7") = (long) arg4; \ + __asm__ volatile ( \ + ".set\tnoreorder\n\t" \ + "lw\t$2, %6\n\t" \ @@ -233,19 +228,18 @@ diff -u -u -r1.2 sysdep.h + "syscall\n\t" \ + "addiu\t$29, 32\n\t" \ + ".set\treorder" \ -+ : "=&r" (__v0), "+r" (__a3) \ ++ : "=r" (__v0), "+r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \ -+ "m" ((unsigned long)arg5), "m" ((unsigned long)arg6), \ -+ "m" ((unsigned long)arg7) \ ++ "m" ((long)arg5), "m" ((long)arg6), "m" ((long)arg7) \ + : __SYSCALL_CLOBBERS); \ -+ \ -+ if ( __a3 ) { \ -+ unsigned long _sys_error = __v0; \ -+ __set_errno(_sys_error); \ -+ _sys_result = (unsigned long)(-1); \ -+ } else \ -+ _sys_result = __v0; \ ++ err = __a3; \ ++ _sys_result = __v0; \ ++ } \ + _sys_result; \ +}) + ++#define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", "$25" ++ ++#endif /* __ASSEMBLER__ */ ++ #endif /* linux/mips/sysdep.h */ diff --git a/sys-libs/glibc/glibc-2.3.1-r3.ebuild b/sys-libs/glibc/glibc-2.3.1-r3.ebuild index ff1a6ff40529..b517e855b7d7 100644 --- a/sys-libs/glibc/glibc-2.3.1-r3.ebuild +++ b/sys-libs/glibc/glibc-2.3.1-r3.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r3.ebuild,v 1.2 2003/01/15 23:14:06 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r3.ebuild,v 1.3 2003/01/23 21:53:00 tuxus Exp $ IUSE="nls pic build" @@ -131,7 +131,7 @@ src_unpack() { epatch ${FILESDIR}/${PV}/${P}-elf-machine-rela-mips.patch epatch ${FILESDIR}/${PV}/${P}-exit-syscall-mips.patch epatch ${FILESDIR}/${PV}/${P}-fpu-cw-mips.patch -# epatch ${FILESDIR}/${PV}/${P}-inline-syscall-mips.patch + epatch ${FILESDIR}/${PV}/${P}-inline-syscall-mips.patch epatch ${FILESDIR}/${PV}/${P}-libgcc-compat-mips.patch epatch ${FILESDIR}/${PV}/${P}-librt-mips.patch epatch ${FILESDIR}/${PV}/${P}-tst-rndseek-mips.patch |