summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/alsa-lib-mips-atomic-fix.patch42
-rw-r--r--gnu/packages/patches/binutils-loongson-madd-fix.patch44
-rw-r--r--gnu/packages/patches/binutils-loongson-workaround.patch34
-rw-r--r--gnu/packages/patches/gd-mips64-deplibs-fix.patch17
-rw-r--r--gnu/packages/patches/gdb-loongson-madd-fix.patch44
-rw-r--r--gnu/packages/patches/glibc-make-4.0.patch12
-rw-r--r--gnu/packages/patches/glibc-no-ld-so-cache.patch53
-rw-r--r--gnu/packages/patches/libffi-mips-n32-fix.patch21
-rw-r--r--gnu/packages/patches/libmad-mips-newgcc.patch16
-rw-r--r--gnu/packages/patches/liboop-mips64-deplibs-fix.patch17
-rw-r--r--gnu/packages/patches/libtheora-config-guess.patch37
-rw-r--r--gnu/packages/patches/libtool-skip-tests-for-mips.patch12
-rw-r--r--gnu/packages/patches/mit-krb5-init-fix.patch18
-rw-r--r--gnu/packages/patches/pspp-tests.patch13
-rw-r--r--gnu/packages/patches/tar-gets-undeclared.patch26
15 files changed, 327 insertions, 79 deletions
diff --git a/gnu/packages/patches/alsa-lib-mips-atomic-fix.patch b/gnu/packages/patches/alsa-lib-mips-atomic-fix.patch
new file mode 100644
index 0000000000..8c37bd3ac4
--- /dev/null
+++ b/gnu/packages/patches/alsa-lib-mips-atomic-fix.patch
@@ -0,0 +1,42 @@
+Fix the declarations of inlined atomic ops for mips.
+
+This patch was copied from Debian.
+
+--- alsa-lib/include/iatomic.h.orig	2013-05-21 04:48:28.000000000 -0400
++++ alsa-lib/include/iatomic.h	2013-10-29 13:01:37.055995968 -0400
+@@ -720,7 +720,7 @@
+  * Atomically adds @i to @v.  Note that the guaranteed useful range
+  * of an atomic_t is only 24 bits.
+  */
+-extern __inline__ void atomic_add(int i, atomic_t * v)
++static __inline__ void atomic_add(int i, atomic_t * v)
+ {
+ 	unsigned long temp;
+ 
+@@ -744,7 +744,7 @@
+  * Atomically subtracts @i from @v.  Note that the guaranteed
+  * useful range of an atomic_t is only 24 bits.
+  */
+-extern __inline__ void atomic_sub(int i, atomic_t * v)
++static __inline__ void atomic_sub(int i, atomic_t * v)
+ {
+ 	unsigned long temp;
+ 
+@@ -763,7 +763,7 @@
+ /*
+  * Same as above, but return the result value
+  */
+-extern __inline__ int atomic_add_return(int i, atomic_t * v)
++static __inline__ int atomic_add_return(int i, atomic_t * v)
+ {
+ 	unsigned long temp, result;
+ 
+@@ -784,7 +784,7 @@
+ 	return result;
+ }
+ 
+-extern __inline__ int atomic_sub_return(int i, atomic_t * v)
++static __inline__ int atomic_sub_return(int i, atomic_t * v)
+ {
+ 	unsigned long temp, result;
+ 
diff --git a/gnu/packages/patches/binutils-loongson-madd-fix.patch b/gnu/packages/patches/binutils-loongson-madd-fix.patch
new file mode 100644
index 0000000000..364ccd67e3
--- /dev/null
+++ b/gnu/packages/patches/binutils-loongson-madd-fix.patch
@@ -0,0 +1,44 @@
+Fix the Loongson 2F specific fused multiply-add instructions on paired singles to
+use the encoding recognized by the processor, as opposed to the mistaken english
+Loongson 2F documentation.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- binutils/opcodes/mips-opc.c.orig	2012-09-04 10:21:10.000000000 -0400
++++ binutils/opcodes/mips-opc.c	2013-10-06 02:23:33.679983766 -0400
+@@ -931,7 +931,7 @@
+ {"madd.s",	"D,S,T",	0x72000018,	0xffe0003f,	RD_S|RD_T|WR_D|FP_S,	0,	IL2F	},
+ {"madd.ps", "D,R,S,T",	0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D,    0,		I5_33	},
+ {"madd.ps",	"D,S,T",	0x45600018,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"madd.ps",	"D,S,T",	0x71600018,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"madd.ps",	"D,S,T",	0x72c00018,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ {"madd",    "s,t",      0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO,           0,		L1	},
+ {"madd",    "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO,          0,		I32|N55	},
+ {"madd",    "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M,      0,		G1	},
+@@ -1041,7 +1041,7 @@
+ {"msub.s",	"D,S,T",	0x72000019,	0xffe0003f,	RD_S|RD_T|WR_D|FP_S,	0,	IL2F	},
+ {"msub.ps", "D,R,S,T",	0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I5_33	},
+ {"msub.ps",	"D,S,T",	0x45600019,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"msub.ps",	"D,S,T",	0x71600019,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"msub.ps",	"D,S,T",	0x72c00019,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ {"msub",    "s,t",      0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO,	0,		L1    	},
+ {"msub",    "s,t",      0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     0,		I32|N55 },
+ {"msub",    "7,s,t",	0x70000004, 0xfc00e7ff, MOD_a|RD_s|RD_t,        0,              D32	},
+@@ -1157,7 +1157,7 @@
+ {"nmadd.s",	"D,S,T",	0x7200001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_S,	0,	IL2F	},
+ {"nmadd.ps","D,R,S,T",	0x4c000036, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I5_33	},
+ {"nmadd.ps",	"D,S,T",	0x4560001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"nmadd.ps",	"D,S,T",	0x7160001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"nmadd.ps",	"D,S,T",	0x72c0001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ {"nmsub.d", "D,R,S,T",	0x4c000039, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I4_33	},
+ {"nmsub.d",	"D,S,T",	0x4620001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+ {"nmsub.d",	"D,S,T",	0x7220001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+@@ -1166,7 +1166,7 @@
+ {"nmsub.s",	"D,S,T",	0x7200001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_S,	0,	IL2F	},
+ {"nmsub.ps","D,R,S,T",	0x4c00003e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I5_33	},
+ {"nmsub.ps",	"D,S,T",	0x4560001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"nmsub.ps",	"D,S,T",	0x7160001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"nmsub.ps",	"D,S,T",	0x72c0001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ /* nop is at the start of the table.  */
+ {"nor",     "d,v,t",	0x00000027, 0xfc0007ff,	WR_d|RD_s|RD_t,		0,		I1	},
+ {"nor",     "t,r,I",	0,    (int) M_NOR_I,	INSN_MACRO,		0,		I1	},
diff --git a/gnu/packages/patches/binutils-loongson-workaround.patch b/gnu/packages/patches/binutils-loongson-workaround.patch
new file mode 100644
index 0000000000..f43572a53d
--- /dev/null
+++ b/gnu/packages/patches/binutils-loongson-workaround.patch
@@ -0,0 +1,34 @@
+Enable the workaround for the Loongson 2F bug by default.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- binutils/gas/config/tc-mips.c.orig	2012-09-04 10:21:03.000000000 -0400
++++ binutils/gas/config/tc-mips.c	2013-10-06 02:23:21.651983768 -0400
+@@ -910,10 +910,10 @@
+ };
+ 
+ /* ...likewise -mfix-loongson2f-jump.  */
+-static bfd_boolean mips_fix_loongson2f_jump;
++static bfd_boolean mips_fix_loongson2f_jump = FALSE;
+ 
+ /* ...likewise -mfix-loongson2f-nop.  */
+-static bfd_boolean mips_fix_loongson2f_nop;
++static bfd_boolean mips_fix_loongson2f_nop = TRUE;
+ 
+ /* True if -mfix-loongson2f-nop or -mfix-loongson2f-jump passed.  */
+ static bfd_boolean mips_fix_loongson2f;
+--- binutils/gas/testsuite/gas/mips/mips.exp.orig	2012-09-04 10:17:13.000000000 -0400
++++ binutils/gas/testsuite/gas/mips/mips.exp	2013-10-06 02:23:21.663983768 -0400
+@@ -91,6 +91,12 @@
+ 
+     # Catch because the variable won't be set the first time through.
+     catch {unset mips_arches}
++
++    # Disable the loongson2f nop fix by default, because most of the
++    # existing test cases for mips will fail otherwise.
++    global ASFLAGS
++    set old_ASFLAGS "$ASFLAGS"
++    set ASFLAGS "$ASFLAGS -mno-fix-loongson2f-nop"
+ }
+ 
+ # mips_arch_create ARCH GPRSIZE EXTENDS PROPS AS_FLAGS OBJDUMP_FLAGS \
diff --git a/gnu/packages/patches/gd-mips64-deplibs-fix.patch b/gnu/packages/patches/gd-mips64-deplibs-fix.patch
new file mode 100644
index 0000000000..6231310cdb
--- /dev/null
+++ b/gnu/packages/patches/gd-mips64-deplibs-fix.patch
@@ -0,0 +1,17 @@
+Patch configure script to choose pass_all deplibs check method for
+linux-gnu* systems on mips64.  This is a temporary hack until libgd
+bootstraps their build system with a newer libtool.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- libgd-gd/src/configure.orig	2006-04-05 11:56:57.000000000 -0400
++++ libgd-gd/src/configure	2013-11-02 17:56:19.123995838 -0400
+@@ -4457,7 +4457,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+   case $host_cpu in
+-  alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | s390* | x86_64*)
++  alpha* | hppa* | i*86 | mips | mipsel | mips64 | mips64el | powerpc* | sparc* | ia64* | s390* | x86_64*)
+     lt_cv_deplibs_check_method=pass_all ;;
+   *)
+     # glibc up to 2.1.1 does not perform some relocations on ARM
diff --git a/gnu/packages/patches/gdb-loongson-madd-fix.patch b/gnu/packages/patches/gdb-loongson-madd-fix.patch
new file mode 100644
index 0000000000..0d50dd2dd4
--- /dev/null
+++ b/gnu/packages/patches/gdb-loongson-madd-fix.patch
@@ -0,0 +1,44 @@
+Fix the Loongson 2F specific fused multiply-add instructions on paired singles to
+use the encoding recognized by the processor, as opposed to the mistaken english
+Loongson 2F documentation.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- gdb/opcodes/mips-opc.c.orig	2013-02-09 05:24:18.000000000 -0500
++++ gdb/opcodes/mips-opc.c	2013-10-27 23:35:20.191997541 -0400
+@@ -956,7 +956,7 @@
+ {"madd.s",  "D,S,T",	0x4600001c, 0xffe0003f, RD_S|RD_T|WR_D|FP_S,	     0,		EE	},
+ {"madd.ps", "D,R,S,T",	0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D,    0,		I5_33	},
+ {"madd.ps",	"D,S,T",	0x45600018,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"madd.ps",	"D,S,T",	0x71600018,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"madd.ps",	"D,S,T",	0x72c00018,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ {"madd",    "s,t",      0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO,           0,		L1	},
+ {"madd",    "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO,          0,		I32|N55	},
+ {"madd",    "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M,      0,		G1	},
+@@ -1084,7 +1084,7 @@
+ {"msub.s",  "D,S,T",	0x4600001d, 0xffe0003f,	RD_S|RD_T|WR_D|FP_S,	0,		EE	},
+ {"msub.ps", "D,R,S,T",	0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I5_33	},
+ {"msub.ps",	"D,S,T",	0x45600019,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"msub.ps",	"D,S,T",	0x71600019,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"msub.ps",	"D,S,T",	0x72c00019,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ {"msub",    "s,t",      0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO,	0,		L1    	},
+ {"msub",    "s,t",      0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     0,		I32|N55 },
+ {"msub",    "7,s,t",	0x70000004, 0xfc00e7ff, MOD_a|RD_s|RD_t,        0,              D32	},
+@@ -1218,7 +1218,7 @@
+ {"nmadd.s",	"D,S,T",	0x7200001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_S,	0,	IL2F	},
+ {"nmadd.ps","D,R,S,T",	0x4c000036, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I5_33	},
+ {"nmadd.ps",	"D,S,T",	0x4560001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"nmadd.ps",	"D,S,T",	0x7160001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"nmadd.ps",	"D,S,T",	0x72c0001a,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ {"nmsub.d", "D,R,S,T",	0x4c000039, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I4_33	},
+ {"nmsub.d",	"D,S,T",	0x4620001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+ {"nmsub.d",	"D,S,T",	0x7220001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+@@ -1227,7 +1227,7 @@
+ {"nmsub.s",	"D,S,T",	0x7200001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_S,	0,	IL2F	},
+ {"nmsub.ps","D,R,S,T",	0x4c00003e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, 0,		I5_33	},
+ {"nmsub.ps",	"D,S,T",	0x4560001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2E	},
+-{"nmsub.ps",	"D,S,T",	0x7160001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
++{"nmsub.ps",	"D,S,T",	0x72c0001b,	0xffe0003f,	RD_S|RD_T|WR_D|FP_D,	0,	IL2F	},
+ /* nop is at the start of the table.  */
+ {"nor",     "d,v,t",	0x00000027, 0xfc0007ff,	WR_d|RD_s|RD_t,		0,		I1	},
+ {"nor",     "t,r,I",	0,    (int) M_NOR_I,	INSN_MACRO,		0,		I1	},
diff --git a/gnu/packages/patches/glibc-make-4.0.patch b/gnu/packages/patches/glibc-make-4.0.patch
new file mode 100644
index 0000000000..d83de1d33d
--- /dev/null
+++ b/gnu/packages/patches/glibc-make-4.0.patch
@@ -0,0 +1,12 @@
+Allow libc to be compiled with GNU Make 4.0.
+
+--- glibc-2.18/configure	2013-08-11 00:52:55.000000000 +0200
++++ glibc-2.18/configure	2013-10-16 16:53:09.000000000 +0200
+@@ -4772,7 +4772,7 @@ $as_echo_n "checking version of $MAKE...
+   ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
+   case $ac_prog_version in
+     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+-    3.79* | 3.[89]*)
++    3.79* | 3.[89]* | 4.*)
+        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
diff --git a/gnu/packages/patches/glibc-no-ld-so-cache.patch b/gnu/packages/patches/glibc-no-ld-so-cache.patch
deleted file mode 100644
index 75fff50b47..0000000000
--- a/gnu/packages/patches/glibc-no-ld-so-cache.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Disable attempts to use the system-wide /etc/ld.so.cache.  This is
-required on LFS distros to avoid loading the distro's libc.so instead
-of ours.
-
-Patch from Nixpkgs.  Idea by Eelco Dolstra, initial patch by Jack
-Cummings, minor fixups by Shea Levy.
-
-diff -Naur glibc-2.13-orig/elf/ldconfig.c glibc-2.13/elf/ldconfig.c
---- glibc-2.13-orig/elf/ldconfig.c	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/elf/ldconfig.c	2012-04-10 23:28:45.957492340 -0400
-@@ -51,7 +51,7 @@
- #endif
- 
- #ifndef LD_SO_CONF
--# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
-+# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
- #endif
- 
- /* Get libc version number.  */
-
---- glibc-2.16.0/elf/Makefile	2012-06-30 21:12:34.000000000 +0200
-+++ glibc-2.16.0/elf/Makefile	2012-11-12 23:52:21.000000000 +0100
-@@ -415,12 +415,12 @@ $(objpfx)ldconfig: $(ldconfig-modules:%=
- 
- $(objpfx)pldd: $(pldd-modules:%=$(objpfx)%.o)
- 
--SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
--CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-+PREFIX-FLAGS := -D'PREFIX="$(sysconfdir)"'
-+CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
- 		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
--CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
--CFLAGS-cache.c = $(SYSCONF-FLAGS)
--CFLAGS-rtld.c = $(SYSCONF-FLAGS)
-+CFLAGS-dl-cache.c = $(PREFIX-FLAGS)
-+CFLAGS-cache.c = $(PREFIX-FLAGS)
-+CFLAGS-rtld.c = $(PREFIX-FLAGS)
- 
- CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
- 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
-
-diff -Naur glibc-2.13-orig/sysdeps/generic/dl-cache.h glibc-2.13/sysdeps/generic/dl-cache.h
---- glibc-2.13-orig/sysdeps/generic/dl-cache.h	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/sysdeps/generic/dl-cache.h	2012-04-10 23:28:20.077488815 -0400
-@@ -29,7 +29,7 @@
- #endif
- 
- #ifndef LD_SO_CACHE
--# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
-+# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
- #endif
- 
- #ifndef add_system_dir
diff --git a/gnu/packages/patches/libffi-mips-n32-fix.patch b/gnu/packages/patches/libffi-mips-n32-fix.patch
new file mode 100644
index 0000000000..87ec48f883
--- /dev/null
+++ b/gnu/packages/patches/libffi-mips-n32-fix.patch
@@ -0,0 +1,21 @@
+Fix handling of uint32_t arguments on the MIPS N32 ABI.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- libffi/src/mips/ffi.c.orig	2013-03-16 07:19:39.000000000 -0400
++++ libffi/src/mips/ffi.c	2013-10-22 01:11:03.111985247 -0400
+@@ -170,7 +170,14 @@
+ 		break;
+ 		  
+ 	      case FFI_TYPE_UINT32:
++#ifdef FFI_MIPS_N32
++		/* The N32 ABI requires that 32-bit integers
++		   be sign-extended to 64-bits, regardless of
++		   whether they are signed or unsigned. */
++		*(ffi_arg *)argp = *(SINT32 *)(* p_argv);
++#else
+ 		*(ffi_arg *)argp = *(UINT32 *)(* p_argv);
++#endif
+ 		break;
+ 
+ 	      /* This can only happen with 64bit slots.  */
diff --git a/gnu/packages/patches/libmad-mips-newgcc.patch b/gnu/packages/patches/libmad-mips-newgcc.patch
new file mode 100644
index 0000000000..d22c51255e
--- /dev/null
+++ b/gnu/packages/patches/libmad-mips-newgcc.patch
@@ -0,0 +1,16 @@
+Fix MIPS assembly code to work with newer GCC, where the "=h"
+constraint is no longer supported.
+
+--- libmad/fixed.h.orig	2004-02-16 21:02:03.000000000 -0500
++++ libmad/fixed.h	2011-10-29 18:47:21.000000000 -0400
+@@ -304,8 +304,8 @@
+  * significant bit depends on OPT_ACCURACY via mad_f_scale64().
+  */
+ #  define MAD_F_MLX(hi, lo, x, y)  \
+-    asm ("mult	%2,%3"  \
+-	 : "=l" (lo), "=h" (hi)  \
++    asm ("mult	%2,%3\n\tmfhi  %1"  \
++	 : "=l" (lo), "=r" (hi)  \
+ 	 : "%r" (x), "r" (y))
+ 
+ # if defined(HAVE_MADD_ASM)
diff --git a/gnu/packages/patches/liboop-mips64-deplibs-fix.patch b/gnu/packages/patches/liboop-mips64-deplibs-fix.patch
new file mode 100644
index 0000000000..b91754a8cc
--- /dev/null
+++ b/gnu/packages/patches/liboop-mips64-deplibs-fix.patch
@@ -0,0 +1,17 @@
+Patch configure script to choose pass_all deplibs check method for
+linux-gnu* systems on mips64.  This is a temporary hack until liboop
+bootstraps their build system with a newer libtool.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- liboop/configure.orig	2003-10-26 11:41:19.000000000 -0500
++++ liboop/configure	2013-11-02 18:09:11.079995796 -0400
+@@ -3395,7 +3395,7 @@
+ # This must be Linux ELF.
+ linux*)
+   case $host_cpu in
+-  alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
++  alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | mips64 | mips64el | powerpc* | sparc* | s390* | sh*)
+     lt_cv_deplibs_check_method=pass_all ;;
+   *)
+     # glibc up to 2.1.1 does not perform some relocations on ARM
diff --git a/gnu/packages/patches/libtheora-config-guess.patch b/gnu/packages/patches/libtheora-config-guess.patch
new file mode 100644
index 0000000000..9529ea7101
--- /dev/null
+++ b/gnu/packages/patches/libtheora-config-guess.patch
@@ -0,0 +1,37 @@
+Minimally patch libtheora's ancient config.guess to support mips64.
+
+--- libtheora/config.guess.orig	2009-02-23 22:50:50.000000000 -0500
++++ libtheora/config.guess	2013-10-31 23:49:48.155999944 -0400
+@@ -798,25 +798,24 @@
+     m68*:Linux:*:*)
+ 	echo ${UNAME_MACHINE}-unknown-linux-gnu
+ 	exit 0 ;;
+-    mips:Linux:*:*)
++    mips:Linux:*:* | mips64:Linux:*:*)
+ 	eval $set_cc_for_build
+ 	sed 's/^	//' << EOF >$dummy.c
+ 	#undef CPU
+-	#undef mips
+-	#undef mipsel
++	#undef ${UNAME_MACHINE}
++	#undef ${UNAME_MACHINE}el
+ 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+-	CPU=mipsel
++	CPU=${UNAME_MACHINE}el
+ 	#else
+ 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+-	CPU=mips
++	CPU=${UNAME_MACHINE}
+ 	#else
+ 	CPU=
+ 	#endif
+ 	#endif
+ EOF
+-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+-	rm -f $dummy.c && rmdir $tmpdir
+-	test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
++	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
++	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit 0; }
+ 	;;
+     ppc:Linux:*:*)
+ 	echo powerpc-unknown-linux-gnu
diff --git a/gnu/packages/patches/libtool-skip-tests-for-mips.patch b/gnu/packages/patches/libtool-skip-tests-for-mips.patch
new file mode 100644
index 0000000000..36587d23c2
--- /dev/null
+++ b/gnu/packages/patches/libtool-skip-tests-for-mips.patch
@@ -0,0 +1,12 @@
+TEMPORARY HACK: Disable a test that fails on MIPS.
+
+--- libtool/Makefile.in.orig	2011-10-17 06:18:55.000000000 -0400
++++ libtool/Makefile.in	2013-10-12 20:41:50.669067382 -0400
+@@ -890,7 +890,6 @@
+ 	tests/demo-pic-make.test \
+ 	tests/demo-pic-exec.test \
+ 	tests/demo-nopic.test \
+-	tests/demo-nopic-make.test \
+ 	tests/demo-nopic-exec.test \
+ 	tests/cdemo-shared.test \
+ 	tests/cdemo-shared-make.test \
diff --git a/gnu/packages/patches/mit-krb5-init-fix.patch b/gnu/packages/patches/mit-krb5-init-fix.patch
new file mode 100644
index 0000000000..13e49c2789
--- /dev/null
+++ b/gnu/packages/patches/mit-krb5-init-fix.patch
@@ -0,0 +1,18 @@
+Fix the early context initialization code to avoid assuming that
+arguments will be evaluated from right to left.
+
+Patch by Mark H Weaver <mhw@netris.org>.
+
+--- src/lib/krb5/krb/t_cc_config.c.orig	2012-12-17 21:47:05.000000000 -0500
++++ src/lib/krb5/krb/t_cc_config.c	2013-10-29 18:19:16.547994590 -0400
+@@ -117,8 +117,8 @@
+     int c;
+     unsigned int i;
+ 
+-    bail_on_err(context, "Error initializing Kerberos library",
+-                krb5_init_context(&context));
++    ret = krb5_init_context(&context);
++    bail_on_err(context, "Error initializing Kerberos library", ret);
+     bail_on_err(context, "Error getting location of default ccache",
+                 krb5_cc_default(context, &ccache));
+     server = NULL;
diff --git a/gnu/packages/patches/pspp-tests.patch b/gnu/packages/patches/pspp-tests.patch
new file mode 100644
index 0000000000..3e61b68804
--- /dev/null
+++ b/gnu/packages/patches/pspp-tests.patch
@@ -0,0 +1,13 @@
+diff --git a/tests/output/render-test.c b/tests/output/render-test.c
+index 5f4c1da..e9df96c 100644
+--- a/tests/output/render-test.c
++++ b/tests/output/render-test.c
+@@ -142,7 +142,7 @@ configure_drivers (int width, int length)
+   string_map_insert (&options, "left-margin", "0");
+   string_map_insert (&options, "right-margin", "0");
+   string_map_insert_nocopy (&options, xstrdup ("paper-size"),
+-                            xasprintf ("%dx%dpt", width * 5, length * 8));
++                            xasprintf ("%dx%dpt", width * 5, length * 16));
+   driver = output_driver_create (&options);
+   if (driver == NULL)
+     exit (EXIT_FAILURE);
diff --git a/gnu/packages/patches/tar-gets-undeclared.patch b/gnu/packages/patches/tar-gets-undeclared.patch
deleted file mode 100644
index 301a09dde1..0000000000
--- a/gnu/packages/patches/tar-gets-undeclared.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-This patch is needed to allow builds with newer versions of
-the GNU libc (2.16+).
-
-This is a backport of this patch:
-
-commit 66712c23388e93e5c518ebc8515140fa0c807348
-Author: Eric Blake <eblake@redhat.com>
-Date:   Thu Mar 29 13:30:41 2012 -0600
-
-    stdio: don't assume gets any more
-    
---- tar-1.26/gnu/stdio.in.h	2012-07-02 14:28:45.000000000 +0200
-+++ tar-1.26/gnu/stdio.in.h	2012-07-02 14:28:50.000000000 +0200
-@@ -160,12 +160,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not
-                  "use gnulib module fflush for portable POSIX compliance");
- #endif
- 
--/* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
--#undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
--
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
- #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)