summaryrefslogtreecommitdiff
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/diffutils-getopt.patch44
-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/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-supported-locales.patch33
-rw-r--r--gnu/packages/patches/groff-source-date-epoch.patch299
-rw-r--r--gnu/packages/patches/handbrake-opt-in-nvenc.patch14
-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/libgcrypt-make-yat2m-reproducible.patch32
-rw-r--r--gnu/packages/patches/mescc-tools-boot.patch222
-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.patch354
-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-pytest-pluggy-compat.patch64
-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/scribus-poppler-0.73.patch36
-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/util-linux-tests.patch13
29 files changed, 1694 insertions, 978 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/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/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/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-supported-locales.patch b/gnu/packages/patches/glibc-supported-locales.patch
new file mode 100644
index 0000000000..2888052bb8
--- /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.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/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/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/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/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/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/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..e4ba728a7e 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
+@@ -1301,6 +1301,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
+@@ -2130,8 +2130,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
+@@ -1133,11 +1133,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
+@@ -764,6 +764,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)
+@@ -781,6 +782,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_slow_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
+@@ -1135,6 +1135,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
+@@ -1163,6 +1164,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,34 @@ 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"
-
-+ @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
-
- 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}")
+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
+@@ -2504,9 +2504,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
+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-pytest-pluggy-compat.patch b/gnu/packages/patches/python-pytest-pluggy-compat.patch
new file mode 100644
index 0000000000..ac33b862e6
--- /dev/null
+++ b/gnu/packages/patches/python-pytest-pluggy-compat.patch
@@ -0,0 +1,64 @@
+Fix test failures when built against Pluggy 0.9.
+
+Taken from this upstream commit:
+https://github.com/pytest-dev/pytest/commit/a68f4fd2b9e99c82476d0e04ebcf561aeddbcb2e
+
+diff --git a/testing/test_assertion.py b/testing/test_assertion.py
+index b659233eb..e4fe56c6f 100644
+--- a/testing/test_assertion.py
++++ b/testing/test_assertion.py
+@@ -209,7 +209,7 @@ def load(self, require=True, *args, **kwargs):
+ import spamplugin
+ return spamplugin
+
+- def iter_entry_points(name):
++ def iter_entry_points(group, name=None):
+ yield DummyEntryPoint()
+
+ pkg_resources.iter_entry_points = iter_entry_points
+diff --git a/testing/test_config.py b/testing/test_config.py
+index f9f22a63e..1e29b83f1 100644
+--- a/testing/test_config.py
++++ b/testing/test_config.py
+@@ -514,8 +514,8 @@ def test_preparse_ordering_with_setuptools(testdir, monkeypatch):
+ pkg_resources = pytest.importorskip("pkg_resources")
+ monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
+
+- def my_iter(name):
+- assert name == "pytest11"
++ def my_iter(group, name=None):
++ assert group == "pytest11"
+
+ class Dist(object):
+ project_name = "spam"
+@@ -552,8 +552,8 @@ def test_setuptools_importerror_issue1479(testdir, monkeypatch):
+ pkg_resources = pytest.importorskip("pkg_resources")
+ monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", raising=False)
+
+- def my_iter(name):
+- assert name == "pytest11"
++ def my_iter(group, name=None):
++ assert group == "pytest11"
+
+ class Dist(object):
+ project_name = "spam"
+@@ -583,8 +583,8 @@ def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch, block
+
+ plugin_module_placeholder = object()
+
+- def my_iter(name):
+- assert name == "pytest11"
++ def my_iter(group, name=None):
++ assert group == "pytest11"
+
+ class Dist(object):
+ project_name = "spam"
+@@ -621,7 +621,7 @@ def load(self):
+ def test_disable_plugin_autoload(testdir, monkeypatch, parse_args, should_load):
+ pkg_resources = pytest.importorskip("pkg_resources")
+
+- def my_iter(name):
++ def my_iter(group, name=None):
+ raise AssertionError("Should not be called")
+
+ class PseudoPlugin(object):
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/scribus-poppler-0.73.patch b/gnu/packages/patches/scribus-poppler-0.73.patch
new file mode 100644
index 0000000000..5cf4cf721d
--- /dev/null
+++ b/gnu/packages/patches/scribus-poppler-0.73.patch
@@ -0,0 +1,36 @@
+Fix build with Poppler 0.73.
+
+This is an amalgamation of these upstream commits:
+https://github.com/scribusproject/scribus/commit/d34e59bfe495250ba023ba0f99e672ee32300a27
+https://github.com/scribusproject/scribus/commit/c43a89030026f8ffab5070b6935daee8bd74838a
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h
+index c46448b80a..4dac7c3983 100644
+--- a/scribus/plugins/import/pdf/slaoutput.h
++++ b/scribus/plugins/import/pdf/slaoutput.h
+@@ -28,7 +28,9 @@ for which a new license (GPL+exception) is in place.
+ #include "selection.h"
+ #include "vgradient.h"
+
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
+ #include <poppler/goo/gtypes.h>
++#endif
+ #include <poppler/Object.h>
+ #include <poppler/OutputDev.h>
+ #include <poppler/Gfx.h>
+diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h
+index f6b3950377..80ac796501 100644
+--- a/scribus/plugins/import/pdf/importpdfconfig.h
++++ b/scribus/plugins/import/pdf/importpdfconfig.h
+@@ -37,4 +37,11 @@ for which a new license (GPL+exception) is in place.
+ #define getCString c_str
+ #endif
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 73, 0)
++#define Guchar unsigned char
++#define Gushort unsigned short
++#define Guint unsigned int
++#define Gulong unsigned long
++#endif
++
+ #endif
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/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