aboutsummaryrefslogtreecommitdiffstats
path: root/packages/glibc
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.ne>2006-04-08 13:23:29 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-04-08 13:23:29 +0000
commitf24decc21acc22809616447b04103ddaa006e047 (patch)
tree8ac6d242aeb83d6730f7ae1a526cc523cb8625ca /packages/glibc
parentc3c0a5a2a44cbce6162340bb57685d49e1600977 (diff)
downloadopenembedded-f24decc21acc22809616447b04103ddaa006e047.tar.gz
glibc-2.3.5+cvs20051107: add mips nptl fixes
Diffstat (limited to 'packages/glibc')
-rw-r--r--packages/glibc/glibc-cvs-2.3.5/glibc-20051107-localedef_segfault-1.patch56
-rw-r--r--packages/glibc/glibc-cvs-2.3.5/glibc-20051107-mips_nptl-1.patch1059
-rw-r--r--packages/glibc/glibc-cvs-2.3.5/glibc-20051107-remap_update-1.patch26
-rw-r--r--packages/glibc/glibc-cvs/mips_fix.patch114
-rw-r--r--packages/glibc/glibc_2.3.5+cvs20051107.bb157
5 files changed, 1412 insertions, 0 deletions
diff --git a/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-localedef_segfault-1.patch b/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-localedef_segfault-1.patch
new file mode 100644
index 0000000000..ecbf36f772
--- /dev/null
+++ b/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-localedef_segfault-1.patch
@@ -0,0 +1,56 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-09-29
+Initial Package Version: 2.3.2
+Origin: Debian
+Upstream Status: Unknown
+Description: Fixes Segfault when using localdef.
+ This problem is only noticed when using PaX
+ and some architectures besides x86.
+ See debian bug # 231438
+
+
+--- glibc-20050926/locale/programs/3level.h.orig 2005-09-30 06:00:37.000000000 +0000
++++ glibc-20050926/locale/programs/3level.h 2005-09-30 06:01:02.000000000 +0000
+@@ -204,6 +204,42 @@
+ }
+ }
+ }
++
++/* GCC ATM seems to do a poor job with pointers to nested functions passed
++ to inlined functions. Help it a little bit with this hack. */
++#define wchead_table_iterate(tp, fn) \
++do \
++ { \
++ struct wchead_table *t = (tp); \
++ uint32_t index1; \
++ for (index1 = 0; index1 < t->level1_size; index1++) \
++ { \
++ uint32_t lookup1 = t->level1[index1]; \
++ if (lookup1 != ((uint32_t) ~0)) \
++ { \
++ uint32_t lookup1_shifted = lookup1 << t->q; \
++ uint32_t index2; \
++ for (index2 = 0; index2 < (1 << t->q); index2++) \
++ { \
++ uint32_t lookup2 = t->level2[index2 + lookup1_shifted]; \
++ if (lookup2 != ((uint32_t) ~0)) \
++ { \
++ uint32_t lookup2_shifted = lookup2 << t->p; \
++ uint32_t index3; \
++ for (index3 = 0; index3 < (1 << t->p); index3++) \
++ { \
++ struct element_t *lookup3 \
++ = t->level3[index3 + lookup2_shifted]; \
++ if (lookup3 != NULL) \
++ fn ((((index1 << t->q) + index2) << t->p) + index3, \
++ lookup3); \
++ } \
++ } \
++ } \
++ } \
++ } \
++ } while (0)
++
+ #endif
+
+ #ifndef NO_FINALIZE
diff --git a/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-mips_nptl-1.patch b/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-mips_nptl-1.patch
new file mode 100644
index 0000000000..4e1b235cc8
--- /dev/null
+++ b/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-mips_nptl-1.patch
@@ -0,0 +1,1059 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-09-27
+Initial Package Version: 20050919 Snapshot
+Origin: Daniel Jacobwitz
+Upstream Status: Submitted by Origin
+Description: Adds NPTL support for MIPS
+
+diff -Naur glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h
+--- glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h 2005-03-28 09:21:52.000000000 +0000
++++ glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h 2005-09-27 16:15:20.000000000 +0000
+@@ -30,6 +30,8 @@
+ #define FUTEX_WAKE 1
+ #define FUTEX_REQUEUE 3
+ #define FUTEX_CMP_REQUEUE 4
++#define FUTEX_WAKE_OP 5
++#define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE ((4 << 24) | 1)
+
+ /* Initializer for compatibility lock. */
+ #define LLL_MUTEX_LOCK_INITIALIZER (0)
+@@ -39,7 +41,7 @@
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, \
+- (futexp), FUTEX_WAIT, (val), 0); \
++ (long) (futexp), FUTEX_WAIT, (val), 0); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ })
+
+@@ -48,7 +50,7 @@
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, \
+- (futexp), FUTEX_WAIT, (val), (timespec)); \
++ (long) (futexp), FUTEX_WAIT, (val), (timespec));\
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ })
+
+@@ -57,7 +59,7 @@
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 4, \
+- (futexp), FUTEX_WAKE, (nr), 0); \
++ (long) (futexp), FUTEX_WAKE, (nr), 0); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
+ })
+
+@@ -67,11 +69,23 @@
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, \
+- (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
++ (long) (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
+ (nr_move), (mutex), (val)); \
+ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
+ })
+
++/* Returns non-zero if error happened, zero if success. */
++#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2) \
++ ({ \
++ INTERNAL_SYSCALL_DECL (__err); \
++ long int __ret; \
++ \
++ __ret = INTERNAL_SYSCALL (futex, __err, 6, \
++ (futexp), FUTEX_WAKE_OP, (nr_wake), \
++ (nr_wake2), (futexp2), \
++ FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
++ INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
++ })
+
+ static inline int __attribute__((always_inline))
+ __lll_mutex_trylock(int *futex)
+diff -Naur glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h
+--- glibc-20050919.orig/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h 1970-01-01 00:00:00.000000000 +0000
++++ glibc-20050919/nptl/sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h 2005-09-27 16:15:20.000000000 +0000
+@@ -0,0 +1,183 @@
++/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <sysdep.h>
++#include <sysdeps/generic/sysdep.h>
++#include <tls.h>
++#ifndef __ASSEMBLER__
++# include <nptl/pthreadP.h>
++#endif
++#include <sys/asm.h>
++
++/* Gas will put the initial save of $gp into the CIE, because it appears to
++ happen before any instructions. So we use cfi_same_value instead of
++ cfi_restore. */
++
++#ifdef HAVE_ASM_CFI_DIRECTIVES
++# define cfi_same_value .cfi_same_value
++#else
++# define cfi_same_value
++#endif
++
++#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
++
++#ifdef __PIC__
++# undef PSEUDO
++# define PSEUDO(name, syscall_name, args) \
++ .align 2; \
++ L(pseudo_start): \
++ cfi_startproc; \
++ cfi_adjust_cfa_offset (STKSPACE); \
++ cfi_rel_offset (gp, STKOFF_GP); \
++ 99: PTR_LA t9,__syscall_error; \
++ /* manual cpreturn */ \
++ REG_L gp, STKOFF_GP(sp); \
++ cfi_same_value (gp); \
++ RESTORESTK; \
++ jr t9; \
++ .type __##syscall_name##_nocancel, @function; \
++ .globl __##syscall_name##_nocancel; \
++ __##syscall_name##_nocancel: \
++ SAVESTK; \
++ .cpsetup t9, STKOFF_GP, name; \
++ cfi_rel_offset (gp, STKOFF_GP); \
++ li v0, SYS_ify(syscall_name); \
++ syscall; \
++ bne a3, zero, SYSCALL_ERROR_LABEL; \
++ /* manual cpreturn */ \
++ REG_L gp, STKOFF_GP(sp); \
++ cfi_same_value (gp); \
++ RESTORESTK; \
++ ret; \
++ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
++ ENTRY (name) \
++ SAVESTK; \
++ .cpsetup t9, STKOFF_GP, name; \
++ cfi_rel_offset (gp, STKOFF_GP); \
++ SINGLE_THREAD_P(v1); \
++ bne zero, v1, L(pseudo_cancel); \
++ .set noreorder; \
++ li v0, SYS_ify(syscall_name); \
++ syscall; \
++ .set reorder; \
++ bne a3, zero, SYSCALL_ERROR_LABEL; \
++ /* manual cpreturn */ \
++ REG_L gp, STKOFF_GP(sp); \
++ cfi_same_value (gp); \
++ RESTORESTK; \
++ ret; \
++ L(pseudo_cancel): \
++ cfi_adjust_cfa_offset (STKSPACE); \
++ cfi_rel_offset (gp, STKOFF_GP); \
++ REG_S ra, STKOFF_RA(sp); \
++ cfi_rel_offset (ra, STKOFF_RA); \
++ PUSHARGS_##args; /* save syscall args */ \
++ CENABLE; \
++ REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \
++ POPARGS_##args; /* restore syscall args */ \
++ .set noreorder; \
++ li v0, SYS_ify (syscall_name); \
++ syscall; \
++ .set reorder; \
++ REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \
++ REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \
++ REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \
++ CDISABLE; \
++ REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \
++ REG_L ra, STKOFF_RA(sp); /* restore return address */ \
++ REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \
++ bne a3, zero, SYSCALL_ERROR_LABEL; \
++ /* manual cpreturn */ \
++ REG_L gp, STKOFF_GP(sp); \
++ cfi_same_value (gp); \
++ RESTORESTK; \
++ L(pseudo_end):
++
++
++# undef PSEUDO_END
++# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
++
++#endif
++
++# define PUSHARGS_0 /* nothing to do */
++# define PUSHARGS_1 PUSHARGS_0 REG_S a0, STKOFF_A0(sp); cfi_rel_offset (a0, STKOFF_A0);
++# define PUSHARGS_2 PUSHARGS_1 REG_S a1, STKOFF_A1(sp); cfi_rel_offset (a1, STKOFF_A1);
++# define PUSHARGS_3 PUSHARGS_2 REG_S a2, STKOFF_A2(sp); cfi_rel_offset (a2, STKOFF_A2);
++# define PUSHARGS_4 PUSHARGS_3 REG_S a3, STKOFF_A3(sp); cfi_rel_offset (a3, STKOFF_A3);
++# define PUSHARGS_5 PUSHARGS_4 REG_S a4, STKOFF_A4(sp); cfi_rel_offset (a3, STKOFF_A4);
++# define PUSHARGS_6 PUSHARGS_5 REG_S a5, STKOFF_A5(sp); cfi_rel_offset (a3, STKOFF_A5);
++
++# define POPARGS_0 /* nothing to do */
++# define POPARGS_1 POPARGS_0 REG_L a0, STKOFF_A0(sp);
++# define POPARGS_2 POPARGS_1 REG_L a1, STKOFF_A1(sp);
++# define POPARGS_3 POPARGS_2 REG_L a2, STKOFF_A2(sp);
++# define POPARGS_4 POPARGS_3 REG_L a3, STKOFF_A3(sp);
++# define POPARGS_5 POPARGS_4 REG_L a4, STKOFF_A4(sp);
++# define POPARGS_6 POPARGS_5 REG_L a5, STKOFF_A5(sp);
++
++/* Save an even number of slots. Should be 0 if an even number of slots
++ are used below, or SZREG if an odd number are used. */
++# define STK_PAD SZREG
++
++/* Place values that we are more likely to use later in this sequence, i.e.
++ closer to the SP at function entry. If you do that, the are more
++ likely to already be in your d-cache. */
++# define STKOFF_A5 (STK_PAD)
++# define STKOFF_A4 (STKOFF_A5 + SZREG)
++# define STKOFF_A3 (STKOFF_A4 + SZREG)
++# define STKOFF_A2 (STKOFF_A3 + SZREG) /* MT and more args. */
++# define STKOFF_A1 (STKOFF_A2 + SZREG) /* MT and 2 args. */
++# define STKOFF_A0 (STKOFF_A1 + SZREG) /* MT and 1 arg. */
++# define STKOFF_RA (STKOFF_A0 + SZREG) /* Used if MT. */
++# define STKOFF_SC_V0 (STKOFF_RA + SZREG) /* Used if MT. */
++# define STKOFF_SC_ERR (STKOFF_SC_V0 + SZREG) /* Used if MT. */
++# define STKOFF_SVMSK (STKOFF_SC_ERR + SZREG) /* Used if MT. */
++# define STKOFF_GP (STKOFF_SVMSK + SZREG) /* Always used. */
++
++# define STKSPACE (STKOFF_GP + SZREG)
++# define SAVESTK PTR_SUBU sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE)
++# define RESTORESTK PTR_ADDU sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE)
++
++# ifdef IS_IN_libpthread
++# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9
++# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9
++# elif defined IS_IN_librt
++# define CENABLE PTR_LA t9, __librt_enable_asynccancel; jalr t9
++# define CDISABLE PTR_LA t9, __librt_disable_asynccancel; jalr t9
++# else
++# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9
++# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9
++# endif
++
++# ifndef __ASSEMBLER__
++# define SINGLE_THREAD_P \
++ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
++ header.multiple_threads) \
++ == 0, 1)
++# else
++# define SINGLE_THREAD_P(reg) \
++ READ_THREAD_POINTER(reg); \
++ lw reg, MULTIPLE_THREADS_OFFSET(reg)
++#endif
++
++#elif !defined __ASSEMBLER__
++
++# define SINGLE_THREAD_P 1
++# define NO_CANCELLATION 1
++
++#endif
+diff -Naur glibc-20050919.orig/sysdeps/mips/dl-machine.h glibc-20050919/sysdeps/mips/dl-machine.h
+--- glibc-20050919.orig/sysdeps/mips/dl-machine.h 2005-03-28 09:32:04.000000000 +0000
++++ glibc-20050919/sysdeps/mips/dl-machine.h 2005-09-27 16:15:20.000000000 +0000
+@@ -266,13 +266,13 @@
+ " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\
+ # Make sure the stack pointer is aligned for _dl_init_internal.\n\
+ and $2, $29, -2 * " STRINGXP(SZREG) "\n\
+- " STRINGXP(PTR_S) " $29, -4($2)\n\
++ " STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\
+ " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\
+ " STRINGXP(SAVE_GP(16)) "\n\
+ # Call the function to run the initializers.\n\
+ jal _dl_init_internal\n\
+ # Restore the stack pointer for _start.\n\
+- " STRINGXP(PTR_L) " $29, 28($29)\n\
++ " STRINGXP(PTR_L) " $29, 32-" STRINGXP(SZREG) "($29)\n\
+ # Pass our finalizer function to the user in $2 as per ELF ABI.\n\
+ " STRINGXP(PTR_LA) " $2, _dl_fini\n\
+ # Jump to the user entry point.\n\
+@@ -336,28 +336,24 @@
+ # endif
+ {
+ struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
+- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+-
+- if (sym)
+- value += sym->st_value;
+
+ switch (r_type)
+ {
+ case R_MIPS_TLS_DTPMOD64:
+ case R_MIPS_TLS_DTPMOD32:
+ if (sym_map)
+- *(ElfW(Word) *)reloc_addr = sym_map->l_tls_modid;
++ *(ElfW(Addr) *)reloc_addr = sym_map->l_tls_modid;
+ break;
+
+ case R_MIPS_TLS_DTPREL64:
+ case R_MIPS_TLS_DTPREL32:
+- *(ElfW(Word) *)reloc_addr += TLS_DTPREL_VALUE (sym);
++ *(ElfW(Addr) *)reloc_addr += TLS_DTPREL_VALUE (sym);
+ break;
+
+ case R_MIPS_TLS_TPREL32:
+ case R_MIPS_TLS_TPREL64:
+ CHECK_STATIC_TLS (map, sym_map);
+- *(ElfW(Word) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym);
++ *(ElfW(Addr) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym);
+ break;
+ }
+
+diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/bits/socket.h glibc-20050919/sysdeps/unix/sysv/linux/mips/bits/socket.h
+--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/bits/socket.h 2004-12-15 01:00:55.000000000 +0000
++++ glibc-20050919/sysdeps/unix/sysv/linux/mips/bits/socket.h 2005-09-27 16:15:20.000000000 +0000
+@@ -219,10 +219,10 @@
+ socklen_t msg_namelen; /* Length of address data. */
+
+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
+- int msg_iovlen; /* Number of elements in the vector. */
++ size_t msg_iovlen; /* Number of elements in the vector. */
+
+ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
+- socklen_t msg_controllen; /* Ancillary data buffer length. */
++ size_t msg_controllen; /* Ancillary data buffer length. */
+
+ int msg_flags; /* Flags on received message. */
+ };
+@@ -270,8 +270,8 @@
+
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+- if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
+- + __mhdr->msg_controllen)
++ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
++ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+ /* No more entries. */
+@@ -284,13 +284,12 @@
+ <linux/socket.h>. */
+ enum
+ {
+- SCM_RIGHTS = 0x01, /* Transfer file descriptors. */
++ SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
+ #define SCM_RIGHTS SCM_RIGHTS
+ #ifdef __USE_BSD
+- SCM_CREDENTIALS = 0x02, /* Credentials passing. */
++ , SCM_CREDENTIALS = 0x02 /* Credentials passing. */
+ # define SCM_CREDENTIALS SCM_CREDENTIALS
+ #endif
+- __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */
+ };
+
+ /* User visible structure for SCM_CREDENTIALS message */
+diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/Makefile glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/Makefile
+--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/Makefile 1970-01-01 00:00:00.000000000 +0000
++++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/Makefile 2005-09-27 16:15:20.000000000 +0000
+@@ -0,0 +1,9 @@
++ifeq ($(subdir),socket)
++CFLAGS-recv.c += -fexceptions
++CFLAGS-send.c += -fexceptions
++endif
++
++ifeq ($(subdir),nptl)
++CFLAGS-recv.c += -fexceptions
++CFLAGS-send.c += -fexceptions
++endif
+diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 2005-02-25 15:18:12.000000000 +0000
++++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 2005-09-27 16:15:20.000000000 +0000
+@@ -66,22 +66,28 @@
+ #define INTERNAL_SYSCALL_ERRNO(val, err) (val)
+
+ #undef INTERNAL_SYSCALL
+-#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args)
++#define INTERNAL_SYSCALL(name, err, nr, args...) \
++ internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
++ "i" (SYS_ify (name)), err, args)
+
+-#define internal_syscall0(name, err, dummy...) \
++#undef INTERNAL_SYSCALL_NCS
++#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
++ internal_syscall##nr (= number, , "r" (__v0), err, args)
++
++#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
+- register long __a3 asm("$7"); \
++ register long long __v0 asm("$2") ncs_init; \
++ register long long __a3 asm("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %2\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "i" (SYS_ify(name)) \
++ : input \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -89,21 +95,21 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall1(name, err, arg1) \
++#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long long __v0 asm("$2"); \
++ register long long __v0 asm("$2") ncs_init; \
+ register long long __a0 asm("$4") = (long long) arg1; \
+ register long long __a3 asm("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %3\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "r" (__a0), "i" (SYS_ify(name)) \
++ : input, "r" (__a0) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -111,22 +117,22 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall2(name, err, arg1, arg2) \
++#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long long __v0 asm("$2"); \
++ register long long __v0 asm("$2") ncs_init; \
+ register long long __a0 asm("$4") = (long long) arg1; \
+ register long long __a1 asm("$5") = (long long) arg2; \
+ register long long __a3 asm("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %4\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \
++ : input, "r" (__a0), "r" (__a1) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -134,23 +140,23 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall3(name, err, arg1, arg2, arg3) \
++#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long long __v0 asm("$2"); \
++ register long long __v0 asm("$2") ncs_init; \
+ register long long __a0 asm("$4") = (long long) arg1; \
+ register long long __a1 asm("$5") = (long long) arg2; \
+ register long long __a2 asm("$6") = (long long) arg3; \
+ register long long __a3 asm("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %5\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -158,23 +164,23 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \
++#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long long __v0 asm("$2"); \
++ register long long __v0 asm("$2") ncs_init; \
+ register long long __a0 asm("$4") = (long long) arg1; \
+ register long long __a1 asm("$5") = (long long) arg2; \
+ register long long __a2 asm("$6") = (long long) arg3; \
+ register long long __a3 asm("$7") = (long long) arg4; \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %5\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -182,12 +188,12 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \
++#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long long __v0 asm("$2"); \
++ register long long __v0 asm("$2") ncs_init; \
+ register long long __a0 asm("$4") = (long long) arg1; \
+ register long long __a1 asm("$5") = (long long) arg2; \
+ register long long __a2 asm("$6") = (long long) arg3; \
+@@ -195,12 +201,11 @@
+ register long long __a4 asm("$8") = (long long) arg5; \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %5\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
+- "r" (__a4) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -208,12 +213,12 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\
++#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long long __v0 asm("$2"); \
++ register long long __v0 asm("$2") ncs_init; \
+ register long long __a0 asm("$4") = (long long) arg1; \
+ register long long __a1 asm("$5") = (long long) arg2; \
+ register long long __a2 asm("$6") = (long long) arg3; \
+@@ -222,12 +227,12 @@
+ register long long __a5 asm("$9") = (long long) arg6; \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %5\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
+- "r" (__a4), "r" (__a5) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
++ "r" (__a5) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 2005-02-25 15:18:13.000000000 +0000
++++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 2005-09-27 16:15:20.000000000 +0000
+@@ -66,22 +66,28 @@
+ #define INTERNAL_SYSCALL_ERRNO(val, err) (val)
+
+ #undef INTERNAL_SYSCALL
+-#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args)
++#define INTERNAL_SYSCALL(name, err, nr, args...) \
++ internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
++ "i" (SYS_ify (name)), err, args)
+
+-#define internal_syscall0(name, err, dummy...) \
++#undef INTERNAL_SYSCALL_NCS
++#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
++ internal_syscall##nr (= number, , "r" (__v0), err, args)
++
++#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
+- register long __a3 asm("$7"); \
++ register long __v0 asm("$2") ncs_init; \
++ register long __a3 asm("$7"); \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %2\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "i" (SYS_ify(name)) \
++ : input \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -89,21 +95,21 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall1(name, err, arg1) \
++#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
++ register long __v0 asm("$2") ncs_init; \
+ 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" \
++ cs_init \
+ "syscall\n\t" \
+ ".set reorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "r" (__a0), "i" (SYS_ify(name)) \
++ : input, "r" (__a0) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -111,22 +117,22 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall2(name, err, arg1, arg2) \
++#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
++ register long __v0 asm("$2") ncs_init; \
+ 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" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \
++ : input, "r" (__a0), "r" (__a1) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -134,23 +140,23 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall3(name, err, arg1, arg2, arg3) \
++#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
++ register long __v0 asm("$2") ncs_init; \
+ 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" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "=r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -158,23 +164,23 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \
++#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
++ register long __v0 asm("$2") ncs_init; \
+ 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" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -182,12 +188,12 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \
++#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
++ register long __v0 asm("$2") ncs_init; \
+ register long __a0 asm("$4") = (long) arg1; \
+ register long __a1 asm("$5") = (long) arg2; \
+ register long __a2 asm("$6") = (long) arg3; \
+@@ -195,12 +201,11 @@
+ register long __a4 asm("$8") = (long) arg5; \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %5\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
+- "r" (__a4) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+@@ -208,12 +213,12 @@
+ _sys_result; \
+ })
+
+-#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\
++#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
+ ({ \
+ long _sys_result; \
+ \
+ { \
+- register long __v0 asm("$2"); \
++ register long __v0 asm("$2") ncs_init; \
+ register long __a0 asm("$4") = (long) arg1; \
+ register long __a1 asm("$5") = (long) arg2; \
+ register long __a2 asm("$6") = (long) arg3; \
+@@ -222,12 +227,12 @@
+ register long __a5 asm("$9") = (long) arg6; \
+ __asm__ volatile ( \
+ ".set\tnoreorder\n\t" \
+- "li\t$2, %5\t\t\t# " #name "\n\t" \
++ cs_init \
+ "syscall\n\t" \
+ ".set\treorder" \
+ : "=r" (__v0), "+r" (__a3) \
+- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
+- "r" (__a4), "r" (__a5) \
++ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
++ "r" (__a5) \
+ : __SYSCALL_CLOBBERS); \
+ err = __a3; \
+ _sys_result = __v0; \
+diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list
+--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list 2004-07-21 06:13:15.000000000 +0000
++++ glibc-20050919/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list 2005-09-27 16:15:20.000000000 +0000
+@@ -1,16 +1,12 @@
+ # File name Caller Syscall name Args Strong name Weak names
+
+-lseek - lseek i:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
+-
+-# proper socket implementations:
+-recvfrom - recvfrom i:ibniBN __libc_recvfrom __recvfrom recvfrom
+-sendto - sendto i:ibnibn __libc_sendto __sendto sendto
++lseek - lseek Ci:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
+
+ # semaphore and shm system calls
+ msgctl - msgctl i:iip __msgctl msgctl
+ msgget - msgget i:ii __msgget msgget
+-msgrcv - msgrcv i:ibnii __msgrcv msgrcv
+-msgsnd - msgsnd i:ibni __msgsnd msgsnd
++msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
++msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
+ shmat - shmat i:ipi __shmat shmat
+ shmctl - shmctl i:iip __shmctl shmctl
+ shmdt - shmdt i:s __shmdt shmdt
+diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/ptrace.c glibc-20050919/sysdeps/unix/sysv/linux/mips/ptrace.c
+--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/ptrace.c 2004-11-24 04:36:11.000000000 +0000
++++ glibc-20050919/sysdeps/unix/sysv/linux/mips/ptrace.c 1970-01-01 00:00:00.000000000 +0000
+@@ -1,111 +0,0 @@
+-/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004
+- Free Software Foundation, Inc.
+- This file is part of the GNU C Library.
+-
+- The GNU C Library is free software; you can redistribute it and/or
+- modify it under the terms of the GNU Lesser General Public
+- License as published by the Free Software Foundation; either
+- version 2.1 of the License, or (at your option) any later version.
+-
+- The GNU C Library is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- Lesser General Public License for more details.
+-
+- You should have received a copy of the GNU Lesser General Public
+- License along with the GNU C Library; if not, write to the Free
+- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+- 02111-1307 USA. */
+-
+-#include <errno.h>
+-#include <sgidefs.h>
+-#include <sys/types.h>
+-#include <sys/ptrace.h>
+-#include <sys/user.h>
+-#include <stdarg.h>
+-
+-#include <sysdep.h>
+-#include <sys/syscall.h>
+-#include <bp-checks.h>
+-#include <sgidefs.h>
+-
+-#if _MIPS_SIM == _ABIN32
+-__extension__ typedef long long int reg_type;
+-#else
+-typedef long int reg_type;
+-#endif
+-
+-reg_type
+-ptrace (enum __ptrace_request request, ...)
+-{
+- reg_type res, ret;
+- va_list ap;
+- pid_t pid;
+- void *addr;
+- reg_type data;
+-
+- va_start (ap, request);
+- pid = va_arg (ap, pid_t);
+- addr = va_arg (ap, void *);
+- data = va_arg (ap, reg_type);
+- va_end (ap);
+-
+- if (request > 0 && request < 4)
+- data = &ret;
+-
+-#if __BOUNDED_POINTERS__
+- switch (request)
+- {
+- case PTRACE_PEEKTEXT:
+- case PTRACE_PEEKDATA:
+- case PTRACE_PEEKUSER:
+- case PTRACE_POKETEXT:
+- case PTRACE_POKEDATA:
+- case PTRACE_POKEUSER:
+- (void) CHECK_1 ((int *) addr);
+- (void) CHECK_1 ((int *) data);
+- break;
+-
+- case PTRACE_GETREGS:
+- case PTRACE_SETREGS:
+- /* We don't know the size of data, so the best we can do is ensure
+- that `data' is valid for at least one word. */
+- (void) CHECK_1 ((int *) data);
+- break;
+-
+- case PTRACE_GETFPREGS:
+- case PTRACE_SETFPREGS:
+- /* We don't know the size of data, so the best we can do is ensure
+- that `data' is valid for at least one word. */
+- (void) CHECK_1 ((int *) data);
+- break;
+-
+- case PTRACE_GETFPXREGS:
+- case PTRACE_SETFPXREGS:
+- /* We don't know the size of data, so the best we can do is ensure
+- that `data' is valid for at least one word. */
+- (void) CHECK_1 ((int *) data);
+- break;
+-
+- case PTRACE_TRACEME:
+- case PTRACE_CONT:
+- case PTRACE_KILL:
+- case PTRACE_SINGLESTEP:
+- case PTRACE_ATTACH:
+- case PTRACE_DETACH:
+- case PTRACE_SYSCALL:
+- /* Neither `data' nor `addr' needs any checks. */
+- break;
+- };
+-#endif
+-
+- res = INLINE_SYSCALL (ptrace, 4, request, pid,
+- __ptrvalue (addr), __ptrvalue (data));
+- if (res >= 0 && request > 0 && request < 4)
+- {
+- __set_errno (0);
+- return ret;
+- }
+-
+- return res;
+-}
+diff -Naur glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/sys/ptrace.h glibc-20050919/sysdeps/unix/sysv/linux/mips/sys/ptrace.h
+--- glibc-20050919.orig/sysdeps/unix/sysv/linux/mips/sys/ptrace.h 2004-11-24 04:37:35.000000000 +0000
++++ glibc-20050919/sysdeps/unix/sysv/linux/mips/sys/ptrace.h 1970-01-01 00:00:00.000000000 +0000
+@@ -1,136 +0,0 @@
+-/* `ptrace' debugger support interface. Linux version.
+- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004
+- Free Software Foundation, Inc.
+- This file is part of the GNU C Library.
+-
+- The GNU C Library is free software; you can redistribute it and/or
+- modify it under the terms of the GNU Lesser General Public
+- License as published by the Free Software Foundation; either
+- version 2.1 of the License, or (at your option) any later version.
+-
+- The GNU C Library is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- Lesser General Public License for more details.
+-
+- You should have received a copy of the GNU Lesser General Public
+- License along with the GNU C Library; if not, write to the Free
+- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+- 02111-1307 USA. */
+-
+-#ifndef _SYS_PTRACE_H
+-#define _SYS_PTRACE_H 1
+-
+-#include <features.h>
+-#include <sgidefs.h>
+-
+-__BEGIN_DECLS
+-
+-/* Type of the REQUEST argument to `ptrace.' */
+-enum __ptrace_request
+-{
+- /* Indicate that the process making this request should be traced.
+- All signals received by this process can be intercepted by its
+- parent, and its parent can use the other `ptrace' requests. */
+- PTRACE_TRACEME = 0,
+-#define PT_TRACE_ME PTRACE_TRACEME
+-
+- /* Return the word in the process's text space at address ADDR. */
+- PTRACE_PEEKTEXT = 1,
+-#define PT_READ_I PTRACE_PEEKTEXT
+-
+- /* Return the word in the process's data space at address ADDR. */
+- PTRACE_PEEKDATA = 2,
+-#define PT_READ_D PTRACE_PEEKDATA
+-
+- /* Return the word in the process's user area at offset ADDR. */
+- PTRACE_PEEKUSER = 3,
+-#define PT_READ_U PTRACE_PEEKUSER
+-
+- /* Write the word DATA into the process's text space at address ADDR. */
+- PTRACE_POKETEXT = 4,
+-#define PT_WRITE_I PTRACE_POKETEXT
+-
+- /* Write the word DATA into the process's data space at address ADDR. */
+- PTRACE_POKEDATA = 5,
+-#define PT_WRITE_D PTRACE_POKEDATA
+-
+- /* Write the word DATA into the process's user area at offset ADDR. */
+- PTRACE_POKEUSER = 6,
+-#define PT_WRITE_U PTRACE_POKEUSER
+-
+- /* Continue the process. */
+- PTRACE_CONT = 7,
+-#define PT_CONTINUE PTRACE_CONT
+-
+- /* Kill the process. */
+- PTRACE_KILL = 8,
+-#define PT_KILL PTRACE_KILL
+-
+- /* Single step the process.
+- This is not supported on all machines. */
+- PTRACE_SINGLESTEP = 9,
+-#define PT_STEP PTRACE_SINGLESTEP
+-
+- /* Get all general purpose registers used by a processes.
+- This is not supported on all machines. */
+- PTRACE_GETREGS = 12,
+-#define PT_GETREGS PTRACE_GETREGS
+-
+- /* Set all general purpose registers used by a processes.
+- This is not supported on all machines. */
+- PTRACE_SETREGS = 13,
+-#define PT_SETREGS PTRACE_SETREGS
+-
+- /* Get all floating point registers used by a processes.
+- This is not supported on all machines. */
+- PTRACE_GETFPREGS = 14,
+-#define PT_GETFPREGS PTRACE_GETFPREGS
+-
+- /* Set all floating point registers used by a processes.
+- This is not supported on all machines. */
+- PTRACE_SETFPREGS = 15,
+-#define PT_SETFPREGS PTRACE_SETFPREGS
+-
+- /* Attach to a process that is already running. */
+- PTRACE_ATTACH = 16,
+-#define PT_ATTACH PTRACE_ATTACH
+-
+- /* Detach from a process attached to with PTRACE_ATTACH. */
+- PTRACE_DETACH = 17,
+-#define PT_DETACH PTRACE_DETACH
+-
+- /* Get all extended floating point registers used by a processes.
+- This is not supported on all machines. */
+- PTRACE_GETFPXREGS = 18,
+-#define PT_GETFPXREGS PTRACE_GETFPXREGS
+-
+- /* Set all extended floating point registers used by a processes.
+- This is not supported on all machines. */
+- PTRACE_SETFPXREGS = 19,
+-#define PT_SETFPXREGS PTRACE_SETFPXREGS
+-
+- /* Continue and stop at the next (return from) syscall. */
+- PTRACE_SYSCALL = 24
+-#define PT_SYSCALL PTRACE_SYSCALL
+-};
+-
+-/* Perform process tracing functions. REQUEST is one of the values
+- above, and determines the action to be taken.
+- For all requests except PTRACE_TRACEME, PID specifies the process to be
+- traced.
+-
+- PID and the other arguments described above for the various requests should
+- appear (those that are used for the particular request) as:
+- pid_t PID, void *ADDR, int DATA, void *ADDR2
+- after REQUEST. */
+-#if _MIPS_SIM == _ABIN32
+-__extension__ extern long long int ptrace
+- (enum __ptrace_request __request, ...) __THROW;
+-#else
+-extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+-#endif
+-
+-__END_DECLS
+-
+-#endif /* _SYS_PTRACE_H */
diff --git a/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-remap_update-1.patch b/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-remap_update-1.patch
new file mode 100644
index 0000000000..c167f1730a
--- /dev/null
+++ b/packages/glibc/glibc-cvs-2.3.5/glibc-20051107-remap_update-1.patch
@@ -0,0 +1,26 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-10-18
+Initial Package Version: 20051017 Snapshot
+Origin: Jim Gifford based on BZ 1458
+Upstream Status: Sent
+Description: Fixes MREMAP_FIXED error that can occur on the MIPS
+ and ALPHA architectures using the current glibc snapshot.
+
+--- glibc-20051017/sysdeps/unix/sysv/linux/alpha/bits/mman.h.orig 2005-10-18 07:07:00.000000000 +0000
++++ glibc-20051017/sysdeps/unix/sysv/linux/alpha/bits/mman.h 2005-10-18 07:07:11.000000000 +0000
+@@ -86,6 +86,7 @@
+ /* Flags for `mremap'. */
+ #ifdef __USE_GNU
+ # define MREMAP_MAYMOVE 1
++# define MREMAP_FIXED 2
+ #endif
+
+ /* Advice to `madvise'. */
+--- glibc-20051017/sysdeps/unix/sysv/linux/mips/bits/mman.h.orig 2005-10-18 06:59:19.000000000 +0000
++++ glibc-20051017/sysdeps/unix/sysv/linux/mips/bits/mman.h 2005-10-18 06:59:51.000000000 +0000
+@@ -89,4 +89,5 @@
+ /* Flags for `mremap'. */
+ #ifdef __USE_GNU
+ # define MREMAP_MAYMOVE 1
++# define MREMAP_FIXED 2
+ #endif
diff --git a/packages/glibc/glibc-cvs/mips_fix.patch b/packages/glibc/glibc-cvs/mips_fix.patch
new file mode 100644
index 0000000000..47e323b231
--- /dev/null
+++ b/packages/glibc/glibc-cvs/mips_fix.patch
@@ -0,0 +1,114 @@
+diff -Naur sysdeps/unix/clock_nanosleep.c sysdeps-patched/unix/clock_nanosleep.c
+--- libc/sysdeps/unix/clock_nanosleep.c 2003-06-25 02:00:04.000000000 +0200
++++ libc/sysdeps-patched/unix/clock_nanosleep.c 2006-02-28 22:16:20.000000000 +0100
+@@ -21,7 +21,7 @@
+ #include <errno.h>
+ #include <time.h>
+ #include <hp-timing.h>
+-#include <sysdep-cancel.h>
++
+
+ #if HP_TIMING_AVAIL
+ # define CPUCLOCK_P(clock) \
+diff -Naur sysdeps/unix/sysv/linux/clock_nanosleep.c sysdeps-patched/unix/sysv/linux/clock_nanosleep.c
+--- libc/sysdeps/unix/sysv/linux/clock_nanosleep.c 2003-06-15 23:21:46.000000000 +0200
++++ libc/sysdeps-patched/unix/sysv/linux/clock_nanosleep.c 2006-02-28 22:16:20.000000000 +0100
+@@ -18,7 +18,7 @@
+
+ #include <time.h>
+
+-#include <sysdep-cancel.h>
++#include <sysdep.h>
+ #include "kernel-features.h"
+
+
+@@ -32,18 +32,7 @@
+ INTERNAL_SYSCALL_DECL (err);
+ int r;
+
+- if (SINGLE_THREAD_P)
+- r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, req, rem);
+- else
+- {
+- int oldstate = LIBC_CANCEL_ASYNC ();
+-
+- r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, req,
+- rem);
+-
+- LIBC_CANCEL_RESET (oldstate);
+- }
+-
++ r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, req, rem);
+ return (INTERNAL_SYSCALL_ERROR_P (r, err)
+ ? INTERNAL_SYSCALL_ERRNO (r, err) : 0);
+ }
+@@ -59,20 +48,15 @@
+ if (!__libc_missing_posix_timers) \
+ { \
+ INTERNAL_SYSCALL_DECL (err); \
+- \
+- int oldstate = LIBC_CANCEL_ASYNC (); \
+- \
+ int r = INTERNAL_SYSCALL (clock_nanosleep, err, 4, clock_id, flags, \
+ req, rem); \
+ \
+- LIBC_CANCEL_RESET (oldstate); \
+- \
+ if (!INTERNAL_SYSCALL_ERROR_P (r, err)) \
+ return 0; \
+ \
+ if (INTERNAL_SYSCALL_ERRNO (r, err) != ENOSYS) \
+ return INTERNAL_SYSCALL_ERRNO (r, err); \
+- \
++ \
+ __libc_missing_posix_timers = 1; \
+ }
+ # endif
+diff -Naur libc_org/sysdeps/mips/Makefile libc/sysdeps/mips/Makefile
+--- libc_org/sysdeps/mips/Makefile 2000-09-06 09:52:59.000000000 +0200
++++ libc/sysdeps/mips/Makefile 2006-02-28 23:31:13.000000000 +0100
+@@ -1,3 +1,7 @@
++ifeq ($(subdir),rt)
++librt-sysdep_routines += rt-sysdep
++endif
++
+ ifeq ($(subdir),misc)
+ sysdep_headers += regdef.h fpregdef.h sys/regdef.h sys/fpregdef.h \
+ sys/asm.h sgidefs.h
+diff -Naur libc_org/sysdeps/mips/rt-sysdep.S libc/sysdeps/mips/rt-sysdep.S
+--- libc_org/sysdeps/mips/rt-sysdep.S 1970-01-01 01:00:00.000000000 +0100
++++ libc/sysdeps/mips/rt-sysdep.S 2006-02-28 23:34:20.000000000 +0100
+@@ -0,0 +1 @@
++#include <sysdep.S>
+diff -Naur libc_org/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h libc/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
+--- libc_org/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h 2003-07-28 20:45:37.000000000 +0200
++++ libc/linuxthreads/sysdeps/unix/sysv/linux/mips/sysdep-cancel.h 2004-08-25 07:55:34.000000000 +0200
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2003 Free Software Foundation, Inc.
++/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Guido Guenther <agx@sigxcpu.org>, 2003.
+
+@@ -118,18 +118,16 @@
+ # define CENABLE la t9, __pthread_enable_asynccancel; jalr t9;
+ # define CDISABLE la t9, __pthread_disable_asynccancel; jalr t9;
+ # define __local_multiple_threads __pthread_multiple_threads
++# elif defined IS_IN_librt
++# define CENABLE la t9, __librt_enable_asynccancel; jalr t9;
++# define CDISABLE la t9, __librt_disable_asynccancel; jalr t9;
++# define __local_multiple_threads __librt_multiple_threads
+ # else
+ # define CENABLE la t9, __libc_enable_asynccancel; jalr t9;
+ # define CDISABLE la t9, __libc_disable_asynccancel; jalr t9;
+ # define __local_multiple_threads __libc_multiple_threads
+ # endif
+
+-# if !defined NOT_IN_libc
+-# define __local_multiple_threads __libc_multiple_threads
+-# else
+-# define __local_multiple_threads __pthread_multiple_threads
+-# endif
+-
+ # ifndef __ASSEMBLER__
+ extern int __local_multiple_threads attribute_hidden;
+ # define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
diff --git a/packages/glibc/glibc_2.3.5+cvs20051107.bb b/packages/glibc/glibc_2.3.5+cvs20051107.bb
new file mode 100644
index 0000000000..61167928d2
--- /dev/null
+++ b/packages/glibc/glibc_2.3.5+cvs20051107.bb
@@ -0,0 +1,157 @@
+DESCRIPTION = "GNU C Library"
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+LICENSE = "LGPL"
+SECTION = "libs"
+PRIORITY = "required"
+MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
+
+FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs-2.3.5"
+CVSDATE = "20051107"
+PR = "r0"
+
+GLIBC_ADDONS ?= "ports,linuxthreads"
+GLIBC_EXTRA_OECONF ?= ""
+
+#
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+#
+# See the note in gcc/gcc_3.4.0.oe
+#
+
+python __anonymous () {
+ import bb, re
+ uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
+ if uc_os:
+ raise bb.parse.SkipPackage("incompatible with target %s" %
+ bb.data.getVar('TARGET_OS', d, 1))
+}
+
+# nptl needs unwind support in gcc, which can't be built without glibc.
+PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', '']['nptl' in '${GLIBC_ADDONS}']}"
+PROVIDES += "virtual/libintl virtual/libiconv"
+DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers"
+RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "cvs://anoncvs@sources.redhat.com/cvs/glibc;module=libc \
+ file://fhs-linux-paths.patch;patch=1 \
+ file://dl-cache-libcmp.patch;patch=1 \
+ file://ldsocache-varrun.patch;patch=1 \
+ file://etc/ld.so.conf \
+ file://generate-supported.mk \
+ file://glibc-20051107-remap_update-1.patch;patch=1;pnum=1 \
+ file://glibc-20051107-localedef_segfault-1.patch;patch=1;pnum=1"
+
+def get_nptl_patches(bb, d):
+ if bb.data.getVar('GLIBC_ADDONS', d, 1) in ['nptl']:
+ return "file://glibc-20051107-mips_nptl-1.patch;patch=1;pnum=1"
+ return ""
+
+SRC_URI_append_mipsel = " ${@get_nptl_patches(bb, d)}"
+
+S = "${WORKDIR}/libc"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+inherit autotools
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+ --without-cvs --disable-profile --disable-debug --without-gd \
+ --enable-clocale=gnu \
+ --enable-add-ons=${GLIBC_ADDONS} \
+ --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
+ --without-selinux \
+ ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
+
+def get_glibc_fpu_setting(bb, d):
+ if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
+ return "--without-fp"
+ return ""
+
+do_munge() {
+ rm -rf ${S}/bits
+}
+
+addtask munge before do_patch after do_unpack
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+ if [ -z "`which rpcgen`" ]; then
+ echo "rpcgen not found. Install glibc-devel."
+ exit 1
+ fi
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ CPPFLAGS="" oe_runconf
+}
+
+rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
+ yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
+ rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
+
+do_compile () {
+ # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+ unset LDFLAGS
+ base_do_compile
+ (
+ cd ${S}/sunrpc/rpcsvc
+ for r in ${rpcsvc}; do
+ h=`echo $r|sed -e's,\.x$,.h,'`
+ rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
+ done
+ )
+}
+
+do_stage() {
+ rm -f ${STAGING_LIBDIR}/libc.so.6
+ oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
+ 'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
+ '${STAGING_LIBDIR}/libc.so.6' \
+ install-headers install-lib
+
+ install -d ${STAGING_INCDIR}/gnu \
+ ${STAGING_INCDIR}/bits \
+ ${STAGING_INCDIR}/rpcsvc
+ install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
+ install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
+ install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
+ for r in ${rpcsvc}; do
+ h=`echo $r|sed -e's,\.x$,.h,'`
+ install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
+ done
+ for i in libc.a libc_pic.a libc_nonshared.a; do
+ install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
+ done
+ echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
+ echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
+
+ rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
+ oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
+ 'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
+ '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
+ install-headers install-lib
+
+ install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
+ ${CROSS_DIR}/${TARGET_SYS}/include/bits \
+ ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
+ install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
+ install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
+ install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
+ for r in ${rpcsvc}; do
+ h=`echo $r|sed -e's,\.x$,.h,'`
+ install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
+ done
+
+ for i in libc.a libc_pic.a libc_nonshared.a; do
+ install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
+ done
+ echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
+ echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
+}
+
+include glibc-package.bbclass