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... :-(
yann@1
     1
From Bill Gatliff, who said:
yann@1
     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."
yann@1
     3
yann@1
     4
diff -bBurN glibc-2.3.2.orig/elf/dl-conflict.c glibc-2.3.2/elf/dl-conflict.c
yann@1
     5
--- glibc-2.3.2.orig/elf/dl-conflict.c	2003-06-12 21:07:54.000000000 -0500
yann@1
     6
+++ glibc-2.3.2/elf/dl-conflict.c	2003-06-12 21:09:12.000000000 -0500
yann@1
     7
@@ -33,6 +33,7 @@
yann@1
     8
 _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict,
yann@1
     9
 		       ElfW(Rela) *conflictend)
yann@1
    10
 {
yann@1
    11
+#ifndef _DL_HAVE_NO_ELF_MACHINE_RELA
yann@1
    12
   if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_RELOC, 0))
yann@1
    13
     _dl_printf ("\nconflict processing: %s\n",
yann@1
    14
 		l->l_name[0] ? l->l_name : rtld_progname);
yann@1
    15
@@ -64,4 +65,5 @@
yann@1
    16
     for (; conflict < conflictend; ++conflict)
yann@1
    17
       elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset);
yann@1
    18
   }
yann@1
    19
+#endif
yann@1
    20
 }
yann@1
    21
diff -bBurN glibc-2.3.2.orig/sysdeps/mips/dl-machine.h glibc-2.3.2/sysdeps/mips/dl-machine.h
yann@1
    22
--- glibc-2.3.2.orig/sysdeps/mips/dl-machine.h	2003-06-12 21:07:49.000000000 -0500
yann@1
    23
+++ glibc-2.3.2/sysdeps/mips/dl-machine.h	2003-06-12 21:11:10.000000000 -0500
yann@1
    24
@@ -56,6 +56,10 @@
yann@1
    25
 #define ELF_MACHINE_JMP_SLOT			R_MIPS_REL32
yann@1
    26
 #define elf_machine_type_class(type)		ELF_RTYPE_CLASS_PLT
yann@1
    27
 
yann@1
    28
+/* MIPS doesn't support RELA; see:
yann@1
    29
+   http://lists.debian.org/debian-mips/2002/debian-mips-200209/msg00020.html */
yann@1
    30
+#define _DL_HAVE_NO_ELF_MACHINE_RELA
yann@1
    31
+
yann@1
    32
 /* Translate a processor specific dynamic tag to the index
yann@1
    33
    in l_info array.  */
yann@1
    34
 #define DT_MIPS(x) (DT_MIPS_##x - DT_LOPROC + DT_NUM)
yann@1
    35
diff -bBurN glibc-2.3.2.orig/sysdeps/mips/Makefile glibc-2.3.2/sysdeps/mips/Makefile
yann@1
    36
--- glibc-2.3.2.orig/sysdeps/mips/Makefile	2003-06-12 21:07:48.000000000 -0500
yann@1
    37
+++ glibc-2.3.2/sysdeps/mips/Makefile	2003-06-12 21:10:14.000000000 -0500
yann@1
    38
@@ -6,3 +6,11 @@
yann@1
    39
 ifeq ($(subdir),setjmp)
yann@1
    40
 sysdep_routines += setjmp_aux
yann@1
    41
 endif
yann@1
    42
+
yann@1
    43
+ifeq ($(subdir),csu)
yann@1
    44
+ifeq (yes,$(build-shared))
yann@1
    45
+# Compatibility
yann@1
    46
+sysdep_routines += divdi3
yann@1
    47
+shared-only-routines += divdi3
yann@1
    48
+endif
yann@1
    49
+endif
yann@1
    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
yann@1
    51
--- glibc-2.3.2.orig/sysdeps/unix/sysv/linux/mips/syscalls.list	2003-06-12 21:07:53.000000000 -0500
yann@1
    52
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/mips/syscalls.list	2003-06-12 21:12:30.000000000 -0500
yann@1
    53
@@ -41,6 +41,7 @@
yann@1
    54
 sys_mknod	xmknod	mknod		i:sii	__syscall_mknod
yann@1
    55
 
yann@1
    56
 # System calls with wrappers.
yann@1
    57
+s_readahead     EXTRA   readahead       i:iipi  __syscall_readahead
yann@1
    58
 rt_sigaction	-	rt_sigaction	i:ippi	__syscall_rt_sigaction
yann@1
    59
 rt_sigpending	-	rt_sigpending	i:pi	__syscall_rt_sigpending
yann@1
    60
 rt_sigprocmask	-	rt_sigprocmask	i:ippi	__syscall_rt_sigprocmask