patches/glibc/2.3.2/glibc-2.3.2-mips.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.2/glibc-2.3.2-mips.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,60 @@
     1.4 +From Bill Gatliff, who said:
     1.5 +"Attached is a glibc-2.3.2 patchfile I use for MIPS.  Versions prior to and including glibc-2.3.2 won't build without it."
     1.6 +
     1.7 +diff -bBurN glibc-2.3.2.orig/elf/dl-conflict.c glibc-2.3.2/elf/dl-conflict.c
     1.8 +--- glibc-2.3.2.orig/elf/dl-conflict.c	2003-06-12 21:07:54.000000000 -0500
     1.9 ++++ glibc-2.3.2/elf/dl-conflict.c	2003-06-12 21:09:12.000000000 -0500
    1.10 +@@ -33,6 +33,7 @@
    1.11 + _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict,
    1.12 + 		       ElfW(Rela) *conflictend)
    1.13 + {
    1.14 ++#ifndef _DL_HAVE_NO_ELF_MACHINE_RELA
    1.15 +   if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_RELOC, 0))
    1.16 +     _dl_printf ("\nconflict processing: %s\n",
    1.17 + 		l->l_name[0] ? l->l_name : rtld_progname);
    1.18 +@@ -64,4 +65,5 @@
    1.19 +     for (; conflict < conflictend; ++conflict)
    1.20 +       elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset);
    1.21 +   }
    1.22 ++#endif
    1.23 + }
    1.24 +diff -bBurN glibc-2.3.2.orig/sysdeps/mips/dl-machine.h glibc-2.3.2/sysdeps/mips/dl-machine.h
    1.25 +--- glibc-2.3.2.orig/sysdeps/mips/dl-machine.h	2003-06-12 21:07:49.000000000 -0500
    1.26 ++++ glibc-2.3.2/sysdeps/mips/dl-machine.h	2003-06-12 21:11:10.000000000 -0500
    1.27 +@@ -56,6 +56,10 @@
    1.28 + #define ELF_MACHINE_JMP_SLOT			R_MIPS_REL32
    1.29 + #define elf_machine_type_class(type)		ELF_RTYPE_CLASS_PLT
    1.30 + 
    1.31 ++/* MIPS doesn't support RELA; see:
    1.32 ++   http://lists.debian.org/debian-mips/2002/debian-mips-200209/msg00020.html */
    1.33 ++#define _DL_HAVE_NO_ELF_MACHINE_RELA
    1.34 ++
    1.35 + /* Translate a processor specific dynamic tag to the index
    1.36 +    in l_info array.  */
    1.37 + #define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM)
    1.38 +diff -bBurN glibc-2.3.2.orig/sysdeps/mips/Makefile glibc-2.3.2/sysdeps/mips/Makefile
    1.39 +--- glibc-2.3.2.orig/sysdeps/mips/Makefile	2003-06-12 21:07:48.000000000 -0500
    1.40 ++++ glibc-2.3.2/sysdeps/mips/Makefile	2003-06-12 21:10:14.000000000 -0500
    1.41 +@@ -6,3 +6,11 @@
    1.42 + ifeq ($(subdir),setjmp)
    1.43 + sysdep_routines += setjmp_aux
    1.44 + endif
    1.45 ++
    1.46 ++ifeq ($(subdir),csu)
    1.47 ++ifeq (yes,$(build-shared))
    1.48 ++# Compatibility
    1.49 ++sysdep_routines += divdi3
    1.50 ++shared-only-routines += divdi3
    1.51 ++endif
    1.52 ++endif
    1.53 +diff -bBurN glibc-2.3.2.orig/sysdeps/unix/sysv/linux/mips/syscalls.list glibc-2.3.2/sysdeps/unix/sysv/linux/mips/syscalls.list
    1.54 +--- glibc-2.3.2.orig/sysdeps/unix/sysv/linux/mips/syscalls.list	2003-06-12 21:07:53.000000000 -0500
    1.55 ++++ glibc-2.3.2/sysdeps/unix/sysv/linux/mips/syscalls.list	2003-06-12 21:12:30.000000000 -0500
    1.56 +@@ -41,6 +41,7 @@
    1.57 + sys_mknod	xmknod	mknod		i:sii	__syscall_mknod
    1.58 + 
    1.59 + # System calls with wrappers.
    1.60 ++s_readahead     EXTRA   readahead       i:iipi  __syscall_readahead
    1.61 + rt_sigaction	-	rt_sigaction	i:ippi	__syscall_rt_sigaction
    1.62 + rt_sigpending	-	rt_sigpending	i:pi	__syscall_rt_sigpending
    1.63 + rt_sigprocmask	-	rt_sigprocmask	i:ippi	__syscall_rt_sigprocmask