summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-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-search-paths.patch4
-rw-r--r--gnu/packages/patches/scribus-poppler-0.73.patch36
-rw-r--r--gnu/packages/patches/tcc-boot-0.9.27.patch26
19 files changed, 1361 insertions, 464 deletions
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-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch
index 73e3f4ccf5..c824705633 100644
--- a/gnu/packages/patches/python-3-search-paths.patch
+++ b/gnu/packages/patches/python-3-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.
--- setup.py 2015-10-07 23:32:58.891329173 +0200
@@ -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/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
+