patches/glibc/2.3.2/glibc-2.3.2-mips.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 From Bill Gatliff, who said:
     2 "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."
     3 
     4 diff -bBurN glibc-2.3.2.orig/elf/dl-conflict.c glibc-2.3.2/elf/dl-conflict.c
     5 --- glibc-2.3.2.orig/elf/dl-conflict.c	2003-06-12 21:07:54.000000000 -0500
     6 +++ glibc-2.3.2/elf/dl-conflict.c	2003-06-12 21:09:12.000000000 -0500
     7 @@ -33,6 +33,7 @@
     8  _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict,
     9  		       ElfW(Rela) *conflictend)
    10  {
    11 +#ifndef _DL_HAVE_NO_ELF_MACHINE_RELA
    12    if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_RELOC, 0))
    13      _dl_printf ("\nconflict processing: %s\n",
    14  		l->l_name[0] ? l->l_name : rtld_progname);
    15 @@ -64,4 +65,5 @@
    16      for (; conflict < conflictend; ++conflict)
    17        elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset);
    18    }
    19 +#endif
    20  }
    21 diff -bBurN glibc-2.3.2.orig/sysdeps/mips/dl-machine.h glibc-2.3.2/sysdeps/mips/dl-machine.h
    22 --- glibc-2.3.2.orig/sysdeps/mips/dl-machine.h	2003-06-12 21:07:49.000000000 -0500
    23 +++ glibc-2.3.2/sysdeps/mips/dl-machine.h	2003-06-12 21:11:10.000000000 -0500
    24 @@ -56,6 +56,10 @@
    25  #define ELF_MACHINE_JMP_SLOT			R_MIPS_REL32
    26  #define elf_machine_type_class(type)		ELF_RTYPE_CLASS_PLT
    27  
    28 +/* MIPS doesn't support RELA; see:
    29 +   http://lists.debian.org/debian-mips/2002/debian-mips-200209/msg00020.html */
    30 +#define _DL_HAVE_NO_ELF_MACHINE_RELA
    31 +
    32  /* Translate a processor specific dynamic tag to the index
    33     in l_info array.  */
    34  #define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM)
    35 diff -bBurN glibc-2.3.2.orig/sysdeps/mips/Makefile glibc-2.3.2/sysdeps/mips/Makefile
    36 --- glibc-2.3.2.orig/sysdeps/mips/Makefile	2003-06-12 21:07:48.000000000 -0500
    37 +++ glibc-2.3.2/sysdeps/mips/Makefile	2003-06-12 21:10:14.000000000 -0500
    38 @@ -6,3 +6,11 @@
    39  ifeq ($(subdir),setjmp)
    40  sysdep_routines += setjmp_aux
    41  endif
    42 +
    43 +ifeq ($(subdir),csu)
    44 +ifeq (yes,$(build-shared))
    45 +# Compatibility
    46 +sysdep_routines += divdi3
    47 +shared-only-routines += divdi3
    48 +endif
    49 +endif
    50 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
    51 --- glibc-2.3.2.orig/sysdeps/unix/sysv/linux/mips/syscalls.list	2003-06-12 21:07:53.000000000 -0500
    52 +++ glibc-2.3.2/sysdeps/unix/sysv/linux/mips/syscalls.list	2003-06-12 21:12:30.000000000 -0500
    53 @@ -41,6 +41,7 @@
    54  sys_mknod	xmknod	mknod		i:sii	__syscall_mknod
    55  
    56  # System calls with wrappers.
    57 +s_readahead     EXTRA   readahead       i:iipi  __syscall_readahead
    58  rt_sigaction	-	rt_sigaction	i:ippi	__syscall_rt_sigaction
    59  rt_sigpending	-	rt_sigpending	i:pi	__syscall_rt_sigpending
    60  rt_sigprocmask	-	rt_sigprocmask	i:ippi	__syscall_rt_sigprocmask