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/acl-fix-perl-regex.patch22
-rw-r--r--gnu/packages/patches/acl-hurd-path-max.patch80
-rw-r--r--gnu/packages/patches/aspell-gcc-compat.patch31
-rw-r--r--gnu/packages/patches/binutils-boot-2.20.1a.patch157
-rw-r--r--gnu/packages/patches/boost-fix-icu-build.patch53
-rw-r--r--gnu/packages/patches/dbus-CVE-2019-12749.patch116
-rw-r--r--gnu/packages/patches/dbus-c++-gcc-compat.patch14
-rw-r--r--gnu/packages/patches/dbus-c++-threading-mutex.patch37
-rw-r--r--gnu/packages/patches/diffutils-getopt.patch44
-rw-r--r--gnu/packages/patches/evolution-data-server-locales.patch33
-rw-r--r--gnu/packages/patches/expat-CVE-2018-20843.patch21
-rw-r--r--gnu/packages/patches/gcc-boot-2.95.3.patch137
-rw-r--r--gnu/packages/patches/gcc-boot-4.7.4.patch68
-rw-r--r--gnu/packages/patches/gdm-CVE-2018-14424.patch172
-rw-r--r--gnu/packages/patches/glib-networking-connection.patch51
-rw-r--r--gnu/packages/patches/glibc-2.27-supported-locales.patch33
-rw-r--r--gnu/packages/patches/glibc-2.28-supported-locales.patch33
-rw-r--r--gnu/packages/patches/glibc-2.29-git-updates.patch742
-rw-r--r--gnu/packages/patches/glibc-CVE-2019-7309.patch76
-rw-r--r--gnu/packages/patches/glibc-CVE-2019-9169.patch22
-rw-r--r--gnu/packages/patches/glibc-boot-2.16.0.patch352
-rw-r--r--gnu/packages/patches/glibc-boot-2.2.5.patch251
-rw-r--r--gnu/packages/patches/glibc-bootstrap-system-2.16.0.patch30
-rw-r--r--gnu/packages/patches/glibc-bootstrap-system.patch34
-rw-r--r--gnu/packages/patches/glibc-locales-2.28.patch31
-rw-r--r--gnu/packages/patches/glibc-locales.patch17
-rw-r--r--gnu/packages/patches/glibc-supported-locales.patch33
-rw-r--r--gnu/packages/patches/gnome-control-center-udisks.patch221
-rw-r--r--gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch144
-rw-r--r--gnu/packages/patches/gobject-introspection-cc.patch11
-rw-r--r--gnu/packages/patches/groff-source-date-epoch.patch299
-rw-r--r--gnu/packages/patches/guile-2.2-default-utf8.patch36
-rw-r--r--gnu/packages/patches/guile-2.2-skip-oom-test.patch25
-rw-r--r--gnu/packages/patches/guile-relocatable.patch18
-rw-r--r--gnu/packages/patches/handbrake-opt-in-nvenc.patch14
-rw-r--r--gnu/packages/patches/inkscape-poppler-0.76.patch36
-rw-r--r--gnu/packages/patches/libarchive-CVE-2017-14166.patch45
-rw-r--r--gnu/packages/patches/libarchive-CVE-2017-14502.patch40
-rw-r--r--gnu/packages/patches/libarchive-CVE-2018-1000877.patch45
-rw-r--r--gnu/packages/patches/libarchive-CVE-2018-1000878.patch86
-rw-r--r--gnu/packages/patches/libarchive-CVE-2018-1000880.patch51
-rw-r--r--gnu/packages/patches/libcroco-CVE-2017-7960.patch66
-rw-r--r--gnu/packages/patches/libcroco-CVE-2017-7961.patch50
-rw-r--r--gnu/packages/patches/libgcrypt-make-yat2m-reproducible.patch32
-rw-r--r--gnu/packages/patches/libgdata-fix-tests.patch325
-rw-r--r--gnu/packages/patches/libgdata-glib-duplicate-tests.patch16
-rw-r--r--gnu/packages/patches/libgpg-error-gawk-compat.patch155
-rw-r--r--gnu/packages/patches/libmp4v2-c++11.patch14
-rw-r--r--gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch33
-rw-r--r--gnu/packages/patches/libxt-guix-search-paths.patch42
-rw-r--r--gnu/packages/patches/mescc-tools-boot.patch222
-rw-r--r--gnu/packages/patches/perl-no-sys-dirs.patch23
-rw-r--r--gnu/packages/patches/python-2.7-search-paths.patch4
-rw-r--r--gnu/packages/patches/python-3-deterministic-build-info.patch4
-rw-r--r--gnu/packages/patches/python-3-fix-tests.patch368
-rw-r--r--gnu/packages/patches/python-3-search-paths.patch8
-rw-r--r--gnu/packages/patches/python-fix-tests.patch147
-rw-r--r--gnu/packages/patches/python-keras-integration-test.patch19
-rw-r--r--gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch35
-rw-r--r--gnu/packages/patches/python2-CVE-2018-1000802.patch47
-rw-r--r--gnu/packages/patches/python2-CVE-2018-14647.patch61
-rw-r--r--gnu/packages/patches/qemu-CVE-2018-16872.patch88
-rw-r--r--gnu/packages/patches/qemu-CVE-2019-6778.patch43
-rw-r--r--gnu/packages/patches/rapidjson-gcc-compat.patch18
-rw-r--r--gnu/packages/patches/sssd-curl-compat.patch18
-rw-r--r--gnu/packages/patches/supertux-fix-build-with-gcc5.patch75
-rw-r--r--gnu/packages/patches/tcc-boot-0.9.27.patch26
-rw-r--r--gnu/packages/patches/texinfo-perl-compat.patch51
-rw-r--r--gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch341
-rw-r--r--gnu/packages/patches/util-linux-tests.patch13
70 files changed, 3551 insertions, 2554 deletions
diff --git a/gnu/packages/patches/acl-fix-perl-regex.patch b/gnu/packages/patches/acl-fix-perl-regex.patch
deleted file mode 100644
index f682abc058..0000000000
--- a/gnu/packages/patches/acl-fix-perl-regex.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-This can be removed with the next acl release
-
----
- test/run | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/test/run b/test/run
-index 2cf52e8..4627cd2 100755
---- a/test/run
-+++ b/test/run
-@@ -70,7 +70,7 @@ for (;;) {
-   if (defined $line) {
-     # Substitute %VAR and %{VAR} with environment variables.
-     $line =~ s[%(\w+)][$ENV{$1}]eg;
--    $line =~ s[%{(\w+)}][$ENV{$1}]eg;
-+    $line =~ s[%\{(\w+)\}][$ENV{$1}]eg;
-   }
-   if (defined $line) {
-     if ($line =~ s/^\s*< ?//) {
--- 
-2.15.0
-
diff --git a/gnu/packages/patches/acl-hurd-path-max.patch b/gnu/packages/patches/acl-hurd-path-max.patch
deleted file mode 100644
index 89cb3a38d7..0000000000
--- a/gnu/packages/patches/acl-hurd-path-max.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636512
-
-From: Svante Signell <srs@kth.se>
-Subject: acl: Fix FTBFS on hurd-i386
-Date: Wed, 03 Aug 2011 19:36:27 +0200
-
-Currently acl does not compile on hurd-i386. The problem is a PATH_MAX
-definition which is not supported on GNU/Hurd.
-
-Index: acl-2.2.52/setfacl/parse.c
-===================================================================
---- acl-2.2.52/setfacl/parse.c
-+++ acl-2.2.52/setfacl/parse.c
-@@ -419,7 +419,13 @@ read_acl_comments(
- 	  bytes for "# file: ". Not a good solution but for now it is the
- 	  best I can do without too much impact on the code. [tw]
- 	*/
-+
-+#ifdef __GNU__
-+	char *linebuf;
-+	size_t dummy = 0;
-+#else
- 	char linebuf[(4*PATH_MAX)+9];
-+#endif
- 	char *cp;
- 	char *p;
- 	int comments_read = 0;
-@@ -449,9 +455,13 @@ read_acl_comments(
- 		if (line)
- 			(*line)++;
- 
-+#ifdef __GNU__
-+		if (getline(&linebuf, &dummy, file) == -1)
-+			break;
-+#else
- 		if (fgets(linebuf, sizeof(linebuf), file) == NULL)
- 			break;
--		
-+#endif		
- 		comments_read = 1;
- 
- 		p = strrchr(linebuf, '\0');
-@@ -473,7 +483,12 @@ read_acl_comments(
- 					goto fail;
- 				*path_p = (char*)malloc(strlen(cp)+1);
- 				if (!*path_p)
-+				  {
-+#ifdef __GNU__
-+				    free (linebuf);
-+#endif
- 					return -1;
-+				  }
- 				strcpy(*path_p, cp);
- 			}
- 		} else if (strncmp(cp, "owner:", 6) == 0) {
-@@ -522,13 +537,24 @@ read_acl_comments(
- 		}
- 	}
- 	if (ferror(file))
-+	  {
-+#ifdef __GNU__
-+	    free (linebuf);
-+#endif
- 		return -1;
-+	  }
-+#ifdef __GNU__
-+	free (linebuf);
-+#endif
- 	return comments_read;
- fail:
- 	if (path_p && *path_p) {
- 		free(*path_p);
- 		*path_p = NULL;
- 	}
-+#ifdef __GNU__
-+	free (linebuf);
-+#endif
- 	return -EINVAL;
- }
- 
diff --git a/gnu/packages/patches/aspell-gcc-compat.patch b/gnu/packages/patches/aspell-gcc-compat.patch
new file mode 100644
index 0000000000..94c44f8fb6
--- /dev/null
+++ b/gnu/packages/patches/aspell-gcc-compat.patch
@@ -0,0 +1,31 @@
+Fix GCC7 warnings.
+
+Taken from upstream:
+https://git.savannah.gnu.org/cgit/aspell.git/commit/?id=8089fa02122fed0a6394eba14bbedcb1d18e2384
+
+diff --git a/modules/filter/tex.cpp b/modules/filter/tex.cpp
+index a979539..19ab63c 100644
+--- a/modules/filter/tex.cpp
++++ b/modules/filter/tex.cpp
+@@ -174,7 +174,7 @@ namespace {
+ 
+     if (c == '{') {
+ 
+-      if (top.in_what == Parm || top.in_what == Opt || top.do_check == '\0')
++      if (top.in_what == Parm || top.in_what == Opt || *top.do_check == '\0')
+ 	push_command(Parm);
+ 
+       top.in_what = Parm;
+diff --git a/prog/check_funs.cpp b/prog/check_funs.cpp
+index db54f3d..89ee09d 100644
+--- a/prog/check_funs.cpp
++++ b/prog/check_funs.cpp
+@@ -647,7 +647,7 @@ static void print_truncate(FILE * out, const char * word, int width) {
+     }
+   }
+   if (i == width-1) {
+-    if (word == '\0')
++    if (*word == '\0')
+       put(out,' ');
+     else if (word[len] == '\0')
+       put(out, word, len);
diff --git a/gnu/packages/patches/binutils-boot-2.20.1a.patch b/gnu/packages/patches/binutils-boot-2.20.1a.patch
new file mode 100644
index 0000000000..7e5762ceb4
--- /dev/null
+++ b/gnu/packages/patches/binutils-boot-2.20.1a.patch
@@ -0,0 +1,157 @@
+This patch enables building binutils using TCC and Mes C Library
+
+  * disable building DOC
+  * remove signed int trickery that does not work with TCC
+  * fixe the malloc prototype to use size_t
+  * add missing includes
+  * remove C99'isms to avoid of mixing code and variable declaration
+  * [MES_BOOTSTRAP]: remove strncmp to avoid duplicat symbol
+
+Upstream status: Not presented upstream.
+
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/bfd/elf32-i386.c binutils-2.20.1a/bfd/elf32-i386.c
+--- ../binutils-2.20.1a/bfd/elf32-i386.c	2009-09-10 13:47:12.000000000 +0200
++++ binutils-2.20.1a/bfd/elf32-i386.c	2018-06-23 19:33:20.068134411 +0200
+@@ -4254,6 +4254,7 @@ elf_i386_finish_dynamic_symbol (bfd *out
+ 	      if (!h->pointer_equality_needed)
+ 		abort ();
+ 
++              {
+ 	      /* For non-shared object, we can't use .got.plt, which
+ 		 contains the real function addres if we need pointer
+ 		 equality.  We load the GOT entry with the PLT entry.  */
+@@ -4262,6 +4263,7 @@ elf_i386_finish_dynamic_symbol (bfd *out
+ 			  (plt->output_section->vma
+ 			   + plt->output_offset + h->plt.offset),
+ 			  htab->elf.sgot->contents + h->got.offset);
++              }
+ 	      return TRUE;
+ 	    }
+ 	}
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/bfd/elfcode.h binutils-2.20.1a/bfd/elfcode.h
+--- ../binutils-2.20.1a/bfd/elfcode.h	2009-09-10 13:47:12.000000000 +0200
++++ binutils-2.20.1a/bfd/elfcode.h	2018-06-19 19:07:16.647627075 +0200
+@@ -73,6 +73,7 @@
+ #include "bfdlink.h"
+ #include "libbfd.h"
+ #include "elf-bfd.h"
++#include <limits.h>
+ 
+ /* Renaming structures, typedefs, macros and functions to be size-specific.  */
+ #define Elf_External_Ehdr	NAME(Elf,External_Ehdr)
+@@ -706,8 +707,8 @@ elf_object_p (bfd *abfd)
+       if (i_ehdrp->e_shnum != 1)
+ 	{
+ 	  /* Check that we don't have a totally silly number of sections.  */
+-	  if (i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (x_shdr)
+-	      || i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (i_shdr))
++	  if (i_ehdrp->e_shnum > INT_MAX / sizeof (x_shdr)
++	      || i_ehdrp->e_shnum > INT_MAX / sizeof (i_shdr))
+ 	    goto got_wrong_format_error;
+ 
+ 	  where += (i_ehdrp->e_shnum - 1) * sizeof (x_shdr);
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/bfd/Makefile.in binutils-2.20.1a/bfd/Makefile.in
+--- ../binutils-2.20.1a/bfd/Makefile.in	2010-03-03 14:59:15.000000000 +0100
++++ binutils-2.20.1a/bfd/Makefile.in	2018-06-16 14:00:46.297724081 +0200
+@@ -320,7 +320,7 @@ ACLOCAL_AMFLAGS = -I . -I .. -I ../confi
+ # RELEASE=y
+ INCDIR = $(srcdir)/../include
+ CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
+-SUBDIRS = doc po
++SUBDIRS = # these fail to build: doc po
+ bfddocdir = doc
+ libbfd_la_LDFLAGS = $(am__append_1) -release `cat libtool-soversion` \
+ 	@SHARED_LDFLAGS@ $(am__empty)
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/binutils/arparse.c binutils-2.20.1a/binutils/arparse.c
+--- ../binutils-2.20.1a/binutils/arparse.c	2009-10-16 13:52:16.000000000 +0200
++++ binutils-2.20.1a/binutils/arparse.c	2018-06-19 01:30:00.576219981 +0200
+@@ -330,7 +330,7 @@ YYID (i)
+ #   define YYMALLOC malloc
+ #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+      || defined __cplusplus || defined _MSC_VER)
+-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
++void *malloc (size_t); /* INFRINGES ON USER NAME SPACE */
+ #   endif
+ #  endif
+ #  ifndef YYFREE
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/binutils/dwarf.c binutils-2.20.1a/binutils/dwarf.c
+--- ../binutils-2.20.1a/binutils/dwarf.c	2009-09-14 13:43:26.000000000 +0200
++++ binutils-2.20.1a/binutils/dwarf.c	2018-06-16 14:01:45.162684662 +0200
+@@ -27,6 +27,10 @@
+ #include "dwarf2.h"
+ #include "dwarf.h"
+ 
++#if MES_BOOTSTRAP
++#include "getopt.h"
++#endif
++
+ static int have_frame_base;
+ static int need_base_address;
+ 
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/binutils/sysinfo.c binutils-2.20.1a/binutils/sysinfo.c
+--- ../binutils-2.20.1a/binutils/sysinfo.c	2009-10-16 13:52:17.000000000 +0200
++++ binutils-2.20.1a/binutils/sysinfo.c	2018-06-19 01:29:23.823612807 +0200
+@@ -286,7 +286,7 @@ YYID (i)
+ #   define YYMALLOC malloc
+ #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+      || defined __cplusplus || defined _MSC_VER)
+-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
++void *malloc (size_t); /* INFRINGES ON USER NAME SPACE */
+ #   endif
+ #  endif
+ #  ifndef YYFREE
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/gas/config/tc-i386.c binutils-2.20.1a/gas/config/tc-i386.c
+--- ../binutils-2.20.1a/gas/config/tc-i386.c	2009-09-14 13:43:27.000000000 +0200
++++ binutils-2.20.1a/gas/config/tc-i386.c	2018-06-23 19:39:37.546254752 +0200
+@@ -4869,6 +4869,7 @@ build_modrm_byte (void)
+   if (vex_3_sources)
+     {
+       unsigned int nds, reg;
++      expressionS *exp; 
+ 
+       if (i.tm.opcode_modifier.veximmext
+ 	  && i.tm.opcode_modifier.immext)
+@@ -4892,7 +4893,7 @@ build_modrm_byte (void)
+ 
+       /* Generate an 8bit immediate operand to encode the register
+ 	 operand.  */
+-      expressionS *exp = &im_expressions[i.imm_operands++];
++      exp = &im_expressions[i.imm_operands++];
+       i.op[i.operands].imms = exp;
+       i.types[i.operands] = imm8;
+       i.operands++;
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/ld/ldgram.c binutils-2.20.1a/ld/ldgram.c
+--- ../binutils-2.20.1a/ld/ldgram.c	2009-10-16 13:52:15.000000000 +0200
++++ binutils-2.20.1a/ld/ldgram.c	2018-06-19 01:30:57.809165437 +0200
+@@ -561,7 +561,7 @@ YYID (i)
+ #   define YYMALLOC malloc
+ #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+      || defined __cplusplus || defined _MSC_VER)
+-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
++void *malloc (size_t); /* INFRINGES ON USER NAME SPACE */
+ #   endif
+ #  endif
+ #  ifndef YYFREE
+diff -purN -x config.status -x config.h -x BOOT ../binutils-2.20.1a/libiberty/strncmp.c binutils-2.20.1a/libiberty/strncmp.c
+--- ../binutils-2.20.1a/libiberty/strncmp.c	2005-03-28 04:09:01.000000000 +0200
++++ binutils-2.20.1a/libiberty/strncmp.c	2018-06-23 19:19:50.038992482 +0200
+@@ -15,6 +15,13 @@ Compares the first @var{n} bytes of two
+ #include <ansidecl.h>
+ #include <stddef.h>
+ 
++#if !MES_BOOTSTRAP
++
++/*
++   libtool: link: /gnu/store/rgwjixk5zl7s2d3xsb2ws2z2q3m0xjm4-tcc-boot-0.9.26-0.97196ce/bin/tcc -D __GLIBC_MINOR__=6 -D MES_BOOTSTRAP=1 -g -o size size.o bucomm.o version.o filemode.o  ../bfd/.libs/libbfd.a ../libiberty/libiberty.a ./../intl/libintl.a
++   /gnu/store/rgwjixk5zl7s2d3xsb2ws2z2q3m0xjm4-tcc-boot-0.9.26-0.97196ce/lib/libc.a: error: 'strncmp' defined twice
++*/
++
+ int
+ strncmp(const char *s1, const char *s2, register size_t n)
+ {
+@@ -31,3 +38,5 @@ strncmp(const char *s1, const char *s2,
+     }
+   return 0;
+ }
++
++#endif // !MES_BOOTSTRAP
diff --git a/gnu/packages/patches/boost-fix-icu-build.patch b/gnu/packages/patches/boost-fix-icu-build.patch
deleted file mode 100644
index 556f91b8f7..0000000000
--- a/gnu/packages/patches/boost-fix-icu-build.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Pass -std=c++11 when compiling files that include the ICU headers.  Without
-this flag, compilation fails and causes Boost's build system to remove ICU
-support.  Note that $(pkg-config --variable=CXXFLAGS icu-uc) includes
-"-std=c++11", but Boost's build system does not use 'pkg-config'.
-
---- boost_1_66_0/libs/locale/build/Jamfile.v2.orig	2017-12-13 18:56:44.000000000 -0500
-+++ boost_1_66_0/libs/locale/build/Jamfile.v2	2018-04-08 15:18:58.673025760 -0400
-@@ -65,8 +65,8 @@
- 
- if $(ICU_LINK)
- {
--    ICU_OPTS = <include>$(ICU_PATH)/include <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin <runtime-link>shared ;
--    ICU64_OPTS = <include>$(ICU_PATH)/include <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin64 <runtime-link>shared ;
-+    ICU_OPTS = <include>$(ICU_PATH)/include <cxxflags>-std=c++11 <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin <runtime-link>shared ;
-+    ICU64_OPTS = <include>$(ICU_PATH)/include <cxxflags>-std=c++11 <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin64 <runtime-link>shared ;
- }
- else
- {
-@@ -121,6 +121,7 @@
-     explicit icuuc icudt icuin ;
- 
-     ICU_OPTS =   <include>$(ICU_PATH)/include 
-+      <cxxflags>-std=c++11
-       <library>icuuc/<link>shared/<runtime-link>shared 
-       <library>icudt/<link>shared/<runtime-link>shared 
-       <library>icuin/<link>shared/<runtime-link>shared
-@@ -180,6 +181,7 @@
-     explicit icuuc_64 icudt_64 icuin_64 ;
- 
-     ICU64_OPTS =   <include>$(ICU_PATH)/include 
-+      <cxxflags>-std=c++11
-       <library>icuuc_64/<link>shared/<runtime-link>shared 
-       <library>icudt_64/<link>shared/<runtime-link>shared 
-       <library>icuin_64/<link>shared/<runtime-link>shared
---- boost_1_66_0/libs/regex/build/Jamfile.v2.orig	2017-12-13 18:56:48.000000000 -0500
-+++ boost_1_66_0/libs/regex/build/Jamfile.v2	2018-04-08 15:20:40.865532505 -0400
-@@ -44,7 +44,7 @@
- 
-    if $(ICU_LINK)
-    {
--      ICU_OPTS = <include>$(ICU_PATH)/include <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin <define>BOOST_HAS_ICU=1 <runtime-link>shared ;
-+      ICU_OPTS = <include>$(ICU_PATH)/include <cxxflags>-std=c++11 <linkflags>$(ICU_LINK) <dll-path>$(ICU_PATH)/bin <define>BOOST_HAS_ICU=1 <runtime-link>shared ;
-    }
-    else
-    {
-@@ -78,6 +78,7 @@
- 
-       ICU_OPTS = 
-          <include>$(ICU_PATH)/include 
-+         <cxxflags>-std=c++11
-          <runtime-link>shared:<library>icuuc/<link>shared
-          <runtime-link>shared:<library>icudt/<link>shared
-          <runtime-link>shared:<library>icuin/<link>shared
diff --git a/gnu/packages/patches/dbus-CVE-2019-12749.patch b/gnu/packages/patches/dbus-CVE-2019-12749.patch
deleted file mode 100644
index 12106f4589..0000000000
--- a/gnu/packages/patches/dbus-CVE-2019-12749.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 47b1a4c41004bf494b87370987b222c934b19016 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Thu, 30 May 2019 12:53:03 +0100
-Subject: [PATCH] auth: Reject DBUS_COOKIE_SHA1 for users other than the server
- owner
-
-The DBUS_COOKIE_SHA1 authentication mechanism aims to prove ownership
-of a shared home directory by having the server write a secret "cookie"
-into a .dbus-keyrings subdirectory of the desired identity's home
-directory with 0700 permissions, and having the client prove that it can
-read the cookie. This never actually worked for non-malicious clients in
-the case where server uid != client uid (unless the server and client
-both have privileges, such as Linux CAP_DAC_OVERRIDE or traditional
-Unix uid 0) because an unprivileged server would fail to write out the
-cookie, and an unprivileged client would be unable to read the resulting
-file owned by the server.
-
-Additionally, since dbus 1.7.10 we have checked that ~/.dbus-keyrings
-is owned by the uid of the server (a side-effect of a check added to
-harden our use of XDG_RUNTIME_DIR), further ruling out successful use
-by a non-malicious client with a uid differing from the server's.
-
-Joe Vennix of Apple Information Security discovered that the
-implementation of DBUS_COOKIE_SHA1 was susceptible to a symbolic link
-attack: a malicious client with write access to its own home directory
-could manipulate a ~/.dbus-keyrings symlink to cause the DBusServer to
-read and write in unintended locations. In the worst case this could
-result in the DBusServer reusing a cookie that is known to the
-malicious client, and treating that cookie as evidence that a subsequent
-client connection came from an attacker-chosen uid, allowing
-authentication bypass.
-
-This is mitigated by the fact that by default, the well-known system
-dbus-daemon (since 2003) and the well-known session dbus-daemon (in
-stable releases since dbus 1.10.0 in 2015) only accept the EXTERNAL
-authentication mechanism, and as a result will reject DBUS_COOKIE_SHA1
-at an early stage, before manipulating cookies. As a result, this
-vulnerability only applies to:
-
-* system or session dbus-daemons with non-standard configuration
-* third-party dbus-daemon invocations such as at-spi2-core (although
-  in practice at-spi2-core also only accepts EXTERNAL by default)
-* third-party uses of DBusServer such as the one in Upstart
-
-Avoiding symlink attacks in a portable way is difficult, because APIs
-like openat() and Linux /proc/self/fd are not universally available.
-However, because DBUS_COOKIE_SHA1 already doesn't work in practice for
-a non-matching uid, we can solve this vulnerability in an easier way
-without regressions, by rejecting it early (before looking at
-~/.dbus-keyrings) whenever the requested identity doesn't match the
-identity of the process hosting the DBusServer.
-
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/269
-Closes: CVE-2019-12749
----
- dbus/dbus-auth.c | 32 ++++++++++++++++++++++++++++++++
- 1 file changed, 32 insertions(+)
-
-diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
-index 37d8d4c9..7390a9d5 100644
---- a/dbus/dbus-auth.c
-+++ b/dbus/dbus-auth.c
-@@ -529,6 +529,7 @@ sha1_handle_first_client_response (DBusAuth         *auth,
-   DBusString tmp2;
-   dbus_bool_t retval = FALSE;
-   DBusError error = DBUS_ERROR_INIT;
-+  DBusCredentials *myself = NULL;
- 
-   _dbus_string_set_length (&auth->challenge, 0);
-   
-@@ -565,6 +566,34 @@ sha1_handle_first_client_response (DBusAuth         *auth,
-       return FALSE;
-     }
- 
-+  myself = _dbus_credentials_new_from_current_process ();
-+
-+  if (myself == NULL)
-+    goto out;
-+
-+  if (!_dbus_credentials_same_user (myself, auth->desired_identity))
-+    {
-+      /*
-+       * DBUS_COOKIE_SHA1 is not suitable for authenticating that the
-+       * client is anyone other than the user owning the process
-+       * containing the DBusServer: we probably aren't allowed to write
-+       * to other users' home directories. Even if we can (for example
-+       * uid 0 on traditional Unix or CAP_DAC_OVERRIDE on Linux), we
-+       * must not, because the other user controls their home directory,
-+       * and could carry out symlink attacks to make us read from or
-+       * write to unintended locations. It's difficult to avoid symlink
-+       * attacks in a portable way, so we just don't try. This isn't a
-+       * regression, because DBUS_COOKIE_SHA1 never worked for other
-+       * users anyway.
-+       */
-+      _dbus_verbose ("%s: client tried to authenticate as \"%s\", "
-+                     "but that doesn't match this process",
-+                     DBUS_AUTH_NAME (auth),
-+                     _dbus_string_get_const_data (data));
-+      retval = send_rejected (auth);
-+      goto out;
-+    }
-+
-   /* we cache the keyring for speed, so here we drop it if it's the
-    * wrong one. FIXME caching the keyring here is useless since we use
-    * a different DBusAuth for every connection.
-@@ -679,6 +708,9 @@ sha1_handle_first_client_response (DBusAuth         *auth,
-   _dbus_string_zero (&tmp2);
-   _dbus_string_free (&tmp2);
- 
-+  if (myself != NULL)
-+    _dbus_credentials_unref (myself);
-+
-   return retval;
- }
- 
diff --git a/gnu/packages/patches/dbus-c++-gcc-compat.patch b/gnu/packages/patches/dbus-c++-gcc-compat.patch
new file mode 100644
index 0000000000..c4f126858c
--- /dev/null
+++ b/gnu/packages/patches/dbus-c++-gcc-compat.patch
@@ -0,0 +1,14 @@
+Fix a string comparison in C++ 11.
+
+Taken from Debian:
+https://sources.debian.org/src/dbus-c++/0.9.0-8.1/debian/patches/06_fix_gcc-7_ftbfs.patch/
+
+--- a/src/pipe.cpp
++++ b/src/pipe.cpp
+@@ -83,5 +83,5 @@ ssize_t Pipe::read(void *buffer, unsigne
+ void Pipe::signal()
+ {
+   // TODO: ignoring return of read/write generates warning; maybe relevant for eventloop work...
+-  ::write(_fd_write, '\0', 1);
++  ::write(_fd_write, "\0", 1);
+ }
diff --git a/gnu/packages/patches/dbus-c++-threading-mutex.patch b/gnu/packages/patches/dbus-c++-threading-mutex.patch
new file mode 100644
index 0000000000..b201700dc0
--- /dev/null
+++ b/gnu/packages/patches/dbus-c++-threading-mutex.patch
@@ -0,0 +1,37 @@
+Description: Fix FTBFS if DBUS_HAS_RECURSIVE_MUTEX is undefined
+Author: Peter Williams <peter@newton.cx>
+Last-Update: 2018-01-26
+
+Taken from Debian:
+https://sources.debian.org/src/dbus-c++/0.9.0-8.1/debian/patches/07_fix_mutex_ftbfs.patch/
+
+--- dbus-c++-0.9.0.orig/include/dbus-c++/dispatcher.h
++++ dbus-c++-0.9.0/include/dbus-c++/dispatcher.h
+@@ -267,6 +267,19 @@ struct Threading
+     return new Mx;
+   }
+ 
++#ifndef DBUS_HAS_RECURSIVE_MUTEX
++  static bool mutex_free(Mutex *mx)
++  {
++    delete mx;
++    return true;
++  }
++
++  static bool mutex_lock(Mutex *mx)
++  {
++    mx->lock();
++    return true;
++  }
++#else
+   static void mutex_free(Mutex *mx)
+   {
+     delete mx;
+@@ -276,6 +289,7 @@ struct Threading
+   {
+     mx->lock();
+   }
++#endif
+ 
+   static void mutex_unlock(Mutex *mx)
+   {
diff --git a/gnu/packages/patches/diffutils-getopt.patch b/gnu/packages/patches/diffutils-getopt.patch
deleted file mode 100644
index 05c2504adf..0000000000
--- a/gnu/packages/patches/diffutils-getopt.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-commit e3461d1c21a99bcef1b8826f710434e0ffb5adea
-Author: Paul Eggert <eggert@cs.ucla.edu>
-Date:   Sun Jun 11 15:53:09 2017 -0700
-
-    getopt-posix: port to glibc 2.25.90
-    
-    Problem reported by Daniel P. Berrange in:
-    http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00003.html
-    * lib/getopt-pfx-core.h (_GETOPT_CORE_H):
-    * lib/getopt-pfx-ext.h (_GETOPT_EXT_H):
-    #undef if __GETOPT_PREFIX is defined.
-
-diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h
-index 155c11612..6ad0da683 100644
---- a/lib/getopt-pfx-core.h
-+++ b/lib/getopt-pfx-core.h
-@@ -47,6 +47,11 @@
- # define opterr __GETOPT_ID (opterr)
- # define optind __GETOPT_ID (optind)
- # define optopt __GETOPT_ID (optopt)
-+
-+/* The system's getopt.h may have already included getopt-core.h to
-+   declare the unprefixed identifiers.  Undef _GETOPT_CORE_H so that
-+   getopt-core.h declares them with prefixes.  */
-+# undef _GETOPT_CORE_H
- #endif
- 
- #include <getopt-core.h>
-diff --git a/lib/getopt-pfx-ext.h b/lib/getopt-pfx-ext.h
-index d960bb34e..c5ac52202 100644
---- a/lib/getopt-pfx-ext.h
-+++ b/lib/getopt-pfx-ext.h
-@@ -45,6 +45,11 @@
- # define getopt_long_only __GETOPT_ID (getopt_long_only)
- # define option __GETOPT_ID (option)
- # define _getopt_internal __GETOPT_ID (getopt_internal)
-+
-+/* The system's getopt.h may have already included getopt-ext.h to
-+   declare the unprefixed identifiers.  Undef _GETOPT_EXT_H so that
-+   getopt-ext.h declares them with prefixes.  */
-+# undef _GETOPT_EXT_H
- #endif
- 
- /* Standalone applications get correct prototypes for getopt_long and
diff --git a/gnu/packages/patches/evolution-data-server-locales.patch b/gnu/packages/patches/evolution-data-server-locales.patch
new file mode 100644
index 0000000000..48baefb0d8
--- /dev/null
+++ b/gnu/packages/patches/evolution-data-server-locales.patch
@@ -0,0 +1,33 @@
+This patch fixes locale canonicalization when using newer versions of
+ICU.  It comes from the upstream repo, and should appear starting in
+version 3.33.5.
+
+From fe4ac94ce3c14f200e049a5d102fc0e4b811c71e Mon Sep 17 00:00:00 2001
+From: Milan Crha <mcrha@redhat.com>
+Date: Tue, 16 Jul 2019 07:22:07 +0200
+Subject: [PATCH] I#137 - POSIX locale tests fail with ICU 64.x
+
+Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/137
+---
+ src/libedataserver/e-collator.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/libedataserver/e-collator.c b/src/libedataserver/e-collator.c
+index 718eac5da..ec2cf7951 100644
+--- a/src/libedataserver/e-collator.c
++++ b/src/libedataserver/e-collator.c
+@@ -132,6 +132,11 @@ canonicalize_locale (const gchar *posix_locale,
+ 	gint   len;
+ 	const gchar *collation_type = NULL;
+ 
++	if (posix_locale && (
++	    g_ascii_strcasecmp (posix_locale, "C") == 0 ||
++	    g_ascii_strcasecmp (posix_locale, "POSIX") == 0))
++		posix_locale = "en_US_POSIX";
++
+ 	len = uloc_canonicalize (posix_locale, locale_buffer, LOCALE_BUFFER_LEN, &status);
+ 
+ 	if (U_FAILURE (status)) {
+-- 
+2.22.0
+
diff --git a/gnu/packages/patches/expat-CVE-2018-20843.patch b/gnu/packages/patches/expat-CVE-2018-20843.patch
deleted file mode 100644
index 216fbe9667..0000000000
--- a/gnu/packages/patches/expat-CVE-2018-20843.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Fix extraction of namespace prefix from XML name.
-Fixes CVE-2018-20843
-
-This patch comes from upstream commit 11f8838bf99ea0a6f0b76f9760c43704d00c4ff6
-https://github.com/libexpat/libexpat/commit/11f8838bf99ea0a6f0b76f9760c43704d00c4ff6
-
-CVE is https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20843
-
-diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
-index 30d55c5..737d7cd 100644
---- a/lib/xmlparse.c
-+++ b/lib/xmlparse.c
-@@ -6071,7 +6071,7 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
-       else
-         poolDiscard(&dtd->pool);
-       elementType->prefix = prefix;
--
-+      break;
-     }
-   }
-   return 1;
diff --git a/gnu/packages/patches/gcc-boot-2.95.3.patch b/gnu/packages/patches/gcc-boot-2.95.3.patch
new file mode 100644
index 0000000000..fd167ae052
--- /dev/null
+++ b/gnu/packages/patches/gcc-boot-2.95.3.patch
@@ -0,0 +1,137 @@
+This patch enables building gcc-2.95.3 using TCC and Mes C Library.
+
+  * Disable building DOC
+  * Avoid running `fixproto'.
+  * Force running `fixinc'.
+  * Replace Makefile trickery of creating an libgcc1.a archive, then
+    extracting the .o files later to create a new libgcc2.a archive.
+    Instead, keep temporary .o files.
+
+Upstream status: Not presented upstream.
+
+diff -purN -x foo.c -x BOOT -x BOOT-2 -x BOOT-strict -x .git -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC ../gcc-2.95.3/gcc/Makefile.in gcc-2.95.3/gcc/Makefile.in
+--- ../gcc-2.95.3/gcc/Makefile.in	2001-01-25 15:02:58.000000000 +0100
++++ gcc-2.95.3/gcc/Makefile.in	2018-06-23 11:46:03.525159181 +0200
+@@ -221,7 +221,7 @@ RANLIB_TEST_FOR_TARGET = \
+ SYSTEM_HEADER_DIR = /usr/include
+ 
+ # Control whether to run fixproto.
+-STMP_FIXPROTO = stmp-fixproto
++# STMP_FIXPROTO = stmp-fixproto
+ 
+ # Test to see whether <limits.h> exists in the system header files.
+ LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
+@@ -958,6 +958,7 @@ libgcc1.cross:
+ # fragments.
+ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
+ 	-rm -f tmplibgcc1.a
++	mkdir -p libgcc1-o
+ # Actually build it in tmplibgcc1.a, then rename at end,
+ # so that libgcc1.a itself remains nonexistent if compilation is aborted.
+ # -e causes any failing command to make this rule fail.
+@@ -974,6 +975,7 @@ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1F
+ 	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ 	  mv libgcc1$(objext) $${name}$(objext); \
+ 	  $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
++	  mv $${name}$(objext) libgcc1-o; \
+ 	  rm -f $${name}$(objext); \
+ 	done
+ # Some shells crash when a loop has no items.
+@@ -994,6 +996,7 @@ libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1F
+ 	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ 	    $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
+ 	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
++	    mv $${name}$(objext) libgcc1-o; \
+ 	    rm -f $${name}.s $${name}$(objext); \
+ 	  else true; \
+ 	  fi; \
+@@ -1024,6 +1027,7 @@ libgcc1-asm.a: libgcc2.ready config.stat
+ 	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ 	  mv libgcc1$(objext) $${name}$(objext); \
+ 	  $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) tmplibgcc1.a $${name}$(objext); \
++	  mv $${name}$(objext) libgcc1-o; \
+ 	  rm -f $${name}$(objext); \
+ 	done
+ 	-rm -f libgcc1.S
+@@ -1062,6 +1066,7 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CON
+ # Actually build it in tmplibgcc2.a, then rename at end,
+ # so that libgcc2.a itself remains nonexistent if compilation is aborted.
+ 	-rm -f tmplibgcc2.a
++	mkdir -p libgcc2-o
+ # -e causes any failing command to make this rule fail.
+ # -e doesn't work in certain shells, so we test $$? as well.
+ # lynx has a broken ar, it always complains when the initial library is
+@@ -1139,6 +1144,7 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CON
+ 	    $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
+ 	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ 	    $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) tmplibgcc2.a $${oname}$(objext); \
++	    mv $${oname}$(objext) libgcc2-o;\
+ 	    rm -f $${name}.s $${oname}$(objext); \
+ 	  fi; \
+ 	done
+@@ -1156,7 +1162,7 @@ libgcc.a: $(LIBGCC1) $(LIBGCC2)
+ 	-rm -rf tmplibgcc.a libgcc.a tmpcopy
+ 	mkdir tmpcopy
+ 	-if [ x$(LIBGCC1) != x ];			\
+-	then (cd tmpcopy; $(AR_FOR_TARGET) x ../$(LIBGCC1));	\
++	then cp -v libgcc1-o/*.o tmpcopy;		\
+ 	else true;					\
+ 	fi
+ # Some versions of ar (specifically the one in RISC/os 5.x), create an
+@@ -1164,7 +1170,7 @@ libgcc.a: $(LIBGCC1) $(LIBGCC2)
+ # the second ar command tries to overwrite this file.  To avoid the error
+ # message from ar, we make sure all files are writable.
+ 	-(cd tmpcopy; chmod +w * > /dev/null 2>&1)
+-	(cd tmpcopy; $(AR_FOR_TARGET) x ../$(LIBGCC2))
++	cp -v libgcc2-o/*.o tmpcopy
+ 	(cd tmpcopy; $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) ../tmplibgcc.a *$(objext))
+ 	rm -rf tmpcopy
+ 	-if $(RANLIB_TEST_FOR_TARGET) ; then \
+@@ -2093,14 +2099,18 @@ gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
+ # s-* so that mostlyclean does not force the include directory to
+ # be rebuilt.
+ 
++# STMP_FIXINC = @STMP_FIXINC@
++STMP_FIXINC = stmp-fixinc
++
+ # Build the include directory including float.h (which no longer depends upon
+ # enquire).
+-stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h
++stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
+ # Copy in the headers provided with gcc.
+ # The sed command gets just the last file name component;
+ # this is necessary because VPATH could add a dirname.
+ # Using basename would be simpler, but some systems don't have it.
+ # The touch command is here to workaround an AIX/Linux NFS bug.
++	-if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
+ 	for file in .. $(USER_H); do \
+ 	  if [ X$$file != X.. ]; then \
+ 	    realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
+@@ -2265,16 +2275,17 @@ stmp-fixproto: fixhdr.ready fixproto stm
+ #
+ # Remake the info files.
+ 
+-doc: info
+-info: cpp.info gcc.info lang.info
+-
+-cpp.info: $(srcdir)/cpp.texi
+-	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
+-
+-gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
+-	  $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
+-	  $(srcdir)/tm.texi $(srcdir)/gcov.texi
+-	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
++doc:
++# doc: info
++# info: cpp.info gcc.info lang.info
++
++# cpp.info: $(srcdir)/cpp.texi
++# 	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
++
++# gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
++# 	  $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
++# 	  $(srcdir)/tm.texi $(srcdir)/gcov.texi
++# 	$(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
+ 
+ dvi: gcc.dvi cpp.dvi lang.dvi
+ 
diff --git a/gnu/packages/patches/gcc-boot-4.7.4.patch b/gnu/packages/patches/gcc-boot-4.7.4.patch
new file mode 100644
index 0000000000..3e51e31fdf
--- /dev/null
+++ b/gnu/packages/patches/gcc-boot-4.7.4.patch
@@ -0,0 +1,68 @@
+This patch enables building gcc-4.7.4 using gcc-2.95.3 and glibc-2.2.5
+
+  * Tweak Makefile to allow overriding NATIVE_SYSTEM_HEADER_DIR using #:makeflags
+  * Add missing limits.h include.
+  * Add SSIZE_MAX define.  The SSIZE_MAX define has been added to Mes
+    upstream and can be removed with the next Mes release.
+  * Remove -fbuilding-libgcc flag, it assumes features being present from a
+    newer gcc or glibc.
+  * [MES_BOOTSTRAP_GCC]: Disable threads harder.
+
+Upstream status: not presented upstream.
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index f3cc49fdb18..bc5718fc9a6 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -458,7 +458,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
+ LTO_SYMTAB_H = $(srcdir)/../include/lto-symtab.h
+ 
+ # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
+-NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
++# NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
+ # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
+ CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+ 
+diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c
+index 94b7a0b89a7..ab2baab55ca 100644
+--- a/gcc/config/host-linux.c
++++ b/gcc/config/host-linux.c
+@@ -23,6 +23,12 @@
+ #include "hosthooks.h"
+ #include "hosthooks-def.h"
+ 
++// ../.././gcc/config/host-linux.c:213: `SSIZE_MAX' undeclared (first
++// use in this function)
++#include <limits.h>
++#ifndef	SSIZE_MAX
++# define SSIZE_MAX	LONG_MAX
++#endif
+ 
+ /* Linux has a feature called exec-shield-randomize that perturbs the
+    address of non-fixed mapped segments by a (relatively) small amount.
+diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
+index c301ff03cae..f86318c3bd5 100644
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -225,7 +225,7 @@ endif
+ LIBGCC2_DEBUG_CFLAGS = -g
+ LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
+ 		 $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
+-		 -fbuilding-libgcc -fno-stack-protector \
++		 -fno-stack-protector \
+ 		 $(INHIBIT_LIBC_CFLAGS)
+ 
+ # Additional options to use when compiling libgcc2.a.
+diff --git a/libgcc/generic-morestack-thread.c b/libgcc/generic-morestack-thread.c
+index bbe6dd12b5a..1d1d48223d7 100644
+--- a/libgcc/generic-morestack-thread.c
++++ b/libgcc/generic-morestack-thread.c
+@@ -35,7 +35,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+    will want to define inhibit_libc while building a compiler which
+    can build glibc.  */
+ 
+-#ifndef inhibit_libc
++#if 0 //!defined (inhibit_libc) && !MES_BOOTSTRAP_GCC
+ 
+ #include <errno.h>
+ #include <pthread.h>
diff --git a/gnu/packages/patches/gdm-CVE-2018-14424.patch b/gnu/packages/patches/gdm-CVE-2018-14424.patch
deleted file mode 100644
index 88a71f4151..0000000000
--- a/gnu/packages/patches/gdm-CVE-2018-14424.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-Fix CVE-2018-14424:
-
-https://gitlab.gnome.org/GNOME/gdm/issues/401
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14424
-
-Patch copied from upstream source repository:
-
-https://gitlab.gnome.org/GNOME/gdm/commit/1ac1697b3b019f50729a6e992065959586e170da
-
-From 1ac1697b3b019f50729a6e992065959586e170da Mon Sep 17 00:00:00 2001
-From: Chris Coulson <chris.coulson@canonical.com>
-Date: Thu, 19 Jul 2018 18:26:05 +0100
-Subject: [PATCH] display-store: Pass the display object rather than the id in
- the removed signal
-
-By the time GdmDisplayStore emits the "display-removed" signal, the display
-is no longer in the store and gdm_display_store_lookup will not work in
-signal handlers.
-
-Change the "display-removed" parameter from the display id to the GdmDisplay
-object, so that signal handers can perform any cleanup they need to do
-
-CVE-2018-14424
-
-Closes: https://gitlab.gnome.org/GNOME/gdm/issues/401
----
- daemon/gdm-display-store.c         | 11 +++--------
- daemon/gdm-display-store.h         |  2 +-
- daemon/gdm-local-display-factory.c | 13 +++----------
- daemon/gdm-manager.c               | 19 +++++++++----------
- daemon/gdm-manager.h               |  3 ++-
- 5 files changed, 18 insertions(+), 30 deletions(-)
-
-diff --git a/daemon/gdm-display-store.c b/daemon/gdm-display-store.c
-index af76f519..fd24334e 100644
---- a/daemon/gdm-display-store.c
-+++ b/daemon/gdm-display-store.c
-@@ -76,15 +76,10 @@ stored_display_new (GdmDisplayStore *store,
- static void
- stored_display_free (StoredDisplay *stored_display)
- {
--        char *id;
--
--        gdm_display_get_id (stored_display->display, &id, NULL);
--
-         g_signal_emit (G_OBJECT (stored_display->store),
-                        signals[DISPLAY_REMOVED],
-                        0,
--                       id);
--        g_free (id);
-+                       stored_display->display);
- 
-         g_debug ("GdmDisplayStore: Unreffing display: %p",
-                  stored_display->display);
-@@ -281,9 +276,9 @@ gdm_display_store_class_init (GdmDisplayStoreClass *klass)
-                               G_STRUCT_OFFSET (GdmDisplayStoreClass, display_removed),
-                               NULL,
-                               NULL,
--                              g_cclosure_marshal_VOID__STRING,
-+                              g_cclosure_marshal_VOID__OBJECT,
-                               G_TYPE_NONE,
--                              1, G_TYPE_STRING);
-+                              1, G_TYPE_OBJECT);
- 
-         g_type_class_add_private (klass, sizeof (GdmDisplayStorePrivate));
- }
-diff --git a/daemon/gdm-display-store.h b/daemon/gdm-display-store.h
-index 28359933..0aff8ee2 100644
---- a/daemon/gdm-display-store.h
-+++ b/daemon/gdm-display-store.h
-@@ -49,7 +49,7 @@ typedef struct
-         void          (* display_added)    (GdmDisplayStore *display_store,
-                                             const char      *id);
-         void          (* display_removed)  (GdmDisplayStore *display_store,
--                                            const char      *id);
-+                                            GdmDisplay      *display);
- } GdmDisplayStoreClass;
- 
- typedef enum
-diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
-index 5f1ae89e..39f3e30a 100644
---- a/daemon/gdm-local-display-factory.c
-+++ b/daemon/gdm-local-display-factory.c
-@@ -805,18 +805,11 @@ on_display_added (GdmDisplayStore        *display_store,
- 
- static void
- on_display_removed (GdmDisplayStore        *display_store,
--                    const char             *id,
-+                    GdmDisplay             *display,
-                     GdmLocalDisplayFactory *factory)
- {
--        GdmDisplay *display;
--
--        display = gdm_display_store_lookup (display_store, id);
--
--        if (display != NULL) {
--                g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), factory);
--                g_object_weak_unref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory);
--
--        }
-+        g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), factory);
-+        g_object_weak_unref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory);
- }
- 
- static gboolean
-diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
-index f17bd1a5..f6684a8b 100644
---- a/daemon/gdm-manager.c
-+++ b/daemon/gdm-manager.c
-@@ -1541,19 +1541,18 @@ on_display_status_changed (GdmDisplay *display,
- 
- static void
- on_display_removed (GdmDisplayStore *display_store,
--                    const char      *id,
-+                    GdmDisplay      *display,
-                     GdmManager      *manager)
- {
--        GdmDisplay *display;
-+        char    *id;
- 
--        display = gdm_display_store_lookup (display_store, id);
--        if (display != NULL) {
--                g_dbus_object_manager_server_unexport (manager->priv->object_manager, id);
-+        gdm_display_get_id (display, &id, NULL);
-+        g_dbus_object_manager_server_unexport (manager->priv->object_manager, id);
-+        g_free (id);
- 
--                g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), manager);
-+        g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), manager);
- 
--                g_signal_emit (manager, signals[DISPLAY_REMOVED], 0, id);
--        }
-+        g_signal_emit (manager, signals[DISPLAY_REMOVED], 0, display);
- }
- 
- static void
-@@ -2535,9 +2534,9 @@ gdm_manager_class_init (GdmManagerClass *klass)
-                               G_STRUCT_OFFSET (GdmManagerClass, display_removed),
-                               NULL,
-                               NULL,
--                              g_cclosure_marshal_VOID__STRING,
-+                              g_cclosure_marshal_VOID__OBJECT,
-                               G_TYPE_NONE,
--                              1, G_TYPE_STRING);
-+                              1, G_TYPE_OBJECT);
- 
-         g_object_class_install_property (object_class,
-                                          PROP_XDMCP_ENABLED,
-diff --git a/daemon/gdm-manager.h b/daemon/gdm-manager.h
-index 41c68a7a..c8fb3f22 100644
---- a/daemon/gdm-manager.h
-+++ b/daemon/gdm-manager.h
-@@ -24,6 +24,7 @@
- 
- #include <glib-object.h>
- 
-+#include "gdm-display.h"
- #include "gdm-manager-glue.h"
- 
- G_BEGIN_DECLS
-@@ -50,7 +51,7 @@ typedef struct
-         void          (* display_added)    (GdmManager      *manager,
-                                             const char      *id);
-         void          (* display_removed)  (GdmManager      *manager,
--                                            const char      *id);
-+                                            GdmDisplay      *display);
- } GdmManagerClass;
- 
- typedef enum
--- 
-2.17.1
-
diff --git a/gnu/packages/patches/glib-networking-connection.patch b/gnu/packages/patches/glib-networking-connection.patch
deleted file mode 100644
index f64b090ae5..0000000000
--- a/gnu/packages/patches/glib-networking-connection.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-https://gitlab.gnome.org/GNOME/glib-networking/issues/4
-https://gitlab.gnome.org/GNOME/glib-networking/commit/55daf3e5fd4bc9e4ebad1a9eab93f852dcbf527e.patch
-This ultimately rejected work-around should be removed with the next
-release, as the bug has supposedly been fixed for real.
-
-
-From 55daf3e5fd4bc9e4ebad1a9eab93f852dcbf527e Mon Sep 17 00:00:00 2001
-From: Michael Catanzaro <mcatanzaro@igalia.com>
-Date: Thu, 19 Jul 2018 11:16:35 -0500
-Subject: [PATCH] Fix intermittent failures in missing client private key test
-
-Because our APIs do nice things like encapsulating the TLS connection
-establishment, we have our test server writing to the client after
-establishing the TCP connection, because the TLS connection is
-established. It's fine in theory, but results in some weirdness like the
-server seeing its write having completed successfully before TLS
-connection establishment. Normally that's what happens and this test
-passes (server sees no error), but sometimes the server sees that the
-client has already failed and the test fails.
-
-This is unfortunate, and tricky to fix properly, so let's just remove
-the bad check. The point of the test is to ensure that the TLS
-connection is not established, and the client-side check is going to
-have to be sufficient, because rewriting the test to wait for the TLS
-connection to be established on the server side is quite tricky: my
-naive attempt resulted in both sides waiting forever on the other.
-
-P.S. At no point in this test does the server ever examine the client
-certificate. That's not quite what I expected when I added the test, but
-it's fine.
-
-Fixes #4
----
- tls/tests/connection.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/tls/tests/connection.c b/tls/tests/connection.c
-index 94645c3..390275d 100644
---- a/tls/tests/connection.c
-+++ b/tls/tests/connection.c
-@@ -1125,7 +1125,6 @@ test_client_auth_fail_missing_client_private_key (TestConnection *test,
-   g_main_loop_run (test->loop);
- 
-   g_assert_error (test->read_error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED);
--  g_assert_no_error (test->server_error);
- }
- 
- static void
--- 
-2.18.1
-
diff --git a/gnu/packages/patches/glibc-2.27-supported-locales.patch b/gnu/packages/patches/glibc-2.27-supported-locales.patch
new file mode 100644
index 0000000000..2888052bb8
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.27-supported-locales.patch
@@ -0,0 +1,33 @@
+This patch is taken from debian's glibc package (generate-supported.mk).
+It install the localedata/SUPPORTED file of the glibc. This file lists
+all the supported locales of the glibc.
+
+diff --git a/localedata/Makefile.old b/localedata/Makefile
+index 34877c0..a61d9b9 100644
+--- a/localedata/Makefile.old
++++ b/localedata/Makefile
+@@ -91,7 +91,8 @@ endif
+ # Files to install.
+ install-others := $(addprefix $(inst_i18ndir)/, \
+ 			      $(addsuffix .gz, $(charmaps)) \
+-			      $(locales))
++			      $(locales)) \
++                   $(inst_i18ndir)/SUPPORTED
+ 
+ tests: $(objdir)/iconvdata/gconv-modules
+ 
+@@ -195,6 +196,14 @@ endif
+ 
+ include SUPPORTED
+ 
++$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
++	for locale in $(SUPPORTED-LOCALES); do \
++		[ $$locale = true ] && continue; \
++		echo $$locale | sed 's,/, ,' >> LOCALES; \
++	done
++	$(make-target-directory)
++	$(INSTALL_DATA) LOCALES $@
++
+ INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+ 
+ # Sometimes the whole collection of locale files should be installed.
diff --git a/gnu/packages/patches/glibc-2.28-supported-locales.patch b/gnu/packages/patches/glibc-2.28-supported-locales.patch
new file mode 100644
index 0000000000..2888052bb8
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.28-supported-locales.patch
@@ -0,0 +1,33 @@
+This patch is taken from debian's glibc package (generate-supported.mk).
+It install the localedata/SUPPORTED file of the glibc. This file lists
+all the supported locales of the glibc.
+
+diff --git a/localedata/Makefile.old b/localedata/Makefile
+index 34877c0..a61d9b9 100644
+--- a/localedata/Makefile.old
++++ b/localedata/Makefile
+@@ -91,7 +91,8 @@ endif
+ # Files to install.
+ install-others := $(addprefix $(inst_i18ndir)/, \
+ 			      $(addsuffix .gz, $(charmaps)) \
+-			      $(locales))
++			      $(locales)) \
++                   $(inst_i18ndir)/SUPPORTED
+ 
+ tests: $(objdir)/iconvdata/gconv-modules
+ 
+@@ -195,6 +196,14 @@ endif
+ 
+ include SUPPORTED
+ 
++$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
++	for locale in $(SUPPORTED-LOCALES); do \
++		[ $$locale = true ] && continue; \
++		echo $$locale | sed 's,/, ,' >> LOCALES; \
++	done
++	$(make-target-directory)
++	$(INSTALL_DATA) LOCALES $@
++
+ INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+ 
+ # Sometimes the whole collection of locale files should be installed.
diff --git a/gnu/packages/patches/glibc-2.29-git-updates.patch b/gnu/packages/patches/glibc-2.29-git-updates.patch
new file mode 100644
index 0000000000..5750e9cac1
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.29-git-updates.patch
@@ -0,0 +1,742 @@
+This file tracks updates from the "release/2.29/master" branch:
+https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.29/master
+
+Abridged commits are appended to this file.
+
+From ec894251ef11723d10df04fcfd7bd2030c6e43ff Mon Sep 17 00:00:00 2001
+From: Carlos O'Donell <carlos@redhat.com>
+Date: Mon, 21 Jan 2019 22:50:12 -0500
+Subject: [PATCH] nptl: Fix pthread_rwlock_try*lock stalls (Bug 23844)
+diff --git a/nptl/pthread_rwlock_tryrdlock.c b/nptl/pthread_rwlock_tryrdlock.c
+index 368862ff07..2f94f17f36 100644
+--- a/nptl/pthread_rwlock_tryrdlock.c
++++ b/nptl/pthread_rwlock_tryrdlock.c
+@@ -94,15 +94,22 @@ __pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
+       /* Same as in __pthread_rwlock_rdlock_full:
+ 	 We started the read phase, so we are also responsible for
+ 	 updating the write-phase futex.  Relaxed MO is sufficient.
+-	 Note that there can be no other reader that we have to wake
+-	 because all other readers will see the read phase started by us
+-	 (or they will try to start it themselves); if a writer started
+-	 the read phase, we cannot have started it.  Furthermore, we
+-	 cannot discard a PTHREAD_RWLOCK_FUTEX_USED flag because we will
+-	 overwrite the value set by the most recent writer (or the readers
+-	 before it in case of explicit hand-over) and we know that there
+-	 are no waiting readers.  */
+-      atomic_store_relaxed (&rwlock->__data.__wrphase_futex, 0);
++	 We have to do the same steps as a writer would when handing over the
++	 read phase to use because other readers cannot distinguish between
++	 us and the writer.
++	 Note that __pthread_rwlock_tryrdlock callers will not have to be
++	 woken up because they will either see the read phase started by us
++	 or they will try to start it themselves; however, callers of
++	 __pthread_rwlock_rdlock_full just increase the reader count and then
++	 check what state the lock is in, so they cannot distinguish between
++	 us and a writer that acquired and released the lock in the
++	 meantime.  */
++      if ((atomic_exchange_relaxed (&rwlock->__data.__wrphase_futex, 0)
++	  & PTHREAD_RWLOCK_FUTEX_USED) != 0)
++	{
++	  int private = __pthread_rwlock_get_private (rwlock);
++	  futex_wake (&rwlock->__data.__wrphase_futex, INT_MAX, private);
++	}
+     }
+ 
+   return 0;
+diff --git a/nptl/pthread_rwlock_trywrlock.c b/nptl/pthread_rwlock_trywrlock.c
+index fd37a71ce4..fae475cc70 100644
+--- a/nptl/pthread_rwlock_trywrlock.c
++++ b/nptl/pthread_rwlock_trywrlock.c
+@@ -46,8 +46,15 @@ __pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
+ 	  &rwlock->__data.__readers, &r,
+ 	  r | PTHREAD_RWLOCK_WRPHASE | PTHREAD_RWLOCK_WRLOCKED))
+ 	{
++	  /* We have become the primary writer and we cannot have shared
++	     the PTHREAD_RWLOCK_FUTEX_USED flag with someone else, so we
++	     can simply enable blocking (see full wrlock code).  */
+ 	  atomic_store_relaxed (&rwlock->__data.__writers_futex, 1);
+-	  atomic_store_relaxed (&rwlock->__data.__wrphase_futex, 1);
++	  /* If we started a write phase, we need to enable readers to
++	     wait.  If we did not, we must not change it because other threads
++	     may have set the PTHREAD_RWLOCK_FUTEX_USED in the meantime.  */
++	  if ((r & PTHREAD_RWLOCK_WRPHASE) == 0)
++	    atomic_store_relaxed (&rwlock->__data.__wrphase_futex, 1);
+ 	  atomic_store_relaxed (&rwlock->__data.__cur_writer,
+ 	      THREAD_GETMEM (THREAD_SELF, tid));
+ 	  return 0;
+diff --git a/support/Makefile b/support/Makefile
+index 432cf2fe6c..c15b93647c 100644
+--- a/support/Makefile
++++ b/support/Makefile
+@@ -129,6 +129,7 @@ libsupport-routines = \
+   xpthread_mutexattr_settype \
+   xpthread_once \
+   xpthread_rwlock_init \
++  xpthread_rwlock_destroy \
+   xpthread_rwlock_rdlock \
+   xpthread_rwlock_unlock \
+   xpthread_rwlock_wrlock \
+diff --git a/support/xpthread_rwlock_destroy.c b/support/xpthread_rwlock_destroy.c
+new file mode 100644
+index 0000000000..6d6e953569
+--- /dev/null
++++ b/support/xpthread_rwlock_destroy.c
+@@ -0,0 +1,26 @@
++/* pthread_rwlock_destroy with error checking.
++   Copyright (C) 2019 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, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <support/xthread.h>
++
++void
++xpthread_rwlock_destroy (pthread_rwlock_t *rwlock)
++{
++  xpthread_check_return ("pthread_rwlock_destroy",
++                         pthread_rwlock_destroy (rwlock));
++}
+diff --git a/support/xthread.h b/support/xthread.h
+index 47c23235f3..9fe1f68b3b 100644
+--- a/support/xthread.h
++++ b/support/xthread.h
+@@ -84,6 +84,7 @@ void xpthread_rwlockattr_setkind_np (pthread_rwlockattr_t *attr, int pref);
+ void xpthread_rwlock_wrlock (pthread_rwlock_t *rwlock);
+ void xpthread_rwlock_rdlock (pthread_rwlock_t *rwlock);
+ void xpthread_rwlock_unlock (pthread_rwlock_t *rwlock);
++void xpthread_rwlock_destroy (pthread_rwlock_t *rwlock);
+ 
+ __END_DECLS
+ 
+From 44113a8ba24af23d7bbb174f9087a6b83a76289a Mon Sep 17 00:00:00 2001
+From: Stefan Liebler <stli@linux.ibm.com>
+Date: Thu, 7 Feb 2019 15:18:36 +0100
+Subject: [PATCH] Add compiler barriers around modifications of the robust
+ mutex list for pthread_mutex_trylock. [BZ #24180]
+diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c
+index 8fe43b8f0f..bf2869eca2 100644
+--- a/nptl/pthread_mutex_trylock.c
++++ b/nptl/pthread_mutex_trylock.c
+@@ -94,6 +94,9 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+     case PTHREAD_MUTEX_ROBUST_ADAPTIVE_NP:
+       THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending,
+ 		     &mutex->__data.__list.__next);
++      /* We need to set op_pending before starting the operation.  Also
++	 see comments at ENQUEUE_MUTEX.  */
++      __asm ("" ::: "memory");
+ 
+       oldval = mutex->__data.__lock;
+       do
+@@ -119,7 +122,12 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	      /* But it is inconsistent unless marked otherwise.  */
+ 	      mutex->__data.__owner = PTHREAD_MUTEX_INCONSISTENT;
+ 
++	      /* We must not enqueue the mutex before we have acquired it.
++		 Also see comments at ENQUEUE_MUTEX.  */
++	      __asm ("" ::: "memory");
+ 	      ENQUEUE_MUTEX (mutex);
++	      /* We need to clear op_pending after we enqueue the mutex.  */
++	      __asm ("" ::: "memory");
+ 	      THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 
+ 	      /* Note that we deliberately exist here.  If we fall
+@@ -135,6 +143,8 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	      int kind = PTHREAD_MUTEX_TYPE (mutex);
+ 	      if (kind == PTHREAD_MUTEX_ROBUST_ERRORCHECK_NP)
+ 		{
++		  /* We do not need to ensure ordering wrt another memory
++		     access.  Also see comments at ENQUEUE_MUTEX. */
+ 		  THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending,
+ 				 NULL);
+ 		  return EDEADLK;
+@@ -142,6 +152,8 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 
+ 	      if (kind == PTHREAD_MUTEX_ROBUST_RECURSIVE_NP)
+ 		{
++		  /* We do not need to ensure ordering wrt another memory
++		     access.  */
+ 		  THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending,
+ 				 NULL);
+ 
+@@ -160,6 +172,9 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 							id, 0);
+ 	  if (oldval != 0 && (oldval & FUTEX_OWNER_DIED) == 0)
+ 	    {
++	      /* We haven't acquired the lock as it is already acquired by
++		 another owner.  We do not need to ensure ordering wrt another
++		 memory access.  */
+ 	      THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 
+ 	      return EBUSY;
+@@ -173,13 +188,20 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	      if (oldval == id)
+ 		lll_unlock (mutex->__data.__lock,
+ 			    PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
++	      /* FIXME This violates the mutex destruction requirements.  See
++		 __pthread_mutex_unlock_full.  */
+ 	      THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 	      return ENOTRECOVERABLE;
+ 	    }
+ 	}
+       while ((oldval & FUTEX_OWNER_DIED) != 0);
+ 
++      /* We must not enqueue the mutex before we have acquired it.
++	 Also see comments at ENQUEUE_MUTEX.  */
++      __asm ("" ::: "memory");
+       ENQUEUE_MUTEX (mutex);
++      /* We need to clear op_pending after we enqueue the mutex.  */
++      __asm ("" ::: "memory");
+       THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 
+       mutex->__data.__owner = id;
+@@ -211,10 +233,15 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	}
+ 
+ 	if (robust)
+-	  /* Note: robust PI futexes are signaled by setting bit 0.  */
+-	  THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending,
+-			 (void *) (((uintptr_t) &mutex->__data.__list.__next)
+-				   | 1));
++	  {
++	    /* Note: robust PI futexes are signaled by setting bit 0.  */
++	    THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending,
++			   (void *) (((uintptr_t) &mutex->__data.__list.__next)
++				     | 1));
++	    /* We need to set op_pending before starting the operation.  Also
++	       see comments at ENQUEUE_MUTEX.  */
++	    __asm ("" ::: "memory");
++	  }
+ 
+ 	oldval = mutex->__data.__lock;
+ 
+@@ -223,12 +250,16 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	  {
+ 	    if (kind == PTHREAD_MUTEX_ERRORCHECK_NP)
+ 	      {
++		/* We do not need to ensure ordering wrt another memory
++		   access.  */
+ 		THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 		return EDEADLK;
+ 	      }
+ 
+ 	    if (kind == PTHREAD_MUTEX_RECURSIVE_NP)
+ 	      {
++		/* We do not need to ensure ordering wrt another memory
++		   access.  */
+ 		THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 
+ 		/* Just bump the counter.  */
+@@ -250,6 +281,9 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	  {
+ 	    if ((oldval & FUTEX_OWNER_DIED) == 0)
+ 	      {
++		/* We haven't acquired the lock as it is already acquired by
++		   another owner.  We do not need to ensure ordering wrt another
++		   memory access.  */
+ 		THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 
+ 		return EBUSY;
+@@ -270,6 +304,9 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	    if (INTERNAL_SYSCALL_ERROR_P (e, __err)
+ 		&& INTERNAL_SYSCALL_ERRNO (e, __err) == EWOULDBLOCK)
+ 	      {
++		/* The kernel has not yet finished the mutex owner death.
++		   We do not need to ensure ordering wrt another memory
++		   access.  */
+ 		THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 
+ 		return EBUSY;
+@@ -287,7 +324,12 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 	    /* But it is inconsistent unless marked otherwise.  */
+ 	    mutex->__data.__owner = PTHREAD_MUTEX_INCONSISTENT;
+ 
++	    /* We must not enqueue the mutex before we have acquired it.
++	       Also see comments at ENQUEUE_MUTEX.  */
++	    __asm ("" ::: "memory");
+ 	    ENQUEUE_MUTEX (mutex);
++	    /* We need to clear op_pending after we enqueue the mutex.  */
++	    __asm ("" ::: "memory");
+ 	    THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 
+ 	    /* Note that we deliberately exit here.  If we fall
+@@ -310,13 +352,20 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
+ 						  PTHREAD_ROBUST_MUTEX_PSHARED (mutex)),
+ 			      0, 0);
+ 
++	    /* To the kernel, this will be visible after the kernel has
++	       acquired the mutex in the syscall.  */
+ 	    THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 	    return ENOTRECOVERABLE;
+ 	  }
+ 
+ 	if (robust)
+ 	  {
++	    /* We must not enqueue the mutex before we have acquired it.
++	       Also see comments at ENQUEUE_MUTEX.  */
++	    __asm ("" ::: "memory");
+ 	    ENQUEUE_MUTEX_PI (mutex);
++	    /* We need to clear op_pending after we enqueue the mutex.  */
++	    __asm ("" ::: "memory");
+ 	    THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
+ 	  }
+ 
+From c096b008d2671028c21ac8cf01f18a2083e73c44 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 8 Feb 2019 12:54:41 +0100
+Subject: [PATCH] nptl: Avoid fork handler lock for async-signal-safe fork [BZ
+ #24161]
+--- a/nptl/register-atfork.c
++++ b/nptl/register-atfork.c
+@@ -107,13 +107,14 @@ __unregister_atfork (void *dso_handle)
+ }
+ 
+ void
+-__run_fork_handlers (enum __run_fork_handler_type who)
++__run_fork_handlers (enum __run_fork_handler_type who, _Bool do_locking)
+ {
+   struct fork_handler *runp;
+ 
+   if (who == atfork_run_prepare)
+     {
+-      lll_lock (atfork_lock, LLL_PRIVATE);
++      if (do_locking)
++	lll_lock (atfork_lock, LLL_PRIVATE);
+       size_t sl = fork_handler_list_size (&fork_handlers);
+       for (size_t i = sl; i > 0; i--)
+ 	{
+@@ -133,7 +134,8 @@ __run_fork_handlers (enum __run_fork_handler_type who)
+ 	  else if (who == atfork_run_parent && runp->parent_handler)
+ 	    runp->parent_handler ();
+ 	}
+-      lll_unlock (atfork_lock, LLL_PRIVATE);
++      if (do_locking)
++	lll_unlock (atfork_lock, LLL_PRIVATE);
+     }
+ }
+ 
+diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
+index bd68f18b45..14b69a6f89 100644
+--- a/sysdeps/nptl/fork.c
++++ b/sysdeps/nptl/fork.c
+@@ -55,7 +55,7 @@ __libc_fork (void)
+      but our current fork implementation is not.  */
+   bool multiple_threads = THREAD_GETMEM (THREAD_SELF, header.multiple_threads);
+ 
+-  __run_fork_handlers (atfork_run_prepare);
++  __run_fork_handlers (atfork_run_prepare, multiple_threads);
+ 
+   /* If we are not running multiple threads, we do not have to
+      preserve lock state.  If fork runs from a signal handler, only
+@@ -134,7 +134,7 @@ __libc_fork (void)
+       __rtld_lock_initialize (GL(dl_load_lock));
+ 
+       /* Run the handlers registered for the child.  */
+-      __run_fork_handlers (atfork_run_child);
++      __run_fork_handlers (atfork_run_child, multiple_threads);
+     }
+   else
+     {
+@@ -149,7 +149,7 @@ __libc_fork (void)
+ 	}
+ 
+       /* Run the handlers registered for the parent.  */
+-      __run_fork_handlers (atfork_run_parent);
++      __run_fork_handlers (atfork_run_parent, multiple_threads);
+     }
+ 
+   return pid;
+diff --git a/sysdeps/nptl/fork.h b/sysdeps/nptl/fork.h
+index a1c3b26b68..99ed76034b 100644
+--- a/sysdeps/nptl/fork.h
++++ b/sysdeps/nptl/fork.h
+@@ -52,10 +52,12 @@ enum __run_fork_handler_type
+    - atfork_run_child: run all the CHILD_HANDLER and unlocks the internal
+ 		       lock.
+    - atfork_run_parent: run all the PARENT_HANDLER and unlocks the internal
+-			lock.  */
+-extern void __run_fork_handlers (enum __run_fork_handler_type who)
+-  attribute_hidden;
++			lock.
++
++   Perform locking only if DO_LOCKING.  */
++extern void __run_fork_handlers (enum __run_fork_handler_type who,
++				 _Bool do_locking) attribute_hidden;
+ 
+ /* C library side function to register new fork handlers.  */
+ extern int __register_atfork (void (*__prepare) (void),
+
+From 067fc32968b601493f4b247a3ac00caeea3f3d61 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Fri, 15 Feb 2019 21:27:01 +0100
+Subject: [PATCH] nptl: Fix invalid Systemtap probe in pthread_join [BZ #24211]
+diff --git a/nptl/pthread_join_common.c b/nptl/pthread_join_common.c
+index ecb78ffba5..366feb376b 100644
+--- a/nptl/pthread_join_common.c
++++ b/nptl/pthread_join_common.c
+@@ -86,6 +86,7 @@ __pthread_timedjoin_ex (pthread_t threadid, void **thread_return,
+       pthread_cleanup_pop (0);
+     }
+ 
++  void *pd_result = pd->result;
+   if (__glibc_likely (result == 0))
+     {
+       /* We mark the thread as terminated and as joined.  */
+@@ -93,7 +94,7 @@ __pthread_timedjoin_ex (pthread_t threadid, void **thread_return,
+ 
+       /* Store the return value if the caller is interested.  */
+       if (thread_return != NULL)
+-	*thread_return = pd->result;
++	*thread_return = pd_result;
+ 
+       /* Free the TCB.  */
+       __free_tcb (pd);
+@@ -101,7 +102,7 @@ __pthread_timedjoin_ex (pthread_t threadid, void **thread_return,
+   else
+     pd->joinid = NULL;
+ 
+-  LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd->result);
++  LIBC_PROBE (pthread_join_ret, 3, threadid, result, pd_result);
+ 
+   return result;
+ }
+
+From bc6f839fb4066be83272c735e662850af2595777 Mon Sep 17 00:00:00 2001
+From: Stefan Liebler <stli@linux.ibm.com>
+Date: Wed, 13 Mar 2019 10:45:35 +0100
+Subject: [PATCH] Fix output of LD_SHOW_AUXV=1.
+diff --git a/elf/dl-sysdep.c b/elf/dl-sysdep.c
+index 5f6c679a3f..5d19b100b2 100644
+--- a/elf/dl-sysdep.c
++++ b/elf/dl-sysdep.c
+@@ -328,14 +328,9 @@ _dl_show_auxv (void)
+       assert (AT_NULL == 0);
+       assert (AT_IGNORE == 1);
+ 
+-      if (av->a_type == AT_HWCAP || av->a_type == AT_HWCAP2
+-	  || AT_L1I_CACHEGEOMETRY || AT_L1D_CACHEGEOMETRY
+-	  || AT_L2_CACHEGEOMETRY || AT_L3_CACHEGEOMETRY)
+-	{
+-	  /* These are handled in a special way per platform.  */
+-	  if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0)
+-	    continue;
+-	}
++      /* Some entries are handled in a special way per platform.  */
++      if (_dl_procinfo (av->a_type, av->a_un.a_val) == 0)
++	continue;
+ 
+       if (idx < sizeof (auxvars) / sizeof (auxvars[0])
+ 	  && auxvars[idx].form != unknown)
+diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
+index f542f7318f..dfc3b33a72 100644
+--- a/sysdeps/powerpc/dl-procinfo.h
++++ b/sysdeps/powerpc/dl-procinfo.h
+@@ -225,7 +225,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
+ 	break;
+       }
+     default:
+-      /* This should not happen.  */
++      /* Fallback to generic output mechanism.  */
+       return -1;
+     }
+    _dl_printf ("\n");
+diff --git a/sysdeps/sparc/dl-procinfo.h b/sysdeps/sparc/dl-procinfo.h
+index 282b8c5117..64ee267fc7 100644
+--- a/sysdeps/sparc/dl-procinfo.h
++++ b/sysdeps/sparc/dl-procinfo.h
+@@ -31,8 +31,8 @@ _dl_procinfo (unsigned int type, unsigned long int word)
+ {
+   int i;
+ 
+-  /* Fallback to unknown output mechanism.  */
+-  if (type == AT_HWCAP2)
++  /* Fallback to generic output mechanism.  */
++  if (type != AT_HWCAP)
+     return -1;
+ 
+   _dl_printf ("AT_HWCAP:   ");
+diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
+index 66c00297b7..05c62c8687 100644
+--- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
++++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h
+@@ -67,7 +67,7 @@ _dl_procinfo (unsigned int type, unsigned long int word)
+ 	break;
+       }
+     default:
+-      /* This should not happen.  */
++      /* Fallback to generic output mechanism.  */
+       return -1;
+     }
+   _dl_printf ("\n");
+diff --git a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
+index 22b43431bc..0585cdaa9c 100644
+--- a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
++++ b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h
+@@ -30,8 +30,8 @@ _dl_procinfo (unsigned int type, unsigned long int word)
+      in the kernel sources.  */
+   int i;
+ 
+-  /* Fallback to unknown output mechanism.  */
+-  if (type == AT_HWCAP2)
++  /* Fallback to generic output mechanism.  */
++  if (type != AT_HWCAP)
+     return -1;
+ 
+   _dl_printf ("AT_HWCAP:   ");
+diff --git a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
+index 19329a335b..d67fde368f 100644
+--- a/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
++++ b/sysdeps/unix/sysv/linux/s390/dl-procinfo.h
+@@ -32,8 +32,8 @@ _dl_procinfo (unsigned int type, unsigned long int word)
+      in the kernel sources.  */
+   int i;
+ 
+-  /* Fallback to unknown output mechanism.  */
+-  if (type == AT_HWCAP2)
++  /* Fallback to generic output mechanism.  */
++  if (type != AT_HWCAP)
+     return -1;
+ 
+   _dl_printf ("AT_HWCAP:   ");
+
+From e28ad442e73b00ae2047d89c8cc7f9b2a0de5436 Mon Sep 17 00:00:00 2001
+From: TAMUKI Shoichi <tamuki@linet.gr.jp>
+Date: Sat, 2 Mar 2019 21:00:28 +0900
+Subject: [PATCH] ja_JP: Change the offset for Taisho gan-nen from 2 to 1 [BZ
+ #24162]
+diff --git a/localedata/locales/ja_JP b/localedata/locales/ja_JP
+index 1fd2fee44b..9bfbb2bb9b 100644
+--- a/localedata/locales/ja_JP
++++ b/localedata/locales/ja_JP
+@@ -14951,7 +14951,7 @@ era	"+:2:1990//01//01:+*:<U5E73><U6210>:%EC%Ey<U5E74>";/
+ 	"+:2:1927//01//01:1989//01//07:<U662D><U548C>:%EC%Ey<U5E74>";/
+ 	"+:1:1926//12//25:1926//12//31:<U662D><U548C>:%EC<U5143><U5E74>";/
+ 	"+:2:1913//01//01:1926//12//24:<U5927><U6B63>:%EC%Ey<U5E74>";/
+-	"+:2:1912//07//30:1912//12//31:<U5927><U6B63>:%EC<U5143><U5E74>";/
++	"+:1:1912//07//30:1912//12//31:<U5927><U6B63>:%EC<U5143><U5E74>";/
+ 	"+:6:1873//01//01:1912//07//29:<U660E><U6CBB>:%EC%Ey<U5E74>";/
+ 	"+:1:0001//01//01:1872//12//31:<U897F><U66A6>:%EC%Ey<U5E74>";/
+ 	"+:1:-0001//12//31:-*:<U7D00><U5143><U524D>:%EC%Ey<U5E74>"
+
+From 0941350c20a52447e53c5169354408e3db591f73 Mon Sep 17 00:00:00 2001
+From: TAMUKI Shoichi <tamuki@linet.gr.jp>
+Date: Tue, 2 Apr 2019 16:46:55 +0900
+Subject: [PATCH] ja_JP locale: Add entry for the new Japanese era [BZ #22964]
+diff --git a/localedata/locales/ja_JP b/localedata/locales/ja_JP
+index 9bfbb2bb9b..c64aaaff55 100644
+--- a/localedata/locales/ja_JP
++++ b/localedata/locales/ja_JP
+@@ -14946,7 +14946,9 @@ am_pm	"<U5348><U524D>";"<U5348><U5F8C>"
+ 
+ t_fmt_ampm "%p%I<U6642>%M<U5206>%S<U79D2>"
+ 
+-era	"+:2:1990//01//01:+*:<U5E73><U6210>:%EC%Ey<U5E74>";/
++era	"+:2:2020//01//01:+*:<U4EE4><U548C>:%EC%Ey<U5E74>";/
++	"+:1:2019//05//01:2019//12//31:<U4EE4><U548C>:%EC<U5143><U5E74>";/
++	"+:2:1990//01//01:2019//04//30:<U5E73><U6210>:%EC%Ey<U5E74>";/
+ 	"+:1:1989//01//08:1989//12//31:<U5E73><U6210>:%EC<U5143><U5E74>";/
+ 	"+:2:1927//01//01:1989//01//07:<U662D><U548C>:%EC%Ey<U5E74>";/
+ 	"+:1:1926//12//25:1926//12//31:<U662D><U548C>:%EC<U5143><U5E74>";/
+
+From 52b7cd6e9a701bb203023d56e84551943dc6a4c0 Mon Sep 17 00:00:00 2001
+From: Adam Maris <amaris@redhat.com>
+Date: Thu, 14 Mar 2019 16:51:16 -0400
+Subject: [PATCH] malloc: Check for large bin list corruption when inserting
+ unsorted chunk
+diff --git a/malloc/malloc.c b/malloc/malloc.c
+index feaf7ee0bf..ce771375b6 100644
+--- a/malloc/malloc.c
++++ b/malloc/malloc.c
+@@ -3876,10 +3876,14 @@ _int_malloc (mstate av, size_t bytes)
+                         {
+                           victim->fd_nextsize = fwd;
+                           victim->bk_nextsize = fwd->bk_nextsize;
++                          if (__glibc_unlikely (fwd->bk_nextsize->fd_nextsize != fwd))
++                            malloc_printerr ("malloc(): largebin double linked list corrupted (nextsize)");
+                           fwd->bk_nextsize = victim;
+                           victim->bk_nextsize->fd_nextsize = victim;
+                         }
+                       bck = fwd->bk;
++                      if (bck->fd != fwd)
++                        malloc_printerr ("malloc(): largebin double linked list corrupted (bk)");
+                     }
+                 }
+               else
+
+From c6177be4b92d5d7df50a785652d1912db511423e Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@suse.de>
+Date: Wed, 15 May 2019 17:09:05 +0200
+Subject: [PATCH] Fix crash in _IO_wfile_sync (bug 20568)
+diff --git a/libio/wfileops.c b/libio/wfileops.c
+index 78f20486e5..bab2ba4892 100644
+--- a/libio/wfileops.c
++++ b/libio/wfileops.c
+@@ -508,11 +508,12 @@ _IO_wfile_sync (FILE *fp)
+ 	     generate the wide characters up to the current reading
+ 	     position.  */
+ 	  int nread;
+-
++	  size_t wnread = (fp->_wide_data->_IO_read_ptr
++			   - fp->_wide_data->_IO_read_base);
+ 	  fp->_wide_data->_IO_state = fp->_wide_data->_IO_last_state;
+ 	  nread = (*cv->__codecvt_do_length) (cv, &fp->_wide_data->_IO_state,
+ 					      fp->_IO_read_base,
+-					      fp->_IO_read_end, delta);
++					      fp->_IO_read_end, wnread);
+ 	  fp->_IO_read_ptr = fp->_IO_read_base + nread;
+ 	  delta = -(fp->_IO_read_end - fp->_IO_read_base - nread);
+ 	}
+
+From e3f828b8bd6e21922da8be8dee35edef09382d8d Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark@klomp.org>
+Date: Wed, 15 May 2019 17:14:01 +0200
+Subject: [PATCH] dlfcn: Guard __dlerror_main_freeres with __libc_once_get
+ (once) [BZ#24476]
+diff --git a/dlfcn/dlerror.c b/dlfcn/dlerror.c
+index 27376582d0..ca42c126c1 100644
+--- a/dlfcn/dlerror.c
++++ b/dlfcn/dlerror.c
+@@ -72,9 +72,16 @@ __dlerror (void)
+   __libc_once (once, init);
+ 
+   /* Get error string.  */
+-  result = (struct dl_action_result *) __libc_getspecific (key);
+-  if (result == NULL)
+-    result = &last_result;
++  if (static_buf != NULL)
++    result = static_buf;
++  else
++    {
++      /* init () has been run and we don't use the static buffer.
++	 So we have a valid key.  */
++      result = (struct dl_action_result *) __libc_getspecific (key);
++      if (result == NULL)
++	result = &last_result;
++    }
+ 
+   /* Test whether we already returned the string.  */
+   if (result->returned != 0)
+@@ -230,13 +237,19 @@ free_key_mem (void *mem)
+ void
+ __dlerror_main_freeres (void)
+ {
+-  void *mem;
+   /* Free the global memory if used.  */
+   check_free (&last_result);
+-  /* Free the TSD memory if used.  */
+-  mem = __libc_getspecific (key);
+-  if (mem != NULL)
+-    free_key_mem (mem);
++
++  if (__libc_once_get (once) && static_buf == NULL)
++    {
++      /* init () has been run and we don't use the static buffer.
++	 So we have a valid key.  */
++      void *mem;
++      /* Free the TSD memory if used.  */
++      mem = __libc_getspecific (key);
++      if (mem != NULL)
++	free_key_mem (mem);
++    }
+ }
+ 
+ struct dlfcn_hook *_dlfcn_hook __attribute__((nocommon));
+
+From 95d66fecaabbc92ab53027e808f0fc1929c9f21a Mon Sep 17 00:00:00 2001
+From: Wilco Dijkstra <wdijkstr@arm.com>
+Date: Fri, 10 May 2019 16:38:21 +0100
+Subject: [PATCH] Fix tcache count maximum (BZ #24531)
+diff --git a/malloc/malloc.c b/malloc/malloc.c
+index ce771375b6..0abd653be2 100644
+--- a/malloc/malloc.c
++++ b/malloc/malloc.c
+@@ -2919,6 +2919,8 @@ typedef struct tcache_perthread_struct
+   tcache_entry *entries[TCACHE_MAX_BINS];
+ } tcache_perthread_struct;
+ 
++#define MAX_TCACHE_COUNT 127	/* Maximum value of counts[] entries.  */
++
+ static __thread bool tcache_shutting_down = false;
+ static __thread tcache_perthread_struct *tcache = NULL;
+ 
+@@ -5124,8 +5126,11 @@ static inline int
+ __always_inline
+ do_set_tcache_count (size_t value)
+ {
+-  LIBC_PROBE (memory_tunable_tcache_count, 2, value, mp_.tcache_count);
+-  mp_.tcache_count = value;
++  if (value <= MAX_TCACHE_COUNT)
++    {
++      LIBC_PROBE (memory_tunable_tcache_count, 2, value, mp_.tcache_count);
++      mp_.tcache_count = value;
++    }
+   return 1;
+ }
+ 
+From 34fb5f61d3c3f4b8fc616ea259fa19168b58ecd4 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Wed, 13 Feb 2019 01:20:51 +0000
+Subject: [PATCH] libio: do not attempt to free wide buffers of legacy streams
+ [BZ #24228]
+diff --git a/libio/genops.c b/libio/genops.c
+index 2a0d9b81df..11a15549e8 100644
+--- a/libio/genops.c
++++ b/libio/genops.c
+@@ -789,9 +789,16 @@ _IO_unbuffer_all (void)
+ 
+   for (fp = (FILE *) _IO_list_all; fp; fp = fp->_chain)
+     {
++      int legacy = 0;
++
++#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
++      if (__glibc_unlikely (_IO_vtable_offset (fp) != 0))
++	legacy = 1;
++#endif
++
+       if (! (fp->_flags & _IO_UNBUFFERED)
+ 	  /* Iff stream is un-orientated, it wasn't used. */
+-	  && fp->_mode != 0)
++	  && (legacy || fp->_mode != 0))
+ 	{
+ #ifdef _IO_MTSAFE_IO
+ 	  int cnt;
+@@ -805,7 +812,7 @@ _IO_unbuffer_all (void)
+ 	      __sched_yield ();
+ #endif
+ 
+-	  if (! dealloc_buffers && !(fp->_flags & _IO_USER_BUF))
++	  if (! legacy && ! dealloc_buffers && !(fp->_flags & _IO_USER_BUF))
+ 	    {
+ 	      fp->_flags |= _IO_USER_BUF;
+ 
+@@ -816,7 +823,7 @@ _IO_unbuffer_all (void)
+ 
+ 	  _IO_SETBUF (fp, NULL, 0);
+ 
+-	  if (fp->_mode > 0)
++	  if (! legacy && fp->_mode > 0)
+ 	    _IO_wsetb (fp, NULL, NULL, 0);
+ 
+ #ifdef _IO_MTSAFE_IO
+@@ -827,7 +834,8 @@ _IO_unbuffer_all (void)
+ 
+       /* Make sure that never again the wide char functions can be
+ 	 used.  */
+-      fp->_mode = -1;
++      if (! legacy)
++	fp->_mode = -1;
+     }
+ 
+ #ifdef _IO_MTSAFE_IO
+
diff --git a/gnu/packages/patches/glibc-CVE-2019-7309.patch b/gnu/packages/patches/glibc-CVE-2019-7309.patch
new file mode 100644
index 0000000000..f9f623830a
--- /dev/null
+++ b/gnu/packages/patches/glibc-CVE-2019-7309.patch
@@ -0,0 +1,76 @@
+Fix <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-7309>.
+
+Taken from this upstream commit, sans ChangeLog updates and tests:
+<https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3f635fb43389b54f682fc9ed2acc0b2aaf4a923d>.
+
+diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
+index 1fc487caa5..1322bb3b92 100644
+--- a/sysdeps/x86_64/memcmp.S
++++ b/sysdeps/x86_64/memcmp.S
+@@ -21,14 +21,18 @@
+ 
+ 	.text
+ ENTRY (memcmp)
+-	test	%rdx, %rdx
++#ifdef __ILP32__
++	/* Clear the upper 32 bits.  */
++	movl	%edx, %edx
++#endif
++	test	%RDX_LP, %RDX_LP
+ 	jz	L(finz)
+ 	cmpq	$1, %rdx
+-	jle	L(finr1b)
++	jbe	L(finr1b)
+ 	subq	%rdi, %rsi
+ 	movq	%rdx, %r10
+ 	cmpq	$32, %r10
+-	jge	L(gt32)
++	jae	L(gt32)
+ 	/* Handle small chunks and last block of less than 32 bytes.  */
+ L(small):
+ 	testq	$1, %r10
+@@ -156,7 +160,7 @@ L(A32):
+ 	movq	%r11, %r10
+ 	andq	$-32, %r10
+ 	cmpq	%r10, %rdi
+-        jge	L(mt16)
++        jae	L(mt16)
+ 	/* Pre-unroll to be ready for unrolled 64B loop.  */
+ 	testq	$32, %rdi
+ 	jz	L(A64)
+@@ -178,7 +182,7 @@ L(A64):
+ 	movq	%r11, %r10
+ 	andq	$-64, %r10
+ 	cmpq	%r10, %rdi
+-        jge	L(mt32)
++        jae	L(mt32)
+ 
+ L(A64main):
+ 	movdqu    (%rdi,%rsi), %xmm0
+@@ -216,7 +220,7 @@ L(mt32):
+ 	movq	%r11, %r10
+ 	andq	$-32, %r10
+ 	cmpq	%r10, %rdi
+-        jge	L(mt16)
++        jae	L(mt16)
+ 
+ L(A32main):
+ 	movdqu    (%rdi,%rsi), %xmm0
+@@ -254,7 +258,7 @@ L(ATR):
+ 	movq	%r11, %r10
+ 	andq	$-32, %r10
+ 	cmpq	%r10, %rdi
+-        jge	L(mt16)
++        jae	L(mt16)
+ 	testq	$16, %rdi
+ 	jz	L(ATR32)
+ 
+@@ -325,7 +329,7 @@ L(ATR64main):
+ 	movq	%r11, %r10
+ 	andq	$-32, %r10
+ 	cmpq	%r10, %rdi
+-        jge	L(mt16)
++        jae	L(mt16)
+ 
+ L(ATR32res):
+ 	movdqa    (%rdi,%rsi), %xmm0
diff --git a/gnu/packages/patches/glibc-CVE-2019-9169.patch b/gnu/packages/patches/glibc-CVE-2019-9169.patch
new file mode 100644
index 0000000000..029b4ddbd7
--- /dev/null
+++ b/gnu/packages/patches/glibc-CVE-2019-9169.patch
@@ -0,0 +1,22 @@
+Fix <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9169>.
+
+Taken from this upstream commit, sans ChangeLog updates:
+https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=583dd860d5b833037175247230a328f0050dbfe9
+
+diff --git a/posix/regexec.c b/posix/regexec.c
+index 91d5a797b8..084b1222d9 100644
+--- a/posix/regexec.c
++++ b/posix/regexec.c
+@@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
+ 	      else if (naccepted)
+ 		{
+ 		  char *buf = (char *) re_string_get_buffer (&mctx->input);
+-		  if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+-			      naccepted) != 0)
++		  if (mctx->input.valid_len - *pidx < naccepted
++		      || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
++				  naccepted)
++			  != 0))
+ 		    return -1;
+ 		}
+ 	    }
diff --git a/gnu/packages/patches/glibc-boot-2.16.0.patch b/gnu/packages/patches/glibc-boot-2.16.0.patch
new file mode 100644
index 0000000000..5cb29bc271
--- /dev/null
+++ b/gnu/packages/patches/glibc-boot-2.16.0.patch
@@ -0,0 +1,352 @@
+This patch enables building glibc-2.2.5 using TCC and GNU Make 4.x and Mes C Library.
+
+  * Makefile: Do not link with (non-existent) libgc_eh.
+  * Makefile: Add SHELL variable, ready for substitution, export it.
+  * Makefile: Do not build or assume librpc_compat_pic.
+  * Makefile: Do not build libmesusage.
+  * gen-as-const: Always add preamble.
+  * [BOOTSTRAP_GLIBC]: Really disable rpc.
+
+Upstream status: Not presented upstream.
+
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/elf/Makefile glibc-2.16.0/elf/Makefile
+--- /home/janneke/src/glibc-2.16.0/elf/Makefile	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/elf/Makefile	2018-09-02 12:54:44.616962543 +0200
+@@ -17,6 +17,8 @@
+ 
+ # Makefile for elf subdirectory of GNU C Library.
+ 
++SHELL := /bin/sh
++
+ subdir		:= elf
+ 
+ headers		= elf.h bits/elfclass.h link.h bits/link.h
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/include/libc-symbols.h glibc-2.16.0/include/libc-symbols.h
+--- /home/janneke/src/glibc-2.16.0/include/libc-symbols.h	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/include/libc-symbols.h	2018-09-02 22:41:00.798467803 +0200
+@@ -558,9 +558,9 @@ for linking")
+ # define libc_hidden_weak(name) hidden_weak (name)
+ # ifdef LINK_OBSOLETE_RPC
+    /* libc_hidden_nolink_sunrpc should only get used in sunrpc code.  */
+-#  define libc_hidden_nolink_sunrpc(name, version) hidden_def (name)
++#  define libc_hidden_nolink_sunrpc(name, version)
+ # else
+-#  define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version)
++#  define libc_hidden_nolink_sunrpc(name, version)
+ # endif
+ # define libc_hidden_ver(local, name) hidden_ver (local, name)
+ # define libc_hidden_data_def(name) hidden_data_def (name)
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/Makeconfig glibc-2.16.0/Makeconfig
+--- /home/janneke/src/glibc-2.16.0/Makeconfig	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/Makeconfig	2018-09-03 00:00:25.290357414 +0200
+@@ -23,6 +23,9 @@ ifneq (,)
+ This makefile requires GNU Make.
+ endif
+ 
++SHELL := /bin/sh
++export SHELL
++
+ all: # Make this the default goal
+ 
+ ifneq "$(origin +included-Makeconfig)" "file"
+@@ -521,9 +524,9 @@ ifneq ($(have-cc-with-libunwind),yes)
+ else
+   libunwind = -lunwind
+ endif
+-libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
++libgcc_eh := #-Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
+ gnulib := -lgcc $(libgcc_eh)
+-static-gnulib := -lgcc -lgcc_eh $(libunwind)
++static-gnulib := -lgcc $(libunwind)
+ libc.so-gnulib := -lgcc
+ endif
+ +preinit = $(addprefix $(csu-objpfx),crti.o)
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/Makefile glibc-2.16.0/Makefile
+--- /home/janneke/src/glibc-2.16.0/Makefile	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/Makefile	2018-09-02 23:01:10.485803965 +0200
+@@ -22,6 +22,9 @@ ifneq (,)
+ This makefile requires GNU Make.
+ endif
+ 
++SHELL := /bin/sh
++export SHELL
++
+ include Makeconfig
+ 
+ 
+@@ -135,13 +138,10 @@ $(common-objpfx)linkobj/libc.so: $(elfob
+ 				 $(shlib-lds)
+ 	$(build-shlib)
+ 
+-$(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a \
+-				    $(common-objpfx)sunrpc/librpc_compat_pic.a
++$(common-objpfx)linkobj/libc_pic.a: $(common-objpfx)libc_pic.a
+ 	$(..)./scripts/mkinstalldirs $(common-objpfx)linkobj
+ 	(cd $(common-objpfx)linkobj; \
+ 	 $(AR) x ../libc_pic.a; \
+-	 rm $$($(AR) t ../sunrpc/librpc_compat_pic.a | sed 's/^compat-//'); \
+-	 $(AR) x ../sunrpc/librpc_compat_pic.a; \
+ 	 $(AR) cr libc_pic.a *.os; \
+ 	 rm *.os)
+ endif
+@@ -151,7 +151,7 @@ endif
+ # the current libc build for testing.
+ $(common-objpfx)testrun.sh: $(common-objpfx)config.make \
+ 			    $(..)Makeconfig $(..)Makefile
+-	(echo '#!/bin/sh'; \
++	(echo '#! $(SHELL)'; \
+ 	 echo 'builddir=`dirname "$$0"`'; \
+ 	 echo 'GCONV_PATH="$${builddir}/iconvdata" \'; \
+ 	 echo 'exec $(subst $(common-objdir),"$${builddir}",\
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/Makefile.in glibc-2.16.0/Makefile.in
+--- /home/janneke/src/glibc-2.16.0/Makefile.in	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/Makefile.in	2018-09-02 13:03:01.892962551 +0200
+@@ -9,3 +9,6 @@ all .DEFAULT:
+ install:
+ 	LANGUAGE=C LC_ALL=C; export LANGUAGE LC_ALL; \
+ 	$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
++
++export SHELL
++export BASH
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/malloc/Makefile glibc-2.16.0/malloc/Makefile
+--- /home/janneke/src/glibc-2.16.0/malloc/Makefile	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/malloc/Makefile	2018-09-02 17:11:33.461547394 +0200
+@@ -35,7 +35,7 @@ install-lib := libmcheck.a
+ non-lib.a := libmcheck.a
+ 
+ # Additional library.
+-extra-libs = libmemusage
++extra-libs = #libmemusage
+ extra-libs-others = $(extra-libs)
+ 
+ libmemusage-routines = memusage
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/nscd/cache.c glibc-2.16.0/nscd/cache.c
+--- /home/janneke/src/glibc-2.16.0/nscd/cache.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/nscd/cache.c	2018-09-02 23:38:31.757616750 +0200
+@@ -74,7 +74,11 @@ struct datahead *
+ cache_search (request_type type, const void *key, size_t len,
+ 	      struct database_dyn *table, uid_t owner)
+ {
++#if !BOOTSTRAP_GLIBC
+   unsigned long int hash = __nis_hash (key, len) % table->head->module;
++#else
++  unsigned long int hash = 0;
++#endif
+ 
+   unsigned long int nsearched = 0;
+   struct datahead *result = NULL;
+@@ -153,7 +153,11 @@ cache_add (int type, const void *key, si
+ 	       first ? _(" (first)") : "");
+     }
+ 
++#if !BOOTSTRAP_GLIBC
+   unsigned long int hash = __nis_hash (key, len) % table->head->module;
++#else
++  unsigned long int hash = 0;
++#endif
+   struct hashentry *newp;
+ 
+   newp = mempool_alloc (table, sizeof (struct hashentry), 0);
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/nscd/Makefile glibc-2.16.0/nscd/Makefile
+--- /home/janneke/src/glibc-2.16.0/nscd/Makefile	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/nscd/Makefile	2018-09-02 23:49:29.948031787 +0200
+@@ -126,9 +126,7 @@ include $(patsubst %,$(..)cppflags-itera
+ $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
+ 
+ ifeq ($(build-shared),yes)
+-$(objpfx)nscd: $(common-objpfx)rt/librt.so $(shared-thread-library) \
+-	       $(common-objpfx)nis/libnsl.so
++$(objpfx)nscd: $(common-objpfx)rt/librt.so $(shared-thread-library)
+ else
+-$(objpfx)nscd: $(common-objpfx)rt/librt.a $(static-thread-library) \
+-	       $(common-objpfx)nis/libnsl.a
++$(objpfx)nscd: $(common-objpfx)rt/librt.a $(static-thread-library)
+ endif
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/nscd/nscd_helper.c glibc-2.16.0/nscd/nscd_helper.c
+--- /home/janneke/src/glibc-2.16.0/nscd/nscd_helper.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/nscd/nscd_helper.c	2018-09-02 23:38:04.941189464 +0200
+@@ -474,7 +474,7 @@ struct datahead *
+ __nscd_cache_search (request_type type, const char *key, size_t keylen,
+ 		     const struct mapped_database *mapped, size_t datalen)
+ {
+-  unsigned long int hash = __nis_hash (key, keylen) % mapped->head->module;
++  unsigned long int hash = 0;
+   size_t datasize = mapped->datasize;
+ 
+   ref_t trail = mapped->head->array[hash];
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/nss/getent.c glibc-2.16.0/nss/getent.c
+--- /home/janneke/src/glibc-2.16.0/nss/function.def	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/nss/function.def	2018-09-18 13:54:49.582060539 +0200
+@@ -63,10 +63,12 @@
+ DEFINE_GET (files, pwnam)
+ DEFINE_GET (files, pwuid)
+ 
++#if !BOOTSTRAP_GLIBC
+ /* rpc */
+ DEFINE_ENT (files, rpc)
+ DEFINE_GETBY (files, rpc, name)
+ DEFINE_GETBY (files, rpc, number)
++#endif
+ 
+ /* services */
+ DEFINE_ENT (files, serv)
+diff -u ~/src/glibc-2.16.0/nss/getent.c glibc-2.16.0/nss/getent.c
+--- /home/janneke/src/glibc-2.16.0/nss/getent.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/nss/getent.c	2018-09-18 13:57:41.856849140 +0200
+@@ -700,6 +700,7 @@
+   return result;
+ }
+ 
++#if !BOOTSTRAP_GLIBC
+ /* Now is all for rpc */
+ static inline void
+ print_rpc (struct rpcent *rpc)
+@@ -745,6 +746,7 @@
+ 
+   return result;
+ }
++#endif //rpc
+ 
+ /* for services */
+ static void
+@@ -880,7 +882,9 @@
+ D(networks)
+ D(passwd)
+ D(protocols)
++#if !BOOTSTRAP_GLIBC
+ D(rpc)
++#endif
+ D(services)
+ D(shadow)
+ #undef D
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/resolv/netdb.h glibc-2.16.0/resolv/netdb.h
+--- /home/janneke/src/glibc-2.16.0/resolv/netdb.h	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/resolv/netdb.h	2018-09-08 08:49:30.537811219 +0200
+@@ -26,11 +26,13 @@
+ 
+ #include <netinet/in.h>
+ #include <stdint.h>
++#if 0 //!BOOTSTRAP_GLIBC
+ #ifdef __USE_MISC
+ /* This is necessary to make this include file properly replace the
+    Sun version.  */
+ # include <rpc/netdb.h>
+ #endif
++#endif
+ 
+ #ifdef __USE_GNU
+ # define __need_sigevent_t
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/Rules glibc-2.16.0/Rules
+--- /home/janneke/src/glibc-2.16.0/Rules	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/Rules	2018-09-02 10:52:06.927362861 +0200
+@@ -24,6 +24,9 @@ ifneq (,)
+ This makefile requires GNU Make.
+ endif
+ 
++export SHELL
++export BASH
++
+ all: # Don't let the default goal come from Makeconfig.
+ 
+ include $(firstword $(..) ../)Makeconfig
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/scripts/gen-as-const.awk glibc-2.16.0/scripts/gen-as-const.awk
+--- /home/janneke/src/glibc-2.16.0/scripts/gen-as-const.awk	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/scripts/gen-as-const.awk	2018-09-01 18:08:37.266516330 +0200
+@@ -14,6 +14,12 @@ BEGIN { started = 0 }
+ 
+ NF >= 1 && !started {
+   if (test) {
++    print "\n#include <stddef.h>";
++    print "\n#include <stdint.h>";
++#    print "\ntypedef unsigned long size_t;";
++    print "\n#ifndef offsetof";
++    print "\n#define offsetof(type, field) ((size_t)&((type *)0)->field)";
++    print "\n#endif";
+     print "\n#include <inttypes.h>";
+     print "\n#include <stdio.h>";
+     print "\n#include <bits/wordsize.h>";
+@@ -33,8 +39,15 @@ NF >= 1 && !started {
+       " source, #name, U (asconst_##name), #expr, (c_t) (expr));" \
+       " } else ++good;\n";
+   }
+-  else
++  else {
++    print "\n#include <stddef.h>";
++    print "\n#include <stdint.h>";
++#    print "\ntypedef unsigned long size_t;";
++    print "\n#ifndef offsetof";
++    print "\n#define offsetof(type, field) ((size_t)&((type *)0)->field)";
++    print "\n#endif";
+     print "void dummy(void) {";
++  }
+   started = 1;
+ }
+ 
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/sunrpc/auth_none.c glibc-2.16.0/sunrpc/auth_none.c
+--- /home/janneke/src/glibc-2.16.0/sunrpc/auth_none.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/auth_none.c	2018-09-02 22:09:21.629007932 +0200
+@@ -95,7 +95,9 @@ authnone_create (void)
+   __libc_once (authnone_private_guard, authnone_create_once);
+   return &authnone_private.no_client;
+ }
++#if !BOOTSTRAP_GLIBC
+ libc_hidden_nolink_sunrpc (authnone_create, GLIBC_2_0)
++#endif
+ 
+ static bool_t
+ authnone_marshal (AUTH *client, XDR *xdrs)
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/sunrpc/authuxprot.c glibc-2.16.0/sunrpc/authuxprot.c
+--- /home/janneke/src/glibc-2.16.0/sunrpc/authuxprot.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/authuxprot.c	2018-09-02 22:15:51.927158451 +0200
+@@ -63,4 +63,6 @@ xdr_authunix_parms (XDR * xdrs, struct a
+     }
+   return FALSE;
+ }
++#if !BOOTSTRAP_GLIBC
+ libc_hidden_nolink_sunrpc (xdr_authunix_parms, GLIBC_2_0)
++#endif
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/sunrpc/bindrsvprt.c glibc-2.16.0/sunrpc/bindrsvprt.c
+--- /home/janneke/src/glibc-2.16.0/sunrpc/bindrsvprt.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/bindrsvprt.c	2018-09-02 22:24:32.687187675 +0200
+@@ -96,4 +96,7 @@ bindresvport (int sd, struct sockaddr_in
+ 
+   return res;
+ }
++#if !BOOTSTRAP_GLIBC
+ libc_hidden_def (bindresvport)
++#endif
++
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/sunrpc/clnt_raw.c glibc-2.16.0/sunrpc/clnt_raw.c
+--- /home/janneke/src/glibc-2.16.0/sunrpc/clnt_raw.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/clnt_raw.c	2018-09-02 22:33:21.151343826 +0200
+@@ -40,6 +40,7 @@
+ #include <rpc/svc.h>
+ #include <rpc/xdr.h>
+ #include <libintl.h>
++#include <stddef.h>
+ 
+ #define MCALL_MSG_SIZE 24
+ 
+@@ -129,7 +130,9 @@ clntraw_create (u_long prog, u_long vers
+   client->cl_auth = authnone_create ();
+   return client;
+ }
++#if !BOOTSTRAP_GLIBC
+ libc_hidden_nolink_sunrpc (clntraw_create, GLIBC_2_0)
++#endif
+ 
+ static enum clnt_stat
+ clntraw_call (h, proc, xargs, argsp, xresults, resultsp, timeout)
+diff '--exclude=*.orig' -purN /home/janneke/src/glibc-2.16.0/sunrpc/clnt_simp.c glibc-2.16.0/sunrpc/clnt_simp.c
+--- /home/janneke/src/glibc-2.16.0/sunrpc/clnt_simp.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/clnt_simp.c	2018-09-02 22:34:14.884175251 +0200
+@@ -139,7 +139,9 @@ callrpc (const char *host, u_long prognu
+     crp->valid = 0;
+   return (int) clnt_stat;
+ }
++#if !BOOTSTRAP_GLIBC
+ libc_hidden_nolink_sunrpc (callrpc, GLIBC_2_0)
++#endif
+ 
+ #ifdef _RPC_THREAD_SAFE_
+ void
diff --git a/gnu/packages/patches/glibc-boot-2.2.5.patch b/gnu/packages/patches/glibc-boot-2.2.5.patch
new file mode 100644
index 0000000000..26bc92a6bb
--- /dev/null
+++ b/gnu/packages/patches/glibc-boot-2.2.5.patch
@@ -0,0 +1,251 @@
+This patch enables building glibc-2.2.5 using TCC and GNU Make 4.x and Mes C Library.
+
+  * Makefile: Do not assemble from stdin, use file indirection.
+  * Makefile: Add new target: install-lib-all.
+  * Makefile: Avoid building stub DOC.
+  * [_LIBC_REENTRANT]: Add missing guarding.
+  * [MES_BOOTSTRAP]: Disable some GCC extensions.
+  * [MES_BOOTSTRAP]: Add missing GCC div/mod defines.
+
+Upstream status: Not presented upstream.
+
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/config.h.in glibc-2.2.5/config.h.in
+--- ../glibc-2.2.5/config.h.in	2001-11-16 02:02:56.000000000 +0100
++++ glibc-2.2.5/config.h.in	2018-06-17 21:30:02.313029074 +0200
+@@ -1,3 +1,10 @@
++#if MES_BOOTSTRAP && BOOTSTRAP_GLIBC
++#undef __umoddi3
++#define __umoddi3(a,b) ((a)%(b))
++#undef __udivdi3
++#define __udivdi3(a,b) ((a)/(b))
++#endif
++
+ #if !defined ASSEMBLER && !defined _ISOMAC && !defined __OPTIMIZE__
+ # error "glibc cannot be compiled without optimization"
+ #endif
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/configure glibc-2.2.5/configure
+--- ../glibc-2.2.5/configure	2002-01-08 23:16:44.000000000 +0100
++++ glibc-2.2.5/configure	2018-06-07 20:47:26.608895319 +0200
+@@ -1530,7 +1530,7 @@ echo "configure:1530: checking version o
+   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 -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/Makeconfig glibc-2.2.5/Makeconfig
+--- ../glibc-2.2.5/Makeconfig	2001-09-12 20:49:45.000000000 +0200
++++ glibc-2.2.5/Makeconfig	2018-06-20 16:33:35.472167202 +0200
+@@ -400,7 +400,7 @@ ifndef +link
+ 						     $(start-installed-name))\
+ 			   $(+preinit) $(link-extra-libs) \
+ 			   $(common-objpfx)libc% $(+postinit),$^) \
+-	      $(link-extra-libs) $(link-libc) $(+postctor) $(+postinit)
++	      $(link-extra-libs) $(link-libc) $(+postctor) $(+postinit) -lc -lgcc2
+ endif
+ # Command for statically linking programs with the C library.
+ ifndef +link-static
+@@ -412,7 +412,7 @@ ifndef +link-static
+ 						     $(start-installed-name))\
+ 			   $(+preinit) $(link-extra-libs-static) \
+ 			   $(common-objpfx)libc% $(+postinit),$^) \
+-	      $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit)
++	      $(link-extra-libs-static) $(link-libc-static) $(+postctor) $(+postinit) -lc -lgcc2
+ endif
+ # Command for statically linking bounded-pointer programs with the C library.
+ ifndef +link-bounded
+@@ -424,7 +424,7 @@ ifndef +link-bounded
+ 						     $(start-installed-name))\
+ 			   $(+preinit) $(link-extra-libs-bounded) \
+ 			   $(common-objpfx)libc% $(+postinit),$^) \
+-	      $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctor) $(+postinit)
++	      $(link-extra-libs-bounded) $(link-libc-bounded) $(+postctor) $(+postinit) -lc -lgcc2
+ endif
+ ifndef config-LDFLAGS
+ ifeq (yesyes,$(build-shared)$(elf))
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/Makerules glibc-2.2.5/Makerules
+--- ../glibc-2.2.5/Makerules	2001-11-16 02:02:19.000000000 +0100
++++ glibc-2.2.5/Makerules	2018-06-10 15:03:42.390329860 +0200
+@@ -748,6 +748,18 @@ endef
+ installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
+ 			     $(inst_libdir)/$(patsubst %,$(libtype$o),\
+ 						     $(libprefix)$(libc-name)))
++
++ifeq (yes,$(build-shared))
++install-lib-all: $(inst_libdir)/libc.a \
++                $(inst_slibdir)/libc.so$(libc.so-version) \
++		$(inst_slibdir)/libc-$(version).so \
++		$(inst_libdir)/libc.so \
++	install-lib
++else
++install-lib-all: $(inst_libdir)/libc.a \
++	install-lib
++endif
++
+ install: $(installed-libcs)
+ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
+ 	$(make-target-directory)
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/misc/syslog.c glibc-2.2.5/misc/syslog.c
+--- ../glibc-2.2.5/misc/syslog.c	2001-08-31 01:13:49.000000000 +0200
++++ glibc-2.2.5/misc/syslog.c	2018-06-09 09:01:20.008918690 +0200
+@@ -216,9 +216,11 @@ vsyslog(pri, fmt, ap)
+ 
+ 	/* Prepare for multiple users.  We have to take care: open and
+ 	   write are cancellation points.  */
++#if _LIBC_REENTRANT
+ 	__libc_cleanup_region_start (1, (void (*) (void *)) cancel_handler,
+ 				     &oldaction_ptr);
+ 	__libc_lock_lock (syslog_lock);
++#endif
+ 
+ 	/* Prepare for a broken connection.  */
+  	memset (&action, 0, sizeof (action));
+@@ -268,9 +270,11 @@ vsyslog(pri, fmt, ap)
+ 	if (sigpipe == 0)
+ 		__sigaction (SIGPIPE, &oldaction, (struct sigaction *) NULL);
+ 
++#if _LIBC_REENTRANT
+ 	/* End of critical section.  */
+ 	__libc_cleanup_region_end (0);
+ 	__libc_lock_unlock (syslog_lock);
++#endif
+ 
+ 	free (buf);
+ }
+@@ -326,16 +330,20 @@ openlog_internal(const char *ident, int
+ void
+ openlog (const char *ident, int logstat, int logfac)
+ {
++#if _LIBC_REENTRANT
+   /* Protect against multiple users.  */
+   __libc_cleanup_region_start (1,
+ 			       (void (*) __P ((void *))) __libc_mutex_unlock,
+ 			       &syslog_lock);
+   __libc_lock_lock (syslog_lock);
++#endif
+ 
+   openlog_internal (ident, logstat, logfac);
+ 
++#if _LIBC_REENTRANT
+   /* Free the lock.  */
+   __libc_cleanup_region_end (1);
++#endif
+ }
+ 
+ static void
+@@ -358,18 +366,22 @@ closelog_internal()
+ void
+ closelog ()
+ {
++#if _LIBC_REENTRANT
+   /* Protect against multiple users.  */
+   __libc_cleanup_region_start (1,
+ 			       (void (*) __P ((void *))) __libc_mutex_unlock,
+ 			       &syslog_lock);
+   __libc_lock_lock (syslog_lock);
++#endif
+ 
+   closelog_internal ();
+   LogTag = NULL;
+   LogType = SOCK_DGRAM; /* this is the default */
+ 
++#if _LIBC_REENTRANT
+   /* Free the lock.  */
+   __libc_cleanup_region_end (1);
++#endif
+ }
+ 
+ #ifdef _LIBC_REENTRANT
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/Rules glibc-2.2.5/Rules
+--- ../glibc-2.2.5/Rules	2001-08-30 00:44:35.000000000 +0200
++++ glibc-2.2.5/Rules	2018-06-09 08:15:54.880683675 +0200
+@@ -218,7 +218,7 @@ endif
+ 	fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; 	\
+ 	filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`;	\
+ 	iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`;	\
+-	fopen_max=$${fopen_max:-16};					\
++	fopen_max=$${fu_fopen_max:-16};					\
+ 	filename_max=$${filename_max:-1024};				\
+ 	if [ -z $$iov_max ]; then					\
+ 	  define_iov_max="# undef IOV_MAX";				\
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/stdio-common/perror.c glibc-2.2.5/stdio-common/perror.c
+--- ../glibc-2.2.5/stdio-common/perror.c	2001-09-01 07:33:01.000000000 +0200
++++ glibc-2.2.5/stdio-common/perror.c	2018-06-09 10:42:25.909899529 +0200
+@@ -48,6 +48,9 @@ perror_internal (FILE *fp, const char *s
+ }
+ 
+ 
++#if MES_BOOTSTRAP
++#define fileno_unlocked(x) 1
++#endif
+ /* Print a line on stderr consisting of the text in S, a colon, a space,
+    a message describing the meaning of the contents of `errno' and a newline.
+    If S is NULL or "", the colon and space are omitted.  */
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/sysdeps/i386/fpu/ftestexcept.c glibc-2.2.5/sysdeps/i386/fpu/ftestexcept.c
+--- ../glibc-2.2.5/sysdeps/i386/fpu/ftestexcept.c	2001-07-06 06:55:53.000000000 +0200
++++ glibc-2.2.5/sysdeps/i386/fpu/ftestexcept.c	2018-06-09 09:45:13.363031424 +0200
+@@ -25,8 +25,10 @@ fetestexcept (int excepts)
+ {
+   int temp;
+ 
++#if !MES_BOOTSTRAP
+   /* Get current exceptions.  */
+   __asm__ ("fnstsw %0" : "=a" (temp));
++#endif
+ 
+   return temp & excepts & FE_ALL_EXCEPT;
+ }
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/sysdeps/unix/make-syscalls.sh glibc-2.2.5/sysdeps/unix/make-syscalls.sh
+--- ../glibc-2.2.5/sysdeps/unix/make-syscalls.sh	2001-09-13 00:19:30.000000000 +0200
++++ glibc-2.2.5/sysdeps/unix/make-syscalls.sh	2018-06-20 15:16:01.813004453 +0200
+@@ -173,7 +173,7 @@ shared-only-routines += $file
+   done
+ 
+   # And finally, pipe this all into the compiler.
+-  echo '	) | $(COMPILE.S) -x assembler-with-cpp -o $@ -'
++  echo '	) > stdin.c; $(COMPILE.S) -x assembler-with-cpp -o $@ stdin.c'
+ 
+   case $weak in
+   *@*)
+@@ -284,7 +284,7 @@ shared-only-routines += $file
+     echo "\
+ 	 echo ''; \\
+ 	 echo '#include <bp-thunks.h>'; \\
+-	) | \$(COMPILE.c) -x c -o \$@ -"
++	) > stdin.c; \$(COMPILE.c) -x c -o \$@ stdin.c"
+ ### Use this for debugging intermediate output:
+ ### 	) >\$(@:.ob=.c)
+ ### 	\$(subst -c,-E,\$(COMPILE.c)) -o \$(@:.ob=.ib) \$(@:.ob=.c)
+diff -purN -x .git -x fubar -x fubar.c -x Makefile -x config.status -x config.h -x BOOT -x BOOT-GCC -x texis -x '*.info*' ../glibc-2.2.5/sysdeps/unix/sysv/linux/sys/timex.h glibc-2.2.5/sysdeps/unix/sysv/linux/sys/timex.h
+--- ../glibc-2.2.5/sysdeps/unix/sysv/linux/sys/timex.h	2001-07-06 06:56:21.000000000 +0200
++++ glibc-2.2.5/sysdeps/unix/sysv/linux/sys/timex.h	2018-06-09 20:09:07.713806647 +0200
+@@ -54,10 +54,12 @@ struct timex
+   long int errcnt;	/* calibration errors (ro) */
+   long int stbcnt;	/* stability limit exceeded (ro) */
+ 
++#if !MES_BOOTSTRAP
+   /* ??? */
+   int  :32; int  :32; int  :32; int  :32;
+   int  :32; int  :32; int  :32; int  :32;
+   int  :32; int  :32; int  :32; int  :32;
++#endif
+ };
+ 
+ /* Mode codes (timex.mode) */
+--- ../glibc-2.2.5/manual/Makefile	2001-08-28 10:05:40.000000000 +0200
++++ glibc-2.2.5/manual/Makefile	2018-06-09 10:13:03.093633660 +0200
+@@ -247,7 +247,11 @@
+ .PHONY: stubs
+ stubs: $(objpfx)stubs
+ endif
+-$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
++po/manual.pot $(objpfx)stubs:
++	$(make-target-directory)
++	touch $@
++
++$(objpfx)stamp%:
+ 	$(make-target-directory)
+ 	touch $@
+ 
diff --git a/gnu/packages/patches/glibc-bootstrap-system-2.16.0.patch b/gnu/packages/patches/glibc-bootstrap-system-2.16.0.patch
new file mode 100644
index 0000000000..936d592f1a
--- /dev/null
+++ b/gnu/packages/patches/glibc-bootstrap-system-2.16.0.patch
@@ -0,0 +1,30 @@
+We want to allow builds in chroots that lack /bin/sh.  Thus, system(3)
+and popen(3) need to be tweaked to use the right shell.  For the bootstrap
+glibc, we just use whatever `sh' can be found in $PATH.  The final glibc
+instead uses the hard-coded absolute file name of `bash'.
+
+--- a/sysdeps/posix/system.c
++++ b/sysdeps/posix/system.c
+@@ -134,7 +134,7 @@ do_system (const char *line)
+       INIT_LOCK ();
+ 
+       /* Exec the shell.  */
+-      (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ);
++      (void) __execvpe (SHELL_NAME, (char *const *) new_argv, __environ);
+       _exit (127);
+     }
+   else if (pid < (pid_t) 0)
+
+--- a/libio/iopopen.c
++++ b/libio/iopopen.c
+@@ -145,7 +145,7 @@ _IO_new_proc_open (fp, command, mode)
+ 	    _IO_close (fd);
+ 	}
+ 
+-      _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
++      execlp ("sh", "sh", "-c", command, (char *) 0);
+       _IO__exit (127);
+     }
+   _IO_close (child_end);
+
+
diff --git a/gnu/packages/patches/glibc-bootstrap-system.patch b/gnu/packages/patches/glibc-bootstrap-system.patch
index addeed6dbd..39eb47ef26 100644
--- a/gnu/packages/patches/glibc-bootstrap-system.patch
+++ b/gnu/packages/patches/glibc-bootstrap-system.patch
@@ -5,26 +5,24 @@ instead uses the hard-coded absolute file name of `bash'.
 
 --- a/sysdeps/posix/system.c
 +++ b/sysdeps/posix/system.c
-@@ -134,7 +134,7 @@ do_system (const char *line)
-       INIT_LOCK ();
+@@ -140,7 +140,7 @@ do_system (const char *line)
+   __posix_spawnattr_setflags (&spawn_attr,
+ 			      POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
  
-       /* Exec the shell.  */
--      (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ);
-+      (void) __execvpe (SHELL_NAME, (char *const *) new_argv, __environ);
-       _exit (127);
-     }
-   else if (pid < (pid_t) 0)
-
+-  status = __posix_spawn (&pid, SHELL_PATH, 0, &spawn_attr,
++  status = posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
+ 			  (char *const[]){ (char*) SHELL_NAME,
+ 					   (char*) "-c",
+ 					   (char *) line, NULL },
 --- a/libio/iopopen.c
 +++ b/libio/iopopen.c
-@@ -145,7 +145,7 @@ _IO_new_proc_open (fp, command, mode)
- 	    __close_nocancel (fd);
- 	}
- 
--      execl ("/bin/sh", "sh", "-c", command, (char *) 0);
-+      execlp ("sh", "sh", "-c", command, (char *) 0);
-       _exit (127);
+@@ -85,7 +85,7 @@ spawn_process (posix_spawn_file_actions_t *fa, FILE *fp, const char *command,
+ 	return false;
      }
-   __close_nocancel (child_end);
-
+ 
+-  if (__posix_spawn (&((_IO_proc_file *) fp)->pid, _PATH_BSHELL, fa, 0,
++  if (posix_spawnp (&((_IO_proc_file *) fp)->pid, "sh", fa, 0,
+ 		     (char *const[]){ (char*) "sh", (char*) "-c",
+ 		     (char *) command, NULL }, __environ) != 0)
+     return false;
 
diff --git a/gnu/packages/patches/glibc-locales-2.28.patch b/gnu/packages/patches/glibc-locales-2.28.patch
new file mode 100644
index 0000000000..31ee6c1ff3
--- /dev/null
+++ b/gnu/packages/patches/glibc-locales-2.28.patch
@@ -0,0 +1,31 @@
+This patch allows us to use glibc's build system to build locales
+in a package separate from glibc.
+
+  1. Use 'localedef' from $PATH since we are not rebuilding it.
+  2. Use '--no-archive' to avoid building the big locale archive, and
+     because the already-built 'localedef' would want to write it
+     to '/run/current-system/locale', which is not possible.
+  3. Pass $(inst_complocaledir)/$$locale to install files in the right
+     place, and because otherwise, 'localedef' fails with:
+     "cannot write output files to `(null)'".
+
+--- glibc-2.27/localedata/Makefile
++++ glibc-2.27/localedata/Makefile
+@@ -199,7 +199,7 @@ INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+ 
+ # Sometimes the whole collection of locale files should be installed.
+ LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
+-$(rtld-prefix) $(common-objpfx)locale/localedef
++  localedef --no-archive
+ install-locales: $(INSTALL-SUPPORTED-LOCALES)
+ 
+ install-locales-dir:
+@@ -224,7 +224,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
+ 	input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
+ 	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
+ 		     -i locales/$$input -f charmaps/$$charset \
+-		     $(addprefix --prefix=,$(install_root)) $$locale \
++		     $(addprefix --prefix=,$(install_root)) $(inst_complocaledir)/$$locale \
+ 	&& echo ' done'; \
+ 
+ tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
diff --git a/gnu/packages/patches/glibc-locales.patch b/gnu/packages/patches/glibc-locales.patch
index 31ee6c1ff3..9329a09063 100644
--- a/gnu/packages/patches/glibc-locales.patch
+++ b/gnu/packages/patches/glibc-locales.patch
@@ -9,23 +9,24 @@ in a package separate from glibc.
      place, and because otherwise, 'localedef' fails with:
      "cannot write output files to `(null)'".
 
---- glibc-2.27/localedata/Makefile
-+++ glibc-2.27/localedata/Makefile
-@@ -199,7 +199,7 @@ INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+diff -ru glibc-2.29-old/localedata/Makefile glibc-2.29-new/localedata/Makefile
+--- glibc-2.29-old/localedata/Makefile	2019-01-31 11:45:36.000000000 -0500
++++ glibc-2.29-new/localedata/Makefile	2019-07-03 22:48:35.662015071 -0400
+@@ -385,7 +385,7 @@
  
  # Sometimes the whole collection of locale files should be installed.
  LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 -$(rtld-prefix) $(common-objpfx)locale/localedef
 +  localedef --no-archive
- install-locales: $(INSTALL-SUPPORTED-LOCALES)
+ install-locales: install-locale-archive
  
- install-locales-dir:
-@@ -224,7 +224,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
+ # Create and install the locale-archive file.
+@@ -414,7 +414,7 @@
  	input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
  	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
  		     -i locales/$$input -f charmaps/$$charset \
 -		     $(addprefix --prefix=,$(install_root)) $$locale \
 +		     $(addprefix --prefix=,$(install_root)) $(inst_complocaledir)/$$locale \
- 	&& echo ' done'; \
+ 	&& echo ' done';
+ endef
  
- tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
diff --git a/gnu/packages/patches/glibc-supported-locales.patch b/gnu/packages/patches/glibc-supported-locales.patch
new file mode 100644
index 0000000000..05865dc7be
--- /dev/null
+++ b/gnu/packages/patches/glibc-supported-locales.patch
@@ -0,0 +1,33 @@
+This patch is taken from debian's glibc package (generate-supported.mk).
+It install the localedata/SUPPORTED file of the glibc. This file lists
+all the supported locales of the glibc.
+
+diff --git a/localedata/Makefile b/localedata/Makefile
+index 65079f9eb8..14818f84e0 100644
+--- a/localedata/Makefile
++++ b/localedata/Makefile
+@@ -169,7 +169,8 @@ endif
+ # Files to install.
+ install-others := $(addprefix $(inst_i18ndir)/, \
+ 			      $(addsuffix .gz, $(charmaps)) \
+-			      $(locales))
++			      $(locales)) \
++                   $(inst_i18ndir)/SUPPORTED
+ 
+ tests: $(objdir)/iconvdata/gconv-modules
+ 
+@@ -380,6 +381,14 @@ endif
+ 
+ include SUPPORTED
+ 
++$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
++	for locale in $(SUPPORTED-LOCALES); do \
++		[ $$locale = true ] && continue; \
++		echo $$locale | sed 's,/, ,' >> LOCALES; \
++	done
++	$(make-target-directory)
++	$(INSTALL_DATA) LOCALES $@
++
+ INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+ INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
+ 
\ No newline at end of file
diff --git a/gnu/packages/patches/gnome-control-center-udisks.patch b/gnu/packages/patches/gnome-control-center-udisks.patch
new file mode 100644
index 0000000000..823684b2e9
--- /dev/null
+++ b/gnu/packages/patches/gnome-control-center-udisks.patch
@@ -0,0 +1,221 @@
+This patch is derived from upstream commit 2520aea6 and fixes upstream issues
+285 and 302.  See https://gitlab.gnome.org/GNOME/gcr/merge_requests/387,
+https://gitlab.gnome.org/GNOME/gnome-control-center/issues/285 and
+https://gitlab.gnome.org/GNOME/gnome-control-center/issues/302.
+
+diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
+index e2276a295b3fd9de01b30fc3369069b5d33ba5b7..ff47c1fef2493bcc7ab34f9e8716d570d8d370ed 100644
+--- a/panels/info/cc-info-overview-panel.c
++++ b/panels/info/cc-info-overview-panel.c
+@@ -36,6 +36,7 @@
+ #include <glibtop/mountlist.h>
+ #include <glibtop/mem.h>
+ #include <glibtop/sysinfo.h>
++#include <udisks/udisks.h>
+ 
+ #include <gdk/gdk.h>
+ 
+@@ -81,9 +82,7 @@ typedef struct
+ 
+   GCancellable   *cancellable;
+ 
+-  /* Free space */
+-  GList          *primary_mounts;
+-  guint64         total_bytes;
++  UDisksClient   *client;
+ 
+   GraphicsData   *graphics_data;
+ } CcInfoOverviewPanelPrivate;
+@@ -96,8 +95,6 @@ struct _CcInfoOverviewPanel
+  CcInfoOverviewPanelPrivate *priv;
+ };
+ 
+-static void get_primary_disc_info_start (CcInfoOverviewPanel *self);
+-
+ typedef struct
+ {
+   char *major;
+@@ -486,111 +483,51 @@ get_os_type (void)
+ }
+ 
+ static void
+-query_done (GFile               *file,
+-            GAsyncResult        *res,
+-            CcInfoOverviewPanel *self)
++get_primary_disc_info (CcInfoOverviewPanel *self)
+ {
+   CcInfoOverviewPanelPrivate *priv;
+-  g_autoptr(GFileInfo) info = NULL;
+-  g_autoptr(GError) error = NULL;
+-
+-  info = g_file_query_filesystem_info_finish (file, res, &error);
+-  if (info != NULL)
+-    {
+-      priv = cc_info_overview_panel_get_instance_private (self);
+-      priv->total_bytes += g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
+-    }
+-  else
+-    {
+-      if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+-          return;
+-      else
+-        {
+-          g_autofree char *path = NULL;
+-          path = g_file_get_path (file);
+-          g_warning ("Failed to get filesystem free space for '%s': %s", path, error->message);
+-        }
+-    }
++  GDBusObjectManager *manager;
++  g_autolist(GDBusObject) objects = NULL;
++  GList *l;
++  guint64 total_size;
+ 
+-  /* And onto the next element */
+-  get_primary_disc_info_start (self);
+-}
+-
+-static void
+-get_primary_disc_info_start (CcInfoOverviewPanel *self)
+-{
+-  GUnixMountEntry *mount;
+-  g_autoptr(GFile) file = NULL;
+-  CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
++  priv = cc_info_overview_panel_get_instance_private (self);
++  total_size = 0;
+ 
+-  if (priv->primary_mounts == NULL)
++  if (!priv->client)
+     {
+-      g_autofree char *size = NULL;
+-
+-      size = g_format_size (priv->total_bytes);
+-      gtk_label_set_text (GTK_LABEL (priv->disk_label), size);
+-
++      gtk_label_set_text (GTK_LABEL (priv->disk_label), _("Unknown"));
+       return;
+     }
+ 
+-  mount = priv->primary_mounts->data;
+-  priv->primary_mounts = g_list_remove (priv->primary_mounts, mount);
+-  file = g_file_new_for_path (g_unix_mount_get_mount_path (mount));
+-  g_unix_mount_free (mount);
+-
+-  g_file_query_filesystem_info_async (file,
+-                                      G_FILE_ATTRIBUTE_FILESYSTEM_SIZE,
+-                                      0,
+-                                      priv->cancellable,
+-                                      (GAsyncReadyCallback) query_done,
+-                                      self);
+-}
+-
+-static void
+-get_primary_disc_info (CcInfoOverviewPanel *self)
+-{
+-  GList *points;
+-  GList *p;
+-  GHashTable *hash;
+-  CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+-
+-  hash = g_hash_table_new (g_str_hash, g_str_equal);
+-  points = g_unix_mount_points_get (NULL);
+-
+-  /* If we do not have /etc/fstab around, try /etc/mtab */
+-  if (points == NULL)
+-    points = g_unix_mounts_get (NULL);
++  manager = udisks_client_get_object_manager (priv->client);
++  objects = g_dbus_object_manager_get_objects (manager);
+ 
+-  for (p = points; p != NULL; p = p->next)
++  for (l = objects; l != NULL; l = l->next)
+     {
+-      GUnixMountEntry *mount = p->data;
+-      const char *mount_path;
+-      const char *device_path;
+-
+-      mount_path = g_unix_mount_get_mount_path (mount);
+-      device_path = g_unix_mount_get_device_path (mount);
+-
+-      /* Do not count multiple mounts with same device_path, because it is
+-       * probably something like btrfs subvolume. Use only the first one in
+-       * order to count the real size. */
+-      if (gsd_should_ignore_unix_mount (mount) ||
+-          gsd_is_removable_mount (mount) ||
+-          g_str_has_prefix (mount_path, "/media/") ||
+-          g_str_has_prefix (mount_path, g_get_home_dir ()) ||
+-          g_hash_table_lookup (hash, device_path) != NULL)
++      UDisksDrive *drive;
++      drive = udisks_object_peek_drive (UDISKS_OBJECT (l->data));
++
++      /* Skip removable devices */
++      if (drive == NULL ||
++          udisks_drive_get_removable (drive) ||
++          udisks_drive_get_ejectable (drive))
+         {
+-          g_unix_mount_free (mount);
+           continue;
+         }
+ 
+-      priv->primary_mounts = g_list_prepend (priv->primary_mounts, mount);
+-      g_hash_table_insert (hash, (gpointer) device_path, (gpointer) device_path);
++      total_size += udisks_drive_get_size (drive);
+     }
+-  g_list_free (points);
+-  g_hash_table_destroy (hash);
+ 
+-  priv->cancellable = g_cancellable_new ();
+-  get_primary_disc_info_start (self);
++  if (total_size > 0)
++    {
++      g_autofree gchar *size = g_format_size (total_size);
++      gtk_label_set_text (GTK_LABEL (priv->disk_label), size);
++    }
++  else
++    {
++      gtk_label_set_text (GTK_LABEL (priv->disk_label), _("Unknown"));
++    }
+ }
+ 
+ static char *
+@@ -852,8 +789,7 @@ cc_info_overview_panel_finalize (GObject *object)
+       g_clear_object (&priv->cancellable);
+     }
+ 
+-  if (priv->primary_mounts)
+-    g_list_free_full (priv->primary_mounts, (GDestroyNotify) g_unix_mount_free);
++  g_clear_object (&priv->client);
+ 
+   g_free (priv->gnome_version);
+   g_free (priv->gnome_date);
+@@ -895,6 +831,7 @@ static void
+ cc_info_overview_panel_init (CcInfoOverviewPanel *self)
+ {
+   CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
++  g_autoptr(GError) error = NULL;
+ 
+   gtk_widget_init_template (GTK_WIDGET (self));
+ 
+@@ -907,6 +844,12 @@ cc_info_overview_panel_init (CcInfoOverviewPanel *self)
+   else
+     gtk_widget_destroy (priv->updates_button);
+ 
++  priv->client = udisks_client_new_sync (NULL, &error);
++
++  if (error != NULL)
++      g_warning ("Unable to get UDisks client: %s. Disk information will not be available.",
++                 error->message);
++
+   info_overview_panel_setup_overview (self);
+   info_overview_panel_setup_virt (self);
+ }
+diff --git a/panels/info/meson.build b/panels/info/meson.build
+index 03742551314f91b60e3ec1caad153ff314b93310..c54e5fdaff3c6ddb59cca8ee9a2bf5a0212bf196 100644
+--- a/panels/info/meson.build
++++ b/panels/info/meson.build
+@@ -61,6 +61,7 @@ sources += gnome.compile_resources(
+ 
+ deps = common_deps + [
+   polkit_gobject_dep,
++  dependency('udisks2', version: '>= 2.1.8'),
+   dependency('libgtop-2.0')
+ ]
+ 
diff --git a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch b/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
index d00cc5a420..956fa617c3 100644
--- a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
+++ b/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
@@ -2,10 +2,134 @@
 # add the full path.
 #
 # This patch was provided by Luca Bruno <lucabru@src.gnome.org>  for 
-# 'gobject-introspection' 1.40.0 in Nix. 
---- ./giscanner/utils.py.orig	2014-08-14 22:05:05.055334080 +0200
-+++ ./giscanner/utils.py	2014-08-14 22:05:24.687497334 +0200
-@@ -110,17 +110,11 @@
+# 'gobject-introspection' 1.40.0 in Nix.
+#
+# It has since been updated to work with newer versions of
+# gobject-introspection.
+--- a/giscanner/scannermain.py
++++ b/giscanner/scannermain.py
+@@ -95,6 +95,39 @@ def get_windows_option_group(parser):
+     return group
+ 
+ 
++def _get_default_fallback_libpath():
++    # Newer multiple-output-optimized stdenv has an environment variable
++    # $outputLib which in turn specifies another variable which then is used as
++    # the destination for the library contents (${!outputLib}/lib).
++    store_path = os.environ.get(os.environ.get("outputLib")) if "outputLib" in os.environ else None
++    if store_path is None:
++        outputs = os.environ.get("outputs", "out").split()
++        if "lib" in outputs:
++            # For multiple output derivations let's try whether there is a $lib
++            # environment variable and use that as the base store path.
++            store_path = os.environ.get("lib")
++        elif "out" in outputs:
++            # Otherwise we have a single output derivation, so the libraries
++            # most certainly will end up in "$out/lib".
++            store_path = os.environ.get("out")
++
++    if store_path is not None:
++        # Even if we have a $lib as output, there still should be a $lib/lib
++        # directory.
++        return os.path.join(store_path, 'lib')
++    else:
++        # If we haven't found a possible scenario, let's return an empty string
++        # so that the shared library won't be prepended with a path.
++        #
++        # Note that this doesn't mean that all hope is lost, because after all
++        # we can still use --fallback-library-path to set one.
++        #
++        # Also, we're not returning None, because that would make it very
++        # difficult to disable adding fallback paths altogether using something
++        # like: --fallback-library-path=""
++        return ""
++
++
+ def _get_option_parser():
+     parser = optparse.OptionParser('%prog [options] sources',
+                                    version='%prog ' + giscanner.__version__)
+@@ -205,6 +238,10 @@ match the namespace prefix.""")
+     parser.add_option("", "--filelist",
+                       action="store", dest="filelist", default=[],
+                       help="file containing headers and sources to be scanned")
++    parser.add_option("", "--fallback-library-path",
++                      action="store", dest="fallback_libpath",
++                      default=_get_default_fallback_libpath(),
++                      help="Path to prepend to unknown shared libraries")
+ 
+     group = get_preprocessor_option_group(parser)
+     parser.add_option_group(group)
+--- a/giscanner/shlibs.py
++++ b/giscanner/shlibs.py
+@@ -57,6 +57,14 @@ def _ldd_library_pattern(library_name):
+     $""" % re.escape(library_name), re.VERBOSE)
+ 
+ 
++def _ldd_library_guix_pattern(library_name):
++    store_dir = re.escape(
++      os.environ.get("NIX_STORE", default="/gnu/store")
++    )
++    pattern = r'(%s(?:/[^/]*)+lib%s[^A-Za-z0-9_-][^\s\(\)]*)'
++    return re.compile(pattern % (store_dir, re.escape(library_name)))
++
++
+ # This is a what we do for non-la files. We assume that we are on an
+ # ELF-like system where ldd exists and the soname extracted with ldd is
+ # a filename that can be opened with dlopen().
+@@ -106,7 +112,8 @@ def _resolve_non_libtool(options, binary, libraries):
+             output = output.decode("utf-8", "replace")
+ 
+         shlibs = resolve_from_ldd_output(libraries, output)
+-        return list(map(sanitize_shlib_path, shlibs))
++        fallback_libpath = options.fallback_libpath or "";
++        return list(map(lambda p: os.path.join(fallback_libpath, p), map(sanitize_shlib_path, shlibs)))
+ 
+ 
+ def sanitize_shlib_path(lib):
+@@ -115,19 +122,18 @@ def sanitize_shlib_path(lib):
+     # In case we get relative paths on macOS (like @rpath) then we fall
+     # back to the basename as well:
+     # https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
+-    if sys.platform == "darwin":
+-        if not os.path.isabs(lib):
+-            return os.path.basename(lib)
+-        return lib
+-    else:
++
++    # Always use absolute paths if available
++    if not os.path.isabs(lib):
+         return os.path.basename(lib)
++    return lib
+ 
+ 
+ def resolve_from_ldd_output(libraries, output):
+     patterns = {}
+     for library in libraries:
+         if not os.path.isfile(library):
+-            patterns[library] = _ldd_library_pattern(library)
++            patterns[library] = (_ldd_library_pattern(library), _ldd_library_guix_pattern(library))
+     if len(patterns) == 0:
+         return []
+ 
+@@ -139,8 +145,12 @@ def resolve_from_ldd_output(libraries, output):
+         if line.endswith(':'):
+             continue
+         for word in line.split():
+-            for library, pattern in patterns.items():
+-                m = pattern.match(word)
++            for library, (pattern, guix_pattern) in patterns.items():
++                store_dir = os.environ.get("NIX_STORE", default="/gnu/store")
++                if line.find(store_dir) != -1:
++                    m = guix_pattern.match(word)
++                else:
++                    m = pattern.match(word)
+                 if m:
+                     del patterns[library]
+                     shlibs.append(m.group())
+
+--- a/giscanner/utils.py
++++ b/giscanner/utils.py
+@@ -111,17 +111,11 @@ def extract_libtool_shlib(la_file):
      if dlname is None:
          return None
  
@@ -28,3 +152,15 @@
  
  
  def extract_libtool(la_file):
+--- a/tests/scanner/test_shlibs.py
++++ b/tests/scanner/test_shlibs.py
+@@ -40,6 +64,7 @@ class TestLddParser(unittest.TestCase):
+ 
+         self.assertEqual(
+             sanitize_shlib_path('/foo/bar'),
+-            '/foo/bar' if sys.platform == 'darwin' else 'bar')
++            # Always use an absolute filename for Guix
++            '/foo/bar')
+ 
+     def test_unresolved_library(self):
+output = ''
diff --git a/gnu/packages/patches/gobject-introspection-cc.patch b/gnu/packages/patches/gobject-introspection-cc.patch
index d9cacf4ca7..6a86b56b44 100644
--- a/gnu/packages/patches/gobject-introspection-cc.patch
+++ b/gnu/packages/patches/gobject-introspection-cc.patch
@@ -1,11 +1,14 @@
 Use gcc as the default C compiler if CC is not set.
 
-
---- gobject-introspection-1.44.0.orig/giscanner/__init__.py	2014-08-04 22:37:07.000000000 +0800
-+++ gobject-introspection-1.44.0/giscanner/__init__.py	2015-04-20 17:30:26.507697234 +0800
-@@ -22,3 +22,5 @@
+diff -ru gobject-introspection-1.58.1.orig/giscanner/__init__.py gobject-introspection-1.58.1/giscanner/__init__.py
+--- gobject-introspection-1.58.1.orig/giscanner/__init__.py	1970-01-01 01:00:00.000000000 +0100
++++ gobject-introspection-1.58.1/giscanner/__init__.py	2018-12-03 13:33:28.788971299 +0100
+@@ -22,6 +22,8 @@
  builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR')
  if builddir is not None:
      __path__.append(os.path.join(builddir, 'giscanner'))
 +if not 'CC' in os.environ:
 +    os.environ['CC'] = 'gcc'
+ try:
+     from ._version import __version__
+ except ImportError:
diff --git a/gnu/packages/patches/groff-source-date-epoch.patch b/gnu/packages/patches/groff-source-date-epoch.patch
deleted file mode 100644
index 53c590b049..0000000000
--- a/gnu/packages/patches/groff-source-date-epoch.patch
+++ /dev/null
@@ -1,299 +0,0 @@
-Adds support for the environment variable SOURCE_DATE_EPOCH.
-
-See: https://sources.debian.net/patches/groff/1.22.3-9/source-date-epoch.patch/
-
-From abc23bc9245e18468817f2838361c3a08f7521e2 Mon Sep 17 00:00:00 2001
-From: Colin Watson <cjwatson@debian.org>
-Date: Thu, 5 Nov 2015 11:47:34 +0000
-Subject: Implement `SOURCE_DATE_EPOCH' for reproducible builds.
-
-Author: Colin Watson <cjwatson@debian.org>
-Forwarded: yes
-Last-Update: 2015-11-05
-
-Patch-Name: source-date-epoch.patch
----
- doc/groff.texinfo                 |  6 +++++
- src/devices/grohtml/grohtml.man   |  7 ++++++
- src/devices/grohtml/post-html.cpp |  5 ++--
- src/devices/gropdf/gropdf.man     |  7 ++++++
- src/devices/gropdf/gropdf.pl      |  3 ++-
- src/devices/grops/grops.man       |  7 ++++++
- src/devices/grops/ps.cpp          |  3 ++-
- src/include/curtime.h             | 23 ++++++++++++++++++
- src/libs/libgroff/Makefile.sub    |  2 ++
- src/libs/libgroff/curtime.cpp     | 51 +++++++++++++++++++++++++++++++++++++++
- src/roff/troff/input.cpp          |  3 ++-
- 11 files changed, 112 insertions(+), 5 deletions(-)
- create mode 100644 src/include/curtime.h
- create mode 100644 src/libs/libgroff/curtime.cpp
-
-diff --git a/doc/groff.texinfo b/doc/groff.texinfo
-index 066b5274..1d3c7a9f 100644
---- a/doc/groff.texinfo
-+++ b/doc/groff.texinfo
-@@ -1453,6 +1453,12 @@ default directory (on Unix and GNU/Linux systems, this is usually
- @item GROFF_TYPESETTER
- @tindex GROFF_TYPESETTER@r{, environment variable}
- The default output device.
-+
-+@item SOURCE_DATE_EPOCH
-+@tindex SOURCE_DATE_EPOCH@r{, environment variable}
-+A timestamp (expressed as seconds since the Unix epoch) to use in place of
-+the current time when initializing time-based built-in registers such as
-+@code{\n[seconds]}.
- @end table
- 
- Note that MS-DOS and MS-Windows ports of @code{groff} use semi-colons,
-diff --git a/src/devices/grohtml/grohtml.man b/src/devices/grohtml/grohtml.man
-index 51eae224..4be4abbc 100644
---- a/src/devices/grohtml/grohtml.man
-+++ b/src/devices/grohtml/grohtml.man
-@@ -419,6 +419,13 @@ and
- for more details.
- .
- .
-+.TP
-+.SM
-+.B SOURCE_DATE_EPOCH
-+A timestamp (expressed as seconds since the Unix epoch) to use as the
-+creation timestamp in place of the current time.
-+.
-+.
- .\" --------------------------------------------------------------------
- .SH BUGS
- .\" --------------------------------------------------------------------
-diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp
-index fefbf014..b5fc5167 100644
---- a/src/devices/grohtml/post-html.cpp
-+++ b/src/devices/grohtml/post-html.cpp
-@@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
- #include "html.h"
- #include "html-text.h"
- #include "html-table.h"
-+#include "curtime.h"
- 
- #include <time.h>
- 
-@@ -5013,7 +5014,7 @@ void html_printer::do_file_components (void)
- 	.put_string(Version_string)
- 	.end_comment();
- 
--      t = time(0);
-+      t = current_time();
-       html.begin_comment("CreationDate: ")
- 	.put_string(ctime(&t), strlen(ctime(&t))-1)
- 	.end_comment();
-@@ -5126,7 +5127,7 @@ html_printer::~html_printer()
-     .put_string(Version_string)
-     .end_comment();
- 
--  t = time(0);
-+  t = current_time();
-   html.begin_comment("CreationDate: ")
-     .put_string(ctime(&t), strlen(ctime(&t))-1)
-     .end_comment();
-diff --git a/src/devices/gropdf/gropdf.man b/src/devices/gropdf/gropdf.man
-index 3bbace6a..cc0c82f1 100644
---- a/src/devices/gropdf/gropdf.man
-+++ b/src/devices/gropdf/gropdf.man
-@@ -1029,6 +1029,13 @@ and
- for more details.
- .
- .
-+.TP
-+.SM
-+.B SOURCE_DATE_EPOCH
-+A timestamp (expressed as seconds since the Unix epoch) to use as the
-+creation timestamp in place of the current time.
-+.
-+.
- .\" --------------------------------------------------------------------
- .SH FILES
- .\" --------------------------------------------------------------------
-diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
-index 035d1238..c25c4c67 100644
---- a/src/devices/gropdf/gropdf.pl
-+++ b/src/devices/gropdf/gropdf.pl
-@@ -239,13 +239,14 @@ elsif (exists($ppsz{$papersz}))
-     @defaultmb=@mediabox=(0,0,$ppsz{$papersz}->[0],$ppsz{$papersz}->[1]);
- }
- 
--my (@dt)=localtime(time);
-+my (@dt)=localtime($ENV{SOURCE_DATE_EPOCH} || time);
- my $dt=PDFDate(\@dt);
- 
- my %info=('Creator' => "(groff version $cfg{GROFF_VERSION})",
- 				'Producer' => "(gropdf version $cfg{GROFF_VERSION})",
- 				'ModDate' => "($dt)",
- 				'CreationDate' => "($dt)");
-+
- while (<>)
- {
-     chomp;
-diff --git a/src/devices/grops/grops.man b/src/devices/grops/grops.man
-index 99fb7486..272c2d18 100644
---- a/src/devices/grops/grops.man
-+++ b/src/devices/grops/grops.man
-@@ -1419,6 +1419,13 @@ and
- for more details.
- .
- .
-+.TP
-+.SM
-+.B SOURCE_DATE_EPOCH
-+A timestamp (expressed as seconds since the Unix epoch) to use as the
-+creation timestamp in place of the current time.
-+.
-+.
- .\" --------------------------------------------------------------------
- .SH FILES
- .\" --------------------------------------------------------------------
-diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp
-index 745a503b..03e65372 100644
---- a/src/devices/grops/ps.cpp
-+++ b/src/devices/grops/ps.cpp
-@@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
- #include "cset.h"
- #include "nonposix.h"
- #include "paper.h"
-+#include "curtime.h"
- 
- #include "ps.h"
- #include <time.h>
-@@ -1390,7 +1391,7 @@ ps_printer::~ps_printer()
- #else
-     time_t
- #endif
--    t = time(0);
-+    t = current_time();
-     fputs(ctime(&t), out.get_file());
-   }
-   for (font_pointer_list *f = font_list; f; f = f->next) {
-diff --git a/src/include/curtime.h b/src/include/curtime.h
-new file mode 100644
-index 00000000..a4105196
---- /dev/null
-+++ b/src/include/curtime.h
-@@ -0,0 +1,23 @@
-+/* Copyright (C) 2015  Free Software Foundation, Inc.
-+
-+This file is part of groff.
-+
-+groff is free software; you can redistribute it and/or modify it under
-+the terms of the GNU General Public License as published by the Free
-+Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+groff 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 General Public License
-+for more details.
-+
-+The GNU General Public License version 2 (GPL2) is available in the
-+internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
-+
-+#ifdef LONG_FOR_TIME_T
-+long
-+#else
-+time_t
-+#endif
-+current_time();
-diff --git a/src/libs/libgroff/Makefile.sub b/src/libs/libgroff/Makefile.sub
-index 840d9934..4cb4937a 100644
---- a/src/libs/libgroff/Makefile.sub
-+++ b/src/libs/libgroff/Makefile.sub
-@@ -32,6 +32,7 @@ OBJS=\
-   cmap.$(OBJEXT) \
-   color.$(OBJEXT) \
-   cset.$(OBJEXT) \
-+  curtime.$(OBJEXT) \
-   device.$(OBJEXT) \
-   errarg.$(OBJEXT) \
-   error.$(OBJEXT) \
-@@ -82,6 +83,7 @@ CCSRCS=\
-   $(srcdir)/cmap.cpp \
-   $(srcdir)/color.cpp \
-   $(srcdir)/cset.cpp \
-+  $(srcdir)/curtime.cpp \
-   $(srcdir)/device.cpp \
-   $(srcdir)/errarg.cpp \
-   $(srcdir)/error.cpp \
-diff --git a/src/libs/libgroff/curtime.cpp b/src/libs/libgroff/curtime.cpp
-new file mode 100644
-index 00000000..00821b7f
---- /dev/null
-+++ b/src/libs/libgroff/curtime.cpp
-@@ -0,0 +1,51 @@
-+/* Copyright (C) 2015  Free Software Foundation, Inc.
-+
-+This file is part of groff.
-+
-+groff is free software; you can redistribute it and/or modify it under
-+the terms of the GNU General Public License as published by the Free
-+Software Foundation, either version 2 of the License, or
-+(at your option) any later version.
-+
-+groff 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 General Public License
-+for more details.
-+
-+The GNU General Public License version 2 (GPL2) is available in the
-+internet at <http://www.gnu.org/licenses/gpl-2.0.txt>. */
-+
-+#include <errno.h>
-+#include <limits.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <time.h>
-+
-+#include "errarg.h"
-+#include "error.h"
-+
-+#ifdef LONG_FOR_TIME_T
-+long
-+#else
-+time_t
-+#endif
-+current_time()
-+{
-+  char *source_date_epoch = getenv("SOURCE_DATE_EPOCH");
-+
-+  if (source_date_epoch) {
-+    errno = 0;
-+    char *endptr;
-+    long epoch = strtol(source_date_epoch, &endptr, 10);
-+
-+    if ((errno == ERANGE && (epoch == LONG_MAX || epoch == LONG_MIN)) ||
-+	(errno != 0 && epoch == 0))
-+      fatal("$SOURCE_DATE_EPOCH: strtol: %1", strerror(errno));
-+    if (endptr == source_date_epoch)
-+      fatal("$SOURCE_DATE_EPOCH: no digits found: %1", endptr);
-+    if (*endptr != '\0')
-+      fatal("$SOURCE_DATE_EPOCH: trailing garbage: %1", endptr);
-+    return epoch;
-+  } else
-+    return time(0);
-+}
-diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
-index 9594f074..f7d2c18a 100644
---- a/src/roff/troff/input.cpp
-+++ b/src/roff/troff/input.cpp
-@@ -36,6 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
- #include "input.h"
- #include "defs.h"
- #include "unicode.h"
-+#include "curtime.h"
- 
- // Needed for getpid() and isatty()
- #include "posix.h"
-@@ -8138,7 +8139,7 @@ static void init_registers()
- #else /* not LONG_FOR_TIME_T */
-   time_t
- #endif /* not LONG_FOR_TIME_T */
--    t = time(0);
-+    t = current_time();
-   // Use struct here to work around misfeature in old versions of g++.
-   struct tm *tt = localtime(&t);
-   set_number_reg("seconds", int(tt->tm_sec));
diff --git a/gnu/packages/patches/guile-2.2-default-utf8.patch b/gnu/packages/patches/guile-2.2-default-utf8.patch
index 3233388874..f55a6430c1 100644
--- a/gnu/packages/patches/guile-2.2-default-utf8.patch
+++ b/gnu/packages/patches/guile-2.2-default-utf8.patch
@@ -4,10 +4,10 @@ available during bootstrap, so using UTF-8 avoids that (and UTF-8 has
 built-in conversions in glibc, too.)
 
 diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
-index 7cd753009..de92653a4 100644
+index 0ac5ea6a6..f73301e2f 100644
 --- a/libguile/bytevectors.c
 +++ b/libguile/bytevectors.c
-@@ -1918,7 +1918,7 @@ utf_encoding_name (char *name, size_t utf_width, SCM endianness)
+@@ -1931,7 +1931,7 @@ utf_encoding_name (char *name, size_t utf_width, SCM endianness)
    if (scm_i_is_narrow_string (str))                                     \
      {                                                                   \
        err = mem_iconveh (scm_i_string_chars (str), c_strlen,            \
@@ -17,10 +17,10 @@ index 7cd753009..de92653a4 100644
                           &c_utf, &c_utf_len);                           \
        if (SCM_UNLIKELY (err))                                           \
 diff --git a/libguile/ports.c b/libguile/ports.c
-index 2a25cd58e..bdaf921ca 100644
+index 45e62f4e4..42012f3aa 100644
 --- a/libguile/ports.c
 +++ b/libguile/ports.c
-@@ -959,7 +959,9 @@ canonicalize_encoding (const char *enc)
+@@ -974,7 +974,9 @@ canonicalize_encoding (const char *enc)
    char *ret;
    int i;
  
@@ -31,7 +31,7 @@ index 2a25cd58e..bdaf921ca 100644
      return sym_ISO_8859_1;
    if (encoding_matches (enc, sym_UTF_8))
      return sym_UTF_8;
-@@ -4182,7 +4184,7 @@ scm_init_ports (void)
+@@ -4198,7 +4200,7 @@ scm_init_ports (void)
      scm_c_define ("%default-port-conversion-strategy",
                    scm_make_fluid_with_default (sym_substitute));
    /* Use the locale as the default port encoding.  */
@@ -41,10 +41,10 @@ index 2a25cd58e..bdaf921ca 100644
    scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,
                              "scm_init_ice_9_ports",
 diff --git a/libguile/strings.c b/libguile/strings.c
-index 5c49e33d8..0131e6dc8 100644
+index 056b4c99f..63a6c050d 100644
 --- a/libguile/strings.c
 +++ b/libguile/strings.c
-@@ -1561,7 +1561,7 @@ scm_i_default_string_failed_conversion_handler (void)
+@@ -1579,7 +1579,7 @@ scm_i_default_string_failed_conversion_handler (void)
  SCM
  scm_from_locale_stringn (const char *str, size_t len)
  {
@@ -53,7 +53,7 @@ index 5c49e33d8..0131e6dc8 100644
                             scm_i_default_string_failed_conversion_handler ());
  }
  
-@@ -1885,7 +1885,7 @@ char *
+@@ -1907,7 +1907,7 @@ char *
  scm_to_locale_stringn (SCM str, size_t *lenp)
  {
    return scm_to_stringn (str, lenp,
@@ -62,17 +62,21 @@ index 5c49e33d8..0131e6dc8 100644
                           scm_i_default_string_failed_conversion_handler ());
  }
  
-@@ -2216,11 +2216,11 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding,
-   len = 0;
-   enc = encoding;
-   if (enc == NULL)
--    enc = "ISO-8859-1";
-+    enc = "UTF-8";
+@@ -2195,7 +2195,7 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding,
+     scm_wrong_type_arg_msg (NULL, 0, str, "string");
+ 
+   if (encoding == NULL)
+-    encoding = "ISO-8859-1";
++    encoding = "UTF-8";
+ 
+   if (c_strcasecmp (encoding, "UTF-8") == 0)
+     /* This is the most common case--e.g., when calling libc bindings
+@@ -2247,7 +2247,7 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding,
    if (scm_i_is_narrow_string (str))
      {
        ret = mem_iconveh (scm_i_string_chars (str), ilen,
--                         "ISO-8859-1", enc,
-+                         "UTF-8", enc,
+-                         "ISO-8859-1", encoding,
++                         "UTF-8", encoding,
                           (enum iconv_ilseq_handler) handler, NULL,
                           &buf, &len);
  
diff --git a/gnu/packages/patches/guile-2.2-skip-oom-test.patch b/gnu/packages/patches/guile-2.2-skip-oom-test.patch
new file mode 100644
index 0000000000..765577653f
--- /dev/null
+++ b/gnu/packages/patches/guile-2.2-skip-oom-test.patch
@@ -0,0 +1,25 @@
+Skip 'test-out-of-memory', which is unreliable in Guile 2.2.4:
+
+  https://bugs.gnu.org/34155
+
+--- a/test-suite/standalone/Makefile.in	1969-12-31 19:00:00.000000000 -0500
++++ b/test-suite/standalone/Makefile.in	2019-05-27 16:44:32.302355990 -0400
+@@ -103,7 +103,7 @@
+ 	test-scm-c-bind-keyword-arguments$(EXEEXT) \
+ 	test-srfi-4$(EXEEXT) $(am__append_6) $(am__EXEEXT_1) \
+ 	test-smob-mark$(EXEEXT) test-smob-mark-race$(EXEEXT) \
+-	test-stack-overflow test-out-of-memory
++	test-stack-overflow
+ check_PROGRAMS = test-num2integral$(EXEEXT) test-round$(EXEEXT) \
+ 	test-foreign-object-c$(EXEEXT) test-list$(EXEEXT) \
+ 	test-unwind$(EXEEXT) test-conversion$(EXEEXT) \
+@@ -1938,8 +1938,7 @@
+ 	test-command-line-encoding test-command-line-encoding2 \
+ 	test-language test-guild-compile $(am__append_3) \
+ 	test-foreign-object-scm test-fast-slot-ref test-mb-regexp \
+-	test-use-srfi $(am__append_5) test-stack-overflow \
+-	test-out-of-memory
++	test-use-srfi $(am__append_5) test-stack-overflow
+ BUILT_SOURCES = $(am__append_2)
+ EXTRA_DIST = test-import-order-a.scm test-import-order-b.scm \
+ 	test-import-order-c.scm test-import-order-d.scm \
diff --git a/gnu/packages/patches/guile-relocatable.patch b/gnu/packages/patches/guile-relocatable.patch
index 95bddcce88..464333880c 100644
--- a/gnu/packages/patches/guile-relocatable.patch
+++ b/gnu/packages/patches/guile-relocatable.patch
@@ -11,7 +11,7 @@ location of the `guile' binary, allowing it to be relocated.
  
  #include "libguile/_scm.h"
  #include "libguile/alist.h"
-@@ -325,6 +326,32 @@
+@@ -326,6 +327,32 @@ scm_init_load_path ()
    SCM cpath = SCM_EOL;
  
  #ifdef SCM_LIBRARY_DIR
@@ -44,24 +44,24 @@ location of the `guile' binary, allowing it to be relocated.
    env = scm_i_mirror_backslashes (getenv ("GUILE_SYSTEM_PATH"));
    if (env && strcmp (env, "") == 0)
      /* special-case interpret system-path=="" as meaning no system path instead
-@@ -333,10 +360,7 @@
+@@ -334,10 +361,7 @@ scm_init_load_path ()
    else if (env)
      path = scm_parse_path (scm_from_locale_string (env), path);
    else
--    path = scm_list_4 (scm_from_locale_string (SCM_LIBRARY_DIR),
--                       scm_from_locale_string (SCM_SITE_DIR),
--                       scm_from_locale_string (SCM_GLOBAL_SITE_DIR),
--                       scm_from_locale_string (SCM_PKGDATA_DIR));
+-    path = scm_list_4 (scm_from_utf8_string (SCM_LIBRARY_DIR),
+-                       scm_from_utf8_string (SCM_SITE_DIR),
+-                       scm_from_utf8_string (SCM_GLOBAL_SITE_DIR),
+-                       scm_from_utf8_string (SCM_PKGDATA_DIR));
 +    path = scm_list_1 (scm_from_locale_string (module_dir));
  
    env = scm_i_mirror_backslashes (getenv ("GUILE_SYSTEM_COMPILED_PATH"));
    if (env && strcmp (env, "") == 0)
-@@ -346,8 +370,7 @@
+@@ -347,8 +371,7 @@ scm_init_load_path ()
      cpath = scm_parse_path (scm_from_locale_string (env), cpath);
    else
      {
--      cpath = scm_list_2 (scm_from_locale_string (SCM_CCACHE_DIR),
--                          scm_from_locale_string (SCM_SITE_CCACHE_DIR));
+-      cpath = scm_list_2 (scm_from_utf8_string (SCM_CCACHE_DIR),
+-                          scm_from_utf8_string (SCM_SITE_CCACHE_DIR));
 +      cpath = scm_list_1 (scm_from_locale_string (ccache_dir));
      }
  
diff --git a/gnu/packages/patches/handbrake-opt-in-nvenc.patch b/gnu/packages/patches/handbrake-opt-in-nvenc.patch
new file mode 100644
index 0000000000..2b34aaa427
--- /dev/null
+++ b/gnu/packages/patches/handbrake-opt-in-nvenc.patch
@@ -0,0 +1,14 @@
+Require opt-in for NVEnc support.  Otherwise the default is true with no way
+to disable it.
+
+--- HandBrake-1.2.0/make/configure.py.orig	1969-12-31 18:00:00.000000000 -0600
++++ HandBrake-1.2.0/make/configure.py	2019-01-22 23:22:46.186959060 -0600
+@@ -1320,7 +1320,7 @@
+     grp.add_option( '--disable-ffmpeg-aac', dest="enable_ffmpeg_aac", action='store_false' )
+ 
+     h = IfHost( 'enable Nvidia NVEnc video encoder', '*-*-*', none=optparse.SUPPRESS_HELP ).value
+-    grp.add_option( '--enable-nvenc', dest="enable_nvenc", default=not (host.match( '*-*-darwin*' ) or host.match( '*-*-freebsd*' )), action='store_true', help=h )
++    grp.add_option( '--enable-nvenc', dest="enable_nvenc", default=False, action='store_true', help=h )
+ 
+ 
+     cli.add_option_group( grp )
diff --git a/gnu/packages/patches/inkscape-poppler-0.76.patch b/gnu/packages/patches/inkscape-poppler-0.76.patch
new file mode 100644
index 0000000000..08e8303892
--- /dev/null
+++ b/gnu/packages/patches/inkscape-poppler-0.76.patch
@@ -0,0 +1,36 @@
+This patch adds support for Poppler 0.76 and later.
+
+Taken from upstream:
+<https://gitlab.com/inkscape/inkscape/commit/e831b034746f8dc3c3c1b88372751f6dcb974831>
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index 8484984bdf..4f798e35bf 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -421,7 +421,7 @@ void PdfParser::parse(Object *obj, GBool topLevel) {
+ 	error(errInternal, -1, "Weird page contents");
+     	return;
+   }
+-  parser = new Parser(xref, new Lexer(xref, obj), gFalse);
++  parser = new _POPPLER_NEW_PARSER(xref, obj);
+   go(topLevel);
+   delete parser;
+   parser = nullptr;
+diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
+index 61a15083a0..5e8bc4ae90 100644
+--- a/src/extension/internal/pdfinput/poppler-transition-api.h
++++ b/src/extension/internal/pdfinput/poppler-transition-api.h
+@@ -14,6 +14,13 @@
+ 
+ #include <glib/poppler-features.h>
+ 
++#if POPPLER_CHECK_VERSION(0, 76, 0)
++#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, obj, gFalse)
++#else
++#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, new Lexer(xref, obj), gFalse)
++#endif
++
++
+ #if POPPLER_CHECK_VERSION(0, 72, 0)
+ #define getCString c_str
+ #endif
diff --git a/gnu/packages/patches/libarchive-CVE-2017-14166.patch b/gnu/packages/patches/libarchive-CVE-2017-14166.patch
deleted file mode 100644
index a122848440..0000000000
--- a/gnu/packages/patches/libarchive-CVE-2017-14166.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Fix CVE-2017-14166:
-
-https://github.com/libarchive/libarchive/issues/935
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14166
-
-Patch copied from upstream source repository:
-
-https://github.com/libarchive/libarchive/commit/fa7438a0ff4033e4741c807394a9af6207940d71
-
-From fa7438a0ff4033e4741c807394a9af6207940d71 Mon Sep 17 00:00:00 2001
-From: Joerg Sonnenberger <joerg@bec.de>
-Date: Tue, 5 Sep 2017 18:12:19 +0200
-Subject: [PATCH] Do something sensible for empty strings to make fuzzers
- happy.
-
----
- libarchive/archive_read_support_format_xar.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c
-index 7a22beb9d..93eeacc5e 100644
---- a/libarchive/archive_read_support_format_xar.c
-+++ b/libarchive/archive_read_support_format_xar.c
-@@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt)
- 	uint64_t l;
- 	int digit;
- 
-+	if (char_cnt == 0)
-+		return (0);
-+
- 	l = 0;
- 	digit = *p - '0';
- 	while (digit >= 0 && digit < 10  && char_cnt-- > 0) {
-@@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt)
- {
- 	int64_t l;
- 	int digit;
--        
-+
-+	if (char_cnt == 0)
-+		return (0);
-+
- 	l = 0;
- 	while (char_cnt-- > 0) {
- 		if (*p >= '0' && *p <= '7')
diff --git a/gnu/packages/patches/libarchive-CVE-2017-14502.patch b/gnu/packages/patches/libarchive-CVE-2017-14502.patch
deleted file mode 100644
index 8e0508afb5..0000000000
--- a/gnu/packages/patches/libarchive-CVE-2017-14502.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Fix CVE-2017-14502:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14502
-https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=573
-
-Patch copied from upstream source repository:
-
-https://github.com/libarchive/libarchive/commit/5562545b5562f6d12a4ef991fae158bf4ccf92b6
-
-From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
-From: Joerg Sonnenberger <joerg@bec.de>
-Date: Sat, 9 Sep 2017 17:47:32 +0200
-Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
- archives.
-
-Reported-By: OSS-Fuzz issue 573
----
- libarchive/archive_read_support_format_rar.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
-index cbb14c32..751de697 100644
---- a/libarchive/archive_read_support_format_rar.c
-+++ b/libarchive/archive_read_support_format_rar.c
-@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
-         return (ARCHIVE_FATAL);
-       }
-       filename[filename_size++] = '\0';
--      filename[filename_size++] = '\0';
-+      /*
-+       * Do not increment filename_size here as the computations below
-+       * add the space for the terminating NUL explicitly.
-+       */
-+      filename[filename_size] = '\0';
- 
-       /* Decoded unicode form is UTF-16BE, so we have to update a string
-        * conversion object for it. */
--- 
-2.15.1
-
diff --git a/gnu/packages/patches/libarchive-CVE-2018-1000877.patch b/gnu/packages/patches/libarchive-CVE-2018-1000877.patch
deleted file mode 100644
index 5b68884a0f..0000000000
--- a/gnu/packages/patches/libarchive-CVE-2018-1000877.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Fix CVE-2018-1000877:
-
-https://bugs.launchpad.net/ubuntu/+source/libarchive/+bug/1794909
-https://github.com/libarchive/libarchive/pull/1105
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000877
-https://security-tracker.debian.org/tracker/CVE-2018-1000877
-
-Patch copied from upstream source repository:
-
-https://github.com/libarchive/libarchive/commit/021efa522ad729ff0f5806c4ce53e4a6cc1daa31
-
-From 021efa522ad729ff0f5806c4ce53e4a6cc1daa31 Mon Sep 17 00:00:00 2001
-From: Daniel Axtens <dja@axtens.net>
-Date: Tue, 20 Nov 2018 17:56:29 +1100
-Subject: [PATCH] Avoid a double-free when a window size of 0 is specified
-
-new_size can be 0 with a malicious or corrupted RAR archive.
-
-realloc(area, 0) is equivalent to free(area), so the region would
-be free()d here and the free()d again in the cleanup function.
-
-Found with a setup running AFL, afl-rb, and qsym.
----
- libarchive/archive_read_support_format_rar.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
-index 23452222..6f419c27 100644
---- a/libarchive/archive_read_support_format_rar.c
-+++ b/libarchive/archive_read_support_format_rar.c
-@@ -2300,6 +2300,11 @@ parse_codes(struct archive_read *a)
-       new_size = DICTIONARY_MAX_SIZE;
-     else
-       new_size = rar_fls((unsigned int)rar->unp_size) << 1;
-+    if (new_size == 0) {
-+      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
-+                        "Zero window size is invalid.");
-+      return (ARCHIVE_FATAL);
-+    }
-     new_window = realloc(rar->lzss.window, new_size);
-     if (new_window == NULL) {
-       archive_set_error(&a->archive, ENOMEM,
--- 
-2.20.1
-
diff --git a/gnu/packages/patches/libarchive-CVE-2018-1000878.patch b/gnu/packages/patches/libarchive-CVE-2018-1000878.patch
deleted file mode 100644
index fef0881320..0000000000
--- a/gnu/packages/patches/libarchive-CVE-2018-1000878.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-Fix CVE-2018-1000878:
-
-https://bugs.launchpad.net/ubuntu/+source/libarchive/+bug/1794909
-https://github.com/libarchive/libarchive/pull/1105
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000878
-https://security-tracker.debian.org/tracker/CVE-2018-1000878
-
-Patch copied from upstream source repository:
-
-https://github.com/libarchive/libarchive/commit/bfcfe6f04ed20db2504db8a254d1f40a1d84eb28
-
-From bfcfe6f04ed20db2504db8a254d1f40a1d84eb28 Mon Sep 17 00:00:00 2001
-From: Daniel Axtens <dja@axtens.net>
-Date: Tue, 4 Dec 2018 00:55:22 +1100
-Subject: [PATCH] rar: file split across multi-part archives must match
-
-Fuzzing uncovered some UAF and memory overrun bugs where a file in a
-single file archive reported that it was split across multiple
-volumes. This was caused by ppmd7 operations calling
-rar_br_fillup. This would invoke rar_read_ahead, which would in some
-situations invoke archive_read_format_rar_read_header.  That would
-check the new file name against the old file name, and if they didn't
-match up it would free the ppmd7 buffer and allocate a new
-one. However, because the ppmd7 decoder wasn't actually done with the
-buffer, it would continue to used the freed buffer. Both reads and
-writes to the freed region can be observed.
-
-This is quite tricky to solve: once the buffer has been freed it is
-too late, as the ppmd7 decoder functions almost universally assume
-success - there's no way for ppmd_read to signal error, nor are there
-good ways for functions like Range_Normalise to propagate them. So we
-can't detect after the fact that we're in an invalid state - e.g. by
-checking rar->cursor, we have to prevent ourselves from ever ending up
-there. So, when we are in the dangerous part or rar_read_ahead that
-assumes a valid split, we set a flag force read_header to either go
-down the path for split files or bail. This means that the ppmd7
-decoder keeps a valid buffer and just runs out of data.
-
-Found with a combination of AFL, afl-rb and qsym.
----
- libarchive/archive_read_support_format_rar.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
-index 6f419c27..a8cc5c94 100644
---- a/libarchive/archive_read_support_format_rar.c
-+++ b/libarchive/archive_read_support_format_rar.c
-@@ -258,6 +258,7 @@ struct rar
-   struct data_block_offsets *dbo;
-   unsigned int cursor;
-   unsigned int nodes;
-+  char filename_must_match;
- 
-   /* LZSS members */
-   struct huffman_code maincode;
-@@ -1560,6 +1561,12 @@ read_header(struct archive_read *a, struct archive_entry *entry,
-     }
-     return ret;
-   }
-+  else if (rar->filename_must_match)
-+  {
-+    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
-+      "Mismatch of file parts split across multi-volume archive");
-+    return (ARCHIVE_FATAL);
-+  }
- 
-   rar->filename_save = (char*)realloc(rar->filename_save,
-                                       filename_size + 1);
-@@ -2933,12 +2940,14 @@ rar_read_ahead(struct archive_read *a, size_t min, ssize_t *avail)
-     else if (*avail == 0 && rar->main_flags & MHD_VOLUME &&
-       rar->file_flags & FHD_SPLIT_AFTER)
-     {
-+      rar->filename_must_match = 1;
-       ret = archive_read_format_rar_read_header(a, a->entry);
-       if (ret == (ARCHIVE_EOF))
-       {
-         rar->has_endarc_header = 1;
-         ret = archive_read_format_rar_read_header(a, a->entry);
-       }
-+      rar->filename_must_match = 0;
-       if (ret != (ARCHIVE_OK))
-         return NULL;
-       return rar_read_ahead(a, min, avail);
--- 
-2.20.1
-
diff --git a/gnu/packages/patches/libarchive-CVE-2018-1000880.patch b/gnu/packages/patches/libarchive-CVE-2018-1000880.patch
deleted file mode 100644
index 6834cabda0..0000000000
--- a/gnu/packages/patches/libarchive-CVE-2018-1000880.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Fix CVE-2018-1000880:
-
-https://bugs.launchpad.net/ubuntu/+source/libarchive/+bug/1794909
-https://github.com/libarchive/libarchive/pull/1105
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000880
-https://security-tracker.debian.org/tracker/CVE-2018-1000880
-
-Patch copied from upstream source repository:
-
-https://github.com/libarchive/libarchive/commit/9c84b7426660c09c18cc349f6d70b5f8168b5680
-
-From 9c84b7426660c09c18cc349f6d70b5f8168b5680 Mon Sep 17 00:00:00 2001
-From: Daniel Axtens <dja@axtens.net>
-Date: Tue, 4 Dec 2018 16:33:42 +1100
-Subject: [PATCH] warc: consume data once read
-
-The warc decoder only used read ahead, it wouldn't actually consume
-data that had previously been printed. This means that if you specify
-an invalid content length, it will just reprint the same data over
-and over and over again until it hits the desired length.
-
-This means that a WARC resource with e.g.
-Content-Length: 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665
-but only a few hundred bytes of data, causes a quasi-infinite loop.
-
-Consume data in subsequent calls to _warc_read.
-
-Found with an AFL + afl-rb + qsym setup.
----
- libarchive/archive_read_support_format_warc.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c
-index e8753853..e8fc8428 100644
---- a/libarchive/archive_read_support_format_warc.c
-+++ b/libarchive/archive_read_support_format_warc.c
-@@ -386,6 +386,11 @@ _warc_read(struct archive_read *a, const void **buf, size_t *bsz, int64_t *off)
- 		return (ARCHIVE_EOF);
- 	}
- 
-+	if (w->unconsumed) {
-+		__archive_read_consume(a, w->unconsumed);
-+		w->unconsumed = 0U;
-+	}
-+
- 	rab = __archive_read_ahead(a, 1U, &nrd);
- 	if (nrd < 0) {
- 		*bsz = 0U;
--- 
-2.20.1
-
diff --git a/gnu/packages/patches/libcroco-CVE-2017-7960.patch b/gnu/packages/patches/libcroco-CVE-2017-7960.patch
deleted file mode 100644
index 0319c7389f..0000000000
--- a/gnu/packages/patches/libcroco-CVE-2017-7960.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-Fix CVE-2017-7960:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7960
-
-Patch copied from upstream source repository:
-
-https://git.gnome.org/browse/libcroco/commit/?id=898e3a8c8c0314d2e6b106809a8e3e93cf9d4394
-
-From 898e3a8c8c0314d2e6b106809a8e3e93cf9d4394 Mon Sep 17 00:00:00 2001
-From: Ignacio Casal Quinteiro <qignacio@amazon.com>
-Date: Sun, 16 Apr 2017 13:13:43 +0200
-Subject: input: check end of input before reading a byte
-
-When reading bytes we weren't check that the index wasn't
-out of bound and this could produce an invalid read which
-could deal to a security bug.
----
- src/cr-input.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/src/cr-input.c b/src/cr-input.c
-index 49000b1..3b63a88 100644
---- a/src/cr-input.c
-+++ b/src/cr-input.c
-@@ -256,7 +256,7 @@ cr_input_new_from_uri (const gchar * a_file_uri, enum CREncoding a_enc)
-                  *we should  free buf here because it's own by CRInput.
-                  *(see the last parameter of cr_input_new_from_buf().
-                  */
--                buf = NULL ;
-+                buf = NULL;
-         }
- 
-  cleanup:
-@@ -404,6 +404,8 @@ cr_input_get_nb_bytes_left (CRInput const * a_this)
- enum CRStatus
- cr_input_read_byte (CRInput * a_this, guchar * a_byte)
- {
-+        gulong nb_bytes_left = 0;
-+
-         g_return_val_if_fail (a_this && PRIVATE (a_this)
-                               && a_byte, CR_BAD_PARAM_ERROR);
- 
-@@ -413,6 +415,12 @@ cr_input_read_byte (CRInput * a_this, guchar * a_byte)
-         if (PRIVATE (a_this)->end_of_input == TRUE)
-                 return CR_END_OF_INPUT_ERROR;
- 
-+        nb_bytes_left = cr_input_get_nb_bytes_left (a_this);
-+
-+        if (nb_bytes_left < 1) {
-+                return CR_END_OF_INPUT_ERROR;
-+        }
-+
-         *a_byte = PRIVATE (a_this)->in_buf[PRIVATE (a_this)->next_byte_index];
- 
-         if (PRIVATE (a_this)->nb_bytes -
-@@ -477,7 +485,6 @@ cr_input_read_char (CRInput * a_this, guint32 * a_char)
-                 if (*a_char == '\n') {
-                         PRIVATE (a_this)->end_of_line = TRUE;
-                 }
--
-         }
- 
-         return status;
--- 
-cgit v0.12
-
diff --git a/gnu/packages/patches/libcroco-CVE-2017-7961.patch b/gnu/packages/patches/libcroco-CVE-2017-7961.patch
deleted file mode 100644
index 675dbe4f08..0000000000
--- a/gnu/packages/patches/libcroco-CVE-2017-7961.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Fix CVE-2017-7961:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7961
-
-Patch copied from upstream source repository:
-
-https://git.gnome.org/browse/libcroco/commit/?id=9ad72875e9f08e4c519ef63d44cdbd94aa9504f7
-
-From 9ad72875e9f08e4c519ef63d44cdbd94aa9504f7 Mon Sep 17 00:00:00 2001
-From: Ignacio Casal Quinteiro <qignacio@amazon.com>
-Date: Sun, 16 Apr 2017 13:56:09 +0200
-Subject: tknzr: support only max long rgb values
-
-This fixes a possible out of bound when reading rgbs which
-are longer than the support MAXLONG
----
- src/cr-tknzr.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/src/cr-tknzr.c b/src/cr-tknzr.c
-index 1a7cfeb..1548c35 100644
---- a/src/cr-tknzr.c
-+++ b/src/cr-tknzr.c
-@@ -1279,6 +1279,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
-         status = cr_tknzr_parse_num (a_this, &num);
-         ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));
- 
-+        if (num->val > G_MAXLONG) {
-+                status = CR_PARSING_ERROR;
-+                goto error;
-+        }
-+
-         red = num->val;
-         cr_num_destroy (num);
-         num = NULL;
-@@ -1298,6 +1303,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
-                 status = cr_tknzr_parse_num (a_this, &num);
-                 ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));
- 
-+                if (num->val > G_MAXLONG) {
-+                        status = CR_PARSING_ERROR;
-+                        goto error;
-+                }
-+
-                 PEEK_BYTE (a_this, 1, &next_bytes[0]);
-                 if (next_bytes[0] == '%') {
-                         SKIP_CHARS (a_this, 1);
--- 
-cgit v0.12
-
diff --git a/gnu/packages/patches/libgcrypt-make-yat2m-reproducible.patch b/gnu/packages/patches/libgcrypt-make-yat2m-reproducible.patch
deleted file mode 100644
index 3056f0baad..0000000000
--- a/gnu/packages/patches/libgcrypt-make-yat2m-reproducible.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Make yat2m in libgcrypt respect SOURCE_DATE_EPOCH, making
-the build reproducible.
-
-This was already fixed upstream in GnuPG:
-https://dev.gnupg.org/rG139de02b93773615bdd95e04a7f0c1ad73b4f6fb
-
-and in libgpg-error:
-https://dev.gnupg.org/rE5494a5728418938d2e42158bb646b07124184e64
-
-
---- a/doc/yat2m.c 2017-11-23 19:16:58.000000000 +0100
-+++ b/doc/yat2m.c 2017-08-28 12:22:54.000000000 +0200
-@@ -1475,6 +1484,7 @@
- main (int argc, char **argv)
- {
-   int last_argc = -1;
-+  const char *s;
- 
-   opt_source = "GNU";
-   opt_release = "";
-@@ -1608,6 +1618,11 @@
-   if (argc > 1)
-     die ("usage: " PGM " [OPTION] [FILE] (try --help for more information)\n");
- 
-+  /* Take care of supplied timestamp for reproducible builds.  See
-+   * https://reproducible-builds.org/specs/source-date-epoch/  */
-+  if (!opt_date && (s = getenv ("SOURCE_DATE_EPOCH")) && *s)
-+    opt_date = s;
-+
-   /* Start processing. */
-   if (argc && strcmp (*argv, "-"))
-     {
diff --git a/gnu/packages/patches/libgdata-fix-tests.patch b/gnu/packages/patches/libgdata-fix-tests.patch
deleted file mode 100644
index dc86b3ab5a..0000000000
--- a/gnu/packages/patches/libgdata-fix-tests.patch
+++ /dev/null
@@ -1,325 +0,0 @@
-From c87a112246e0bcbd5c3a8aa484a50c617d710dbf Mon Sep 17 00:00:00 2001
-From: Philip Withnall <philip.withnall@collabora.co.uk>
-Date: Fri, 12 Dec 2014 17:31:01 +0000
-Subject: [PATCH] tests: Eliminate ISO 8601 formatting workaround for dates
-
-Follow up to commit 732017e4e5235e28c578cc3367fa0c4548b65495.
-
-https://bugzilla.gnome.org/show_bug.cgi?id=739956
----
- gdata/tests/calendar.c | 20 ++++++++++----------
- gdata/tests/general.c  | 34 +++++++++++++++++-----------------
- gdata/tests/tasks.c    | 34 +++++++++++++++++-----------------
- gdata/tests/youtube.c  | 16 ++++++++--------
- 4 files changed, 52 insertions(+), 52 deletions(-)
-
-diff --git a/gdata/tests/calendar.c b/gdata/tests/calendar.c
-index bb1d609..c54ddda 100644
---- a/gdata/tests/calendar.c
-+++ b/gdata/tests/calendar.c
-@@ -620,7 +620,7 @@ test_event_xml (void)
- 			"<gCal:guestsCanInviteOthers value='false'/>"
- 			"<gCal:guestsCanSeeGuests value='false'/>"
- 			"<gCal:anyoneCanAddSelf value='false'/>"
--			"<gd:when startTime='2009-04-17T15:00:00.000001+00:00' endTime='2009-04-17T17:00:00.000001+00:00'/>"
-+			"<gd:when startTime='2009-04-17T15:00:00Z' endTime='2009-04-17T17:00:00Z'/>"
- 			"<gd:who email='john.smith@example.com' "
- 			        "rel='http://schemas.google.com/g/2005#event.organizer' "
- 			        "valueString='John Smith\342\200\275'/>"
-@@ -706,7 +706,7 @@ test_event_xml_dates (void)
- 			"<gCal:guestsCanSeeGuests value='false'/>"
- 			"<gCal:anyoneCanAddSelf value='false'/>"
- 			"<gd:when startTime='2009-04-17'/>"
--			"<gd:when startTime='2009-04-17T15:00:00.000001+00:00'/>"
-+			"<gd:when startTime='2009-04-17T15:00:00Z'/>"
- 			"<gd:when startTime='2009-04-27' endTime='2009-05-06'/>"
- 		"</entry>");
- 
-@@ -934,25 +934,25 @@ test_query_uri (void)
- 
- 	/* Check the built query URI with a normal feed URI */
- 	query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com");
--	g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00"
--	                                "&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00&singleevents=true&sortorder=descending"
--	                                "&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00&ctz=America%2FLos_Angeles&max-attendees=15"
-+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00Z"
-+	                                "&recurrence-expansion-end=2010-04-17T15:00:00Z&singleevents=true&sortorder=descending"
-+	                                "&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z&ctz=America%2FLos_Angeles&max-attendees=15"
- 	                                "&showdeleted=true");
- 	g_free (query_uri);
- 
- 	/* …with a feed URI with a trailing slash */
- 	query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/");
--	g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00"
--	                                "&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00&singleevents=true&sortorder=descending"
--	                                "&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00&ctz=America%2FLos_Angeles&max-attendees=15"
-+	g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00Z"
-+	                                "&recurrence-expansion-end=2010-04-17T15:00:00Z&singleevents=true&sortorder=descending"
-+	                                "&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z&ctz=America%2FLos_Angeles&max-attendees=15"
- 	                                "&showdeleted=true");
- 	g_free (query_uri);
- 
- 	/* …with a feed URI with pre-existing arguments */
- 	query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/bar/?test=test&this=that");
- 	g_assert_cmpstr (query_uri, ==, "http://example.com/bar/?test=test&this=that&q=q&futureevents=true&orderby=starttime"
--	                                "&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00"
--	                                "&singleevents=true&sortorder=descending&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00"
-+	                                "&recurrence-expansion-start=2009-04-17T15:00:00Z&recurrence-expansion-end=2010-04-17T15:00:00Z"
-+	                                "&singleevents=true&sortorder=descending&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z"
- 	                                "&ctz=America%2FLos_Angeles&max-attendees=15&showdeleted=true");
- 	g_free (query_uri);
- 
-diff --git a/gdata/tests/general.c b/gdata/tests/general.c
-index 237a908..f828d2e 100644
---- a/gdata/tests/general.c
-+++ b/gdata/tests/general.c
-@@ -528,8 +528,8 @@ test_entry_parse_xml (void)
- 			 "<?xml version='1.0' encoding='UTF-8'?>"
- 			 "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' xmlns:ns='http://example.com/'>"
- 				"<title type='text'>Testing unhandled XML</title>"
--				"<updated>2009-01-25T14:07:37.000001+00:00</updated>"
--				"<published>2009-01-23T14:06:37.000001+00:00</published>"
-+				"<updated>2009-01-25T14:07:37Z</updated>"
-+				"<published>2009-01-23T14:06:37Z</published>"
- 				"<content type='text'>Here we test unhandled XML elements.</content>"
- 				"<foobar>Test!</foobar>"
- 				"<barfoo shizzle=\"zing\"/>"
-@@ -569,8 +569,8 @@ test_entry_parse_xml_kind_category (void)
- 			 "<?xml version='1.0' encoding='UTF-8'?>"
- 			 "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>"
- 				"<title type='text'>Testing kind categories</title>"
--				"<updated>2009-01-25T14:07:37.000001+00:00</updated>"
--				"<published>2009-01-23T14:06:37.000001+00:00</published>"
-+				"<updated>2009-01-25T14:07:37Z</updated>"
-+				"<published>2009-01-23T14:06:37Z</published>"
- 				"<content type='text'>Here we test kind categories.</content>"
- 			"<category term='http://schemas.google.com/docs/2007#file' "
- 			          "scheme='http://schemas.google.com/g/2005#kind' "
-@@ -620,7 +620,7 @@ test_entry_parse_json (void)
- 		"{"
- 			"\"title\":\"A title\","
- 			"\"id\":\"some-id\","
--			"\"updated\":\"2009-01-25T14:07:37.000001+00:00\","
-+			"\"updated\":\"2009-01-25T14:07:37Z\","
- 			"\"etag\":\"some-etag\","
- 			"\"selfLink\":\"http://example.com/\","
- 			"\"kind\":\"kind#kind\","
-@@ -760,8 +760,8 @@ test_entry_escaping (void)
- 		"<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>"
- 			"<title type='text'>Escaped content &amp; stuff</title>"
- 			"<id>http://foo.com/?foo&amp;bar</id>"
--			"<updated>2010-12-10T17:21:24.000001+00:00</updated>"
--			"<published>2010-12-10T17:21:24.000001+00:00</published>"
-+			"<updated>2010-12-10T17:21:24Z</updated>"
-+			"<published>2010-12-10T17:21:24Z</published>"
- 			"<summary type='text'>Summary &amp; stuff</summary>"
- 			"<rights>Free &amp; open source</rights>"
- 			"<content type='text'>Content &amp; things.</content>"
-@@ -1106,7 +1106,7 @@ test_feed_escaping (void)
- 		"<feed xmlns='http://www.w3.org/2005/Atom'>"
- 			"<title type='text'>Test feed &amp; stuff.</title>"
- 			"<id>http://foo.com?foo&amp;bar</id>"
--			"<updated>2010-12-10T17:49:15.000001+00:00</updated>"
-+			"<updated>2010-12-10T17:49:15Z</updated>"
- 		"</feed>");
- 	g_object_unref (feed);
- }
-@@ -1157,28 +1157,28 @@ test_query_dates (void)
- 	/* updated-min */
- 	gdata_query_set_updated_min (query, 1373280114); /* 2013-07-08T10:41:54Z */
- 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
--	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-min=2013-07-08T10:41:54.000001+00:00");
-+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-min=2013-07-08T10:41:54Z");
- 	g_free (query_uri);
- 	gdata_query_set_updated_min (query, -1);
- 
- 	/* updated-max */
- 	gdata_query_set_updated_max (query, 1373280114); /* 2013-07-08T10:41:54Z */
- 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
--	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-max=2013-07-08T10:41:54.000001+00:00");
-+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-max=2013-07-08T10:41:54Z");
- 	g_free (query_uri);
- 	gdata_query_set_updated_max (query, -1);
- 
- 	/* published-min */
- 	gdata_query_set_published_min (query, 1373280114); /* 2013-07-08T10:41:54Z */
- 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
--	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-min=2013-07-08T10:41:54.000001+00:00");
-+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-min=2013-07-08T10:41:54Z");
- 	g_free (query_uri);
- 	gdata_query_set_published_min (query, -1);
- 
- 	/* published-max */
- 	gdata_query_set_published_max (query, 1373280114); /* 2013-07-08T10:41:54Z */
- 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
--	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-max=2013-07-08T10:41:54.000001+00:00");
-+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-max=2013-07-08T10:41:54Z");
- 	g_free (query_uri);
- 	gdata_query_set_published_max (query, -1);
- 
-@@ -3127,7 +3127,7 @@ test_gd_reminder (void)
- 	gdata_test_assert_xml (reminder,
- 			 "<?xml version='1.0' encoding='UTF-8'?>"
- 			 "<gd:reminder xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' "
--				"absoluteTime='2005-06-07T00:55:00.000001+00:00' method='alert'/>");
-+				"absoluteTime='2005-06-07T00:55:00Z' method='alert'/>");
- 	g_object_unref (reminder);
- }
- 
-@@ -3218,8 +3218,8 @@ test_gd_when (void)
- 	/* Check the outputted XML is the same */
- 	gdata_test_assert_xml (when,
- 			 "<?xml version='1.0' encoding='UTF-8'?>"
--			 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-07T01:00:00.000001+00:00' "
--				"endTime='2005-06-07T02:00:00.000001+00:00'/>");
-+			 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-07T01:00:00Z' "
-+				"endTime='2005-06-07T02:00:00Z'/>");
- 	g_object_unref (when);
- 
- 	/* Now parse a time with different information */
-@@ -3258,7 +3258,7 @@ test_gd_when (void)
- 			 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-06' "
- 				"endTime='2005-06-08' valueString='This weekend'>"
- 				"<gd:reminder minutes='15'/>"
--				"<gd:reminder absoluteTime='2005-06-06T00:00:00.000001+00:00' method='alert'/>"
-+				"<gd:reminder absoluteTime='2005-06-06T00:00:00Z' method='alert'/>"
- 				"<foobar/>"
- 			 "</gd:when>");
- 	g_object_unref (when);
-@@ -3278,7 +3278,7 @@ test_gd_when_escaping (void)
- 	gdata_test_assert_xml (when,
- 	                 "<?xml version='1.0' encoding='UTF-8'?>"
- 	                 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' "
--	                          "startTime='2005-06-07T01:00:00.000001+00:00' valueString='Value string &amp; stuff!'/>");
-+	                          "startTime='2005-06-07T01:00:00Z' valueString='Value string &amp; stuff!'/>");
- 	g_object_unref (when);
- }
- 
-diff --git a/gdata/tests/tasks.c b/gdata/tests/tasks.c
-index 7a5bc7e..7bf3174 100644
---- a/gdata/tests/tasks.c
-+++ b/gdata/tests/tasks.c
-@@ -122,11 +122,11 @@ test_query_uri (void)
- 	g_assert_cmpstr (query_uri, ==,
- 	                 "http://example.com"
- 	                 "?maxResults=10"
--	                 "&updatedMin=1970-01-01T01:53:09.000001+00:00"
--	                 "&completedMin=1970-01-01T01:34:38.000001+00:00"
--	                 "&completedMax=1970-01-01T00:20:34.000001+00:00"
--	                 "&dueMin=1970-01-01T00:39:05.000001+00:00"
--	                 "&dueMax=1970-01-01T00:57:36.000001+00:00"
-+	                 "&updatedMin=1970-01-01T01:53:09Z"
-+	                 "&completedMin=1970-01-01T01:34:38Z"
-+	                 "&completedMax=1970-01-01T00:20:34Z"
-+	                 "&dueMin=1970-01-01T00:39:05Z"
-+	                 "&dueMax=1970-01-01T00:57:36Z"
- 	                 "&showCompleted=true"
- 	                 "&showDeleted=true"
- 	                 "&showHidden=true");
-@@ -148,11 +148,11 @@ test_query_uri (void)
- 	g_assert_cmpstr (query_uri, ==,
- 	                 "http://example.com"
- 	                 "?maxResults=10"
--	                 "&updatedMin=1970-01-01T01:53:09.000001+00:00"
--	                 "&completedMin=1970-01-01T01:34:38.000001+00:00"
--	                 "&completedMax=1970-01-01T00:20:34.000001+00:00"
--	                 "&dueMin=1970-01-01T00:39:05.000001+00:00"
--	                 "&dueMax=1970-01-01T00:57:36.000001+00:00"
-+	                 "&updatedMin=1970-01-01T01:53:09Z"
-+	                 "&completedMin=1970-01-01T01:34:38Z"
-+	                 "&completedMax=1970-01-01T00:20:34Z"
-+	                 "&dueMin=1970-01-01T00:39:05Z"
-+	                 "&dueMax=1970-01-01T00:57:36Z"
- 	                 "&showCompleted=false"
- 	                 "&showDeleted=false"
- 	                 "&showHidden=false");
-@@ -317,8 +317,8 @@ test_task_properties (void)
- 			"\"title\": \"some-other-title\","
- 			"\"notes\": \"more-notes\","
- 			"\"status\": \"completed\","
--			"\"due\": \"2014-08-30T17:20:00.000001+00:00\","
--			"\"completed\": \"2014-08-30T17:20:00.000001+00:00\","
-+			"\"due\": \"2014-08-30T17:20:00Z\","
-+			"\"completed\": \"2014-08-30T17:20:00Z\","
- 			"\"deleted\": true,"
- 			"\"hidden\": false"
- 		"}");
-@@ -332,8 +332,8 @@ test_task_properties (void)
- 			"\"title\": \"some-other-title\","
- 			"\"notes\": \"more-notes\","
- 			"\"status\": \"completed\","
--			"\"due\": \"2014-08-30T17:20:00.000001+00:00\","
--			"\"completed\": \"2014-08-30T17:20:00.000001+00:00\","
-+			"\"due\": \"2014-08-30T17:20:00Z\","
-+			"\"completed\": \"2014-08-30T17:20:00Z\","
- 			"\"deleted\": false,"
- 			"\"hidden\": false"
- 		"}");
-@@ -496,14 +496,14 @@ test_task_parser_normal (void)
- 			"\"id\": \"some-id\","
- 			"\"etag\": \"some-etag\","
- 			"\"title\": \"some-title \\\"with quotes\\\"\","
--			"\"updated\": \"2014-08-30T19:40:00.000001+00:00\","
-+			"\"updated\": \"2014-08-30T19:40:00Z\","
- 			"\"selfLink\": \"http://some-uri/\","
- 			"\"parent\": \"some-parent-id\","
- 			"\"position\": \"some-position\","
- 			"\"notes\": \"Some notes!\","
- 			"\"status\": \"needsAction\","
--			"\"due\": \"2014-08-30T20:00:00.000001+00:00\","
--			"\"completed\": \"2014-08-30T20:10:05.000001+00:00\","
-+			"\"due\": \"2014-08-30T20:00:00Z\","
-+			"\"completed\": \"2014-08-30T20:10:05Z\","
- 			"\"deleted\": false,"
- 			"\"hidden\": true,"
- 			/* Unhandled for the moment: */
-diff --git a/gdata/tests/youtube.c b/gdata/tests/youtube.c
-index a1e070a..1195bc3 100644
---- a/gdata/tests/youtube.c
-+++ b/gdata/tests/youtube.c
-@@ -967,8 +967,8 @@ test_parsing_yt_recorded (void)
- 				"gd:etag='W/\"CEMFSX47eCp7ImA9WxVUGEw.\"'>"
- 				"<title type='text'>Judas Priest - Painkiller</title>"
- 				"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
--				"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
--				"<published>2006-05-16T14:06:37.000001+00:00</published>"
-+				"<updated>2009-03-23T12:46:58Z</updated>"
-+				"<published>2006-05-16T14:06:37Z</published>"
- 				"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
- 				"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
- 				"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
-@@ -1055,8 +1055,8 @@ test_parsing_yt_access_control (void)
- 				"gd:etag='W/\"CEMFSX47eCp7ImA9WxVUGEw.\"'>"
- 				"<title type='text'>Judas Priest - Painkiller</title>"
- 				"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
--				"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
--				"<published>2006-05-16T14:06:37.000001+00:00</published>"
-+				"<updated>2009-03-23T12:46:58Z</updated>"
-+				"<published>2006-05-16T14:06:37Z</published>"
- 				"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
- 				"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
- 				"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
-@@ -1255,8 +1255,8 @@ test_parsing_georss_where (void)
- 		       "xmlns:gml='http://www.opengis.net/gml'>"
- 			"<title type='text'>Some video somewhere</title>"
- 			"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
--			"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
--			"<published>2006-05-16T14:06:37.000001+00:00</published>"
-+			"<updated>2009-03-23T12:46:58Z</updated>"
-+			"<published>2006-05-16T14:06:37Z</published>"
- 			"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
- 			"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
- 			"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
-@@ -1295,8 +1295,8 @@ test_parsing_georss_where (void)
- 		       "xmlns:gml='http://www.opengis.net/gml'>"
- 			"<title type='text'>Some video somewhere</title>"
- 			"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
--			"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
--			"<published>2006-05-16T14:06:37.000001+00:00</published>"
-+			"<updated>2009-03-23T12:46:58Z</updated>"
-+			"<published>2006-05-16T14:06:37Z</published>"
- 			"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
- 			"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
- 			"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
--- 
-1.9.3
diff --git a/gnu/packages/patches/libgdata-glib-duplicate-tests.patch b/gnu/packages/patches/libgdata-glib-duplicate-tests.patch
deleted file mode 100644
index d5d8d064de..0000000000
--- a/gnu/packages/patches/libgdata-glib-duplicate-tests.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -ur a/gdata/tests/oauth1-authorizer.c b/gdata/tests/oauth1-authorizer.c
---- a/gdata/tests/oauth1-authorizer.c	1969-12-31 19:00:00.000000000 -0500
-+++ b/gdata/tests/oauth1-authorizer.c	2017-05-27 19:35:30.551725678 -0400
-@@ -1045,10 +1045,10 @@
- 	/* Sync request-authentication-uri tests */
- 	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync", OAuth1AuthorizerData, NULL, set_up_oauth1_authorizer_data,
- 	            test_oauth1_authorizer_request_authentication_uri_sync, tear_down_oauth1_authorizer_data);
--	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains", OAuth1AuthorizerData, NULL,
-+	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains1", OAuth1AuthorizerData, NULL,
- 	            set_up_oauth1_authorizer_data_multiple_domains, test_oauth1_authorizer_request_authentication_uri_sync,
- 	            tear_down_oauth1_authorizer_data);
--	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains", OAuth1AuthorizerData, NULL,
-+	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains2", OAuth1AuthorizerData, NULL,
- 	            set_up_oauth1_authorizer_data_locale, test_oauth1_authorizer_request_authentication_uri_sync,
- 	            tear_down_oauth1_authorizer_data);
- 	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/cancellation", OAuth1AuthorizerData, NULL,
diff --git a/gnu/packages/patches/libgpg-error-gawk-compat.patch b/gnu/packages/patches/libgpg-error-gawk-compat.patch
new file mode 100644
index 0000000000..85477b0be6
--- /dev/null
+++ b/gnu/packages/patches/libgpg-error-gawk-compat.patch
@@ -0,0 +1,155 @@
+From 7865041c77f4f7005282f10f9b6666b19072fbdf Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gniibe@fsij.org>
+Date: Mon, 15 Apr 2019 15:10:44 +0900
+Subject: [PATCH] awk: Prepare for Gawk 5.0.
+
+* src/Makefile.am: Use pkg_namespace (instead of namespace).
+* src/mkerrnos.awk: Likewise.
+* lang/cl/mkerrcodes.awk: Don't escape # in regexp.
+* src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto.
+
+--
+
+In Gawk 5.0, regexp routines are replaced by Gnulib implementation,
+which only allows escaping specific characters.
+
+GnuPG-bug-id: 4459
+Reported-by: Marius Schamschula
+Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
+---
+ lang/cl/mkerrcodes.awk |  2 +-
+ src/Makefile.am        |  2 +-
+ src/mkerrcodes.awk     |  2 +-
+ src/mkerrcodes1.awk    |  2 +-
+ src/mkerrcodes2.awk    |  2 +-
+ src/mkerrnos.awk       |  2 +-
+ src/mkstrtable.awk     | 10 +++++-----
+ 7 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk
+index ae29043..9a1fc18 100644
+--- a/lang/cl/mkerrcodes.awk
++++ b/lang/cl/mkerrcodes.awk
+@@ -122,7 +122,7 @@ header {
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+diff --git a/src/Makefile.am b/src/Makefile.am
+index ce1b882..f2590cb 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -293,7 +293,7 @@ code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile
+ 
+ errnos-sym.h: Makefile mkstrtable.awk errnos.in
+ 	$(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
+-		-v prefix=GPG_ERR_ -v namespace=errnos_ \
++		-v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \
+ 		$(srcdir)/errnos.in >$@
+ 
+ 
+diff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk
+index 46d436c..e9c857c 100644
+--- a/src/mkerrcodes.awk
++++ b/src/mkerrcodes.awk
+@@ -85,7 +85,7 @@ header {
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+diff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk
+index a771a73..4578e29 100644
+--- a/src/mkerrcodes1.awk
++++ b/src/mkerrcodes1.awk
+@@ -81,7 +81,7 @@ header {
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk
+index ea58503..188f7a4 100644
+--- a/src/mkerrcodes2.awk
++++ b/src/mkerrcodes2.awk
+@@ -91,7 +91,7 @@ header {
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk
+index f79df66..15b1aad 100644
+--- a/src/mkerrnos.awk
++++ b/src/mkerrnos.awk
+@@ -83,7 +83,7 @@ header {
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+diff --git a/src/mkstrtable.awk b/src/mkstrtable.awk
+index c9de9c1..285e45f 100644
+--- a/src/mkstrtable.awk
++++ b/src/mkstrtable.awk
+@@ -77,7 +77,7 @@
+ #
+ # The variable prefix can be used to prepend a string to each message.
+ #
+-# The variable namespace can be used to prepend a string to each
++# The variable pkg_namespace can be used to prepend a string to each
+ # variable and macro name.
+ 
+ BEGIN {
+@@ -102,7 +102,7 @@ header {
+       print "/* The purpose of this complex string table is to produce";
+       print "   optimal code with a minimum of relocations.  */";
+       print "";
+-      print "static const char " namespace "msgstr[] = ";
++      print "static const char " pkg_namespace "msgstr[] = ";
+       header = 0;
+     }
+   else
+@@ -110,7 +110,7 @@ header {
+ }
+ 
+ !header {
+-  sub (/\#.+/, "");
++  sub (/#.+/, "");
+   sub (/[ 	]+$/, ""); # Strip trailing space and tab characters.
+ 
+   if (/^$/)
+@@ -150,7 +150,7 @@ END {
+   else
+     print "  gettext_noop (\"" last_msgstr "\");";
+   print "";
+-  print "static const int " namespace "msgidx[] =";
++  print "static const int " pkg_namespace "msgidx[] =";
+   print "  {";
+   for (i = 0; i < coded_msgs; i++)
+     print "    " pos[i] ",";
+@@ -158,7 +158,7 @@ END {
+   print "  };";
+   print "";
+   print "static GPG_ERR_INLINE int";
+-  print namespace "msgidxof (int code)";
++  print pkg_namespace "msgidxof (int code)";
+   print "{";
+   print "  return (0 ? 0";
+ 
diff --git a/gnu/packages/patches/libmp4v2-c++11.patch b/gnu/packages/patches/libmp4v2-c++11.patch
new file mode 100644
index 0000000000..e12f89bd84
--- /dev/null
+++ b/gnu/packages/patches/libmp4v2-c++11.patch
@@ -0,0 +1,14 @@
+Avoid a type mismatch that shows up in C++11.
+Taken from <https://bugs.debian.org/853560>.
+
+--- a/src/rtphint.cpp	2012-05-20 16:11:53.000000000 -0600
++++ b/src/rtphint.cpp	2017-05-16 10:25:26.930705191 -0600
+@@ -339,7 +339,7 @@
+                 pSlash = strchr(pSlash, '/');
+                 if (pSlash != NULL) {
+                     pSlash++;
+-                    if (pSlash != '\0') {
++                    if (*pSlash != '\0') {
+                         length = (uint32_t)strlen(pRtpMap) - (pSlash - pRtpMap);
+                         *ppEncodingParams = (char *)MP4Calloc(length + 1);
+                         strncpy(*ppEncodingParams, pSlash, length);
diff --git a/gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch b/gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch
deleted file mode 100644
index 4133be7fc9..0000000000
--- a/gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This fixes a regression introduced in 1.8.0 where libssh2 fails to build
-with the gcrypt backend.
-
-Upstream bug URL:
-
-https://github.com/libssh2/libssh2/issues/150
-
-Patch copied from upstream source repository:
-
-https://github.com/libssh2/libssh2/commit/ced924b78a40126606797ef57a74066eb3b4b83f
-
-From ced924b78a40126606797ef57a74066eb3b4b83f Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <siarheit@google.com>
-Date: Mon, 31 Oct 2016 09:04:33 +0000
-Subject: [PATCH] acinclude.m4: fix ./configure --with-libgcrypt
-
-diff --git a/acinclude.m4 b/acinclude.m4
-index 734ef07..c78260c 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -412,9 +412,9 @@ AC_DEFUN([LIBSSH2_CHECKFOR_GCRYPT], [
- 
-   old_LDFLAGS=$LDFLAGS
-   old_CFLAGS=$CFLAGS
--  if test -n "$use_libgcrypt" && test "$use_libgcrypt" != "no"; then
--    LDFLAGS="$LDFLAGS -L$use_libgcrypt/lib"
--    CFLAGS="$CFLAGS -I$use_libgcrypt/include"
-+  if test -n "$with_libgcrypt_prefix" && test "$use_libgcrypt" != "no"; then
-+    LDFLAGS="$LDFLAGS -L$with_libgcrypt_prefix/lib"
-+    CFLAGS="$CFLAGS -I$with_libgcrypt_prefix/include"
-   fi
-   AC_LIB_HAVE_LINKFLAGS([gcrypt], [], [
-     #include <gcrypt.h>
diff --git a/gnu/packages/patches/libxt-guix-search-paths.patch b/gnu/packages/patches/libxt-guix-search-paths.patch
index c618f48da5..5419edd1bd 100644
--- a/gnu/packages/patches/libxt-guix-search-paths.patch
+++ b/gnu/packages/patches/libxt-guix-search-paths.patch
@@ -1,26 +1,27 @@
---- libXt-1.1.5/src/Intrinsic.c	2015-05-01 07:36:20.000000000 +0200
-+++ Intrinsic.c	2016-12-12 00:42:16.567388450 +0100
-@@ -1303,21 +1303,101 @@
+diff --git a/src/Intrinsic.c b/src/Intrinsic.c
+index c9624ec..addcdba 100644
+--- a/src/Intrinsic.c
++++ b/src/Intrinsic.c
+@@ -1312,21 +1312,101 @@ static void FillInLangSubs(
      } else (void) strcpy(*rest, string);
  }
  
--/*
++
++
+ /*
 - * default path used if environment variable XFILESEARCHPATH
 - * is not defined.  Also substitued for %D.
 - * The exact value should be documented in the implementation
 - * notes for any Xt implementation.
-+
-+
-+/* 
 +   Return the default search path for the function
-+   XtResolvePathname to use if XFILESEARCHPATH is 
++   XtResolvePathname to use if XFILESEARCHPATH is
 +   not defined.
 +
 +   It returns the combination the set of values which are the 6 "stems" below,
-+   prepended with "/run/current-system/profile", and $GUIX_PROFILE and 
++   prepended with "/run/current-system/profile", and $GUIX_PROFILE and
 +   "$HOME/.guix-profile"
 +
-+   These values provide the default paths where Guix/GuixSD  can expect
++   These values provide the default paths where Guix/GuixSD can expect
 +   to find resources for installed packages.
   */
 -static const char *implementation_default_path(void)
@@ -28,11 +29,6 @@
  {
 -#if defined(WIN32)
 -    static char xfilesearchpath[] = "";
--
--    return xfilesearchpath;
--#else
--    return XFILESEARCHPATHDEFAULT;
--#endif
 +  static const char *search_path_default_stem[] = {
 +    "/lib/X11/%L/%T/%N%C%S",
 +    "/lib/X11/%l/%T/%N%C%S",
@@ -55,7 +51,7 @@
 +  char *home = getenv ("HOME");
 +  char *guix_profile = getenv ("GUIX_PROFILE");
 +
-+  size_t bytesAllocd = SIZEOF_STEMS + 1; 
++  size_t bytesAllocd = SIZEOF_STEMS + 1;
 +
 +  /* This function is evaluated multiple times and the calling
 +     code assumes that it is idempotent. So we must not allow
@@ -72,7 +68,11 @@
 +      bytesAllocd += SIZEOF_STEMS;
 +      bytesAllocd += 6 * (1 + strlen (guix_profile));
 +    }
-+
+ 
+-    return xfilesearchpath;
+-#else
+-    return XFILESEARCHPATHDEFAULT;
+-#endif
 +  if (home != NULL)
 +    {
 +      bytesAllocd += SIZEOF_STEMS;
@@ -83,7 +83,7 @@
 +  if (path == NULL) _XtAllocError(NULL);
 +
 +  memset (path, 0, bytesAllocd);
-+  
++
 +  for (i = 0 ; i < 6 ; ++i)
 +    {
 +      strcat (path, current_profile);
@@ -110,17 +110,17 @@
 +
 +  /* Remove final : */
 +  path[strlen(path) - 1] = '\0';
-+  
++
 +  return path;
  }
  
  
-@@ -1345,7 +1425,7 @@
+@@ -1354,7 +1434,7 @@ _XtString XtResolvePathname(
  {
      XtPerDisplay pd;
      static const char *defaultPath = NULL;
 -    const char *impl_default = implementation_default_path();
 +    const char *impl_default = guix_default_path();
-     int idef_len = strlen(impl_default);
+     int idef_len = (int) strlen(impl_default);
      char *massagedPath;
      int bytesAllocd, bytesLeft;
diff --git a/gnu/packages/patches/mescc-tools-boot.patch b/gnu/packages/patches/mescc-tools-boot.patch
new file mode 100644
index 0000000000..2bce8a49c2
--- /dev/null
+++ b/gnu/packages/patches/mescc-tools-boot.patch
@@ -0,0 +1,222 @@
+From c184e95096881a13f29ebd7fc507fe305d3d8de5 Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Thu, 4 Oct 2018 22:03:31 +0200
+Subject: [PATCH] build.sh: Update for mes 0.18.
+
+---
+ build.sh   | 92 +++++++++++++++++++++++++++++++++++++-----------------
+ install.sh |  6 ++--
+ 2 files changed, 66 insertions(+), 32 deletions(-)
+
+diff --git a/build.sh b/build.sh
+index 335a7bb..19a0029 100755
+--- a/build.sh
++++ b/build.sh
+@@ -18,7 +18,8 @@
+ # along with mescc-tools.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ set -eux
+-MES_SEED=${MES_SEED-../mescc-tools-seed/libs}
++MES_PREFIX=${MES_PREFIX-../mes}
++MES_SEED=${MES_SEED-../mes-seed}
+ MESCC_TOOLS_SEED=${MESCC_TOOLS_SEED-../mescc-tools-seed}
+ 
+ #########################################
+@@ -32,15 +33,23 @@ MESCC_TOOLS_SEED=${MESCC_TOOLS_SEED-../mescc-tools-seed}
+ # blood-elf
+ # Create proper debug segment
+ $MESCC_TOOLS_SEED/blood-elf\
++    -f $MESCC_TOOLS_SEED/file_print.M1\
++    -f $MESCC_TOOLS_SEED/match.M1\
++    -f $MESCC_TOOLS_SEED/numerate_number.M1\
++    -f $MESCC_TOOLS_SEED/string.M1\
+     -f $MESCC_TOOLS_SEED/blood-elf.M1\
+     -o blood-elf-blood-elf-footer.M1
+ 
+ # Build
+ # M1-macro phase
+ $MESCC_TOOLS_SEED/M1 --LittleEndian --Architecture 1\
+-    -f $MES_SEED/x86.M1\
+-    -f $MES_SEED/crt1.M1\
+-    -f $MES_SEED/libc+tcc-mes.M1\
++    -f $MES_PREFIX/lib/x86-mes/x86.M1\
++    -f $MES_SEED/x86-mes/crt1.S\
++    -f $MES_SEED/x86-mes/libc+tcc.S\
++    -f $MESCC_TOOLS_SEED/file_print.M1\
++    -f $MESCC_TOOLS_SEED/match.M1\
++    -f $MESCC_TOOLS_SEED/numerate_number.M1\
++    -f $MESCC_TOOLS_SEED/string.M1\
+     -f $MESCC_TOOLS_SEED/blood-elf.M1\
+     -f blood-elf-blood-elf-footer.M1\
+     -o blood-elf.hex2
+@@ -49,7 +58,7 @@ $MESCC_TOOLS_SEED/hex2\
+     --LittleEndian\
+     --Architecture 1\
+     --BaseAddress 0x1000000\
+-    -f $MES_SEED/elf32-header.hex2\
++    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
+     -f blood-elf.hex2\
+     --exec_enable\
+     -o bin/blood-elf
+@@ -65,9 +74,13 @@ $MESCC_TOOLS_SEED/hex2\
+ $MESCC_TOOLS_SEED/M1 \
+     --LittleEndian\
+     --Architecture 1\
+-    -f $MES_SEED/x86.M1\
+-    -f $MES_SEED/crt1.M1\
+-    -f $MES_SEED/libc+tcc-mes.M1\
++    -f $MES_PREFIX/lib/x86-mes/x86.M1\
++    -f $MES_SEED/x86-mes/crt1.S\
++    -f $MES_SEED/x86-mes/libc+tcc.S\
++    -f $MESCC_TOOLS_SEED/file_print.M1\
++    -f $MESCC_TOOLS_SEED/match.M1\
++    -f $MESCC_TOOLS_SEED/numerate_number.M1\
++    -f $MESCC_TOOLS_SEED/string.M1\
+     -f $MESCC_TOOLS_SEED/M1.M1\
+     -f M1-footer.M1\
+     -o M1.hex2
+@@ -76,7 +89,7 @@ $MESCC_TOOLS_SEED/hex2 \
+     --LittleEndian\
+     --Architecture 1\
+     --BaseAddress 0x1000000\
+-    -f $MES_SEED/elf32-header.hex2\
++    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
+     -f M1.hex2\
+     --exec_enable\
+     -o bin/M1
+@@ -92,9 +105,13 @@ $MESCC_TOOLS_SEED/hex2 \
+ ./bin/M1 \
+     --LittleEndian\
+     --Architecture 1\
+-    -f $MES_SEED/x86.M1\
+-    -f $MES_SEED/crt1.M1\
+-    -f $MES_SEED/libc+tcc-mes.M1\
++    -f $MES_PREFIX/lib/x86-mes/x86.M1\
++    -f $MES_SEED/x86-mes/crt1.S\
++    -f $MES_SEED/x86-mes/libc+tcc.S\
++    -f $MESCC_TOOLS_SEED/file_print.M1\
++    -f $MESCC_TOOLS_SEED/match.M1\
++    -f $MESCC_TOOLS_SEED/numerate_number.M1\
++    -f $MESCC_TOOLS_SEED/string.M1\
+     -f $MESCC_TOOLS_SEED/hex2.M1\
+     -f hex2-footer.M1\
+     -o hex2.hex2
+@@ -103,10 +120,10 @@ $MESCC_TOOLS_SEED/hex2 \
+       --LittleEndian\
+       --Architecture 1\
+       --BaseAddress 0x1000000\
+-      -f $MES_SEED/elf32-header.hex2\
++      -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
+       -f hex2.hex2\
+       --exec_enable\
+-      -o bin/hex2
++      -o bin/hex2-0
+ 
+ #########################
+ # Phase-1 Self-host     #
+@@ -123,18 +140,22 @@ $MESCC_TOOLS_SEED/hex2 \
+ ./bin/M1 \
+     --LittleEndian\
+     --Architecture 1\
+-    -f $MES_SEED/x86.M1\
+-    -f $MES_SEED/crt1.M1\
+-    -f $MES_SEED/libc+tcc-mes.M1\
++    -f $MES_PREFIX/lib/x86-mes/x86.M1\
++    -f $MES_SEED/x86-mes/crt1.S\
++    -f $MES_SEED/x86-mes/libc+tcc.S\
++    -f $MESCC_TOOLS_SEED/file_print.M1\
++    -f $MESCC_TOOLS_SEED/match.M1\
++    -f $MESCC_TOOLS_SEED/numerate_number.M1\
++    -f $MESCC_TOOLS_SEED/string.M1\
+     -f $MESCC_TOOLS_SEED/blood-elf.M1\
+     -f blood-elf-blood-elf-footer.M1\
+     -o blood-elf.hex2
+ # Hex2-linker phase
+-./bin/hex2 \
++./bin/hex2-0 \
+     --LittleEndian\
+     --Architecture 1\
+     --BaseAddress 0x1000000\
+-    -f $MES_SEED/elf32-header.hex2\
++    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
+     -f blood-elf.hex2\
+     --exec_enable\
+     -o blood-elf
+@@ -150,18 +171,22 @@ $MESCC_TOOLS_SEED/hex2 \
+ ./bin/M1 \
+     --LittleEndian\
+     --Architecture 1\
+-    -f $MES_SEED/x86.M1\
+-    -f $MES_SEED/crt1.M1\
+-    -f $MES_SEED/libc+tcc-mes.M1\
++    -f $MES_PREFIX/lib/x86-mes/x86.M1\
++    -f $MES_SEED/x86-mes/crt1.S\
++    -f $MES_SEED/x86-mes/libc+tcc.S\
++    -f $MESCC_TOOLS_SEED/file_print.M1\
++    -f $MESCC_TOOLS_SEED/match.M1\
++    -f $MESCC_TOOLS_SEED/numerate_number.M1\
++    -f $MESCC_TOOLS_SEED/string.M1\
+     -f $MESCC_TOOLS_SEED/M1.M1\
+     -f M1-footer.M1\
+     -o M1.hex2
+ # Hex2-linker phase
+-./bin/hex2 \
++./bin/hex2-0 \
+     --LittleEndian\
+     --Architecture 1\
+     --BaseAddress 0x1000000\
+-    -f $MES_SEED/elf32-header.hex2\
++    -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
+     -f M1.hex2\
+     --exec_enable\
+     -o bin/M1
+@@ -177,18 +202,27 @@ $MESCC_TOOLS_SEED/hex2 \
+ ./bin/M1 \
+     --LittleEndian\
+     --Architecture 1\
+-    -f $MES_SEED/x86.M1\
+-    -f $MES_SEED/crt1.M1\
+-    -f $MES_SEED/libc+tcc-mes.M1\
++    -f $MES_PREFIX/lib/x86-mes/x86.M1\
++    -f $MES_SEED/x86-mes/crt1.S\
++    -f $MES_SEED/x86-mes/libc+tcc.S\
++    -f $MESCC_TOOLS_SEED/file_print.M1\
++    -f $MESCC_TOOLS_SEED/match.M1\
++    -f $MESCC_TOOLS_SEED/numerate_number.M1\
++    -f $MESCC_TOOLS_SEED/string.M1\
+     -f $MESCC_TOOLS_SEED/hex2.M1\
+     -f hex2-footer.M1\
+     -o hex2.hex2
+ # Hex2-linker phase
+-./bin/hex2 \
++./bin/hex2-0 \
+       --LittleEndian\
+       --Architecture 1\
+       --BaseAddress 0x1000000\
+-      -f $MES_SEED/elf32-header.hex2\
++      -f $MES_PREFIX/lib/x86-mes/elf32-header.hex2\
+       -f hex2.hex2\
+       --exec_enable\
+       -o bin/hex2
++
++# TODO
++touch bin/exec_enable
++touch bin/get_machine
++touch bin/kaem
+diff --git a/install.sh b/install.sh
+index e4dccff..29e58d6 100644
+--- a/install.sh
++++ b/install.sh
+@@ -18,6 +18,6 @@
+ PREFIX=${PREFIX-usr}
+ 
+ mkdir -p "$PREFIX/bin"
+-cp blood-elf "$PREFIX/bin/blood-elf"
+-cp hex2 "$PREFIX/bin/hex2"
+-cp M1 "$PREFIX/bin/M1"
++cp bin/blood-elf "$PREFIX/bin/blood-elf"
++cp bin/hex2 "$PREFIX/bin/hex2"
++cp bin/M1 "$PREFIX/bin/M1"
+-- 
+2.18.0
+
diff --git a/gnu/packages/patches/perl-no-sys-dirs.patch b/gnu/packages/patches/perl-no-sys-dirs.patch
index 31d53e0353..2269d715c7 100644
--- a/gnu/packages/patches/perl-no-sys-dirs.patch
+++ b/gnu/packages/patches/perl-no-sys-dirs.patch
@@ -112,20 +112,29 @@ Only in perl-5.20.0/: Configure.orig
 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/ext/Errno/Errno_pm.PL perl-5.20.0/ext/Errno/Errno_pm.PL
 --- perl-5.20.0-orig/ext/Errno/Errno_pm.PL	2014-05-26 15:34:20.000000000 +0200
 +++ perl-5.20.0/ext/Errno/Errno_pm.PL	2014-06-25 10:31:24.317970047 +0200
-@@ -126,11 +126,7 @@
+@@ -114,7 +114,7 @@ sub get_files {
+     # When cross-compiling we may store a path for gcc's "sysroot" option:
+     my $sysroot = $Config{sysroot} || '';
+     my $linux_errno_h;
+-    if ($^O eq 'linux') {
++    if (0) {
+ 	# Some Linuxes have weird errno.hs which generate
+ 	# no #file or #line directives
+ 	($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" }
+@@ -134,13 +134,6 @@ sub get_files {
  	if ($dep =~ /(\S+errno\.h)/) {
  	     $file{$1} = 1;
  	}
 -    } elsif ($^O eq 'linux' &&
 -	      $Config{gccversion} ne '' && 
--	      $Config{gccversion} !~ /intel/i
+-	      $Config{gccversion} !~ /intel/i &&
 -	      # might be using, say, Intel's icc
+-	      $linux_errno_h
 -	     ) {
-+    } elsif (0) {
-     # When cross-compiling we may store a path for gcc's "sysroot" option:
-     my $sysroot = $Config{sysroot} || '';
- 	# Some Linuxes have weird errno.hs which generate
-Only in perl-5.20.0/ext/Errno: Errno_pm.PL.orig
+-	$file{$linux_errno_h} = 1;
+     } elsif ($^O eq 'haiku') {
+ 	# hidden in a special place
+ 	$file{'/boot/develop/headers/posix/errno.h'} = 1;
 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/freebsd.sh perl-5.20.0/hints/freebsd.sh
 --- perl-5.20.0-orig/hints/freebsd.sh	2014-01-31 22:55:51.000000000 +0100
 +++ perl-5.20.0/hints/freebsd.sh	2014-06-25 10:25:53.263964680 +0200
diff --git a/gnu/packages/patches/python-2.7-search-paths.patch b/gnu/packages/patches/python-2.7-search-paths.patch
index ba7235df27..a012bc8fe0 100644
--- a/gnu/packages/patches/python-2.7-search-paths.patch
+++ b/gnu/packages/patches/python-2.7-search-paths.patch
@@ -1,4 +1,4 @@
-Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when
+Make sure the build system honors CPATH and LIBRARY_PATH when
 looking for headers and libraries.
 
 --- Python-2.7.10/setup.py	2015-10-07 18:33:18.125153186 +0200
@@ -9,7 +9,7 @@ looking for headers and libraries.
  
 +        # Always honor these variables.
 +        lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+        inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
++        inc_dirs += os.getenv('CPATH', '').split(os.pathsep)
 +
          # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
          if host_platform in ['osf1', 'unixware7', 'openunix8']:
diff --git a/gnu/packages/patches/python-3-deterministic-build-info.patch b/gnu/packages/patches/python-3-deterministic-build-info.patch
index 22c372a0cf..25a079fe90 100644
--- a/gnu/packages/patches/python-3-deterministic-build-info.patch
+++ b/gnu/packages/patches/python-3-deterministic-build-info.patch
@@ -2,8 +2,8 @@ Always provide the same date and time in 'Py_GetBuildInfo'.
 This is the information shown at the REPL and in 'sys.version'.
 We cannot pass it in CPPFLAGS due to whitespace in the DATE string.
 
---- Modules/getbuildinfo.c
-+++ Modules/getbuildinfo.c
+--- a/Modules/getbuildinfo.c
++++ b/Modules/getbuildinfo.c
 @@ -4,6 +4,10 @@
  #include <stdio.h>
  #endif
diff --git a/gnu/packages/patches/python-3-fix-tests.patch b/gnu/packages/patches/python-3-fix-tests.patch
index ab713c54dd..e13790bd41 100644
--- a/gnu/packages/patches/python-3-fix-tests.patch
+++ b/gnu/packages/patches/python-3-fix-tests.patch
@@ -1,9 +1,134 @@
-Additional test fixes which affect Python 3.5 (and presumably later) but not
-prior revisions of Python.
+See the discussion about the issues fixed here at:
+http://bugs.python.org/issue20868 .
 
---- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
-+++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
-@@ -2132,8 +2132,7 @@
+diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
+--- a/Lib/ctypes/test/test_callbacks.py
++++ b/Lib/ctypes/test/test_callbacks.py
+@@ -3,6 +3,7 @@ import unittest
+ from ctypes import *
+ from ctypes.test import need_symbol
+ import _ctypes_test
++import platform
+ 
+ class Callbacks(unittest.TestCase):
+     functype = CFUNCTYPE
+@@ -176,6 +177,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
+ 
+         self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
+ 
++    @unittest.skipIf(platform.machine() in ['mips64'],
++                     "This test fails on this platform")
+     def test_issue_8959_a(self):
+         from ctypes.util import find_library
+         libc_path = find_library("c")
+diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
+--- a/Lib/ctypes/test/test_libc.py
++++ b/Lib/ctypes/test/test_libc.py
+@@ -2,6 +2,7 @@ import unittest
+ 
+ from ctypes import *
+ import _ctypes_test
++import platform
+ 
+ lib = CDLL(_ctypes_test.__file__)
+ 
+@@ -17,6 +18,8 @@ class LibTest(unittest.TestCase):
+         import math
+         self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))
+ 
++    @unittest.skipIf(platform.machine() in ['mips64'],
++                     "This test fails on this platform")
+     def test_qsort(self):
+         comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
+         lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
+diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
+--- a/Lib/distutils/tests/test_archive_util.py
++++ b/Lib/distutils/tests/test_archive_util.py
+@@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
+         self.assertEqual(os.path.basename(res), 'archive.tar.xz')
+         self.assertEqual(self._tarinfo(res), self._created_files)
+ 
++    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
+     def test_make_archive_owner_group(self):
+         # testing make_archive with owner and group, with various combinations
+         # this works even if there's not gid/uid support
+@@ -362,6 +363,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
+ 
+     @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
+     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
++    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
+     def test_tarfile_root_owner(self):
+         tmpdir =  self._create_files()
+         base_name = os.path.join(self.mkdtemp(), 'archive')
+diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
+--- a/Lib/distutils/tests/test_sdist.py
++++ b/Lib/distutils/tests/test_sdist.py
+@@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
+                      "The tar command is not found")
+     @unittest.skipIf(find_executable('gzip') is None,
+                      "The gzip command is not found")
++    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
+     def test_make_distribution_owner_group(self):
+         # now building a sdist
+         dist, cmd = self.get_cmd()
+diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+--- a/Lib/test/_test_multiprocessing.py
++++ b/Lib/test/_test_multiprocessing.py
+@@ -1473,6 +1473,7 @@ class _TestCondition(BaseTestCase):
+         if pid is not None:
+             os.kill(pid, signal.SIGINT)
+ 
++    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
+     def test_wait_result(self):
+         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
+             pid = os.getpid()
+diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+--- a/Lib/test/test_asyncio/test_base_events.py
++++ b/Lib/test/test_asyncio/test_base_events.py
+@@ -1323,6 +1323,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
+         self._test_create_connection_ip_addr(m_socket, False)
+ 
+     @patch_socket
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_create_connection_service_name(self, m_socket):
+         m_socket.getaddrinfo = socket.getaddrinfo
+         sock = m_socket.socket.return_value
+diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
+--- a/Lib/test/test_generators.py
++++ b/Lib/test/test_generators.py
+@@ -34,6 +34,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
+         else:
+             return "FAILED"
+ 
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
+     def test_raise_and_yield_from(self):
+         gen = self.generator1()
+         gen.send(None)
+diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
+--- a/Lib/test/test_normalization.py
++++ b/Lib/test/test_normalization.py
+@@ -2,6 +2,7 @@ from test.support import open_urlresource
+ import unittest
+ 
+ from http.client import HTTPException
++from urllib.error import URLError
+ import sys
+ from unicodedata import normalize, unidata_version
+ 
+@@ -43,6 +44,8 @@ class NormalizationTest(unittest.TestCase):
+         except PermissionError:
+             self.skipTest(f"Permission error when downloading {TESTDATAURL} "
+                           f"into the test data directory")
++        except URLError:
++            self.skipTest("DNS lookups are not enabled.")
+         except (OSError, HTTPException):
+             self.fail(f"Could not retrieve {TESTDATAURL}")
+ 
+diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
+--- a/Lib/test/test_pathlib.py
++++ b/Lib/test/test_pathlib.py
+@@ -2134,8 +2134,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
          self.assertEqual(given, expect)
          self.assertEqual(set(p.rglob("FILEd*")), set())
  
@@ -13,47 +138,10 @@ prior revisions of Python.
      def test_expanduser(self):
          P = self.cls
          support.import_module('pwd')
---- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
-+++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
-@@ -2305,11 +2305,14 @@
-     try:
-         import pwd, grp
-     except ImportError:
-         return False
--    if pwd.getpwuid(0)[0] != 'root':
--        return False
--    if grp.getgrgid(0)[0] != 'root':
-+    try:
-+        if pwd.getpwuid(0)[0] != 'root':
-+            return False
-+        if grp.getgrgid(0)[0] != 'root':
-+            return False
-+    except KeyError:
-         return False
-     return True
-
-
---- Lib/test/test_asyncio/test_base_events.py
-+++ Lib/test/test_asyncio/test_base_events.py
-@@ -1216,6 +1216,8 @@
-         self._test_create_connection_ip_addr(m_socket, False)
-
-     @patch_socket
-+    @unittest.skipUnless(support.is_resource_enabled('network'),
-+                         'network is not enabled')
-     def test_create_connection_service_name(self, m_socket):
-         m_socket.getaddrinfo = socket.getaddrinfo
-         sock = m_socket.socket.return_value
-
---- Lib/test/test_pdb.py.org    2017-03-12 03:09:01.991856701 +0100
-+++ Lib/test/test_pdb.py        2017-03-12 03:26:17.742572869 +0100
-
-For some reason, KeyboardInterrupts do not work in the build
-environment (lack of controlling TTY?). Just change the expected
-outcome. Unfortunately, this will make it fail for users running
-`python -m test test_pdb test_pdb` interactively.
-
-@@ -928,11 +928,11 @@
+diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+--- a/Lib/test/test_pdb.py
++++ b/Lib/test/test_pdb.py
+@@ -1150,11 +1150,11 @@ def test_pdb_issue_20766():
      > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
      -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
      (Pdb) continue
@@ -65,22 +153,100 @@ outcome. Unfortunately, this will make it fail for users running
 -    pdb 2: <built-in function default_int_handler>
 +    pdb 2: Handlers.SIG_IGN
      """
-
- class PdbTestCase(unittest.TestCase):
---- Lib/test/test_socket.py
-+++ Lib/test/test_socket.py
-@@ -802,6 +802,8 @@
+ 
+ 
+diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+--- a/Lib/test/test_regrtest.py
++++ b/Lib/test/test_regrtest.py
+@@ -762,6 +762,7 @@ class ArgsTestCase(BaseTestCase):
+         output = self.run_tests('--fromfile', filename)
+         self.check_executed_tests(output, tests)
+ 
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_interrupted(self):
+         code = TEST_INTERRUPTED
+         test = self.create_test('sigint', code=code)
+@@ -779,6 +780,7 @@ class ArgsTestCase(BaseTestCase):
+                  % (self.TESTNAME_REGEX, len(tests)))
+         self.check_line(output, regex)
+ 
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_slowest_interrupted(self):
+         # Issue #25373: test --slowest with an interrupted test
+         code = TEST_INTERRUPTED
+diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
+--- a/Lib/test/test_resource.py
++++ b/Lib/test/test_resource.py
+@@ -145,6 +145,7 @@ class ResourceTest(unittest.TestCase):
+ 
+     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
+     @support.requires_linux_version(2, 6, 36)
++    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
+     def test_prlimit(self):
+         self.assertRaises(TypeError, resource.prlimit)
+         self.assertRaises(ProcessLookupError, resource.prlimit,
+diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+--- a/Lib/test/test_shutil.py
++++ b/Lib/test/test_shutil.py
+@@ -1143,6 +1143,7 @@ class TestShutil(unittest.TestCase):
+         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+ 
+     @support.requires_zlib
++    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
+     def test_make_archive_owner_group(self):
+         # testing make_archive with owner and group, with various combinations
+         # this works even if there's not gid/uid support
+@@ -1171,6 +1172,7 @@ class TestShutil(unittest.TestCase):
+ 
+ 
+     @support.requires_zlib
++    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
+     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+     def test_tarfile_root_owner(self):
+         root_dir, base_dir = self._create_files()
+diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+--- a/Lib/test/test_socket.py
++++ b/Lib/test/test_socket.py
+@@ -875,6 +875,8 @@ class GeneralModuleTests(unittest.TestCase):
          if not fqhn in all_host_names:
              self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
  
 +    @unittest.skipUnless(support.is_resource_enabled('network'),
 +                         'network is not enabled')
      def test_host_resolution(self):
-         for addr in [support.HOST, '10.0.0.1', '255.255.255.255']:
+         for addr in [support.HOSTv4, '10.0.0.1', '255.255.255.255']:
              self.assertEqual(socket.gethostbyname(addr), addr)
---- Lib/test/test_spwd.py
-+++ Lib/test/test_spwd.py
-@@ -5,8 +5,7 @@
+@@ -1004,6 +1006,8 @@ class GeneralModuleTests(unittest.TestCase):
+             self.assertWarns(DeprecationWarning, socket.ntohs, k)
+             self.assertWarns(DeprecationWarning, socket.htons, k)
+ 
++    @unittest.skipUnless(os.path.exists("/etc/services"),
++                         "getservbyname uses /etc/services, which is not in the chroot")
+     def testGetServBy(self):
+         eq = self.assertEqual
+         # Find one service that exists, then check all the related interfaces.
+@@ -1358,6 +1362,8 @@ class GeneralModuleTests(unittest.TestCase):
+             raise
+         self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
+ 
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     def testGetaddrinfo(self):
+         try:
+             socket.getaddrinfo('localhost', 80)
+@@ -1440,6 +1446,8 @@ class GeneralModuleTests(unittest.TestCase):
+         # only IP addresses are allowed
+         self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
+ 
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     @unittest.skipUnless(support.is_resource_enabled('network'),
+                          'network is not enabled')
+     def test_idna(self):
+diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+--- a/Lib/test/test_spwd.py
++++ b/Lib/test/test_spwd.py
+@@ -5,8 +5,7 @@ from test import support
  spwd = support.import_module('spwd')
  
  
@@ -90,7 +256,7 @@ outcome. Unfortunately, this will make it fail for users running
  class TestSpwdRoot(unittest.TestCase):
  
      def test_getspall(self):
-@@ -56,8 +55,7 @@
+@@ -56,8 +55,7 @@ class TestSpwdRoot(unittest.TestCase):
              self.assertRaises(TypeError, spwd.getspnam, bytes_name)
  
  
@@ -100,50 +266,54 @@ outcome. Unfortunately, this will make it fail for users running
  class TestSpwdNonRoot(unittest.TestCase):
  
      def test_getspnam_exception(self):
---- Lib/test/test_regrtest.py
-+++ Lib/test/test_regrtest.py
-@@ -700,6 +700,7 @@
-         output = self.run_tests('--fromfile', filename)
-         self.check_executed_tests(output, tests)
- 
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
-     def test_interrupted(self):
-         code = TEST_INTERRUPTED
-         test = self.create_test('sigint', code=code)
-@@ -717,6 +718,7 @@
-                  % (self.TESTNAME_REGEX, len(tests)))
-         self.check_line(output, regex)
- 
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
-     def test_slow_interrupted(self):
-         # Issue #25373: test --slowest with an interrupted test
-         code = TEST_INTERRUPTED
---- Lib/test/test_generators.py
-+++ Lib/test/test_generators.py
-@@ -29,6 +29,7 @@
-         else:
-             return "FAILED"
+diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+--- a/Lib/test/test_tarfile.py
++++ b/Lib/test/test_tarfile.py
+@@ -2509,9 +2509,12 @@ def root_is_uid_gid_0():
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
  
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
-     def test_raise_and_yield_from(self):
-         gen = self.generator1()
-         gen.send(None)
---- Lib/test/test_normalization.py
-+++ Lib/test/test_normalization.py
-@@ -2,6 +2,7 @@
- import unittest
+diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -1249,6 +1249,7 @@ class MiscTestCase(unittest.TestCase):
  
- from http.client import HTTPException
-+from urllib.error import URLError
- import sys
- from unicodedata import normalize, unidata_version
  
-@@ -43,6 +44,8 @@
-         except PermissionError:
-             self.skipTest(f"Permission error when downloading {TESTDATAURL} "
-                           f"into the test data directory")
-+        except URLError:
-+            self.skipTest("DNS lookups are not enabled.")
-         except (OSError, HTTPException):
-             self.fail(f"Could not retrieve {TESTDATAURL}")
+ class InterruptMainTests(unittest.TestCase):
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_subthread(self):
+         # Calling start_new_thread with a function that executes interrupt_main
+         # should raise KeyboardInterrupt upon completion.
+@@ -1260,6 +1261,8 @@ class InterruptMainTests(unittest.TestCase):
+             t.join()
+         t.join()
  
++
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_mainthread(self):
+         # Make sure that if interrupt_main is called in main thread that
+         # KeyboardInterrupt is raised instantly.
+diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+--- a/Tools/scripts/run_tests.py
++++ b/Tools/scripts/run_tests.py
+@@ -39,7 +39,7 @@ def main(regrtest_args):
+     if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
+         args.extend(['-j', '0'])  # Use all CPU cores
+     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
+-        args.extend(['-u', 'all,-largefile,-audio,-gui'])
++        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
+     args.extend(regrtest_args)
+     print(' '.join(args))
+     if sys.platform == 'win32':
diff --git a/gnu/packages/patches/python-3-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch
index 73e3f4ccf5..5fea9c66b6 100644
--- a/gnu/packages/patches/python-3-search-paths.patch
+++ b/gnu/packages/patches/python-3-search-paths.patch
@@ -1,8 +1,8 @@
-Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when
+Make sure the build system honors CPATH and LIBRARY_PATH when
 looking for headers and libraries.
 
---- setup.py	2015-10-07 23:32:58.891329173 +0200
-+++ setup.py	2015-10-07 23:46:29.653349924 +0200
+--- a/setup.py	2015-10-07 23:32:58.891329173 +0200
++++ b/setup.py	2015-10-07 23:46:29.653349924 +0200
 @@ -575,8 +575,8 @@
          # if a file is found in one of those directories, it can
          # be assumed that no additional -I,-L directives are needed.
@@ -10,7 +10,7 @@ looking for headers and libraries.
 -            lib_dirs = self.compiler.library_dirs + system_lib_dirs
 -            inc_dirs = self.compiler.include_dirs + system_include_dirs
 +            lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+            inc_dirs = os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
++            inc_dirs = os.getenv('CPATH', '').split(os.pathsep)
          else:
              # Add the sysroot paths. 'sysroot' is a compiler option used to
              # set the logical path of the standard system headers and
diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/patches/python-fix-tests.patch
deleted file mode 100644
index d8f69866fd..0000000000
--- a/gnu/packages/patches/python-fix-tests.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-See the discussion about the issues fixed here at:
-http://bugs.python.org/issue20868 .
-
---- Lib/test/test_shutil.py     2014-03-01 03:02:36.088311000 +0100
-+++ Lib/test/test_shutil.py     2014-03-01 04:56:37.768311000 +0100
-@@ -1127,6 +1127,7 @@
-         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
-
-     @support.requires_zlib
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_archive_owner_group(self):
-         # testing make_archive with owner and group, with various combinations
-         # this works even if there's not gid/uid support
-@@ -1155,6 +1156,7 @@
-
-
-     @support.requires_zlib
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
-     def test_tarfile_root_owner(self):
-         root_dir, base_dir = self._create_files()
---- Lib/test/test_socket.py.orig	2014-03-02 22:14:12.264311000 +0100
-+++ Lib/test/test_socket.py	2014-03-21 03:50:45.660311000 +0100
-@@ -819,6 +819,8 @@
-             self.assertRaises(OverflowError, socket.htonl, k)
-             self.assertRaises(OverflowError, socket.htons, k)
- 
-+    @unittest.skipUnless(os.path.exists("/etc/services"),
-+                         "getservbyname uses /etc/services, which is not in the chroot")
-     def testGetServBy(self):
-         eq = self.assertEqual
-         # Find one service that exists, then check all the related interfaces.
-@@ -1104,6 +1106,8 @@
-         self.assertRaises(ValueError, s.ioctl, -1, None)
-         s.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 100, 100))
- 
-+    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
-+                         "getaddrinfo() will fail")
-     def testGetaddrinfo(self):
-         try:
-             socket.getaddrinfo('localhost', 80)
-@@ -1174,6 +1178,8 @@
-         # only IP addresses are allowed
-         self.assertRaises(socket.error, socket.getnameinfo, ('mail.python.org',0), 0)
- 
-+    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
-+                         "getaddrinfo() will fail")
-     @unittest.skipUnless(support.is_resource_enabled('network'),
-                          'network is not enabled')
-     def test_idna(self):
---- Lib/test/_test_multiprocessing.py	2014-04-06 23:12:27.575235000 +0200
-+++ Lib/test/_test_multiprocessing.py	2014-04-06 23:13:04.827235000 +0200
-@@ -1016,6 +1016,7 @@
-         if pid is not None:
-             os.kill(pid, signal.SIGINT)
- 
-+    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
-     def test_wait_result(self):
-         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
-             pid = os.getpid()
---- Lib/ctypes/test/test_libc.py	2014-04-07 23:17:41.351235000 +0200
-+++ Lib/ctypes/test/test_libc.py	2014-04-07 23:32:18.799235000 +0200
-@@ -2,6 +2,7 @@
- 
- from ctypes import *
- import _ctypes_test
-+import platform
- 
- lib = CDLL(_ctypes_test.__file__)
- 
-@@ -17,6 +18,8 @@
-         import math
-         self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))
- 
-+    @unittest.skipIf(platform.machine() in ['mips64'],
-+                     "This test fails on this platform")
-     def test_qsort(self):
-         comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
-         lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
---- Lib/ctypes/test/test_callbacks.py	2014-04-07 23:15:42.835235000 +0200
-+++ Lib/ctypes/test/test_callbacks.py	2014-04-07 23:32:42.035235000 +0200
-@@ -1,6 +1,7 @@
- import unittest
- from ctypes import *
- import _ctypes_test
-+import platform
- 
- class Callbacks(unittest.TestCase):
-     functype = CFUNCTYPE
-@@ -174,6 +175,8 @@
- 
-         self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
- 
-+    @unittest.skipIf(platform.machine() in ['mips64'],
-+                     "This test fails on this platform")
-     def test_issue_8959_a(self):
-         from ctypes.util import find_library
-         libc_path = find_library("c")
---- Tools/scripts/run_tests.py.orig	2015-04-06 03:52:17.484000000 +0200
-+++ Tools/scripts/run_tests.py	2015-04-06 03:52:25.880000000 +0200
-@@ -47,7 +47,7 @@
-     if threading and not any(is_multiprocess_flag(arg) for arg in regrtest_args):
-         args.extend(['-j', '0'])  # Use all CPU cores
-     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
--        args.extend(['-u', 'all,-largefile,-audio,-gui'])
-+        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
-     args.extend(regrtest_args)
-     print(' '.join(args))
-     os.execv(sys.executable, args)
---- Lib/distutils/tests/test_archive_util.py.orig	2015-04-06 04:08:49.288000000 +0200
-+++ Lib/distutils/tests/test_archive_util.py	2015-04-06 04:09:34.396000000 +0200
-@@ -282,6 +282,7 @@
-         finally:
-             del ARCHIVE_FORMATS['xxx']
-
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_archive_owner_group(self):
-         # testing make_archive with owner and group, with various combinations
-         # this works even if there's not gid/uid support
-@@ -310,6 +311,7 @@
-
-     @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
-     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_tarfile_root_owner(self):
-         tmpdir, tmpdir2, base_name =  self._create_files()
-         old_dir = os.getcwd()
---- Lib/distutils/tests/test_sdist.py.orig	2015-04-06 04:10:05.264000000 +0200
-+++ Lib/distutils/tests/test_sdist.py	2015-04-06 04:10:21.448000000 +0200
-@@ -435,6 +435,7 @@
-                      "The tar command is not found")
-     @unittest.skipIf(find_executable('gzip') is None,
-                      "The gzip command is not found")
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_distribution_owner_group(self):
-         # now building a sdist
-         dist, cmd = self.get_cmd()
---- Lib/test/test_resource.py.orig	2015-04-06 21:30:24.708000000 +0200
-+++ Lib/test/test_resource.py	2015-04-06 23:07:27.220000000 +0200
-@@ -146,6 +146,7 @@
-
-     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
-     @support.requires_linux_version(2, 6, 36)
-+    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
-     def test_prlimit(self):
-         self.assertRaises(TypeError, resource.prlimit)
-         if os.geteuid() != 0:
diff --git a/gnu/packages/patches/python-keras-integration-test.patch b/gnu/packages/patches/python-keras-integration-test.patch
new file mode 100644
index 0000000000..aa2b1a273d
--- /dev/null
+++ b/gnu/packages/patches/python-keras-integration-test.patch
@@ -0,0 +1,19 @@
+Fix a test failure with recent versions of ... Pytest?  Python?
+
+Taken from upstream:
+https://github.com/keras-team/keras/commit/fe35050a8f18dc52304aa8da4e463eececa25240
+
+diff --git a/tests/integration_tests/applications_test.py b/tests/integration_tests/applications_test.py
+index 979f2f2abd6..6e3b57fa8e2 100644
+--- a/tests/integration_tests/applications_test.py
++++ b/tests/integration_tests/applications_test.py
+@@ -58,7 +58,8 @@ def _test_application_basic(app, last_dim=1000):
+ def _test_application_notop(app, last_dim):
+     output_shape = _get_output_shape(
+         lambda: app(weights=None, include_top=False))
+-    assert output_shape == (None, None, None, last_dim)
++    assert len(output_shape) == 4
++    assert output_shape[-1] == last_dim
+ 
+ 
+ def test_mobilenet_v2_legacy_import():
diff --git a/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch b/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch
new file mode 100644
index 0000000000..f11d8f7be8
--- /dev/null
+++ b/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch
@@ -0,0 +1,35 @@
+From 397463014fda3cdefe8d6c9d117ae16d878dc494 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Tue, 25 Sep 2018 14:58:57 +1200
+Subject: [PATCH] Keep compability with stdlib tokenize.py changes
+
+https://github.com/python/cpython/commit/c4ef4896eac86a6759901c8546e26de4695a1389
+is not yet part of any release of Python but has been backported to all
+versions in Git (includeing 2.7!). It causes the tokenize.py module to
+emit a synthetic NEWLINE token for files that do not in fact end with a
+newline, which confuses pycodestyle's checks for blank lines at the end
+of a file. Fortunately the synthetic NEWLINE tokens are easy to detect
+(the token text is "").
+
+Fixes #786
+---
+ pycodestyle.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pycodestyle.py b/pycodestyle.py
+index 0d725d27..fbc3dca3 100755
+--- a/pep8.py
++++ b/pep8.py
+@@ -258,10 +258,10 @@ def trailing_blank_lines(physical_line, lines, line_number, total_lines):
+     """
+     if line_number == total_lines:
+         stripped_last_line = physical_line.rstrip()
+-        if not stripped_last_line:
++        if physical_line and not stripped_last_line:
+             return 0, "W391 blank line at end of file"
+         if stripped_last_line == physical_line:
+-            return len(physical_line), "W292 no newline at end of file"
++            return len(lines[-1]), "W292 no newline at end of file"
+ 
+ 
+ @register_check
diff --git a/gnu/packages/patches/python2-CVE-2018-1000802.patch b/gnu/packages/patches/python2-CVE-2018-1000802.patch
deleted file mode 100644
index 0d5bc77c84..0000000000
--- a/gnu/packages/patches/python2-CVE-2018-1000802.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Fix CVE-2018-1000802:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-1000802
-
-Taken from upstream commit (sans NEWS):
-https://github.com/python/cpython/commit/d8b103b8b3ef9644805341216963a64098642435
-
-diff --git a/Lib/shutil.py b/Lib/shutil.py
-index 3462f7c5e9..0ab1a06f52 100644
---- a/Lib/shutil.py
-+++ b/Lib/shutil.py
-@@ -413,17 +413,21 @@ def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
- 
-     return archive_name
- 
--def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False):
-+def _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger):
-     # XXX see if we want to keep an external call here
-     if verbose:
-         zipoptions = "-r"
-     else:
-         zipoptions = "-rq"
--    from distutils.errors import DistutilsExecError
--    from distutils.spawn import spawn
-+    cmd = ["zip", zipoptions, zip_filename, base_dir]
-+    if logger is not None:
-+        logger.info(' '.join(cmd))
-+    if dry_run:
-+        return
-+    import subprocess
-     try:
--        spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run)
--    except DistutilsExecError:
-+        subprocess.check_call(cmd)
-+    except subprocess.CalledProcessError:
-         # XXX really should distinguish between "couldn't find
-         # external 'zip' command" and "zip failed".
-         raise ExecError, \
-@@ -458,7 +462,7 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
-         zipfile = None
- 
-     if zipfile is None:
--        _call_external_zip(base_dir, zip_filename, verbose, dry_run)
-+        _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger)
-     else:
-         if logger is not None:
-             logger.info("creating '%s' and adding '%s' to it",
diff --git a/gnu/packages/patches/python2-CVE-2018-14647.patch b/gnu/packages/patches/python2-CVE-2018-14647.patch
deleted file mode 100644
index 6226b06aca..0000000000
--- a/gnu/packages/patches/python2-CVE-2018-14647.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Fix CVE-2018-14647:
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14647
-https://bugs.python.org/issue34623
-
-Taken from upstream:
-https://github.com/python/cpython/commit/18b20bad75b4ff0486940fba4ec680e96e70f3a2
-
-diff --git a/Include/pyexpat.h b/Include/pyexpat.h
-index 5340ef5fa3..3fc5fa54da 100644
---- a/Include/pyexpat.h
-+++ b/Include/pyexpat.h
-@@ -3,7 +3,7 @@
- 
- /* note: you must import expat.h before importing this module! */
- 
--#define PyExpat_CAPI_MAGIC  "pyexpat.expat_CAPI 1.0"
-+#define PyExpat_CAPI_MAGIC  "pyexpat.expat_CAPI 1.1"
- #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
- 
- struct PyExpat_CAPI 
-@@ -43,6 +43,8 @@ struct PyExpat_CAPI
-         XML_Parser parser, XML_UnknownEncodingHandler handler,
-         void *encodingHandlerData);
-     void (*SetUserData)(XML_Parser parser, void *userData);
-+    /* might be none for expat < 2.1.0 */
-+    int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt);
-     /* always add new stuff to the end! */
- };
- 
-diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
-index f7f992dd3a..b38e0ab329 100644
---- a/Modules/_elementtree.c
-+++ b/Modules/_elementtree.c
-@@ -2574,6 +2574,11 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw)
-         PyErr_NoMemory();
-         return NULL;
-     }
-+    /* expat < 2.1.0 has no XML_SetHashSalt() */
-+    if (EXPAT(SetHashSalt) != NULL) {
-+        EXPAT(SetHashSalt)(self->parser,
-+                           (unsigned long)_Py_HashSecret.prefix);
-+    }
- 
-     ALLOC(sizeof(XMLParserObject), "create expatparser");
- 
-diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
-index 2b4d31293c..1f8c0d70a5 100644
---- a/Modules/pyexpat.c
-+++ b/Modules/pyexpat.c
-@@ -2042,6 +2042,11 @@ MODULE_INITFUNC(void)
-     capi.SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
-     capi.SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
-     capi.SetUserData = XML_SetUserData;
-+#if XML_COMBINED_VERSION >= 20100
-+    capi.SetHashSalt = XML_SetHashSalt;
-+#else
-+    capi.SetHashSalt = NULL;
-+#endif
- 
-     /* export using capsule */
-     capi_object = PyCapsule_New(&capi, PyExpat_CAPSULE_NAME, NULL);
diff --git a/gnu/packages/patches/qemu-CVE-2018-16872.patch b/gnu/packages/patches/qemu-CVE-2018-16872.patch
deleted file mode 100644
index 094e823ee4..0000000000
--- a/gnu/packages/patches/qemu-CVE-2018-16872.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Fixes CVE-2018-16872:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-16872
-
-Patch copied from upstream source repository:
-
-https://git.qemu.org/?p=qemu.git;a=commitdiff;h=bab9df35ce73d1c8e19a37e2737717ea1c984dc1
-
-From bab9df35ce73d1c8e19a37e2737717ea1c984dc1 Mon Sep 17 00:00:00 2001
-From: Gerd Hoffmann <kraxel@redhat.com>
-Date: Thu, 13 Dec 2018 13:25:11 +0100
-Subject: [PATCH] usb-mtp: use O_NOFOLLOW and O_CLOEXEC.
-
-Open files and directories with O_NOFOLLOW to avoid symlinks attacks.
-While being at it also add O_CLOEXEC.
-
-usb-mtp only handles regular files and directories and ignores
-everything else, so users should not see a difference.
-
-Because qemu ignores symlinks, carrying out a successful symlink attack
-requires swapping an existing file or directory below rootdir for a
-symlink and winning the race against the inotify notification to qemu.
-
-Fixes: CVE-2018-16872
-Cc: Prasad J Pandit <ppandit@redhat.com>
-Cc: Bandan Das <bsd@redhat.com>
-Reported-by: Michael Hanselmann <public@hansmi.ch>
-Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-Reviewed-by: Michael Hanselmann <public@hansmi.ch>
-Message-id: 20181213122511.13853-1-kraxel@redhat.com
----
- hw/usb/dev-mtp.c | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
-index 100b7171f4..36c43b8c20 100644
---- a/hw/usb/dev-mtp.c
-+++ b/hw/usb/dev-mtp.c
-@@ -653,13 +653,18 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)
- {
-     struct dirent *entry;
-     DIR *dir;
-+    int fd;
- 
-     if (o->have_children) {
-         return;
-     }
-     o->have_children = true;
- 
--    dir = opendir(o->path);
-+    fd = open(o->path, O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);
-+    if (fd < 0) {
-+        return;
-+    }
-+    dir = fdopendir(fd);
-     if (!dir) {
-         return;
-     }
-@@ -1007,7 +1012,7 @@ static MTPData *usb_mtp_get_object(MTPState *s, MTPControl *c,
- 
-     trace_usb_mtp_op_get_object(s->dev.addr, o->handle, o->path);
- 
--    d->fd = open(o->path, O_RDONLY);
-+    d->fd = open(o->path, O_RDONLY | O_CLOEXEC | O_NOFOLLOW);
-     if (d->fd == -1) {
-         usb_mtp_data_free(d);
-         return NULL;
-@@ -1031,7 +1036,7 @@ static MTPData *usb_mtp_get_partial_object(MTPState *s, MTPControl *c,
-                                         c->argv[1], c->argv[2]);
- 
-     d = usb_mtp_data_alloc(c);
--    d->fd = open(o->path, O_RDONLY);
-+    d->fd = open(o->path, O_RDONLY | O_CLOEXEC | O_NOFOLLOW);
-     if (d->fd == -1) {
-         usb_mtp_data_free(d);
-         return NULL;
-@@ -1658,7 +1663,7 @@ static void usb_mtp_write_data(MTPState *s)
-                                  0, 0, 0, 0);
-             goto done;
-         }
--        d->fd = open(path, O_CREAT | O_WRONLY, mask);
-+        d->fd = open(path, O_CREAT | O_WRONLY | O_CLOEXEC | O_NOFOLLOW, mask);
-         if (d->fd == -1) {
-             usb_mtp_queue_result(s, RES_STORE_FULL, d->trans,
-                                  0, 0, 0, 0);
--- 
-2.20.1
-
diff --git a/gnu/packages/patches/qemu-CVE-2019-6778.patch b/gnu/packages/patches/qemu-CVE-2019-6778.patch
deleted file mode 100644
index 315f2922da..0000000000
--- a/gnu/packages/patches/qemu-CVE-2019-6778.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Fixes CVE-2019-6778:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6778
-
-Patch copied from upstream source repository:
-
-https://git.qemu.org/?p=qemu.git;a=commitdiff;h=a7104eda7dab99d0cdbd3595c211864cba415905
-
-From a7104eda7dab99d0cdbd3595c211864cba415905 Mon Sep 17 00:00:00 2001
-From: Prasad J Pandit <pjp@fedoraproject.org>
-Date: Sun, 13 Jan 2019 23:29:48 +0530
-Subject: [PATCH] slirp: check data length while emulating ident function
-
-While emulating identification protocol, tcp_emu() does not check
-available space in the 'sc_rcv->sb_data' buffer. It could lead to
-heap buffer overflow issue. Add check to avoid it.
-
-Reported-by: Kira <864786842@qq.com>
-Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
-Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
----
- slirp/tcp_subr.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
-index 4a9a5b5edc..23a841f26e 100644
---- a/slirp/tcp_subr.c
-+++ b/slirp/tcp_subr.c
-@@ -634,6 +634,11 @@ tcp_emu(struct socket *so, struct mbuf *m)
- 			socklen_t addrlen = sizeof(struct sockaddr_in);
- 			struct sbuf *so_rcv = &so->so_rcv;
- 
-+			if (m->m_len > so_rcv->sb_datalen
-+					- (so_rcv->sb_wptr - so_rcv->sb_data)) {
-+			    return 1;
-+			}
-+
- 			memcpy(so_rcv->sb_wptr, m->m_data, m->m_len);
- 			so_rcv->sb_wptr += m->m_len;
- 			so_rcv->sb_rptr += m->m_len;
--- 
-2.20.1
-
diff --git a/gnu/packages/patches/rapidjson-gcc-compat.patch b/gnu/packages/patches/rapidjson-gcc-compat.patch
new file mode 100644
index 0000000000..b5ffc0a908
--- /dev/null
+++ b/gnu/packages/patches/rapidjson-gcc-compat.patch
@@ -0,0 +1,18 @@
+Disable -Werror=implicit-fallthrough on GCC7 and later.  Taken from upstream:
+https://github.com/Tencent/rapidjson/commit/fe19b7b6016d446722621fb407738209d1a911e8
+https://github.com/Tencent/rapidjson/commit/cba45fe9de6923b858edb0780e257b7257aa4f7b
+
+diff --git a/include/rapidjson/internal/regex.h b/include/rapidjson/internal/regex.h
+index 422a5240..d4039716 100644
+--- a/include/rapidjson/internal/regex.h
++++ b/include/rapidjson/internal/regex.h
+@@ -29,6 +29,9 @@ RAPIDJSON_DIAG_OFF(implicit-fallthrough)
+ #ifdef __GNUC__
+ RAPIDJSON_DIAG_PUSH
+ RAPIDJSON_DIAG_OFF(effc++)
++#if __GNUC__ >= 7
++RAPIDJSON_DIAG_OFF(implicit-fallthrough)
++#endif
+ #endif
+ 
+ #ifdef _MSC_VER
diff --git a/gnu/packages/patches/sssd-curl-compat.patch b/gnu/packages/patches/sssd-curl-compat.patch
deleted file mode 100644
index ecab737153..0000000000
--- a/gnu/packages/patches/sssd-curl-compat.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Fix build with curl >= 7.62.  Patch taken from upstream:
-
-https://pagure.io/SSSD/sssd/c/4d3841ca379afc01184453ba45ab3e75ffec60da?branch=sssd-1-16
-
-diff --git a/src/util/tev_curl.c b/src/util/tev_curl.c
-index 6a7a580..d70a429 100644
---- a/src/util/tev_curl.c
-+++ b/src/util/tev_curl.c
-@@ -97,7 +97,9 @@ static errno_t curl_code2errno(CURLcode crv)
-         return ETIMEDOUT;
-     case CURLE_SSL_ISSUER_ERROR:
-     case CURLE_SSL_CACERT_BADFILE:
-+#if LIBCURL_VERSION_NUM < 0x073e00
-     case CURLE_SSL_CACERT:
-+#endif
-     case CURLE_SSL_CERTPROBLEM:
-         return ERR_INVALID_CERT;
- 
diff --git a/gnu/packages/patches/supertux-fix-build-with-gcc5.patch b/gnu/packages/patches/supertux-fix-build-with-gcc5.patch
deleted file mode 100644
index 6393215ca1..0000000000
--- a/gnu/packages/patches/supertux-fix-build-with-gcc5.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-Taken from https://github.com/SuperTux/supertux/commit/a75317ef0a94847d9b6a7833b9c6652ef29edde3.
-This patch fixes building with gcc versions earlier than 6.
-
-From a75317ef0a94847d9b6a7833b9c6652ef29edde3 Mon Sep 17 00:00:00 2001
-From: Ingo Ruhnke <grumbel@gmail.com>
-Date: Fri, 28 Dec 2018 22:45:35 +0100
-Subject: [PATCH] Add workaround for backwards compatibilty with gcc5
-
-Fixes #1014
----
- src/video/gl/gl_painter.cpp | 11 ++++++-----
- src/video/ttf_surface.cpp   | 16 +++++++++-------
- 2 files changed, 15 insertions(+), 12 deletions(-)
-
-diff --git a/src/video/gl/gl_painter.cpp b/src/video/gl/gl_painter.cpp
-index 5e0d1e7b1e..32fb7a09b6 100644
---- a/src/video/gl/gl_painter.cpp
-+++ b/src/video/gl/gl_painter.cpp
-@@ -37,12 +37,13 @@ namespace {
- 
- inline std::tuple<GLenum, GLenum> blend_factor(Blend blend)
- {
-+  using B = std::tuple<GLenum, GLenum>;
-   switch(blend) {
--    case Blend::NONE: return {GL_ONE, GL_ZERO};
--    case Blend::BLEND: return {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA};
--    case Blend::ADD: return {GL_SRC_ALPHA, GL_ONE};
--    case Blend::MOD: return {GL_DST_COLOR, GL_ZERO};
--    default: return {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA};
-+    case Blend::NONE: return B(GL_ONE, GL_ZERO);
-+    case Blend::BLEND: return B(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-+    case Blend::ADD: return B(GL_SRC_ALPHA, GL_ONE);
-+    case Blend::MOD: return B(GL_DST_COLOR, GL_ZERO);
-+    default: return B(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-   }
- }
- 
-diff --git a/src/video/ttf_surface.cpp b/src/video/ttf_surface.cpp
-index 7c9505004f..b41d67b2c8 100644
---- a/src/video/ttf_surface.cpp
-+++ b/src/video/ttf_surface.cpp
-@@ -55,12 +55,13 @@ TTFSurface::create(const TTFFont& font, const std::string& text)
-     SDL_SetSurfaceColorMod(text_surface.get(), 0, 0, 0);
-     SDL_SetSurfaceBlendMode(text_surface.get(), SDL_BLENDMODE_BLEND);
- 
-+    using P = std::tuple<int, int>;
-     const std::initializer_list<std::tuple<int, int> > positions[] = {
-       {},
--      {{0, 0}},
--      {{-1, 0}, {1, 0}, {0, -1}, {0, 1}},
--      {{-2, 0}, {2, 0}, {0, -2}, {0, 2},
--       {-1, -1}, {1, -1}, {-1, 1}, {1, 1}}
-+      {P{0, 0}},
-+      {P{-1, 0}, P{1, 0}, P{0, -1}, P{0, 1}},
-+      {P{-2, 0}, P{2, 0}, P{0, -2}, P{0, 2},
-+       P{-1, -1}, P{1, -1}, P{-1, 1}, P{1, 1}}
-     };
- 
-     int shadow_size = std::min(2, font.get_shadow_size());
-@@ -77,11 +78,12 @@ TTFSurface::create(const TTFFont& font, const std::string& text)
-     SDL_SetSurfaceColorMod(text_surface.get(), 0, 0, 0);
-     SDL_SetSurfaceBlendMode(text_surface.get(), SDL_BLENDMODE_BLEND);
- 
-+    using P = std::tuple<int, int>;
-     const std::initializer_list<std::tuple<int, int> > positions[] = {
-       {},
--      {{-1, 0}, {1, 0}, {0, -1}, {0, 1}},
--      {{-2, 0}, {2, 0}, {0, -2}, {0, 2},
--       {-1, -1}, {1, -1}, {-1, 1}, {1, 1}}
-+      {P{-1, 0}, P{1, 0}, P{0, -1}, P{0, 1}},
-+      {P{-2, 0}, P{2, 0}, P{0, -2}, P{0, 2},
-+       P{-1, -1}, P{1, -1}, P{-1, 1}, P{1, 1}}
-     };
- 
-     int border = std::min(2, font.get_border());
diff --git a/gnu/packages/patches/tcc-boot-0.9.27.patch b/gnu/packages/patches/tcc-boot-0.9.27.patch
new file mode 100644
index 0000000000..6f9d365788
--- /dev/null
+++ b/gnu/packages/patches/tcc-boot-0.9.27.patch
@@ -0,0 +1,26 @@
+From 1431ba3a99582e4c3d2693ac37e57f361858affd Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Mon, 11 Jun 2018 18:39:44 +0200
+Subject: [PATCH] bootstrappable: Force static link.
+
+---
+ libtcc.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libtcc.c b/libtcc.c
+index 3448f44..02ab850 100644
+--- a/libtcc.c
++++ b/libtcc.c
+@@ -735,6 +735,9 @@ LIBTCCAPI TCCState *tcc_new(void)
+     tcc_state = s;
+     ++nb_states;
+ 
++#if BOOTSTRAP
++    s->static_link = 1;
++#endif
+     s->alacarte_link = 1;
+     s->nocommon = 1;
+     s->warn_implicit_function_declaration = 1;
+-- 
+2.16.2
+
diff --git a/gnu/packages/patches/texinfo-perl-compat.patch b/gnu/packages/patches/texinfo-perl-compat.patch
deleted file mode 100644
index a7348fde0d..0000000000
--- a/gnu/packages/patches/texinfo-perl-compat.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Fix compatibility with newer Perls.
-
-The first patch is taken from upstream:
-https://svn.savannah.gnu.org/viewvc/texinfo?view=revision&revision=8008
-
-The second gets rid of a deprecation warning that breaks some tests.
-Taken from Fedora: <https://bugzilla.redhat.com/show_bug.cgi?id=1590308>.
-
---- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c	2017/04/30 14:57:26	7765
-+++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c	2018/07/13 15:39:29	8008
-@@ -248,6 +248,11 @@
- 
-   dTHX;
- 
-+#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
-+  /* needed due to thread-safe locale handling in newer perls */
-+  switch_to_global_locale();
-+#endif
-+
-   if (setlocale (LC_CTYPE, "en_US.UTF-8")
-       || setlocale (LC_CTYPE, "en_US.utf8"))
-     goto success;
-@@ -320,6 +325,10 @@
-     {
- success: ;
-       free (utf8_locale);
-+#if PERL_VERSION > 27 || (PERL_VERSION == 27 && PERL_SUBVERSION > 8)
-+      /* needed due to thread-safe locale handling in newer perls */
-+      sync_locale();
-+#endif
-       /*
-       fprintf (stderr, "tried to set LC_CTYPE to UTF-8.\n");
-       fprintf (stderr, "character encoding is: %s\n",
-
-diff -up texinfo-6.5/tp/Texinfo/Parser.pm.orig texinfo-6.5/tp/Texinfo/Parser.pm
---- texinfo-6.5/tp/Texinfo/Parser.pm.orig	2018-06-12 13:40:29.356030136 +0200
-+++ texinfo-6.5/tp/Texinfo/Parser.pm	2018-06-12 13:41:28.357725639 +0200
-@@ -5478,11 +5478,11 @@ sub _parse_special_misc_command($$$$)
-     }
-   } elsif ($command eq 'clickstyle') {
-     # REMACRO
--    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*/) {
-+    if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)(\{})?\s*/) {
-       $args = ['@'.$1];
-       $self->{'clickstyle'} = $1;
-       $remaining = $line;
--      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
-+      $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)(\{})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
-       $has_comment = 1 if (defined($4));
-     } else {
-       $self->line_error (sprintf($self->__(
diff --git a/gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch b/gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch
index d8b9bf172a..024ff416af 100644
--- a/gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch
+++ b/gnu/packages/patches/texlive-bin-luatex-poppler-compat.patch
@@ -1,23 +1,14 @@
-Fix LuaTeX compatibility with Poppler 0.72.
+Fix LuaTeX compatibility with Poppler 0.75.
 
 Upstream LuaTeX have moved from Poppler to "pplib" and thus upstream
-fixes are unavailable.  This is based on Arch Linux patches, with minor
-changes for Poppler 0.72:
-https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/texlive-bin&id=f1b424435c8fa31d9296c7a6dc17f939a8332780
+fixes are unavailable.  This is based on Archs patch, with minor
+tweaks to comply with texlive-bin-CVE-2018-17407.patch.
+https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/texlive-bin&id=418dd6f008c3d41a461353fdb60f2d73d87c58ed
 
 diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w
 --- a/texk/web2c/luatexdir/image/pdftoepdf.w
 +++ b/texk/web2c/luatexdir/image/pdftoepdf.w
-@@ -35,7 +35,7 @@
- 
- extern void md5(Guchar *msg, int msgLen, Guchar *digest);
- 
--static GBool isInit = gFalse;
-+static bool isInit = false;
- 
- /* Maintain AVL tree of all PDF files for embedding */
- 
-@@ -363,10 +363,10 @@ void copyReal(PDF pdf, double d)
+@@ -363,7 +363,7 @@ void copyReal(PDF pdf, double d)
  
  static void copyString(PDF pdf, GooString * string)
  {
@@ -25,11 +16,7 @@ diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image
 +    const char *p;
      unsigned char c;
      size_t i, l;
--    p = string->getCString();
-+    p = string->c_str();
-     l = (size_t) string->getLength();
-     if (pdf->cave)
-         pdf_out(pdf, ' ');
+     p = string->getCString();
 @@ -393,7 +393,7 @@ static void copyString(PDF pdf, GooString * string)
      pdf->cave = true;
  }
@@ -39,15 +26,25 @@ diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image
  {
      pdf_out(pdf, '/');
      for (; *s != 0; s++) {
-@@ -468,14 +468,14 @@ static void copyObject(PDF pdf, PdfDocument * pdf_doc, Object * obj)
-         break;
-     /*
-     case objNum:
--        GBool isNum() { return type == objInt || type == objReal; }
-+        bool isNum() { return type == objInt || type == objReal; }
-         break;
-     */
-     case objString:
+@@ -412,7 +412,7 @@ static void copyArray(PDF pdf, PdfDocument * pdf_doc, Array * array)
+     Object obj1;
+     pdf_begin_array(pdf);
+     for (i = 0, l = array->getLength(); i < l; ++i) {
+-        obj1 = array->getNF(i);
++        obj1 = array->getNF(i).copy();
+         copyObject(pdf, pdf_doc, &obj1);
+     }
+     pdf_end_array(pdf);
+@@ -425,7 +425,7 @@ static void copyDict(PDF pdf, PdfDocument * pdf_doc, Dict * dict)
+     pdf_begin_dict(pdf);
+     for (i = 0, l = dict->getLength(); i < l; ++i) {
+         copyName(pdf, dict->getKey(i));
+-        obj1 = dict->getValNF(i);
++        obj1 = dict->getValNF(i).copy();
+         copyObject(pdf, pdf_doc, &obj1);
+     }
+     pdf_end_dict(pdf);
+@@ -475,7 +475,7 @@ static void copyObject(PDF pdf, PdfDocument * pdf_doc, Object * obj)
          copyString(pdf, (GooString *)obj->getString());
          break;
      case objName:
@@ -85,31 +82,37 @@ diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image
              break;
      }
  }
-@@ -587,11 +587,11 @@ void read_pdf_info(image_dict * idict)
-     PDFRectangle *pagebox;
-     int pdf_major_version_found, pdf_minor_version_found;
-     float xsize, ysize, xorig, yorig;
--    if (isInit == gFalse) {
-+    if (isInit == false) {
-         if (!(globalParams))
-             globalParams = new GlobalParams();
--        globalParams->setErrQuiet(gFalse);
--        isInit = gTrue;
-+        globalParams->setErrQuiet(false);
-+        isInit = true;
-     }
-     if (img_type(idict) == IMG_TYPE_PDF)
-         pdf_doc = refPdfDocument(img_filepath(idict), FE_FAIL);
-@@ -966,7 +966,7 @@ void epdf_free()
-     if (PdfDocumentTree != NULL)
-         avl_destroy(PdfDocumentTree, destroyPdfDocument);
-     PdfDocumentTree = NULL;
--    if (isInit == gTrue)
-+    if (isInit == true)
-         delete globalParams;
--    isInit = gFalse;
-+    isInit = false;
- }
+@@ -788,12 +788,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
+         Now all relevant parts of the Page dictionary are copied. Metadata validity
+         check is needed(as a stream it must be indirect).
+     */
+-    obj1 = pageDict->lookupNF("Metadata");
++    obj1 = pageDict->lookupNF("Metadata").copy();
+     if (!obj1.isNull() && !obj1.isRef())
+         formatted_warning("pdf inclusion","/Metadata must be indirect object");
+     /* copy selected items in Page dictionary */
+     for (i = 0; pagedictkeys[i] != NULL; i++) {
+-        obj1 = pageDict->lookupNF(pagedictkeys[i]);
++        obj1 = pageDict->lookupNF(pagedictkeys[i]).copy();
+         if (!obj1.isNull()) {
+             pdf_add_name(pdf, pagedictkeys[i]);
+             /* preserves indirection */
+@@ -806,13 +806,13 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
+         PDF file, climbing up the tree until the Resources are found.
+         (This fixes a problem with Scribus 1.3.3.14.)
+     */
+-    obj1 = pageDict->lookupNF("Resources");
++    obj1 = pageDict->lookupNF("Resources").copy();
+     if (obj1.isNull()) {
+         op1 = &pagesobj1;
+         op2 = &pagesobj2;
+         *op1 = pageDict->lookup("Parent");
+         while (op1->isDict()) {
+-            obj1 = op1->dictLookupNF("Resources");
++            obj1 = op1->dictLookupNF("Resources").copy();
+             if (!obj1.isNull()) {
+                 pdf_add_name(pdf, "Resources");
+                 copyObject(pdf, pdf_doc, &obj1);
 diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc
 --- a/texk/web2c/luatexdir/lua/lepdflib.cc
 +++ b/texk/web2c/luatexdir/lua/lepdflib.cc
@@ -122,15 +125,15 @@ diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lep
         uout->atype = ALLOC_LEPDF;
         uout->pc = uobj->pc;
         uout->pd = uobj->pd;
-@@ -439,7 +439,7 @@ static int l_new_Object(lua_State * L)
-       break;
-     case 1:
-       if (lua_isboolean (L,1)) {
--	uout->d = new Object(lua_toboolean(L, 1)? gTrue : gFalse);
-+	uout->d = new Object(lua_toboolean(L, 1)? true : false);
- 	uout->atype = ALLOC_LEPDF;
- 	uout->pc = 0;
- 	uout->pd = NULL;
+@@ -496,7 +496,7 @@ static int l_new_Object(lua_State * L)
+ 	double numA = lua_tonumber(L,1);
+ 	double genA = lua_tonumber(L,2);
+ 	if ( ((numA)==(int)(numA)) && ((genA)==(int)(genA)) ){
+-	  uout->d = new Object((int)(numA), (int)(genA));
++	  uout->d = new Object({(int)(numA), (int)(genA)});
+ 	  uout->atype = ALLOC_LEPDF;
+ 	  uout->pc = 0;
+ 	  uout->pd = NULL;
 @@ -596,7 +596,7 @@ static int m_##in##_##function(lua_State * L)                  \
      uin = (udstruct *) luaL_checkudata(L, 1, M_##in);          \
      if (uin->pd != NULL && uin->pd->pc != uin->pc)             \
@@ -140,33 +143,15 @@ diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lep
      if (o != NULL) {                                           \
          uout = new_##out##_userdata(L);                        \
          uout->d = o;                                           \
-@@ -676,7 +676,7 @@ static int m_##in##_##function(lua_State * L)                  \
-         pdfdoc_changed_error(L);                               \
-     gs = (GooString *)((in *) uin->d)->function();             \
-     if (gs != NULL)                                            \
--        lua_pushlstring(L, gs->getCString(), gs->getLength()); \
-+        lua_pushlstring(L, gs->c_str(), gs->getLength()); \
-     else                                                       \
-         lua_pushnil(L);                                        \
-     return 1;                                                  \
-@@ -911,7 +911,7 @@ static int m_Array_getString(lua_State * L)
-     if (i > 0 && i <= len) {
-         gs = new GooString();
-         if (((Array *) uin->d)->getString(i - 1, gs))
--            lua_pushlstring(L, gs->getCString(), gs->getLength());
-+            lua_pushlstring(L, gs->c_str(), gs->getLength());
-         else
-             lua_pushnil(L);
-         delete gs;
-@@ -1063,7 +1063,7 @@ static int m_Catalog_getJS(lua_State * L)
+@@ -889,7 +889,7 @@ static int m_Array_getNF(lua_State * L)
      if (i > 0 && i <= len) {
-         gs = ((Catalog *) uin->d)->getJS(i - 1);
-         if (gs != NULL)
--            lua_pushlstring(L, gs->getCString(), gs->getLength());
-+            lua_pushlstring(L, gs->c_str(), gs->getLength());
-         else
-             lua_pushnil(L);
-         delete gs;
+         uout = new_Object_userdata(L);
+         uout->d = new Object();
+-        *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1);
++        *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1).copy();
+         uout->atype = ALLOC_LEPDF;
+         uout->pc = uin->pc;
+         uout->pd = uin->pd;
 @@ -1125,12 +1125,12 @@ m_poppler_get_INT(Dict, getLength);
  
  static int m_Dict_add(lua_State * L)
@@ -182,36 +167,42 @@ diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lep
      uobj = (udstruct *) luaL_checkudata(L, 3, M_Object);
      ((Dict *) uin->d)->add(s, std::move(*((Object *) uobj->d)));
      return 0;
-@@ -1378,7 +1378,7 @@ static int m_GooString__tostring(lua_State * L)
-     uin = (udstruct *) luaL_checkudata(L, 1, M_GooString);
-     if (uin->pd != NULL && uin->pd->pc != uin->pc)
-         pdfdoc_changed_error(L);
--    lua_pushlstring(L, ((GooString *) uin->d)->getCString(),
-+    lua_pushlstring(L, ((GooString *) uin->d)->c_str(),
-                     ((GooString *) uin->d)->getLength());
-     return 1;
- }
-@@ -1527,9 +1527,9 @@ static int m_Object_initBool(lua_State * L)
+@@ -1190,7 +1190,7 @@ static int m_Dict_lookupNF(lua_State * L)
+     s = luaL_checkstring(L, 2);
+     uout = new_Object_userdata(L);
+     uout->d = new Object();
+-    *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s);
++    *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s).copy();
+     uout->atype = ALLOC_LEPDF;
+     uout->pc = uin->pc;
+     uout->pd = uin->pd;
+@@ -1263,7 +1263,7 @@ static int m_Dict_getValNF(lua_State * L)
+     if (i > 0 && i <= len) {
+         uout = new_Object_userdata(L);
+         uout->d = new Object();
+-        *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1);
++        *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1).copy();
+         uout->atype = ALLOC_LEPDF;
+         uout->pc = uin->pc;
+         uout->pd = uin->pd;
+@@ -1653,7 +1653,7 @@ static int m_Object_initRef(lua_State * L)
          pdfdoc_changed_error(L);
-     luaL_checktype(L, 2, LUA_TBOOLEAN);
-     if (lua_toboolean(L, 2) != 0)
--        *((Object *) uin->d) = Object(gTrue);
-+        *((Object *) uin->d) = Object(true);
-     else
--        *((Object *) uin->d) = Object(gFalse);
-+        *((Object *) uin->d) = Object(false);
+     num = luaL_checkint(L, 2);
+     gen = luaL_checkint(L, 3);
+-    *((Object *) uin->d) = Object(num, gen);
++    *((Object *) uin->d) = Object({num, gen});
      return 0;
  }
  
-@@ -1814,7 +1814,7 @@ static int m_Object_getString(lua_State * L)
-         pdfdoc_changed_error(L);
-     if (((Object *) uin->d)->isString()) {
-         gs = (GooString *)((Object *) uin->d)->getString();
--        lua_pushlstring(L, gs->getCString(), gs->getLength());
-+        lua_pushlstring(L, gs->c_str(), gs->getLength());
-     } else
-         lua_pushnil(L);
-     return 1;
+@@ -2011,7 +2011,7 @@ static int m_Object_arrayGetNF(lua_State * L)
+         if (i > 0 && i <= len) {
+             uout = new_Object_userdata(L);
+             uout->d = new Object();
+-            *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1);
++            *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1).copy();
+             uout->atype = ALLOC_LEPDF;
+             uout->pc = uin->pc;
+             uout->pd = uin->pd;
 @@ -2051,7 +2051,7 @@ static int m_Object_dictAdd(lua_State * L)
          pdfdoc_changed_error(L);
      if (!((Object *) uin->d)->isDict())
@@ -221,30 +212,42 @@ diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lep
      return 0;
  }
  
-@@ -2470,9 +2470,9 @@ static int m_PDFDoc_getFileName(lua_State * L)
+@@ -2104,7 +2104,7 @@ static int m_Object_dictLookupNF(lua_State * L)
+     if (((Object *) uin->d)->isDict()) {
+         uout = new_Object_userdata(L);
+         uout->d = new Object();
+-        *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s);
++        *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s).copy();
+         uout->atype = ALLOC_LEPDF;
+         uout->pc = uin->pc;
+         uout->pd = uin->pd;
+@@ -2169,7 +2169,7 @@ static int m_Object_dictGetValNF(lua_State * L)
+         if (i > 0 && i <= len) {
+             uout = new_Object_userdata(L);
+             uout->d = new Object();
+-            *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1);
++            *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1).copy();
+             uout->atype = ALLOC_LEPDF;
+             uout->pc = uin->pc;
+             uout->pd = uin->pd;
+@@ -2470,7 +2470,7 @@ static int m_PDFDoc_getFileName(lua_State * L)
      uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
      if (uin->pd != NULL && uin->pd->pc != uin->pc)
          pdfdoc_changed_error(L);
 -    gs = ((PdfDocument *) uin->d)->doc->getFileName();
 +    gs = (GooString *) ((PdfDocument *) uin->d)->doc->getFileName();
      if (gs != NULL)
--        lua_pushlstring(L, gs->getCString(), gs->getLength());
-+        lua_pushlstring(L, gs->c_str(), gs->getLength());
+         lua_pushlstring(L, gs->getCString(), gs->getLength());
      else
-         lua_pushnil(L);
-     return 1;
-@@ -2559,9 +2559,9 @@ static int m_PDFDoc_readMetadata(lua_State * L)
+@@ -2559,7 +2559,7 @@ static int m_PDFDoc_readMetadata(lua_State * L)
      if (uin->pd != NULL && uin->pd->pc != uin->pc)
          pdfdoc_changed_error(L);
      if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
 -        gs = ((PdfDocument *) uin->d)->doc->readMetadata();
 +        gs = (GooString *) ((PdfDocument *) uin->d)->doc->readMetadata();
          if (gs != NULL)
--            lua_pushlstring(L, gs->getCString(), gs->getLength());
-+            lua_pushlstring(L, gs->c_str(), gs->getLength());
+             lua_pushlstring(L, gs->getCString(), gs->getLength());
          else
-             lua_pushnil(L);
-     } else
 @@ -2577,7 +2577,7 @@ static int m_PDFDoc_getStructTreeRoot(lua_State * L)
      if (uin->pd != NULL && uin->pd->pc != uin->pc)
          pdfdoc_changed_error(L);
@@ -254,65 +257,37 @@ diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lep
          uout = new_StructTreeRoot_userdata(L);
          uout->d = obj;
          uout->pc = uin->pc;
-@@ -3038,12 +3038,12 @@ m_poppler_get_BOOL(Attribute, isHidden);
- 
- static int m_Attribute_setHidden(lua_State * L)
- {
--    GBool i;
-+    bool i;
-     udstruct *uin;
-     uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
-     if (uin->pd != NULL && uin->pd->pc != uin->pc)
+--- texlive-source/texk/web2c/luatexdir/lua/lepdflib.cc.orig    2019-04-24 09:41:05.090522664 +0000
++++ texlive-source/texk/web2c/luatexdir/lua/lepdflib.cc 2019-04-24 09:43:37.119184926 +0000
+@@ -994,7 +994,8 @@
          pdfdoc_changed_error(L);
--    i = (GBool) lua_toboolean(L, 2);
-+    i = (bool) lua_toboolean(L, 2);
-     ((Attribute *) uin->d)->setHidden(i);
-     return 0;
- }
-@@ -3180,7 +3180,7 @@ static int m_StructElement_getParentRef(lua_State * L)
- // Ref is false if the C++ functione return false
- static int m_StructElement_getPageRef(lua_State * L)
- {
--    GBool b;
-+    bool b;
-     Ref *r;
-     udstruct *uin, *uout;
-     uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
-@@ -3226,16 +3226,16 @@ static int m_StructElement_setRevision(lua_State * L)
- 
- static int m_StructElement_getText(lua_State * L)
- {
--    GBool i;
-+    bool i;
-     GooString *gs;
-     udstruct *uin;
-     uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
-     if (uin->pd != NULL && uin->pd->pc != uin->pc)
-         pdfdoc_changed_error(L);
--    i = (GBool) lua_toboolean(L, 2);
-+    i = (bool) lua_toboolean(L, 2);
-     gs =  ((StructElement *) uin->d)->getText(i);
-     if (gs != NULL)
--        lua_pushlstring(L, gs->getCString(), gs->getLength());
-+        lua_pushlstring(L, gs->c_str(), gs->getLength());
+     num = luaL_checkint(L, 2);
+     gen = luaL_checkint(L, 3);
+-    i = ((Catalog *) uin->d)->findPage(num, gen);
++    Ref numgen = {num, gen};
++    i = ((Catalog *) uin->d)->findPage(numgen);
+     if (i > 0)
+         lua_pushinteger(L, i);
      else
-         lua_pushnil(L);
-     return 1;
-@@ -3321,7 +3321,7 @@ static int m_StructElement_findAttribute(lua_State * L)
- {
-     Attribute::Type t;
-     Attribute::Owner o;
--    GBool g;
-+    bool g;
-     udstruct *uin, *uout;
-     const Attribute *a;
-     uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
-@@ -3329,7 +3329,7 @@ static int m_StructElement_findAttribute(lua_State * L)
+@@ -2596,8 +2597,9 @@
          pdfdoc_changed_error(L);
-     t = (Attribute::Type) luaL_checkint(L,1);
-     o = (Attribute::Owner) luaL_checkint(L,2);
--    g = (GBool) lua_toboolean(L, 3);
-+    g = (bool) lua_toboolean(L, 3);
-     a = ((StructElement *) uin->d)->findAttribute(t,g,o);
- 
-     if (a!=NULL){
+     num = luaL_checkint(L, 2);
+     gen = luaL_checkint(L, 3);
++    Ref numgen = {num, gen};
+     if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
+-        i = ((PdfDocument *) uin->d)->doc->findPage(num, gen);
++        i = ((PdfDocument *) uin->d)->doc->findPage(numgen);
+         if (i > 0)
+             lua_pushinteger(L, i);
+         else
+--- texlive-source/texk/web2c/luatexdir/image/pdftoepdf.w.orig  2019-04-24 09:56:38.406498975 +0000
++++ texlive-source/texk/web2c/luatexdir/image/pdftoepdf.w       2019-04-24 09:56:57.020081327 +0000
+@@ -630,7 +630,7 @@
+         if (link == NULL || !link->isOk())
+             formatted_error("pdf inclusion","invalid destination '%s'",img_pagename(idict));
+         Ref ref = link->getPageRef();
+-        img_pagenum(idict) = catalog->findPage(ref.num, ref.gen);
++        img_pagenum(idict) = catalog->findPage(ref);
+         if (img_pagenum(idict) == 0)
+             formatted_error("pdf inclusion","destination is not a page '%s'",img_pagename(idict));
+         delete link;
diff --git a/gnu/packages/patches/util-linux-tests.patch b/gnu/packages/patches/util-linux-tests.patch
index bb5be66515..ec1671f224 100644
--- a/gnu/packages/patches/util-linux-tests.patch
+++ b/gnu/packages/patches/util-linux-tests.patch
@@ -2,6 +2,8 @@ This test checks whether 'root' is successfully translated to UID/GID 0,
 using 'getpwnam' in libmount.  This doesn't work in the chroot because
 /etc/passwd doesn't contain an entry for 'root' so skip it.
 
+The second test requires that '/sys/dev/block' is present, which is not
+the case inside the build container.
 
 --- util-linux-2.25.2/tests/ts/libmount/optstr	2015-01-23 13:58:41.181151194 +0100
 +++ util-linux-2.25.2/tests/ts/libmount/optstr	2015-01-23 13:58:42.829161716 +0100
@@ -16,3 +18,14 @@ using 'getpwnam' in libmount.  This doesn't work in the chroot because
  ts_init_subtest "deduplicate"
  ts_run $TESTPROG --dedup bbb,ccc,AAA,xxx,AAA=a,AAA=bbb,ddd,AAA=ccc,fff=eee AAA &> $TS_OUTPUT
  ts_finalize_subtest
+--- a/tests/ts/lsblk/lsblk	2019-03-11 21:08:23.734387391 +0100
++++ b/tests/ts/lsblk/lsblk	2019-03-11 21:12:43.635473111 +0100
+@@ -22,6 +22,8 @@
+ 
+ ts_init "$*"
+ 
++ts_skip "/sys/dev/block is not available"
++
+ ts_check_test_command "$TS_CMD_LSBLK"
+ ts_check_prog xz
+ ts_check_prog tar