summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/atlas-gfortran-compat.patch37
-rw-r--r--gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch22
-rw-r--r--gnu/packages/patches/biber-fix-encoding-write.patch31
-rw-r--r--gnu/packages/patches/biber-sortinithash.patch1666
-rw-r--r--gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch231
-rw-r--r--gnu/packages/patches/binutils-loongson-workaround.patch14
-rw-r--r--gnu/packages/patches/binutils-mingw-w64-timestamp.patch39
-rw-r--r--gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch126
-rw-r--r--gnu/packages/patches/cheese-vala-update.patch180
-rw-r--r--gnu/packages/patches/classpath-miscompilation.patch71
-rw-r--r--gnu/packages/patches/coreutils-gnulib-tests.patch45
-rw-r--r--gnu/packages/patches/cups-CVE-2020-10001.patch47
-rw-r--r--gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch64
-rw-r--r--gnu/packages/patches/curl-use-ssl-cert-env.patch4
-rw-r--r--gnu/packages/patches/dbus-CVE-2020-12049.patch58
-rw-r--r--gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch11
-rw-r--r--gnu/packages/patches/docbook-xsl-support-old-url.patch17
-rw-r--r--gnu/packages/patches/doxygen-1.8.17-runtests.patch73
-rw-r--r--gnu/packages/patches/doxygen-test.patch60
-rw-r--r--gnu/packages/patches/evolution-data-server-printableoptions.patch57
-rw-r--r--gnu/packages/patches/evolution-printableoptions.patch57
-rw-r--r--gnu/packages/patches/findutils-test-rwlock-threads.patch38
-rw-r--r--gnu/packages/patches/fontconfig-cache-ignore-mtime.patch15
-rw-r--r--gnu/packages/patches/fontconfig-hurd-path-max.patch17
-rw-r--r--gnu/packages/patches/freeglut-gcc-compat.patch53
-rw-r--r--gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch21
-rw-r--r--gnu/packages/patches/gcc-10-cross-environment-variables.patch51
-rw-r--r--gnu/packages/patches/gcc-cross-gxx-include-dir.patch73
-rw-r--r--gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch179
-rw-r--r--gnu/packages/patches/gdb-9.2-sim-ppc-fno-common.patch123
-rw-r--r--gnu/packages/patches/gdb-hurd.patch77
-rw-r--r--gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch53
-rw-r--r--gnu/packages/patches/gdm-default-session.patch27
-rw-r--r--gnu/packages/patches/gdm-elogind-support.patch211
-rw-r--r--gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch22
-rw-r--r--gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch35
-rw-r--r--gnu/packages/patches/ghostscript-CVE-2020-15900.patch36
-rw-r--r--gnu/packages/patches/ghostscript-freetype-compat.patch35
-rw-r--r--gnu/packages/patches/ghostscript-no-header-creationdate.patch22
-rw-r--r--gnu/packages/patches/glade-gls-set-script-name.patch32
-rw-r--r--gnu/packages/patches/glade-test-widget-null-icon.patch30
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27218.patch132
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-01.patch176
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-02.patch264
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-03.patch136
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-04.patch308
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-05.patch47
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-06.patch94
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-07.patch118
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-08.patch94
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-09.patch98
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-10.patch52
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-11.patch57
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-12.patch30
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-13.patch32
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-14.patch32
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-15.patch95
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-16.patch43
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-17.patch37
-rw-r--r--gnu/packages/patches/glib-CVE-2021-27219-18.patch232
-rw-r--r--gnu/packages/patches/glib-CVE-2021-28153.patch283
-rw-r--r--gnu/packages/patches/glib-networking-gnutls-binding.patch21
-rw-r--r--gnu/packages/patches/glib-skip-failing-test.patch27
-rw-r--r--gnu/packages/patches/glib-tests-timer.patch15
-rw-r--r--gnu/packages/patches/glibc-2.27-git-fixes.patch702
-rw-r--r--gnu/packages/patches/glibc-2.27-supported-locales.patch33
-rw-r--r--gnu/packages/patches/glibc-2.28-git-fixes.patch248
-rw-r--r--gnu/packages/patches/glibc-2.28-supported-locales.patch33
-rw-r--r--gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch84
-rw-r--r--gnu/packages/patches/glibc-bootstrap-system.patch37
-rw-r--r--gnu/packages/patches/glibc-cross-objcopy.patch159
-rw-r--r--gnu/packages/patches/glibc-cross-objdump.patch159
-rw-r--r--gnu/packages/patches/glibc-dl-cache.patch140
-rw-r--r--gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch19
-rw-r--r--gnu/packages/patches/glibc-skip-c++.patch31
-rw-r--r--gnu/packages/patches/glibc-static-nss.patch1244
-rw-r--r--gnu/packages/patches/gnome-online-miners-tracker-3.patch1505
-rw-r--r--gnu/packages/patches/gnome-shell-CVE-2020-17489.patch46
-rw-r--r--gnu/packages/patches/gnome-shell-disable-test.patch9
-rw-r--r--gnu/packages/patches/gnome-shell-theme.patch51
-rw-r--r--gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch10
-rw-r--r--gnu/packages/patches/gnupg-1-build-with-gcc10.patch64
-rw-r--r--gnu/packages/patches/gnutls-CVE-2021-20231.patch62
-rw-r--r--gnu/packages/patches/gnutls-CVE-2021-20232.patch60
-rw-r--r--gnu/packages/patches/gnutls-guile-eintr-eagain.patch56
-rw-r--r--gnu/packages/patches/graphviz-CVE-2020-18032.patch49
-rw-r--r--gnu/packages/patches/gtk-doc-respect-xml-catalog.patch16
-rw-r--r--gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch51
-rw-r--r--gnu/packages/patches/guile-email-fix-tests.patch35
-rw-r--r--gnu/packages/patches/guile-ssh-fix-test-suite.patch217
-rw-r--r--gnu/packages/patches/guile-ssh-read-error.patch18
-rw-r--r--gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch34
-rw-r--r--gnu/packages/patches/icu4c-CVE-2020-10531.patch127
-rw-r--r--gnu/packages/patches/inetutils-hurd.patch583
-rw-r--r--gnu/packages/patches/jsoncpp-fix-inverted-case.patch22
-rw-r--r--gnu/packages/patches/jsoncpp-pkg-config-version.patch24
-rw-r--r--gnu/packages/patches/lcms-CVE-2018-16435.patch171
-rw-r--r--gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch35
-rw-r--r--gnu/packages/patches/librime-fix-build-with-gcc10.patch41
-rw-r--r--gnu/packages/patches/libtirpc-hurd-client.patch50
-rw-r--r--gnu/packages/patches/libxml2-parent-pointers.patch228
-rw-r--r--gnu/packages/patches/libxml2-terminating-newline.patch33
-rw-r--r--gnu/packages/patches/libxml2-xpath-recursion-limit.patch20
-rw-r--r--gnu/packages/patches/libxt-guix-search-paths.patch13
-rw-r--r--gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch13
-rw-r--r--gnu/packages/patches/mariadb-CVE-2021-27928.patch642
-rw-r--r--gnu/packages/patches/mesa-opencl-all-targets.patch25
-rw-r--r--gnu/packages/patches/mesa-skip-tests.patch20
-rw-r--r--gnu/packages/patches/meson-for-build-rpath.patch24
-rw-r--r--gnu/packages/patches/mit-krb5-hurd.patch15
-rw-r--r--gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch29
-rw-r--r--gnu/packages/patches/mpg321-gcc-10.patch83
-rw-r--r--gnu/packages/patches/nss-getcwd-nonnull.patch30
-rw-r--r--gnu/packages/patches/ocaml-4.09-multiple-definitions.patch41
-rw-r--r--gnu/packages/patches/ocaml-multiple-definitions.patch43
-rw-r--r--gnu/packages/patches/p11-kit-hurd.patch46
-rw-r--r--gnu/packages/patches/perl-cross.patch60
-rw-r--r--gnu/packages/patches/perl-deterministic-ordering.patch29
-rw-r--r--gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch33
-rw-r--r--gnu/packages/patches/perl-no-sys-dirs.patch99
-rw-r--r--gnu/packages/patches/pipewire-0.2.7-fno-common.patch51
-rw-r--r--gnu/packages/patches/python-2.7-no-static-lib.patch70
-rw-r--r--gnu/packages/patches/python-3-fix-tests.patch194
-rw-r--r--gnu/packages/patches/python-3-hurd-configure.patch27
-rw-r--r--gnu/packages/patches/python-3-no-static-lib.patch75
-rw-r--r--gnu/packages/patches/python-3.8-CVE-2021-3177.patch194
-rw-r--r--gnu/packages/patches/python-3.8-fix-tests.patch42
-rw-r--r--gnu/packages/patches/python-3.9-fix-tests.patch370
-rw-r--r--gnu/packages/patches/python-babel-fix-parse-future-test.patch68
-rw-r--r--gnu/packages/patches/python-chai-drop-python2.patch32
-rw-r--r--gnu/packages/patches/python-docopt-pytest6-compat.patch29
-rw-r--r--gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch59
-rw-r--r--gnu/packages/patches/python-random2-getrandbits-test.patch23
-rw-r--r--gnu/packages/patches/python-testtools.patch57
-rw-r--r--gnu/packages/patches/python-typing-inspect-fix.patch38
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch54
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch21
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch152
-rw-r--r--gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch35
-rw-r--r--gnu/packages/patches/range-v3-build-with-gcc10.patch122
-rw-r--r--gnu/packages/patches/rust-1.19-mrustc.patch28
-rw-r--r--gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch111
-rw-r--r--gnu/packages/patches/rust-1.30-gdb-llvm.patch89
-rw-r--r--gnu/packages/patches/rust-1.45-linker-locale.patch14
-rw-r--r--gnu/packages/patches/rust-1.48-linker-locale.patch14
-rw-r--r--gnu/packages/patches/rust-bootstrap-stage0-test.patch55
-rw-r--r--gnu/packages/patches/syslinux-gcc10.patch87
-rw-r--r--gnu/packages/patches/syslinux-strip-gnu-property.patch31
-rw-r--r--gnu/packages/patches/tcl-fix-cross-compilation.patch39
-rw-r--r--gnu/packages/patches/tcsh-fix-autotest.patch11
-rw-r--r--gnu/packages/patches/texlive-bin-poppler-0.83.patch52
-rw-r--r--gnu/packages/patches/texlive-bin-poppler-0.86.patch17
-rw-r--r--gnu/packages/patches/vigra-python-compat.patch18
-rw-r--r--gnu/packages/patches/xygrib-fix-finding-data.patch131
-rw-r--r--gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch68
-rw-r--r--gnu/packages/patches/zziplib-CVE-2018-16548.patch49
156 files changed, 7587 insertions, 9174 deletions
diff --git a/gnu/packages/patches/atlas-gfortran-compat.patch b/gnu/packages/patches/atlas-gfortran-compat.patch
new file mode 100644
index 0000000000..5b46f5a64d
--- /dev/null
+++ b/gnu/packages/patches/atlas-gfortran-compat.patch
@@ -0,0 +1,37 @@
+Fix build with gfortran 10.
+
+Taken from Debian:
+https://salsa.debian.org/science-team/atlas/-/blob/master/debian/patches/gfortran-10.patch
+
+--- a/interfaces/blas/C/testing/c_dblat1.f
++++ b/interfaces/blas/C/testing/c_dblat1.f
+@@ -247,11 +247,11 @@
+             IF (ICASE.EQ.7) THEN
+ *              .. DNRM2TEST ..
+                STEMP(1) = DTRUE1(NP1)
+-               CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(DNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.8) THEN
+ *              .. DASUMTEST ..
+                STEMP(1) = DTRUE3(NP1)
+-               CALL STEST1(DASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(DASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.9) THEN
+ *              .. DSCALTEST ..
+                CALL DSCALTEST(N,SA((INCX-1)*5+NP1),SX,INCX)
+--- a/interfaces/blas/C/testing/c_sblat1.f
++++ b/interfaces/blas/C/testing/c_sblat1.f
+@@ -247,11 +247,11 @@
+             IF (ICASE.EQ.7) THEN
+ *              .. SNRM2TEST ..
+                STEMP(1) = DTRUE1(NP1)
+-               CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.8) THEN
+ *              .. SASUMTEST ..
+                STEMP(1) = DTRUE3(NP1)
+-               CALL STEST1(SASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
++               CALL STEST1(SASUMTEST(N,SX,INCX),STEMP(1),STEMP,SFAC)
+             ELSE IF (ICASE.EQ.9) THEN
+ *              .. SSCALTEST ..
+                CALL SSCALTEST(N,SA((INCX-1)*5+NP1),SX,INCX)
diff --git a/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
new file mode 100644
index 0000000000..56d404da15
--- /dev/null
+++ b/gnu/packages/patches/bdb-5.3-atomics-on-gcc-9.patch
@@ -0,0 +1,22 @@
+Patch borrowed from Arch Linux. Allows compiling bdb 5.3 and earlier with GCC newer than 7.
+
+--- src/dbinc/atomic.h	2013-03-12 14:07:22.000000000 -0400
++++ src/dbinc/atomic.h.change	2013-03-12 14:06:35.000000000 -0400
+@@ -144,7 +144,7 @@
+ #define	atomic_inc(env, p)	__atomic_inc(p)
+ #define	atomic_dec(env, p)	__atomic_dec(p)
+ #define	atomic_compare_exchange(env, p, o, n)	\
+-	__atomic_compare_exchange((p), (o), (n))
++	__atomic_compare_exchange_db((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ 	int	temp;
+@@ -176,7 +176,7 @@
+  * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+  * which configure could be changed to use.
+  */
+-static inline int __atomic_compare_exchange(
++static inline int __atomic_compare_exchange_db(
+ 	db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ 	atomic_value_t was;
diff --git a/gnu/packages/patches/biber-fix-encoding-write.patch b/gnu/packages/patches/biber-fix-encoding-write.patch
deleted file mode 100644
index 56cd11212e..0000000000
--- a/gnu/packages/patches/biber-fix-encoding-write.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 2a9b15aefb842a734637f3d230936ea1b7c60096 Mon Sep 17 00:00:00 2001
-From: Philip Kime <Philip@kime.org.uk>
-Date: Thu, 8 Nov 2018 22:02:09 +0100
-Subject: [PATCH] Fix to address #239
-
----
- lib/Biber.pm | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/lib/Biber.pm b/lib/Biber.pm
-index 8b1f80a5..d97fca29 100644
---- a/lib/Biber.pm
-+++ b/lib/Biber.pm
-@@ -311,6 +311,8 @@ sub parse_ctrlfile {
-     unless (eval {$checkbuf = File::Slurper::read_text($ctrl_file_path, 'latin1')}) {
-       biber_error("$ctrl_file_path is not UTF-8 or even latin1, how horrible.");
-     }
-+    # Write ctrl file as UTF-8
-+    File::Slurper::write_text($ctrl_file_path, NFC($checkbuf));# Unicode NFC boundary
-   }
- 
-   $checkbuf = NFD($checkbuf);# Unicode NFD boundary
-@@ -319,8 +321,6 @@ sub parse_ctrlfile {
-     unlink($output) unless $output eq '-';# ignore deletion of STDOUT marker
-     biber_error("$ctrl_file_path is malformed, last biblatex run probably failed. Deleted $output");
-   }
--  # Write ctrl file as UTF-8
--  File::Slurper::write_text($ctrl_file_path, NFC($checkbuf));# Unicode NFC boundary
- 
-   # Validate if asked to
-   if (Biber::Config->getoption('validate_control')) {
diff --git a/gnu/packages/patches/biber-sortinithash.patch b/gnu/packages/patches/biber-sortinithash.patch
deleted file mode 100644
index 5a626705e6..0000000000
--- a/gnu/packages/patches/biber-sortinithash.patch
+++ /dev/null
@@ -1,1666 +0,0 @@
-This is a backport of this upstream commit to Biber 2.12:
-
-  From 6b61b4c13778cf638f82569ab9e413f09f111ba5 Mon Sep 17 00:00:00 2001
-  From: Philip Kime <Philip@kime.org.uk>
-  Date: Sat, 12 Jan 2019 17:19:51 +0100
-  Subject: [PATCH] Updated tests after U::C upgrade changed sortinit hashes
-
-It addresses test failures found with recent versions of the
-Biber dependencies.
-
-diff --git a/t/annotations.t b/t/annotations.t
-index b4f641e..c6f86c7 100644
---- a/t/annotations.t
-+++ b/t/annotations.t
-@@ -73,7 +73,7 @@ my $ann1 = q|    \entry{ann1}{misc}{}
-       \strng{authorfullhash}{90ae96c82de92e36949bc64254bbde0c}
-       \field{extraname}{1}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{title}{The Title}
-@@ -116,7 +116,7 @@ my $ann2 = q|    \entry{ann2}{misc}{}
-       \strng{authorfullhash}{90ae96c82de92e36949bc64254bbde0c}
-       \field{extraname}{2}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{title}{The Title}
-diff --git a/t/basic-misc.t b/t/basic-misc.t
-index d4664b1..a9168cc 100644
---- a/t/basic-misc.t
-+++ b/t/basic-misc.t
-@@ -97,7 +97,7 @@ my $u1 = q|    \entry{u1}{misc}{}
-       \strng{authorfullhash}{b78abdc838d79b6576f2ed0021642766}
-       \field{labelalpha}{AAA\textbf{+}00}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -231,7 +231,7 @@ my $murray1 = q|    \entry{murray}{article}{}
-       \strng{authorfullhash}{1572cc3fd324f560e5e71d041a6bd764}
-       \field{labelalpha}{Hos\textbf{+}98}
-       \field{sortinit}{H}
--      \field{sortinithash}{5f15a7bc777ad49ff15aa4d2831b1681}
-+      \field{sortinithash}{6db6145dae8dc9e1271a8d556090b50a}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -348,7 +348,7 @@ my $murray2 = q|    \entry{murray}{article}{}
-       \strng{authorfullhash}{1572cc3fd324f560e5e71d041a6bd764}
-       \field{labelalpha}{Hos98}
-       \field{sortinit}{H}
--      \field{sortinithash}{5f15a7bc777ad49ff15aa4d2831b1681}
-+      \field{sortinithash}{6db6145dae8dc9e1271a8d556090b50a}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -389,7 +389,7 @@ my $t1 = q+    \entry{t1}{misc}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Bro92}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -419,7 +419,7 @@ my $t2 = q|    \entry{t2}{misc}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Bro94}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -452,7 +452,7 @@ my $anon1 = q|    \entry{anon1}{unpublished}{}
-       \strng{shortauthorfullhash}{9873a6cc65c553faa2b21aaad626fe4b}
-       \field{labelalpha}{XAn35}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{shortauthor}
-@@ -491,7 +491,7 @@ my $anon2 = q|    \entry{anon2}{unpublished}{}
-       \strng{shortauthorfullhash}{f64c29e89ea49402b997956610b58ef6}
-       \field{labelalpha}{YAn39}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquework}
-       \field{labelnamesource}{shortauthor}
-@@ -526,7 +526,7 @@ my $url1 = q|    \entry{url1}{misc}{}
-       \field{extraname}{4}
-       \field{labelalpha}{Ali05}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{extraalpha}{4}
-       \field{labelnamesource}{author}
-       \field{year}{2005}
-@@ -710,7 +710,7 @@ my $isbn1 = q|    \entry{isbn1}{misc}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Flu}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{isbn}{978-0-8165-2066-4}
-@@ -735,7 +735,7 @@ my $isbn2 = q|    \entry{isbn2}{misc}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Flu}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-       \field{isbn}{978-0-8165-2066-4}
-@@ -778,7 +778,7 @@ my $clone1 = q|    \entry{snk1}{book}{}
-       \field{extraname}{2}
-       \field{labelalpha}{vDoe}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -807,7 +807,7 @@ my $clone2 = q|    \entry{clone-snk1}{book}{}
-       \field{extraname}{1}
-       \field{labelalpha}{vDoe}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{addendum}{add}
-@@ -839,7 +839,7 @@ my $ent1 = q|    \entry{ent1}{book}{}
-       \strng{authorfullhash}{b2536a425d549b46de5f21c4d468050a}
-       \field{labelalpha}{SdB}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -862,7 +862,7 @@ my $verb1 = q|    \entry{verb1}{book}{}
-       \strng{authorfullhash}{cac5a25f503e71f5ef28f474e14007b6}
-       \field{labelalpha}{All}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \verb{verba}
-diff --git a/t/biblatexml.t b/t/biblatexml.t
-index ad9ad25..0959bfa 100644
---- a/t/biblatexml.t
-+++ b/t/biblatexml.t
-@@ -111,7 +111,7 @@ my $l1 = q|    \entry{bltx1}{misc}{useprefix=false}
-       \strng{translatornamehash}{b44eba830fe9817fbe8e53c82f1cbe04}
-       \strng{translatorfullhash}{b44eba830fe9817fbe8e53c82f1cbe04}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -158,7 +158,7 @@ my $l1 = q|    \entry{bltx1}{misc}{useprefix=false}
- 
- my $l2 = q|    \entry{loopkey:a}{book}{}
-       \field{sortinit}{0}
--      \field{sortinithash}{168ad0c7c5ed09f1d28c6675717b5b03}
-+      \field{sortinithash}{bcf7a1f4afb88b7299f988caccb80d1c}
-     \endentry
- |;
- 
-diff --git a/t/crossrefs.t b/t/crossrefs.t
-index 915b52b..b6191c6 100644
---- a/t/crossrefs.t
-+++ b/t/crossrefs.t
-@@ -82,7 +82,7 @@ my $cr1 = q|    \entry{cr1}{inbook}{}
-       \strng{editornamehash}{c129df5593fdaa7475548811bfbb227d}
-       \strng{editorfullhash}{c129df5593fdaa7475548811bfbb227d}
-       \field{sortinit}{G}
--      \field{sortinithash}{5e8d2bf9d38de41b1528bd307546008f}
-+      \field{sortinithash}{62eb2aa29549e4fdbd3cb154ec5711cb}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -131,7 +131,7 @@ my $cr2 = q|    \entry{cr2}{inbook}{}
-       \strng{editornamehash}{c129df5593fdaa7475548811bfbb227d}
-       \strng{editorfullhash}{c129df5593fdaa7475548811bfbb227d}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -165,7 +165,7 @@ my $cr_m = q|    \entry{cr_m}{book}{}
-       \strng{editornamehash}{c129df5593fdaa7475548811bfbb227d}
-       \strng{editorfullhash}{c129df5593fdaa7475548811bfbb227d}
-       \field{sortinit}{G}
--      \field{sortinithash}{5e8d2bf9d38de41b1528bd307546008f}
-+      \field{sortinithash}{62eb2aa29549e4fdbd3cb154ec5711cb}
-       \true{crossrefsource}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-@@ -203,7 +203,7 @@ my $cr3 = q|    \entry{cr3}{inbook}{}
-       \strng{editornamehash}{a1f5c22413396d599ec766725b226735}
-       \strng{editorfullhash}{a1f5c22413396d599ec766725b226735}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -248,7 +248,7 @@ my $cr4 = q|    \entry{cr4}{inbook}{}
-       \strng{editornamehash}{6ea89bd4958743a20b70fe17647d6af5}
-       \strng{editorfullhash}{6ea89bd4958743a20b70fe17647d6af5}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -279,7 +279,7 @@ my $crt = q|    \entry{crt}{book}{}
-       \strng{editornamehash}{a1f5c22413396d599ec766725b226735}
-       \strng{editorfullhash}{a1f5c22413396d599ec766725b226735}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \field{title}{Beasts of the Burbling Burns}
-@@ -315,7 +315,7 @@ my $cr6 = q|    \entry{cr6}{inproceedings}{}
-       \strng{editorfullhash}{344a7f427fb765610ef96eb7bce95257}
-       \field{extraname}{2}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{uniquetitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -366,7 +366,7 @@ my $cr7 = q|    \entry{cr7}{inbook}{}
-       \strng{bookauthorfullhash}{91a1dd4aeed3c4ec29ca74c4e778be5f}
-       \field{extraname}{1}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{uniquetitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -401,7 +401,7 @@ my $cr8 = q|    \entry{cr8}{incollection}{}
-       \strng{authorfullhash}{3d449e56eb3ca1ae80dc99a18d689795}
-       \field{extraname}{4}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -431,7 +431,7 @@ my $xr1 = q|    \entry{xr1}{inbook}{}
-       \strng{authornamehash}{e0ecc4fc668ee499d1afba44e1ac064d}
-       \strng{authorfullhash}{e0ecc4fc668ee499d1afba44e1ac064d}
-       \field{sortinit}{Z}
--      \field{sortinithash}{156173bd08b075d7295bc3e0f4735a04}
-+      \field{sortinithash}{8f7b480688e809b50b6f6577b16f3db5}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -460,7 +460,7 @@ my $xr2 = q|    \entry{xr2}{inbook}{}
-       \strng{authornamehash}{6afa09374ecfd6b394ce714d2d9709c7}
-       \strng{authorfullhash}{6afa09374ecfd6b394ce714d2d9709c7}
-       \field{sortinit}{I}
--      \field{sortinithash}{320bc8fe8101b9376f9f21cd507de0e8}
-+      \field{sortinithash}{9417e9a1288a9371e2691d999083ed39}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -491,7 +491,7 @@ my $xrm = q|    \entry{xrm}{book}{}
-       \strng{editornamehash}{809950f9b59ae207092b909a19dcb27b}
-       \strng{editorfullhash}{809950f9b59ae207092b909a19dcb27b}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \true{xrefsource}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-@@ -516,7 +516,7 @@ my $xr3 = q|    \entry{xr3}{inbook}{}
-       \strng{authornamehash}{9788055665b9bb4b37c776c3f6b74f16}
-       \strng{authorfullhash}{9788055665b9bb4b37c776c3f6b74f16}
-       \field{sortinit}{N}
--      \field{sortinithash}{f7242c3ed3dc50029fca1be76c497c7c}
-+      \field{sortinithash}{98cf339a479c0454fe09153a08675a15}
-       \true{singletitle}
-       \true{uniquetitle}
-       \true{uniquework}
-@@ -546,7 +546,7 @@ my $xrt = q|    \entry{xrt}{book}{}
-       \strng{editornamehash}{bf7d6b02f3e073913e5bfe5059508dd5}
-       \strng{editorfullhash}{bf7d6b02f3e073913e5bfe5059508dd5}
-       \field{sortinit}{K}
--      \field{sortinithash}{9fd838a31ba64d981e8f44562bd33f89}
-+      \field{sortinithash}{d3edc18d54b9438a72c24c925bfb38f4}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \field{title}{Kings, Cork and Calculation}
-@@ -572,7 +572,7 @@ my $xr4 = q|    \entry{xr4}{inbook}{}
-       \strng{authorfullhash}{7804ffef086c0c4686c235807f5cb502}
-       \field{extraname}{1}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{origyear}{1933}
-@@ -600,7 +600,7 @@ my $mxr = q|    \entry{mxr}{inbook}{}
-       \strng{authorfullhash}{7804ffef086c0c4686c235807f5cb502}
-       \field{extraname}{2}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{origyear}{1933}
-@@ -625,7 +625,7 @@ my $mcr = q|    \entry{mcr}{inbook}{}
-       \strng{authorfullhash}{7804ffef086c0c4686c235807f5cb502}
-       \field{extraname}{3}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-       \field{origyear}{1933}
-@@ -660,7 +660,7 @@ my $ccr1 = q|    \entry{ccr2}{book}{}
-       \strng{editorfullhash}{cfee758a1c82df2e26af1985e061bb0a}
-       \field{extraname}{1}
-       \field{sortinit}{V}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \true{uniquetitle}
-       \true{uniquework}
-       \field{labelnamesource}{author}
-@@ -694,7 +694,7 @@ my $ccr2 = q|    \entry{ccr3}{inbook}{}
-       \strng{editornamehash}{cfee758a1c82df2e26af1985e061bb0a}
-       \strng{editorfullhash}{cfee758a1c82df2e26af1985e061bb0a}
-       \field{sortinit}{P}
--      \field{sortinithash}{8d51b3d5b78d75b54308d706b9bbe285}
-+      \field{sortinithash}{bb5b15f2db90f7aef79bb9e83defefcb}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \field{booktitle}{Misc etc.}
-@@ -726,7 +726,7 @@ my $ccr3 = q|    \entry{ccr4}{inbook}{}
- 
- my $s1 = q|    \entry{s1}{inbook}{}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{uniquetitle}
-       \field{labeltitlesource}{title}
-       \strng{crossref}{s2}
-@@ -760,7 +760,7 @@ my $xc2 = q|    \entry{xc2}{inbook}{}
-       \strng{bookauthorfullhash}{1a0f7d518cccdad859a74412ef956474}
-       \field{extraname}{2}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \true{xrefsource}
-       \field{labelnamesource}{author}
-       \field{booktitle}{Title}
-@@ -769,7 +769,7 @@ my $xc2 = q|    \entry{xc2}{inbook}{}
- 
- my $b1 = q|    \entry{b1}{inbook}{}
-       \field{sortinit}{2}
--      \field{sortinithash}{cbff857e587bcb4635511624d773949e}
-+      \field{sortinithash}{ed39bb39cf854d5250e95b1c1f94f4ed}
-       \strng{crossref}{b2}
-       \field{day}{3}
-       \field{month}{3}
-@@ -803,7 +803,7 @@ my $sup1 = q|    \entry{sup1}{mvbook}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{3}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{crossrefsource}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -828,7 +828,7 @@ my $sup2 = q|    \entry{sup2}{book}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{1}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/datalists.t b/t/datalists.t
-index 3081cc4..4855e3d 100644
---- a/t/datalists.t
-+++ b/t/datalists.t
-@@ -187,7 +187,7 @@ my $K11 = q|    \entry{K11}{book}{}
-       \strng{authornamehash}{4edc280a0ef229f9c061e3b121b17482}
-       \strng{authorfullhash}{4edc280a0ef229f9c061e3b121b17482}
-       \field{sortinit}{a}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -219,7 +219,7 @@ my $K12 = q|    \entry{K12}{book}{}
-       \strng{authornamehash}{a846a485fc9cbb59b0ebeedd6ac637e4}
-       \strng{authorfullhash}{a846a485fc9cbb59b0ebeedd6ac637e4}
-       \field{sortinit}{Z}
--      \field{sortinithash}{156173bd08b075d7295bc3e0f4735a04}
-+      \field{sortinithash}{8f7b480688e809b50b6f6577b16f3db5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-diff --git a/t/dateformats.t b/t/dateformats.t
-index 6beb567..0d5072a 100644
---- a/t/dateformats.t
-+++ b/t/dateformats.t
-@@ -88,7 +88,7 @@ my $l13c = q|    \entry{L13}{book}{}
-       \strng{authorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{3}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -126,7 +126,7 @@ my $l14 = q|    \entry{L14}{book}{}
-       \strng{authorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{4}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{3}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -168,7 +168,7 @@ my $l15 = q|    \entry{L15}{book}{}
-       \strng{authorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{12}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{4}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -201,7 +201,7 @@ my $l16 = q|    \entry{L16}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{13}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{7}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{event}
-@@ -240,7 +240,7 @@ my $l17 = q|    \entry{L17}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{5}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{4}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -299,7 +299,7 @@ my $l17c = q|    \entry{L17}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{5}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{orig}
-       \field{labelnamesource}{editor}
-@@ -357,7 +357,7 @@ my $l17e = q|    \entry{L17}{proceedings}{}
-       \strng{editorfullhash}{8c77336299b25bdada7bf8038f46722f}
-       \field{extraname}{5}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{event}
-       \field{labelnamesource}{editor}
-@@ -479,7 +479,7 @@ my $era1 = q|    \entry{era1}{article}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{9}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -512,7 +512,7 @@ my $era2 = q|    \entry{era2}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{10}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -546,7 +546,7 @@ my $era3 = q|    \entry{era3}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{11}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -580,7 +580,7 @@ my $era4 = q|    \entry{era4}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{6}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -622,7 +622,7 @@ my $time1 = q|    \entry{time1}{article}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{2}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -671,7 +671,7 @@ my $range1 = q|    \entry{range1}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{7}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{1}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -712,7 +712,7 @@ my $range2 = q|    \entry{range2}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{8}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{2}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -753,7 +753,7 @@ my $season1 = q|    \entry{season1}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{1}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -785,7 +785,7 @@ my $unspec1 = q|    \entry{unspec1}{inproceedings}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{4}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -838,7 +838,7 @@ my $unspec2 = q|    \entry{unspec2}{article}{}
-       \strng{authorfullhash}{556c8dba145b472e6a8598d506f7cbe2}
-       \field{extraname}{3}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-diff --git a/t/encoding.t b/t/encoding.t
-index a150b4f..36d9955 100644
---- a/t/encoding.t
-+++ b/t/encoding.t
-@@ -52,7 +52,7 @@ my $encode1 = q|    \entry{testŠ}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -82,7 +82,7 @@ my $encode2 = q|    \entry{test1}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -112,7 +112,7 @@ my $encode3 = q|    \entry{test1}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -142,7 +142,7 @@ my $encode5 = q|    \entry{test}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -172,7 +172,7 @@ my $encode6 = q|    \entry{test}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-@@ -202,7 +202,7 @@ my $encode7 = q|    \entry{test}{book}{}
-       \strng{authorfullhash}{06a47edae2e847800cfd78323a0e6be8}
-       \field{labelalpha}{Enc99}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{labeldatesource}{year}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-diff --git a/t/names.t b/t/names.t
-index 7228042..b73f2ed 100644
---- a/t/names.t
-+++ b/t/names.t
-@@ -188,7 +188,7 @@ my $l1 = q|    \entry{L1}{book}{}
-       \strng{authornamehash}{72287a68c1714cb1b9f4ab9e03a88b96}
-       \strng{authorfullhash}{72287a68c1714cb1b9f4ab9e03a88b96}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -208,7 +208,7 @@ my $l2 = q|    \entry{L2}{book}{}
-       \strng{authornamehash}{2098d59d0f19a2e003ee06c1aa750d57}
-       \strng{authorfullhash}{2098d59d0f19a2e003ee06c1aa750d57}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -228,7 +228,7 @@ my $l3 = q|    \entry{L3}{book}{}
-       \strng{authornamehash}{c8b06fe88bde128b25eb0b3b1cc5837c}
-       \strng{authorfullhash}{c8b06fe88bde128b25eb0b3b1cc5837c}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -248,7 +248,7 @@ my $l4 = q|    \entry{L4}{book}{}
-       \strng{authornamehash}{5ec958b850c0c2de7de7c42c84b9c419}
-       \strng{authorfullhash}{5ec958b850c0c2de7de7c42c84b9c419}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -270,7 +270,7 @@ my $l5 = q|    \entry{L5}{book}{}
-       \strng{authornamehash}{c6b9d281cc1ff3f35570f76f463d4244}
-       \strng{authorfullhash}{c6b9d281cc1ff3f35570f76f463d4244}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -292,7 +292,7 @@ my $l6 = q|    \entry{L6}{book}{}
-       \strng{authornamehash}{5fd24d3d1608a310ec205a6b201a5495}
-       \strng{authorfullhash}{5fd24d3d1608a310ec205a6b201a5495}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -314,7 +314,7 @@ my $l7 = q|    \entry{L7}{book}{}
-       \strng{authornamehash}{98edb0b90251df22b74328d9227eceb7}
-       \strng{authorfullhash}{98edb0b90251df22b74328d9227eceb7}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -336,7 +336,7 @@ my $l8 = q|    \entry{L8}{book}{}
-       \strng{authornamehash}{1211dc8dbbc191cbcab4da3c3c1fc48a}
-       \strng{authorfullhash}{1211dc8dbbc191cbcab4da3c3c1fc48a}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -356,7 +356,7 @@ my $l9 = q|    \entry{L9}{book}{}
-       \strng{authornamehash}{bae61a889ab149a6deafe45333204cf0}
-       \strng{authorfullhash}{bae61a889ab149a6deafe45333204cf0}
-       \field{sortinit}{I}
--      \field{sortinithash}{320bc8fe8101b9376f9f21cd507de0e8}
-+      \field{sortinithash}{9417e9a1288a9371e2691d999083ed39}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -379,7 +379,7 @@ my $l10 = q|    \entry{L10}{book}{}
-       \strng{authornamehash}{37b4325752e394ddfb2fc810f6c88e27}
-       \strng{authorfullhash}{37b4325752e394ddfb2fc810f6c88e27}
-       \field{sortinit}{J}
--      \field{sortinithash}{fce5f8d0bd05e8d93f3dbe21c78897ca}
-+      \field{sortinithash}{c45040a764d616897e7f5b30174d7b92}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -402,7 +402,7 @@ my $l10a = q|    \entry{L10a}{book}{}
-       \strng{authornamehash}{7bf2c9d8b89a1930ee91bfddcaf20c9c}
-       \strng{authorfullhash}{7bf2c9d8b89a1930ee91bfddcaf20c9c}
-       \field{sortinit}{P}
--      \field{sortinithash}{8d51b3d5b78d75b54308d706b9bbe285}
-+      \field{sortinithash}{bb5b15f2db90f7aef79bb9e83defefcb}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -427,7 +427,7 @@ my $l11 = q|    \entry{L11}{book}{}
-       \strng{authornamehash}{9f48d231be68c9435fab4faca55a5caf}
-       \strng{authorfullhash}{9f48d231be68c9435fab4faca55a5caf}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -449,7 +449,7 @@ my $l12 = q|    \entry{L12}{book}{}
-       \strng{authornamehash}{d7ca88c13a8f7ce1c23e920010a31f83}
-       \strng{authorfullhash}{d7ca88c13a8f7ce1c23e920010a31f83}
-       \field{sortinit}{d}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \true{uniqueprimaryauthor}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -470,7 +470,7 @@ my $l13 = q|    \entry{L13}{book}{}
-       \strng{authornamehash}{227ac48bb788a658cfaa4eefc71ff0cc}
-       \strng{authorfullhash}{227ac48bb788a658cfaa4eefc71ff0cc}
-       \field{sortinit}{V}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -490,7 +490,7 @@ my $l14 = q|    \entry{L14}{book}{}
-       \strng{authornamehash}{779475052c17ed56dc3be900d0dfdf87}
-       \strng{authorfullhash}{779475052c17ed56dc3be900d0dfdf87}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -513,7 +513,7 @@ my $l15 = q|    \entry{L15}{book}{}
-       \strng{authorfullhash}{783c636e853e47a854ae034ebe9dde62}
-       \field{extraname}{1}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -536,7 +536,7 @@ my $l16 = q|    \entry{L16}{book}{}
-       \strng{authorfullhash}{783c636e853e47a854ae034ebe9dde62}
-       \field{extraname}{2}
-       \field{sortinit}{v}
--      \field{sortinithash}{75dd7385c90b2252c3ae853a80ca853b}
-+      \field{sortinithash}{02432525618c08e2b03cac47c19764af}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -557,7 +557,7 @@ my $l17 = q|    \entry{L17}{book}{}
-       \strng{authorfullhash}{b51f667a3384d92ea5458ba80716bff7}
-       \field{extraname}{1}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -578,7 +578,7 @@ my $l18 = q|    \entry{L18}{book}{}
-       \strng{authorfullhash}{b51f667a3384d92ea5458ba80716bff7}
-       \field{extraname}{2}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -598,7 +598,7 @@ my $l19 = q|    \entry{L19}{book}{}
-       \strng{authornamehash}{83caa52f21f97e572dd3267bdf62978a}
-       \strng{authorfullhash}{83caa52f21f97e572dd3267bdf62978a}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -618,7 +618,7 @@ my $l19a = q|    \entry{L19a}{book}{}
-       \strng{authornamehash}{0963f6904ccfeaac2770c5882a587001}
-       \strng{authorfullhash}{0963f6904ccfeaac2770c5882a587001}
-       \field{sortinit}{L}
--      \field{sortinithash}{2c7981aaabc885868aba60f0c09ee20f}
-+      \field{sortinithash}{dad3efd0836470093a7b4a7bb756eb8c}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -639,7 +639,7 @@ my $l20 = q|    \entry{L20}{book}{}
-       \strng{authornamehash}{5f26c2f3b33095d5b005714893f4d698}
-       \strng{authorfullhash}{5f26c2f3b33095d5b005714893f4d698}
-       \field{sortinit}{F}
--      \field{sortinithash}{669c706c6f1fbf3b5a83d26f1d9e9e72}
-+      \field{sortinithash}{fb0c0faa89eb6abae8213bf60e6799ea}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -660,7 +660,7 @@ my $l21 = q|    \entry{L21}{book}{}
-       \strng{authorfullhash}{4389a3c0dc7da74487b50808ba9436ad}
-       \field{extraname}{1}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -681,7 +681,7 @@ my $l22u = q|    \entry{L22}{book}{}
-       \strng{authorfullhash}{e58b861545799d0eaf883402a882126e}
-       \field{extraname}{1}
-       \field{sortinit}{Š}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -703,7 +703,7 @@ my $l22 = q|    \entry{L22}{book}{}
-       \strng{authorfullhash}{e58b861545799d0eaf883402a882126e}
-       \field{extraname}{1}
-       \field{sortinit}{\v{S}}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \true{uniqueprimaryauthor}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -726,7 +726,7 @@ my $l23 = q|    \entry{L23}{book}{}
-       \strng{authorfullhash}{4389a3c0dc7da74487b50808ba9436ad}
-       \field{extraname}{3}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -747,7 +747,7 @@ my $l24 = q|    \entry{L24}{book}{}
-       \strng{authorfullhash}{e58b861545799d0eaf883402a882126e}
-       \field{extraname}{2}
-       \field{sortinit}{Š}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -765,7 +765,7 @@ my $l25 = q|    \entry{L25}{book}{}
-       \strng{authornamehash}{d7cd2c5ea0848abc3e90609558b84a45}
-       \strng{authorfullhash}{d7cd2c5ea0848abc3e90609558b84a45}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -783,7 +783,7 @@ my $l26 = q|    \entry{L26}{book}{}
-       \strng{authornamehash}{8eee1dbafdbd0a4b73157e60f18b4784}
-       \strng{authorfullhash}{8eee1dbafdbd0a4b73157e60f18b4784}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -791,7 +791,7 @@ my $l26 = q|    \entry{L26}{book}{}
- # Malformed anyway but a decent test
- my $l28 = q|    \entry{L28}{book}{}
-       \field{sortinit}{0}
--      \field{sortinithash}{168ad0c7c5ed09f1d28c6675717b5b03}
-+      \field{sortinithash}{bcf7a1f4afb88b7299f988caccb80d1c}
-       \warn{\item Name "Deux et al.,, O." is malformed (consecutive commas): skipping name}
-     \endentry
- |;
-@@ -810,7 +810,7 @@ my $l29 = q|    \entry{L29}{book}{}
-       \strng{authornamehash}{27ad192a3a715aa89152b2a4ee392e8c}
-       \strng{authorfullhash}{27ad192a3a715aa89152b2a4ee392e8c}
-       \field{sortinit}{U}
--      \field{sortinithash}{36a2444f5238e0dcf4bb59704df6624d}
-+      \field{sortinithash}{77a6935510e008adcf5b555e7b4f0711}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -850,7 +850,7 @@ my $l31 = q|    \entry{L31}{book}{}
-       \strng{translatornamehash}{29c3ff92fff79d09a8b44d2f775de0b1}
-       \strng{translatorfullhash}{29c3ff92fff79d09a8b44d2f775de0b1}
-       \field{sortinit}{\~{Z}}
--      \field{sortinithash}{156173bd08b075d7295bc3e0f4735a04}
-+      \field{sortinithash}{8f7b480688e809b50b6f6577b16f3db5}
-       \true{uniqueprimaryauthor}
-       \field{labelnamesource}{author}
-     \endentry
-diff --git a/t/options.t b/t/options.t
-index 940a282..c14d694 100644
---- a/t/options.t
-+++ b/t/options.t
-@@ -100,7 +100,7 @@ my $l1 = q|    \entry{L1}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -137,7 +137,7 @@ my $l2 = q|    \entry{L2}{book}{maxcitenames=3,maxbibnames=3,maxsortnames=3,maxi
-       \strng{authornamehash}{19eec87c959944d6d9c72434a42856ba}
-       \strng{authorfullhash}{19eec87c959944d6d9c72434a42856ba}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -169,7 +169,7 @@ my $l3 = q|    \entry{L3}{book}{blah=10}
-       \strng{authornamehash}{490250da1f3b92580d97563dc96c6c84}
-       \strng{authorfullhash}{490250da1f3b92580d97563dc96c6c84}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-diff --git a/t/related-entries.t b/t/related-entries.t
-index 53dce64..b38ac79 100644
---- a/t/related-entries.t
-+++ b/t/related-entries.t
-@@ -56,7 +56,7 @@ my $k1 = q|    \entry{key1}{article}{}
-       \strng{authorfullhash}{a517747c3d12f99244ae598910d979c5}
-       \field{extraname}{1}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -95,7 +95,7 @@ my $k2 = q|    \entry{key2}{inbook}{}
-       \strng{authorfullhash}{a517747c3d12f99244ae598910d979c5}
-       \field{extraname}{2}
-       \field{sortinit}{2}
--      \field{sortinithash}{cbff857e587bcb4635511624d773949e}
-+      \field{sortinithash}{ed39bb39cf854d5250e95b1c1f94f4ed}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -243,7 +243,7 @@ my $kck4 = q|    \entry{caf8e34be07426ae7127c1b4829983c1}{inbook}{dataonly,useed
- 
- my $c1 = q|    \entry{c1}{book}{}
-       \field{sortinit}{3}
--      \field{sortinithash}{a4b52e5432884761f50fb9571273b93e}
-+      \field{sortinithash}{a37a8ef248a93c322189792c34fc68c9}
-       \field{related}{9ab62b5ef34a985438bfdf7ee0102229}
-     \endentry
- |;
-@@ -330,7 +330,7 @@ my $un1 = q|    \entry{kullback}{book}{}
-       \strng{authorfullhash}{34c5bbf9876c37127c3abe4e7d7a7198}
-       \field{extraname}{1}
-       \field{sortinit}{5}
--      \field{sortinithash}{3c19c3776b658b3558e9e2e4840c01e2}
-+      \field{sortinithash}{5dd416adbafacc8226114bc0202d5fdd}
-       \field{extradatescope}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -364,7 +364,7 @@ my $un2 = q|    \entry{kullback:related}{book}{}
-       \strng{authorfullhash}{34c5bbf9876c37127c3abe4e7d7a7198}
-       \field{extraname}{2}
-       \field{sortinit}{6}
--      \field{sortinithash}{57e57fb8451e7fcfa45d1e069f6d3136}
-+      \field{sortinithash}{7851c86048328b027313775d8fbd2131}
-       \field{extradatescope}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/remote-files.t b/t/remote-files.t
-index c747dcd..6f4cf4d 100644
---- a/t/remote-files.t
-+++ b/t/remote-files.t
-@@ -86,7 +86,7 @@ my $cu1 = q|    \entry{citeulike:8283461}{article}{}
-       \strng{authornamehash}{a700cc0bdce78f5a1f50ff6314ff6f2a}
-       \strng{authorfullhash}{094b095bbb7ac93fdd3e2eafdcec0cac}
-       \field{sortinit}{M}
--      \field{sortinithash}{cfd219b90152c06204fab207bc6c7cab}
-+      \field{sortinithash}{2e5c2f51f7fa2d957f3206819bf86dc3}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-@@ -133,7 +133,7 @@ my $dl1 = q|    \entry{AbdelbarH98}{article}{}
-       \strng{authornamehash}{bb887c5d0458bfb1f3f7e6afc8d1def4}
-       \strng{authorfullhash}{bb887c5d0458bfb1f3f7e6afc8d1def4}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-diff --git a/t/set-dynamic.t b/t/set-dynamic.t
-index 9ab5fdd..0846f8a 100644
---- a/t/set-dynamic.t
-+++ b/t/set-dynamic.t
-@@ -51,7 +51,7 @@ my $out = $biber->get_output_obj;
- my $string1 = q|    \entry{DynSet}{set}{}
-       \set{Dynamic1,Dynamic2,Dynamic3}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-     \endentry
- |;
- 
-@@ -71,7 +71,7 @@ my $string2 = q|    \entry{Dynamic1}{book}{}
-       \strng{authornamehash}{252caa7921a061ca92087a1a52f15b78}
-       \strng{authorfullhash}{252caa7921a061ca92087a1a52f15b78}
-       \field{sortinit}{8}
--      \field{sortinithash}{07edf88d4ea82509b9c4b4d13f41c452}
-+      \field{sortinithash}{1b24cab5087933ef0826a7cd3b99e994}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -98,7 +98,7 @@ my $string3 = q|    \entry{Dynamic2}{book}{}
-       \strng{authornamehash}{894a5fe6de820f5dcce84a65581667f4}
-       \strng{authorfullhash}{894a5fe6de820f5dcce84a65581667f4}
-       \field{sortinit}{9}
--      \field{sortinithash}{1dd72ab054147731c9d824b49aba0534}
-+      \field{sortinithash}{54047ffb55bdefa0694bbd554c1b11a0}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -124,7 +124,7 @@ my $string4 = q|    \entry{Dynamic3}{book}{}
-       \strng{authornamehash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \strng{authorfullhash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -151,7 +151,7 @@ my $string5 = q|    \entry{Dynamic3}{book}{}
-       \strng{authornamehash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \strng{authorfullhash}{fc3cc97631ceaecdde2aee6cc60ab42b}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/set-legacy.t b/t/set-legacy.t
-index 4e56991..9d40acb 100644
---- a/t/set-legacy.t
-+++ b/t/set-legacy.t
-@@ -45,7 +45,7 @@ my $out = $biber->get_output_obj;
- my $string1 = q|    \entry{Elias1955}{set}{}
-       \set{Elias1955a,Elias1955b}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-     \endentry
- |;
- 
-diff --git a/t/set-static.t b/t/set-static.t
-index 1e45d4d..a6cbe73 100644
---- a/t/set-static.t
-+++ b/t/set-static.t
-@@ -47,7 +47,7 @@ my $out = $biber->get_output_obj;
- my $string1 = q|    \entry{Static1}{set}{}
-       \set{Static2,Static4,Static3}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{annotation}{Some notes}
-     \endentry
- |;
-@@ -68,7 +68,7 @@ my $string2 = q|    \entry{Static2}{book}{}
-       \strng{authornamehash}{43874d80d7ce68027102819f16c47df1}
-       \strng{authorfullhash}{43874d80d7ce68027102819f16c47df1}
-       \field{sortinit}{B}
--      \field{sortinithash}{276475738cc058478c1677046f857703}
-+      \field{sortinithash}{8de16967003c7207dae369d874f1456e}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -94,7 +94,7 @@ my $string3 = q|    \entry{Static3}{book}{}
-       \strng{authornamehash}{22dafa5cd57bb5dd7f3e3bab98fd539c}
-       \strng{authorfullhash}{22dafa5cd57bb5dd7f3e3bab98fd539c}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -119,7 +119,7 @@ my $string4 = q|    \entry{Static4}{book}{}
-       \strng{authornamehash}{da80091c8cd89e5269bd55af1bd5d2fa}
-       \strng{authorfullhash}{da80091c8cd89e5269bd55af1bd5d2fa}
-       \field{sortinit}{C}
--      \field{sortinithash}{963e9d84a3da2344e8833203de5aed05}
-+      \field{sortinithash}{4c244ceae61406cdc0cc2ce1cb1ff703}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -145,7 +145,7 @@ my $string5 = q|    \entry{Static2}{book}{}
-       \strng{authornamehash}{43874d80d7ce68027102819f16c47df1}
-       \strng{authorfullhash}{43874d80d7ce68027102819f16c47df1}
-       \field{sortinit}{1}
--      \field{sortinithash}{2174f786c6195e7fe2ee1c229b416e29}
-+      \field{sortinithash}{50c6687d7fc80f50136d75228e3c59ba}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/skips.t b/t/skips.t
-index 7c80d39..caa835f 100644
---- a/t/skips.t
-+++ b/t/skips.t
-@@ -50,7 +50,7 @@ my $set1 = q|    \entry{seta}{set}{}
-       \field{labelalpha}{Doe10}
-       \field{extraalpha}{1}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-     \endentry
- |;
- 
-@@ -70,7 +70,7 @@ my $set2 = q|    \entry{set:membera}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -97,7 +97,7 @@ my $set3 = q|    \entry{set:memberb}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -123,7 +123,7 @@ my $set4 = q|    \entry{set:memberc}{book}{}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -150,7 +150,7 @@ my $noset1 = q|    \entry{noseta}{book}{}
-       \field{extraname}{3}
-       \field{labelalpha}{Doe10}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{2}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -180,7 +180,7 @@ my $noset2 = q|    \entry{nosetb}{book}{}
-       \field{extraname}{4}
-       \field{labelalpha}{Doe10}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{3}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -210,7 +210,7 @@ my $noset3 = q|    \entry{nosetc}{book}{}
-       \field{extraname}{5}
-       \field{labelalpha}{Doe10}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extradate}{4}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-@@ -244,7 +244,7 @@ my $sk4 = q|    \entry{skip4}{article}{dataonly}
-       \strng{authornamehash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{labeldatesource}{year}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/sort-complex.t b/t/sort-complex.t
-index aa3e564..d52db08 100644
---- a/t/sort-complex.t
-+++ b/t/sort-complex.t
-@@ -123,7 +123,7 @@ my $l4 = q|    \entry{L4}{book}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Doe\textbf{+}95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -155,7 +155,7 @@ my $l1 = q|    \entry{L1}{book}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Doe95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -187,7 +187,7 @@ my $l2 = q|    \entry{L2}{book}{}
-       \field{extraname}{3}
-       \field{labelalpha}{Doe95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{3}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -219,7 +219,7 @@ my $l3 = q|    \entry{L3}{book}{}
-       \field{extraname}{2}
-       \field{labelalpha}{Doe95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{2}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -253,7 +253,7 @@ my $l5 = q|    \entry{L5}{book}{}
-       \field{extraname}{1}
-       \field{labelalpha}{Doe\textbf{+}95}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \field{extraalpha}{1}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/tdata/full-bbl.bbl b/t/tdata/full-bbl.bbl
-index 4f168de..07c2fab 100644
---- a/t/tdata/full-bbl.bbl
-+++ b/t/tdata/full-bbl.bbl
-@@ -36,7 +36,7 @@
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{labelalpha}{\emph{A}}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -63,7 +63,7 @@
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{labelalpha}{\emph{A}}
-       \field{sortinit}{A}
--      \field{sortinithash}{d77c7cdd82ff690d4c3ef13216f92f0b}
-+      \field{sortinithash}{a3dcedd53b04d1adfd5ac303ecd5e6fa}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-@@ -90,7 +90,7 @@
-       \strng{authorfullhash}{bd051a2f7a5f377e3a62581b0e0f8577}
-       \field{labelalpha}{\emph{A}}
-       \field{sortinit}{D}
--      \field{sortinithash}{2ef1bd9a78cc71eb74d7231c635177b8}
-+      \field{sortinithash}{c438b3d5d027251ba63f5ed538d98af5}
-       \true{singletitle}
-       \field{labelnamesource}{author}
-       \field{labeltitlesource}{title}
-diff --git a/t/tdata/full-bblxml.bblxml b/t/tdata/full-bblxml.bblxml
-index 9eea7d1..a39a787 100644
---- a/t/tdata/full-bblxml.bblxml
-+++ b/t/tdata/full-bblxml.bblxml
-@@ -47,7 +47,7 @@
-         <bbl:field name="authorbibnamehash">860705eb8ffac6e40507746c7ede79ca</bbl:field>
-         <bbl:field name="labelalpha">Aks\textbf{+}06</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="indextitle">Effect of immobilization on catalytic characteristics</bbl:field>
-@@ -79,7 +79,7 @@
-         <bbl:field name="authorbibnamehash">9717d2d959a4b18727868ca7928c34b4</bbl:field>
-         <bbl:field name="labelalpha">Ang02</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-         <bbl:field name="annotation">A German article in a French journal. Apart from that, a typical article entry. Note the indextitle field</bbl:field>
-@@ -109,7 +109,7 @@
-         </bbl:set>
-         <bbl:field name="labelalpha">Gla61</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="annotation">A set entry with three members discussing the standard model of particle physics.</bbl:field>
-       </bbl:entry>
-       <bbl:entry key="stdmodel:glashow" type="article">
-@@ -129,7 +129,7 @@
-         <bbl:field name="authorfullhash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="authorbibnamehash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Nucl. Phys.</bbl:field>
-@@ -168,7 +168,7 @@
-         <bbl:field name="extraname">1</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">1</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -207,7 +207,7 @@
-         <bbl:field name="extraname">2</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">2</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -236,7 +236,7 @@
-         <bbl:field name="authorbibnamehash">d52f05e0199eae563725b4165f4b2520</bbl:field>
-         <bbl:field name="labelalpha">Ree58</bbl:field>
-         <bbl:field name="sortinit">R</bbl:field>
--        <bbl:field name="sortinithash">da6b42bd3ab22fee61abed031ee405f7</bbl:field>
-+        <bbl:field name="sortinithash">b9c68a358aea118dfa887b6e902414a7</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with a series and a volume field. Note the format of the series. If the value of the series field is an integer, this number is printed as an ordinal and the string *series is appended automatically</bbl:field>
-@@ -286,7 +286,7 @@
-         <bbl:field name="editorfullhash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="editorbibnamehash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="booksubtitle">Relativistic groups and analyticity</bbl:field>
-@@ -317,7 +317,7 @@
-         <bbl:field name="authorbibnamehash">93f17724cbd884231ef39a73755ef5bb</bbl:field>
-         <bbl:field name="labelalpha">Sho91</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with series, volume, and number fields. Note the format of the series which is a localization key</bbl:field>
-@@ -353,7 +353,7 @@
-         <bbl:field name="authorfullhash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="authorbibnamehash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="sortinit">W</bbl:field>
--        <bbl:field name="sortinithash">ecb89ff85896a47dc313960773ac311d</bbl:field>
-+        <bbl:field name="sortinithash">1af34bd8c148ffb32de1494636b49713</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Phys. Rev. Lett.</bbl:field>
-@@ -411,7 +411,7 @@
-         <bbl:field name="authorbibnamehash">860705eb8ffac6e40507746c7ede79ca</bbl:field>
-         <bbl:field name="labelalpha">Aks\textbf{+}06</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="indextitle">Effect of immobilization on catalytic characteristics</bbl:field>
-@@ -443,7 +443,7 @@
-         <bbl:field name="authorbibnamehash">9717d2d959a4b18727868ca7928c34b4</bbl:field>
-         <bbl:field name="labelalpha">Ang02</bbl:field>
-         <bbl:field name="sortinit">A</bbl:field>
--        <bbl:field name="sortinithash">d77c7cdd82ff690d4c3ef13216f92f0b</bbl:field>
-+        <bbl:field name="sortinithash">a3dcedd53b04d1adfd5ac303ecd5e6fa</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-         <bbl:field name="annotation">A German article in a French journal. Apart from that, a typical article entry. Note the indextitle field</bbl:field>
-@@ -473,7 +473,7 @@
-         </bbl:set>
-         <bbl:field name="labelalpha">Gla61</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="annotation">A set entry with three members discussing the standard model of particle physics.</bbl:field>
-       </bbl:entry>
-       <bbl:entry key="stdmodel:glashow" type="article">
-@@ -493,7 +493,7 @@
-         <bbl:field name="authorfullhash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="authorbibnamehash">eb3f242602109f5bdbeb41fdd990fcc0</bbl:field>
-         <bbl:field name="sortinit">G</bbl:field>
--        <bbl:field name="sortinithash">5e8d2bf9d38de41b1528bd307546008f</bbl:field>
-+        <bbl:field name="sortinithash">62eb2aa29549e4fdbd3cb154ec5711cb</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Nucl. Phys.</bbl:field>
-@@ -532,7 +532,7 @@
-         <bbl:field name="extraname">1</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">1</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -571,7 +571,7 @@
-         <bbl:field name="extraname">2</bbl:field>
-         <bbl:field name="labelalpha">Knu86</bbl:field>
-         <bbl:field name="sortinit">K</bbl:field>
--        <bbl:field name="sortinithash">9fd838a31ba64d981e8f44562bd33f89</bbl:field>
-+        <bbl:field name="sortinithash">d3edc18d54b9438a72c24c925bfb38f4</bbl:field>
-         <bbl:field name="extraalpha">2</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">shorttitle</bbl:field>
-@@ -600,7 +600,7 @@
-         <bbl:field name="authorbibnamehash">d52f05e0199eae563725b4165f4b2520</bbl:field>
-         <bbl:field name="labelalpha">Ree58</bbl:field>
-         <bbl:field name="sortinit">R</bbl:field>
--        <bbl:field name="sortinithash">da6b42bd3ab22fee61abed031ee405f7</bbl:field>
-+        <bbl:field name="sortinithash">b9c68a358aea118dfa887b6e902414a7</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with a series and a volume field. Note the format of the series. If the value of the series field is an integer, this number is printed as an ordinal and the string *series is appended automatically</bbl:field>
-@@ -650,7 +650,7 @@
-         <bbl:field name="editorfullhash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="editorbibnamehash">d0ec890e59163c24c111a08d2a4be982</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="booksubtitle">Relativistic groups and analyticity</bbl:field>
-@@ -681,7 +681,7 @@
-         <bbl:field name="authorbibnamehash">93f17724cbd884231ef39a73755ef5bb</bbl:field>
-         <bbl:field name="labelalpha">Sho91</bbl:field>
-         <bbl:field name="sortinit">S</bbl:field>
--        <bbl:field name="sortinithash">322b1d5276f2f6c1bccdcd15920dbee6</bbl:field>
-+        <bbl:field name="sortinithash">c319cff79d99c853d775f88277d4e45f</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="annotation">An article entry with series, volume, and number fields. Note the format of the series which is a localization key</bbl:field>
-@@ -717,7 +717,7 @@
-         <bbl:field name="authorfullhash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="authorbibnamehash">15e144c72b0b9d10db00ddc6d37a19e6</bbl:field>
-         <bbl:field name="sortinit">W</bbl:field>
--        <bbl:field name="sortinithash">ecb89ff85896a47dc313960773ac311d</bbl:field>
-+        <bbl:field name="sortinithash">1af34bd8c148ffb32de1494636b49713</bbl:field>
-         <bbl:field name="labelnamesource">author</bbl:field>
-         <bbl:field name="labeltitlesource">title</bbl:field>
-         <bbl:field name="journaltitle">Phys. Rev. Lett.</bbl:field>
-diff --git a/t/tdata/remote-files.bcf b/t/tdata/remote-files.bcf
-index c2d784b..a2a1842 100644
---- a/t/tdata/remote-files.bcf
-+++ b/t/tdata/remote-files.bcf
-@@ -1853,12 +1853,12 @@
-     <bcf:datasource type="file" datatype="bibtex">http://www.citeulike.org/bibtex/group/8082</bcf:datasource>
-     <bcf:datasource type="file" datatype="bibtex">http://people.cs.uu.nl/hansb/graphs-bib/definitions.bib</bcf:datasource>
-     <bcf:datasource type="file" datatype="bibtex">http://people.cs.uu.nl/hansb/graphs-bib/papers.bib</bcf:datasource>
--    <bcf:datasource type="file" datatype="bibtex">https://api.zotero.org/groups/9097/items/II22KQ7D?format=bibtex&amp;limit=1</bcf:datasource>
-+    <bcf:datasource type="file" datatype="bibtex">https://api.zotero.org/groups/9097/items/8VITAT46?format=bibtex&amp;limit=1</bcf:datasource>
-   </bcf:bibdata>
-   <bcf:section number="0">
-     <bcf:citekey order="1">citeulike:8283461</bcf:citekey>
-     <bcf:citekey order="2">AbdelbarH98</bcf:citekey>
--    <bcf:citekey order="3">merleau-ponty_philosophe_2010</bcf:citekey>
-+    <bcf:citekey order="3">crossley_politics_1994</bcf:citekey>
-   </bcf:section>
-   <!-- SORTING TEMPLATES -->
-   <bcf:sortingtemplate name="nty">
-diff --git a/t/uniqueness-nameparts.t b/t/uniqueness-nameparts.t
-index beb2e39..1fb65a8 100644
---- a/t/uniqueness-nameparts.t
-+++ b/t/uniqueness-nameparts.t
-@@ -81,7 +81,7 @@ my $un1 = q|    \entry{un1}{article}{}
-       \strng{authorfullhash}{329d8f9192ea3349d700160c9ddb505d}
-       \field{labelalpha}{SmiJohSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -106,7 +106,7 @@ my $un2 = q|    \entry{un2}{article}{}
-       \strng{authorfullhash}{7551114aede4ef69e4b3683039801706}
-       \field{labelalpha}{SmiJohAla}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -131,7 +131,7 @@ my $un3 = q|    \entry{un3}{article}{}
-       \strng{authorfullhash}{401aebda288799a7c757526242d8c9fc}
-       \field{labelalpha}{SmiJohArt}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -156,7 +156,7 @@ my $un4 = q|    \entry{un4}{article}{}
-       \strng{authorfullhash}{f6038a264619efefd49c7daac56424ca}
-       \field{labelalpha}{SmiAlaSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -181,7 +181,7 @@ my $un1a = q|    \entry{un1}{article}{}
-       \strng{authorfullhash}{329d8f9192ea3349d700160c9ddb505d}
-       \field{labelalpha}{SmiJohSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -206,7 +206,7 @@ my $un2a = q|    \entry{un2}{article}{}
-       \strng{authorfullhash}{7551114aede4ef69e4b3683039801706}
-       \field{labelalpha}{SmiJohAla}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -231,7 +231,7 @@ my $un3a = q|    \entry{un3}{article}{}
-       \strng{authorfullhash}{401aebda288799a7c757526242d8c9fc}
-       \field{labelalpha}{SmiJohArt}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -257,7 +257,7 @@ my $un4a = q|    \entry{un4}{article}{}
-       \strng{authorfullhash}{f6038a264619efefd49c7daac56424ca}
-       \field{labelalpha}{SmiAlaSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -285,7 +285,7 @@ my $un1b = q|    \entry{un1}{article}{}
-       \field{extraname}{5}
-       \field{labelalpha}{SmiJohSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{5}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -311,7 +311,7 @@ my $un2b = q|    \entry{un2}{article}{}
-       \strng{authorfullhash}{7551114aede4ef69e4b3683039801706}
-       \field{labelalpha}{SmiJohAla}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -336,7 +336,7 @@ my $un3b = q|    \entry{un3}{article}{}
-       \strng{authorfullhash}{401aebda288799a7c757526242d8c9fc}
-       \field{labelalpha}{SmiJohArt}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{labelnamesource}{author}
-     \endentry
- |;
-@@ -364,7 +364,7 @@ my $un4b = q|    \entry{un4}{article}{}
-       \field{extraname}{1}
-       \field{labelalpha}{SmiAlaSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{1}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -393,7 +393,7 @@ my $un5 = q|    \entry{un5}{article}{uniquenametemplatename=test3}
-       \field{extraname}{2}
-       \field{labelalpha}{SmiArtSim}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{2}
-       \field{labelnamesource}{author}
-     \endentry
-@@ -422,7 +422,7 @@ my $un6 = q|    \entry{un6}{article}{}
-       \field{extraname}{3}
-       \field{labelalpha}{SmiArtSmy}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{3}
-       \field{labelnamesource}{author}
-     \\endentry
-@@ -451,7 +451,7 @@ my $un7 = q|    \entry{un7}{article}{}
-       \field{extraname}{4}
-       \field{labelalpha}{SmiArtSme}
-       \field{sortinit}{S}
--      \field{sortinithash}{322b1d5276f2f6c1bccdcd15920dbee6}
-+      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
-       \field{extradate}{4}
-       \field{labelnamesource}{author}
-     \endentry
-diff --git a/t/xdata.t b/t/xdata.t
-index 7411b1d..73dcb8b 100644
---- a/t/xdata.t
-+++ b/t/xdata.t
-@@ -75,7 +75,7 @@ my $xd1 = q|    \entry{xd1}{book}{}
-       \strng{authorfullhash}{51db4bfd331cba22959ce2d224c517cd}
-       \field{extraname}{2}
-       \field{sortinit}{E}
--      \field{sortinithash}{f615fb9c6fba11c6f962fb3fd599810e}
-+      \field{sortinithash}{c554bd1a0b76ea92b9f105fe36d9c7b0}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
-@@ -107,7 +107,7 @@ my $xd2 = q|    \entry{xd2}{book}{}
-       \strng{authornamehash}{68539e0ce4922cc4957c6cabf35e6fc8}
-       \strng{authorfullhash}{68539e0ce4922cc4957c6cabf35e6fc8}
-       \field{sortinit}{P}
--      \field{sortinithash}{8d51b3d5b78d75b54308d706b9bbe285}
-+      \field{sortinithash}{bb5b15f2db90f7aef79bb9e83defefcb}
-       \field{extradatescope}{labelyear}
-       \field{labeldatesource}{}
-       \field{labelnamesource}{author}
diff --git a/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch b/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch
new file mode 100644
index 0000000000..1fd3d3d9b7
--- /dev/null
+++ b/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch
@@ -0,0 +1,231 @@
+From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Mon, 26 Jul 2021 05:59:55 -0700
+Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
+
+Close the file descriptor if there is no archive plugin file descriptor
+to avoid running out of file descriptors on thin archives with many
+archive members.
+
+bfd/
+
+	PR ld/28138
+	* plugin.c (bfd_plugin_close_file_descriptor): Close the file
+	descriptor there is no archive plugin file descriptor.
+
+ld/
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
+	native build.
+
+	PR ld/28138
+	* testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
+	* testsuite/ld-plugin/pr28138.c: New file.
+	* testsuite/ld-plugin/pr28138-1.c: Likewise.
+	* testsuite/ld-plugin/pr28138-2.c: Likewise.
+	* testsuite/ld-plugin/pr28138-3.c: Likewise.
+	* testsuite/ld-plugin/pr28138-4.c: Likewise.
+	* testsuite/ld-plugin/pr28138-5.c: Likewise.
+	* testsuite/ld-plugin/pr28138-6.c: Likewise.
+	* testsuite/ld-plugin/pr28138-7.c: Likewise.
+
+(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
+(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
+---
+ bfd/plugin.c                       |  8 +++++++
+ ld/testsuite/ld-plugin/lto.exp     | 34 ++++++++++++++++++++++++++++++
+ ld/testsuite/ld-plugin/pr28138-1.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-2.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-3.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-4.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-5.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-6.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138-7.c |  6 ++++++
+ ld/testsuite/ld-plugin/pr28138.c   | 20 ++++++++++++++++++
+ 10 files changed, 104 insertions(+)
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
+ create mode 100644 ld/testsuite/ld-plugin/pr28138.c
+
+diff --git a/bfd/plugin.c b/bfd/plugin.c
+index 6cfa2b66470..3bab8febe88 100644
+--- a/bfd/plugin.c
++++ b/bfd/plugin.c
+@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
+ 	     && !bfd_is_thin_archive (abfd->my_archive))
+ 	abfd = abfd->my_archive;
+ 
++      /* Close the file descriptor if there is no archive plugin file
++	 descriptor.  */
++      if (abfd->archive_plugin_fd == -1)
++	{
++	  close (fd);
++	  return;
++	}
++
+       abfd->archive_plugin_fd_open_count--;
+       /* Dup the archive plugin file descriptor for later use, which
+ 	 will be closed by _bfd_archive_close_and_cleanup.  */
+diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
+index def69e43ab3..999d911ce6a 100644
+--- a/ld/testsuite/ld-plugin/lto.exp
++++ b/ld/testsuite/ld-plugin/lto.exp
+@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
+     }
+ }
+ 
++run_cc_link_tests [list \
++    [list \
++	"Build pr28138.a" \
++	"-T" "" \
++	{pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
++	 pr28138-6.c pr28138-7.c} {} "pr28138.a" \
++    ] \
++    [list \
++	"Build pr28138.o" \
++	"" "" \
++	{pr28138.c} {} \
++    ] \
++]
++
++set exec_output [run_host_cmd "sh" \
++			      "-c \"ulimit -n 20; \
++			      $CC -Btmpdir/ld -o tmpdir/pr28138 \
++			      tmpdir/pr28138.o tmpdir/pr28138.a\""]
++set exec_output [prune_warnings $exec_output]
++if [string match "" $exec_output] then {
++    if { [isnative] } {
++	set exec_output [run_host_cmd "tmpdir/pr28138" ""]
++	if [string match "PASS" $exec_output] then {
++	    pass "PR ld/28138"
++	} else {
++	    fail "PR ld/28138"
++	}
++    } else {
++	pass "PR ld/28138"
++    }
++} else {
++    fail "PR ld/28138"
++}
++
+ set testname "Build liblto-11.a"
+ remote_file host delete "tmpdir/liblto-11.a"
+ set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
+diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
+new file mode 100644
+index 00000000000..51d119e1642
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-1.c
+@@ -0,0 +1,6 @@
++extern int a0(void);
++int
++a1(void)
++{
++  return 1 + a0();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
+new file mode 100644
+index 00000000000..1120cd797e9
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-2.c
+@@ -0,0 +1,6 @@
++extern int a1(void);
++int
++a2(void)
++{
++  return 1 + a1();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
+new file mode 100644
+index 00000000000..ec464947ee6
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-3.c
+@@ -0,0 +1,6 @@
++extern int a2(void);
++int
++a3(void)
++{
++  return 1 + a2();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
+new file mode 100644
+index 00000000000..475701b2c5c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-4.c
+@@ -0,0 +1,6 @@
++extern int a3(void);
++int
++a4(void)
++{
++  return 1 + a3();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
+new file mode 100644
+index 00000000000..e24f86c363e
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-5.c
+@@ -0,0 +1,6 @@
++extern int a4(void);
++int
++a5(void)
++{
++  return 1 + a4();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
+new file mode 100644
+index 00000000000..b5b938bdb21
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-6.c
+@@ -0,0 +1,6 @@
++extern int a5(void);
++int
++a6(void)
++{
++  return 1 + a5();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
+new file mode 100644
+index 00000000000..4ef75bf0f0c
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138-7.c
+@@ -0,0 +1,6 @@
++extern int a6(void);
++int
++a7(void)
++{
++  return 1 + a6();
++}
+diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
+new file mode 100644
+index 00000000000..68252c9f382
+--- /dev/null
++++ b/ld/testsuite/ld-plugin/pr28138.c
+@@ -0,0 +1,20 @@
++#include <stdio.h>
++
++extern int a7(void);
++
++int
++a0(void)
++{
++  return 0;
++}
++
++int
++main()
++{
++  if (a7() == 7)
++    {
++      printf ("PASS\n");
++      return 0;
++    }
++  return 1;
++}
+-- 
+2.27.0
diff --git a/gnu/packages/patches/binutils-loongson-workaround.patch b/gnu/packages/patches/binutils-loongson-workaround.patch
index f43572a53d..f05d6c3c96 100644
--- a/gnu/packages/patches/binutils-loongson-workaround.patch
+++ b/gnu/packages/patches/binutils-loongson-workaround.patch
@@ -4,22 +4,22 @@ Patch by Mark H Weaver <mhw@netris.org>.
 
 --- binutils/gas/config/tc-mips.c.orig	2012-09-04 10:21:03.000000000 -0400
 +++ binutils/gas/config/tc-mips.c	2013-10-06 02:23:21.651983768 -0400
-@@ -910,10 +910,10 @@
+@@ -934,10 +934,10 @@ enum fix_vr4120_class
  };
  
  /* ...likewise -mfix-loongson2f-jump.  */
--static bfd_boolean mips_fix_loongson2f_jump;
-+static bfd_boolean mips_fix_loongson2f_jump = FALSE;
+-static bool mips_fix_loongson2f_jump;
++static bool mips_fix_loongson2f_jump = FALSE;
  
  /* ...likewise -mfix-loongson2f-nop.  */
--static bfd_boolean mips_fix_loongson2f_nop;
-+static bfd_boolean mips_fix_loongson2f_nop = TRUE;
+-static bool mips_fix_loongson2f_nop;
++static bool mips_fix_loongson2f_nop = TRUE;
  
  /* True if -mfix-loongson2f-nop or -mfix-loongson2f-jump passed.  */
- static bfd_boolean mips_fix_loongson2f;
+ static bool mips_fix_loongson2f;
 --- binutils/gas/testsuite/gas/mips/mips.exp.orig	2012-09-04 10:17:13.000000000 -0400
 +++ binutils/gas/testsuite/gas/mips/mips.exp	2013-10-06 02:23:21.663983768 -0400
-@@ -91,6 +91,12 @@
+@@ -110,6 +110,12 @@ proc mips_arch_init {} {
  
      # Catch because the variable won't be set the first time through.
      catch {unset mips_arches}
diff --git a/gnu/packages/patches/binutils-mingw-w64-timestamp.patch b/gnu/packages/patches/binutils-mingw-w64-timestamp.patch
index b785043b62..fcfe4a36aa 100644
--- a/gnu/packages/patches/binutils-mingw-w64-timestamp.patch
+++ b/gnu/packages/patches/binutils-mingw-w64-timestamp.patch
@@ -4,14 +4,14 @@ https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git
 
 Invoke the following in the aforementioned repo to see the original patch:
 
-  $ git show da63f6b:debian/patches/specify-timestamp.patch
+  $ git show faf7c64:debian/patches/specify-timestamp.patch
 
 Description: Allow the PE timestamp to be specified
 Author: Stephen Kitt <skitt@debian.org>
 
 --- a/bfd/peXXigen.c
 +++ b/bfd/peXXigen.c
-@@ -70,6 +70,9 @@
+@@ -77,6 +77,9 @@
  #include <wctype.h>
  #endif
  
@@ -21,20 +21,20 @@ Author: Stephen Kitt <skitt@debian.org>
  /* NOTE: it's strange to be including an architecture specific header
     in what's supposed to be general (to PE/PEI) code.  However, that's
     where the definitions are, and they don't vary per architecture
-@@ -879,10 +882,38 @@
+@@ -876,9 +879,36 @@
  
    /* Use a real timestamp by default, unless the no-insert-timestamp
       option was chosen.  */
--  if ((pe_data (abfd)->insert_timestamp))
+-  if ((pe_data (abfd)->timestamp) == -1)
 -    H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
 -  else
-+  if (pe_data (abfd)->insert_timestamp) {
++  if ((pe_data (abfd)->timestamp) == -1) {
 +    time_t now;
 +    char *source_date_epoch;
 +    unsigned long long epoch;
 +    char *endptr;
 +
-+    now = time(NULL);
++    now = time (NULL);
 +    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
 +    if (source_date_epoch) {
 +      errno = 0;
@@ -57,30 +57,29 @@ Author: Stephen Kitt <skitt@debian.org>
 +      }
 +    }
 +    H_PUT_32 (abfd, now, filehdr_out->f_timdat);
-+  } else {
-     H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
-+  }
++  } else
+     H_PUT_32 (abfd, pe_data (abfd)->timestamp, filehdr_out->f_timdat);
  
    PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
- 		      filehdr_out->f_symptr);
 --- a/ld/pe-dll.c
 +++ b/ld/pe-dll.c
-@@ -26,6 +26,8 @@
- #include "filenames.h"
+@@ -27,6 +27,8 @@
  #include "safe-ctype.h"
+ #include "ctf-api.h"
  
 +#include <errno.h>
 +#include <limits.h>
  #include <time.h>
  
  #include "ld.h"
-@@ -1202,8 +1204,36 @@
+@@ -1218,9 +1220,36 @@
  
    memset (edata_d, 0, edata_sz);
  
--  if (pe_data (abfd)->insert_timestamp)
+-  if (pe_data (abfd)->timestamp == -1)
 -    H_PUT_32 (abfd, time (0), edata_d + 4);
-+  if (pe_data (abfd)->insert_timestamp) {
+-  else
++  if (pe_data (abfd)->timestamp == -1) {
 +    time_t now;
 +    char *source_date_epoch;
 +    unsigned long long epoch;
@@ -109,13 +108,13 @@ Author: Stephen Kitt <skitt@debian.org>
 +      }
 +    }
 +    H_PUT_32 (abfd, now, edata_d + 4);
-+  }
++  } else
+     H_PUT_32 (abfd, pe_data (abfd)->timestamp, edata_d + 4);
  
    if (pe_def_file->version_major != -1)
-     {
 --- a/ld/emultempl/pe.em
 +++ b/ld/emultempl/pe.em
-@@ -303,7 +303,7 @@
+@@ -304,7 +304,7 @@
       OPTION_USE_NUL_PREFIXED_IMPORT_TABLES},
      {"no-leading-underscore", no_argument, NULL, OPTION_NO_LEADING_UNDERSCORE},
      {"leading-underscore", no_argument, NULL, OPTION_LEADING_UNDERSCORE},
@@ -126,7 +125,7 @@ Author: Stephen Kitt <skitt@debian.org>
      /* getopt allows abbreviations, so we do this to stop it
 --- a/ld/emultempl/pep.em
 +++ b/ld/emultempl/pep.em
-@@ -321,7 +321,7 @@
+@@ -323,7 +323,7 @@
      {"no-bind", no_argument, NULL, OPTION_NO_BIND},
      {"wdmdriver", no_argument, NULL, OPTION_WDM_DRIVER},
      {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE},
@@ -134,4 +133,4 @@ Author: Stephen Kitt <skitt@debian.org>
 +    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
      {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
      {"build-id", optional_argument, NULL, OPTION_BUILD_ID},
-     {NULL, no_argument, NULL, 0}
+     {"enable-reloc-section", no_argument, NULL, OPTION_ENABLE_RELOC_SECTION},
diff --git a/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch b/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch
new file mode 100644
index 0000000000..0629212688
--- /dev/null
+++ b/gnu/packages/patches/c++-gsl-move-array-bounds-tests.patch
@@ -0,0 +1,126 @@
+Description: Move tests that trigger -Warray-bounds to separate compilation unit
+ GCC 10 is now smart enough to detect violation of array boundaries that tests
+ are actually tested. Along with -Werror this led to tests failure, so I move
+ such tests to another compilation unit to have the warning deactivated for
+ only these tests.
+Bug-Debian: https://bugs.debian.org/966895
+Author: Nicholas Guriev <guriev-ns@ya.ru>
+Last-Modified: Wed, 19 Aug 2020 08:55:52 +0300
+
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -179,6 +179,7 @@ add_gsl_test(owner_tests)
+ add_gsl_test(byte_tests)
+ add_gsl_test(algorithm_tests)
+ add_gsl_test(strict_notnull_tests)
++add_gsl_test(array_bounds)
+ 
+ 
+ # No exception tests
+--- /dev/null
++++ b/tests/array_bounds.cpp
+@@ -0,0 +1,68 @@
++///////////////////////////////////////////////////////////////////////////////
++//
++// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
++//
++// This code is licensed under the MIT License (MIT).
++//
++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++// THE SOFTWARE.
++//
++///////////////////////////////////////////////////////////////////////////////
++
++#ifdef __GNUC__
++#pragma GCC diagnostic warning "-Warray-bounds"
++#endif // __GNUC__
++
++#include <gtest/gtest.h>
++
++#include <gsl/multi_span> // for gsl::multi_span
++
++namespace gsl
++{
++struct fail_fast;
++} // namespace gsl
++
++namespace
++{
++static constexpr char deathstring[] = "Expected Death";
++} // namespace
++
++TEST(array_bounds, subspan_from_multi_span_test)
++{
++    int arr[5] = {1, 2, 3, 4, 5};
++    gsl::multi_span<int> av = arr;
++
++    std::set_terminate([] {
++        std::cerr << "Expected Death. subspan";
++        std::abort();
++    });
++
++    EXPECT_DEATH(av.subspan(6).length(), deathstring);
++}
++
++TEST(array_bounds, strided_span_bounds_from_strided_span_tests)
++{
++    int arr[] = {0, 1, 2, 3};
++    gsl::multi_span<int> av(arr);
++
++    std::set_terminate([] {
++        std::cerr << "Expected Death. strided_span_bounds";
++        std::abort();
++    });
++
++    // incorrect sections
++    EXPECT_DEATH(av.section(0, 0)[0], deathstring);
++    EXPECT_DEATH(av.section(1, 0)[0], deathstring);
++    EXPECT_DEATH(av.section(1, 1)[1], deathstring);
++
++    EXPECT_DEATH(av.section(2, 5), deathstring);
++    EXPECT_DEATH(av.section(5, 2), deathstring);
++    EXPECT_DEATH(av.section(5, 0), deathstring);
++    EXPECT_DEATH(av.section(0, 5), deathstring);
++    EXPECT_DEATH(av.section(5, 5), deathstring);
++}
+--- a/tests/multi_span_tests.cpp
++++ b/tests/multi_span_tests.cpp
+@@ -1042,10 +1042,6 @@ TEST(multi_span_test, subspan)
+         EXPECT_TRUE(av.subspan(1).length() == 4);
+         EXPECT_TRUE(av.subspan(4).length() == 1);
+         EXPECT_TRUE(av.subspan(5).length() == 0);
+-        // Disabled test instead of fixing since multi_span is deprecated. (PR#835)
+-#if !(defined(__GNUC__) && __GNUC__ == 8)
+-        EXPECT_DEATH(av.subspan(6).length(), deathstring);
+-#endif
+         auto av2 = av.subspan(1);
+         for (int i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == i + 2);
+     }
+--- a/tests/strided_span_tests.cpp
++++ b/tests/strided_span_tests.cpp
+@@ -403,20 +403,6 @@ TEST(strided_span_tests, strided_span_bo
+     });
+ 
+     {
+-        // incorrect sections
+-
+-        EXPECT_DEATH(av.section(0, 0)[0], deathstring);
+-        EXPECT_DEATH(av.section(1, 0)[0], deathstring);
+-        EXPECT_DEATH(av.section(1, 1)[1], deathstring);
+-
+-        EXPECT_DEATH(av.section(2, 5), deathstring);
+-        EXPECT_DEATH(av.section(5, 2), deathstring);
+-        EXPECT_DEATH(av.section(5, 0), deathstring);
+-        EXPECT_DEATH(av.section(0, 5), deathstring);
+-        EXPECT_DEATH(av.section(5, 5), deathstring);
+-    }
+-
+-    {
+         // zero stride
+         strided_span<int, 1> sav{av, {{4}, {}}};
+         EXPECT_TRUE(sav[0] == 0);
diff --git a/gnu/packages/patches/cheese-vala-update.patch b/gnu/packages/patches/cheese-vala-update.patch
new file mode 100644
index 0000000000..cb18952ce4
--- /dev/null
+++ b/gnu/packages/patches/cheese-vala-update.patch
@@ -0,0 +1,180 @@
+Taken from upstream:
+https://gitlab.gnome.org/GNOME/cheese/-/commit/7cf6268e54620bbbe5e6e61800c50fb0cb4bea57.patch.
+
+From 7cf6268e54620bbbe5e6e61800c50fb0cb4bea57 Mon Sep 17 00:00:00 2001 From:
+=?UTF-8?q?Corentin=20No=C3=ABl?= <corentin@elementary.io> Date: Fri, 16 Oct
+2020 19:56:26 +0200 Subject: [PATCH] Change GLib.PtrArray into
+GLib.GenericArray
+
+This is the vala-friendly way of handling GPtrArray.
+Fix several memory leaks on the go and unnecessary reference increase.
+---
+ src/cheese-preferences.vala | 26 ++++++++++++--------------
+ src/cheese-window.vala      | 22 +++++++++++-----------
+ src/vapi/cheese-common.vapi |  2 +-
+ 3 files changed, 24 insertions(+), 26 deletions(-)
+
+diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
+index f56af7e0..80a92431 100644
+--- a/src/cheese-preferences.vala
++++ b/src/cheese-preferences.vala
+@@ -100,7 +100,7 @@ public PreferencesDialog (Cheese.Camera camera)
+    */
+   private void initialize_camera_devices ()
+   {
+-    unowned GLib.PtrArray devices = camera.get_camera_devices ();
++    GLib.GenericArray<unowned Cheese.CameraDevice> devices = camera.get_camera_devices ();
+     camera_model = new Gtk.ListStore (2, typeof (string), typeof (Cheese.CameraDevice));
+ 
+     source_combo.model = camera_model;
+@@ -357,13 +357,13 @@ public PreferencesDialog (Cheese.Camera camera)
+    */
+   private void on_camera_update_num_camera_devices ()
+   {
+-    unowned GLib.PtrArray devices = camera.get_camera_devices ();
+-    Cheese.CameraDevice   dev;
++    GLib.GenericArray<unowned Cheese.CameraDevice> devices = camera.get_camera_devices ();
++    unowned Cheese.CameraDevice   dev;
+ 
+     // Add (if) / Remove (else) a camera device.
+-    if (devices.len > camera_model.iter_n_children (null))
++    if (devices.length > camera_model.iter_n_children (null))
+     {
+-      dev = (Cheese.CameraDevice) devices.index (devices.len - 1);
++      dev = devices.get (devices.length - 1);
+       add_camera_device(dev);
+     }
+     else
+@@ -382,12 +382,11 @@ public PreferencesDialog (Cheese.Camera camera)
+       bool device_removed = false;
+       devices.foreach ((device) =>
+       {
+-        var old_device = (Cheese.CameraDevice) device;
+         Cheese.CameraDevice new_device;
+         camera_model.get (iter, 1, out new_device, -1);
+ 
+         // Found the device that was removed.
+-        if (old_device != new_device)
++        if (device != new_device)
+         {
+             remove_camera_device (iter, new_device, active_device);
+             device_removed = true;
+@@ -418,17 +417,16 @@ public PreferencesDialog (Cheese.Camera camera)
+    *
+    * @param device a Cheese.CameraDevice to add to the device combo box model
+    */
+-  private void add_camera_device (void *device)
++  private void add_camera_device (Cheese.CameraDevice device)
+   {
+     TreeIter iter;
+-    Cheese.CameraDevice dev = (Cheese.CameraDevice) device;
+ 
+     camera_model.append (out iter);
+     camera_model.set (iter,
+-                      0, dev.get_name (),
+-                      1, dev);
++                      0, device.get_name (),
++                      1, device);
+ 
+-    if (camera.get_selected_device () == dev)
++    if (camera.get_selected_device () == device)
+         source_combo.set_active_iter (iter);
+ 
+     if (camera_model.iter_n_children (null) > 1)
+@@ -445,12 +443,12 @@ public PreferencesDialog (Cheese.Camera camera)
+   private void remove_camera_device (TreeIter iter, Cheese.CameraDevice device_node,
+                              Cheese.CameraDevice active_device_node)
+   {
+-      unowned GLib.PtrArray devices = camera.get_camera_devices ();
++      GLib.GenericArray<unowned Cheese.CameraDevice> devices = camera.get_camera_devices ();
+ 
+       // Check if the camera that we want to remove, is the active one
+       if (device_node == active_device_node)
+       {
+-        if (devices.len > 0)
++        if (devices.length > 0)
+           set_new_available_camera_device (iter);
+         else
+           this.hide ();
+diff --git a/src/cheese-window.vala b/src/cheese-window.vala
+index ff069808..cc119b68 100644
+--- a/src/cheese-window.vala
++++ b/src/cheese-window.vala
+@@ -1216,9 +1216,9 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+    */
+   public void on_switch_camera_clicked ()
+   {
+-      Cheese.CameraDevice selected;
+-      Cheese.CameraDevice next = null;
+-      GLib.PtrArray cameras;
++      unowned Cheese.CameraDevice selected;
++      unowned Cheese.CameraDevice next = null;
++      GLib.GenericArray<unowned Cheese.CameraDevice> cameras;
+       uint i;
+ 
+       if (camera == null)
+@@ -1235,9 +1235,9 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+ 
+       cameras = camera.get_camera_devices ();
+ 
+-      for (i = 0; i < cameras.len; i++)
++      for (i = 0; i < cameras.length; i++)
+       {
+-          next = (Cheese.CameraDevice )cameras.index (i);
++          next = cameras.get (i);
+ 
+           if (next == selected)
+           {
+@@ -1245,13 +1245,13 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+           }
+       }
+ 
+-      if (i + 1 < cameras.len)
++      if (i + 1 < cameras.length)
+       {
+-          next = (Cheese.CameraDevice )cameras.index (i + 1);
++          next = cameras.get (i + 1);
+       }
+       else
+       {
+-          next = (Cheese.CameraDevice )cameras.index (0);
++          next = cameras.get (0);
+       }
+ 
+       if (next == selected)
+@@ -1269,8 +1269,8 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+    */
+   public void set_switch_camera_button_state ()
+   {
+-      Cheese.CameraDevice selected;
+-      GLib.PtrArray cameras;
++      unowned Cheese.CameraDevice selected;
++      GLib.GenericArray<unowned Cheese.CameraDevice> cameras;
+ 
+       if (camera == null)
+       {
+@@ -1288,7 +1288,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
+ 
+       cameras = camera.get_camera_devices ();
+ 
+-      if (cameras.len > 1)
++      if (cameras.length > 1)
+       {
+          switch_camera_button.set_visible (true);
+          return;
+diff --git a/src/vapi/cheese-common.vapi b/src/vapi/cheese-common.vapi
+index 6517cdfc..e4ae7ad3 100644
+--- a/src/vapi/cheese-common.vapi
++++ b/src/vapi/cheese-common.vapi
+@@ -35,7 +35,7 @@ namespace Cheese
+     [CCode (has_construct_function = false)]
+     public Camera (Clutter.Actor video_texture, string camera_device_node, int x_resolution, int y_resolution);
+     public bool                        get_balance_property_range (string property, double min, double max, double def);
+-    public unowned GLib.PtrArray       get_camera_devices ();
++    public GLib.GenericArray<unowned Cheese.CameraDevice> get_camera_devices ();
+     public unowned Cheese.VideoFormat  get_current_video_format ();
+     public int                         get_num_camera_devices ();
+     public unowned Cheese.CameraDevice get_selected_device ();
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/classpath-miscompilation.patch b/gnu/packages/patches/classpath-miscompilation.patch
new file mode 100644
index 0000000000..c3a569ea4f
--- /dev/null
+++ b/gnu/packages/patches/classpath-miscompilation.patch
@@ -0,0 +1,71 @@
+For some reason, the original code gets miscompiled on x86_64, leading
+'Java_java_io_VMFile_isFile' to return true when the return value of
+'cpio_checkType' is ENOENT (= 2).
+
+See <https://issues.guix.gnu.org/issue/36685>
+and <https://issues.guix.gnu.org/49990>.
+
+diff --git a/native/jni/java-io/java_io_VMFile.c b/native/jni/java-io/java_io_VMFile.c
+index de1320b..6695e1f 100644
+--- a/native/jni/java-io/java_io_VMFile.c
++++ b/native/jni/java-io/java_io_VMFile.c
+@@ -240,6 +240,7 @@ Java_java_io_VMFile_exists (JNIEnv * env,
+ #ifndef WITHOUT_FILESYSTEM
+   const char *filename;
+   int result;
++  jboolean exists;
+ 
+   /* Don't use the JCL convert function because it throws an exception
+      on failure */
+@@ -250,9 +251,10 @@ Java_java_io_VMFile_exists (JNIEnv * env,
+     }
+ 
+   result = cpio_isFileExists (filename);
++  exists = (result == CPNATIVE_OK ? 1 : 0);
+   (*env)->ReleaseStringUTFChars (env, name, filename);
+ 
+-  return result == CPNATIVE_OK ? 1 : 0;
++  return exists;
+ #else /* not WITHOUT_FILESYSTEM */
+   return 0;
+ #endif /* not WITHOUT_FILESYSTEM */
+@@ -278,6 +280,7 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
+   const char *filename;
+   int result;
+   jint entryType;
++  jboolean isfile;
+ 
+   /* Don't use the JCL convert function because it throws an exception
+      on failure */
+@@ -288,9 +291,10 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
+     }
+ 
+   result = cpio_checkType (filename, &entryType);
++  isfile = (result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0);
+   (*env)->ReleaseStringUTFChars (env, name, filename);
+ 
+-  return result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0;
++  return isfile;
+ #else /* not WITHOUT_FILESYSTEM */
+   return 0;
+ #endif /* not WITHOUT_FILESYSTEM */
+@@ -315,6 +319,7 @@ Java_java_io_VMFile_isDirectory (JNIEnv * env,
+   const char *filename;
+   int result;
+   jint entryType;
++  jboolean isdirectory;
+ 
+   /* Don't use the JCL convert function because it throws an exception
+      on failure */
+@@ -325,9 +330,10 @@ Java_java_io_VMFile_isDirectory (JNIEnv * env,
+     }
+   
+   result = cpio_checkType (filename, &entryType);
++  isdirectory = (result == CPNATIVE_OK && entryType == CPFILE_DIRECTORY ? 1 : 0);
+   (*env)->ReleaseStringUTFChars (env, name, filename);
+ 
+-  return result == CPNATIVE_OK && entryType == CPFILE_DIRECTORY ? 1 : 0;
++  return isdirectory;
+ #else /* not WITHOUT_FILESYSTEM */
+   return 0;
+ #endif /* not WITHOUT_FILESYSTEM */
diff --git a/gnu/packages/patches/coreutils-gnulib-tests.patch b/gnu/packages/patches/coreutils-gnulib-tests.patch
new file mode 100644
index 0000000000..7142401202
--- /dev/null
+++ b/gnu/packages/patches/coreutils-gnulib-tests.patch
@@ -0,0 +1,45 @@
+Fix Gnulib test failures showing up on ARMv7:
+
+  https://issues.guix.gnu.org/49459
+
+This is a backport of this Gnulib commit:
+
+  commit 175e0bc72808d564074c4adcc72aeadb74adfcc6
+  Author: Paul Eggert <eggert@cs.ucla.edu>
+  Date:   Thu Aug 27 17:52:58 2020 -0700
+
+      perror, strerror_r: remove unportable tests
+
+      Problem reported by Florian Weimer in:
+      https://lists.gnu.org/r/bug-gnulib/2020-08/msg00220.html
+      * tests/test-perror2.c (main):
+      * tests/test-strerror_r.c (main): Omit unportable tests.
+
+diff --git a/tests/test-perror2.c b/tests/test-perror2.c
+index 1d14eda7be..c6214dd25c 100644
+--- a/gnulib-tests/test-perror2.c
++++ b/gnulib-tests/test-perror2.c
+@@ -79,9 +79,6 @@ main (void)
+     errno = -5;
+     perror ("");
+     ASSERT (!ferror (stderr));
+-    ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
+-    ASSERT (msg2 == msg4 || STREQ (msg2, str2));
+-    ASSERT (msg3 == msg4 || STREQ (msg3, str3));
+     ASSERT (STREQ (msg4, str4));
+ 
+     free (str1);
+diff --git a/tests/test-strerror_r.c b/tests/test-strerror_r.c
+index b11d6fd9f6..c1dbcf837b 100644
+--- a/gnulib-tests/test-strerror_r.c
++++ b/gnulib-tests/test-strerror_r.c
+@@ -165,9 +165,6 @@ main (void)
+ 
+     strerror_r (EACCES, buf, sizeof buf);
+     strerror_r (-5, buf, sizeof buf);
+-    ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1));
+-    ASSERT (msg2 == msg4 || STREQ (msg2, str2));
+-    ASSERT (msg3 == msg4 || STREQ (msg3, str3));
+     ASSERT (STREQ (msg4, str4));
+ 
+     free (str1);
diff --git a/gnu/packages/patches/cups-CVE-2020-10001.patch b/gnu/packages/patches/cups-CVE-2020-10001.patch
deleted file mode 100644
index 1b16c7d97c..0000000000
--- a/gnu/packages/patches/cups-CVE-2020-10001.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From efbea1742bd30f842fbbfb87a473e5c84f4162f9 Mon Sep 17 00:00:00 2001
-From: Michael R Sweet <msweet@msweet.org>
-Date: Mon, 1 Feb 2021 15:02:32 -0500
-Subject: [PATCH] Fix a buffer (read) overflow in ippReadIO (CVE-2020-10001)
-
----
-
-diff --git a/cups/ipp.c b/cups/ipp.c
-index 3d529346c..adbb26fba 100644
---- a/cups/ipp.c
-+++ b/cups/ipp.c
-@@ -2866,7 +2866,8 @@ ippReadIO(void       *src,		/* I - Data source */
-   unsigned char		*buffer,	/* Data buffer */
- 			string[IPP_MAX_TEXT],
- 					/* Small string buffer */
--			*bufptr;	/* Pointer into buffer */
-+			*bufptr,	/* Pointer into buffer */
-+			*bufend;	/* End of buffer */
-   ipp_attribute_t	*attr;		/* Current attribute */
-   ipp_tag_t		tag;		/* Current tag */
-   ipp_tag_t		value_tag;	/* Current value tag */
-@@ -3441,6 +3442,7 @@ ippReadIO(void       *src,		/* I - Data source */
- 		}
- 
-                 bufptr = buffer;
-+                bufend = buffer + n;
- 
- 	       /*
- 	        * text-with-language and name-with-language are composite
-@@ -3454,7 +3456,7 @@ ippReadIO(void       *src,		/* I - Data source */
- 
- 		n = (bufptr[0] << 8) | bufptr[1];
- 
--		if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) || n >= (int)sizeof(string))
-+		if ((bufptr + 2 + n + 2) > bufend || n >= (int)sizeof(string))
- 		{
- 		  _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
- 		                _("IPP language length overflows value."), 1);
-@@ -3481,7 +3483,7 @@ ippReadIO(void       *src,		/* I - Data source */
-                 bufptr += 2 + n;
- 		n = (bufptr[0] << 8) | bufptr[1];
- 
--		if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
-+		if ((bufptr + 2 + n) > bufend)
- 		{
- 		  _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
- 		                _("IPP string length overflows value."), 1);
diff --git a/gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch b/gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch
deleted file mode 100644
index 24be6e31d9..0000000000
--- a/gnu/packages/patches/curl-7.76-use-ssl-cert-env.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-Make libcurl respect the SSL_CERT_{DIR,FILE} variables by default. The variables
-are fetched during initialization to preserve thread-safety (curl_global_init(3)
-must be called when no other threads exist).
-
-This fixes network functionality in rust:cargo, and probably removes the need
-for other future workarounds.
-===================================================================
---- curl-7.66.0.orig/lib/easy.c	2020-01-02 15:43:11.883921171 +0100
-+++ curl-7.66.0/lib/easy.c	2020-01-02 16:18:54.691882797 +0100
-@@ -134,6 +134,9 @@
- #  pragma warning(default:4232) /* MSVC extension, dllimport identity */
- #endif
- 
-+char * Curl_ssl_cert_dir = NULL;
-+char * Curl_ssl_cert_file = NULL;
-+
- /**
-  * curl_global_init() globally initializes curl given a bitwise set of the
-  * different features of what to initialize.
-@@ -155,6 +158,9 @@
- #endif
-   }
- 
-+  Curl_ssl_cert_dir = curl_getenv("SSL_CERT_DIR");
-+  Curl_ssl_cert_file = curl_getenv("SSL_CERT_FILE");
-+
-   if(!Curl_ssl_init()) {
-     DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n"));
-     return CURLE_FAILED_INIT;
-@@ -260,6 +266,9 @@
-   Curl_ssl_cleanup();
-   Curl_resolver_global_cleanup();
- 
-+  free(Curl_ssl_cert_dir);
-+  free(Curl_ssl_cert_file);
-+
- #ifdef WIN32
-   Curl_win32_cleanup(init_flags);
- #endif
-diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
---- curl-7.66.0.orig/lib/url.c	2020-01-02 15:43:11.883921171 +0100
-+++ curl-7.66.0/lib/url.c	2020-01-02 16:21:11.563880346 +0100
-@@ -524,6 +524,21 @@
-     if(result)
-       return result;
- #endif
-+    extern char * Curl_ssl_cert_dir;
-+    extern char * Curl_ssl_cert_file;
-+    if(Curl_ssl_cert_dir) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], Curl_ssl_cert_dir))
-+            return result;
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
-+            return result;
-+    }
-+
-+    if(Curl_ssl_cert_file) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], Curl_ssl_cert_file))
-+            return result;
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
-+            return result;
-+    }
-   }
- 
-   set->wildcard_enabled = FALSE;
diff --git a/gnu/packages/patches/curl-use-ssl-cert-env.patch b/gnu/packages/patches/curl-use-ssl-cert-env.patch
index c8e80b4445..24be6e31d9 100644
--- a/gnu/packages/patches/curl-use-ssl-cert-env.patch
+++ b/gnu/packages/patches/curl-use-ssl-cert-env.patch
@@ -47,14 +47,14 @@ diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
 +    extern char * Curl_ssl_cert_dir;
 +    extern char * Curl_ssl_cert_file;
 +    if(Curl_ssl_cert_dir) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_ORIG], Curl_ssl_cert_dir))
++        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], Curl_ssl_cert_dir))
 +            return result;
 +        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
 +            return result;
 +    }
 +
 +    if(Curl_ssl_cert_file) {
-+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], Curl_ssl_cert_file))
++        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], Curl_ssl_cert_file))
 +            return result;
 +        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
 +            return result;
diff --git a/gnu/packages/patches/dbus-CVE-2020-12049.patch b/gnu/packages/patches/dbus-CVE-2020-12049.patch
deleted file mode 100644
index 71280144a1..0000000000
--- a/gnu/packages/patches/dbus-CVE-2020-12049.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Fix CVE-2020-12049:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12049
-https://lists.freedesktop.org/archives/ftp-release/2020-June/000753.html
-
-Taken from upstream:
-
-https://gitlab.freedesktop.org/dbus/dbus/-/commit/272d484283883fa9ff95b69d924fff6cd34842f5
-
-diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
---- a/dbus/dbus-sysdeps-unix.c
-+++ b/dbus/dbus-sysdeps-unix.c
-@@ -435,18 +435,6 @@ _dbus_read_socket_with_unix_fds (DBusSocket        fd,
-       struct cmsghdr *cm;
-       dbus_bool_t found = FALSE;
- 
--      if (m.msg_flags & MSG_CTRUNC)
--        {
--          /* Hmm, apparently the control data was truncated. The bad
--             thing is that we might have completely lost a couple of fds
--             without chance to recover them. Hence let's treat this as a
--             serious error. */
--
--          errno = ENOSPC;
--          _dbus_string_set_length (buffer, start);
--          return -1;
--        }
--
-       for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
-         if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
-           {
-@@ -501,6 +489,26 @@ _dbus_read_socket_with_unix_fds (DBusSocket        fd,
-       if (!found)
-         *n_fds = 0;
- 
-+      if (m.msg_flags & MSG_CTRUNC)
-+        {
-+          unsigned int i;
-+
-+          /* Hmm, apparently the control data was truncated. The bad
-+             thing is that we might have completely lost a couple of fds
-+             without chance to recover them. Hence let's treat this as a
-+             serious error. */
-+
-+          /* We still need to close whatever fds we *did* receive,
-+           * otherwise they'll never get closed. (CVE-2020-12049) */
-+          for (i = 0; i < *n_fds; i++)
-+            close (fds[i]);
-+
-+          *n_fds = 0;
-+          errno = ENOSPC;
-+          _dbus_string_set_length (buffer, start);
-+          return -1;
-+        }
-+
-       /* put length back (doesn't actually realloc) */
-       _dbus_string_set_length (buffer, start + bytes_read);
- 
diff --git a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch b/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
index 4199dd18a5..fed4b76429 100644
--- a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
+++ b/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
@@ -5,7 +5,7 @@ https://bugzilla.samba.org/show_bug.cgi?id=9515
 https://bugzilla.gnome.org/show_bug.cgi?id=736077 (for xsltproc)
 
 Patch copied from Debian:
-https://anonscm.debian.org/cgit/collab-maint/docbook-xsl.git/tree/debian/patches/765567_non-recursive_string_subst.patch
+https://salsa.debian.org/debian/docbook-xsl/-/blob/master/debian/patches/765567_non-recursive_string_subst.patch
 
 Description: use EXSLT "replace" function when available
  A recursive implementation  of string.subst is problematic,
@@ -15,11 +15,12 @@ Bug-Debian: https://bugs.debian.org/750593
 
 --- a/lib/lib.xsl
 +++ b/lib/lib.xsl
-@@ -10,7 +10,10 @@
+@@ -6,7 +6,11 @@
+ 
       This module implements DTD-independent functions
  
-      ******************************************************************** -->
--<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+-     ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
++     ******************************************************************** -->
 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 +                xmlns:str="http://exslt.org/strings"
 +                exclude-result-prefixes="str"
@@ -27,7 +28,7 @@ Bug-Debian: https://bugs.debian.org/750593
  
  <xsl:template name="dot.count">
    <!-- Returns the number of "." characters in a string -->
-@@ -56,6 +59,9 @@
+@@ -52,6 +56,9 @@
    <xsl:param name="replacement"/>
  
    <xsl:choose>
diff --git a/gnu/packages/patches/docbook-xsl-support-old-url.patch b/gnu/packages/patches/docbook-xsl-support-old-url.patch
new file mode 100644
index 0000000000..5b7dda458f
--- /dev/null
+++ b/gnu/packages/patches/docbook-xsl-support-old-url.patch
@@ -0,0 +1,17 @@
+Docbook 1.79.2 makes very few changes apart from changing the canonical URL
+to cdn.docbook.org.  This patch adds support for the previous URL to avoid
+breaking packages that still use that.
+
+Adapted from Debian:
+https://salsa.debian.org/debian/docbook-xsl/-/blob/master/debian/patches/0005-catalog.xml-Compatibility-with-1.79.1-or-earlier.patch
+
+--- a/catalog.xml
++++ b/catalog.xml
+@@ -5,4 +5,7 @@
+   <rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl/current/" rewritePrefix="./"/>
+   <rewriteURI uriStartString="http://cdn.docbook.org/release/xsl/1.79.2/" rewritePrefix="./"/>
+   <rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl/1.79.2/" rewritePrefix="./"/>
++  <!-- Also support old URI of v1.79.1 or earlier -->
++  <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="./"/>
++  <rewriteSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/current/" rewritePrefix="./"/>
+ </catalog>
diff --git a/gnu/packages/patches/doxygen-1.8.17-runtests.patch b/gnu/packages/patches/doxygen-1.8.17-runtests.patch
deleted file mode 100644
index 0340c72448..0000000000
--- a/gnu/packages/patches/doxygen-1.8.17-runtests.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-1.8.17 was released with a broken test runner.
-
-https://github.com/doxygen/doxygen/issues/7464
-
-Taken from upstream:
-https://github.com/doxygen/doxygen/commit/cd9dee013dc749a10bbe019c350e0e62b6635795
-
-diff --git a/testing/runtests.py b/testing/runtests.py
-index a4118b865..10fe50214 100755
---- a/testing/runtests.py
-+++ b/testing/runtests.py
-@@ -3,6 +3,7 @@
- from __future__ import print_function
- import argparse, glob, itertools, re, shutil, os, sys
- import subprocess
-+import shlex
- 
- config_reg = re.compile('.*\/\/\s*(?P<name>\S+):\s*(?P<value>.*)$')
- 
-@@ -28,10 +29,10 @@ def xpopen(cmd, cmd1="",encoding='utf-8-sig', getStderr=False):
- 		return os.popen(cmd).read() # Python 2 without encoding
- 	else:
- 		if (getStderr):
--			proc = subprocess.run(cmd1,encoding=encoding,capture_output=True) # Python 3 with encoding
--			return proc.stderr
-+			proc = subprocess.Popen(shlex.split(cmd1),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
-+			return proc.stderr.read()
- 		else:
--			proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
-+			proc = subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
- 			return proc.stdout.read()
- 
- class Tester:
-@@ -137,7 +138,7 @@ def prepare_test(self):
- 				print('GENERATE_DOCBOOK=NO', file=f)
- 			if (self.args.xhtml):
- 				print('GENERATE_HTML=YES', file=f)
--			# HTML_OUTPUT can also be set locally
-+			# HTML_OUTPUT can also have been set locally
- 			print('HTML_OUTPUT=%s/html' % self.test_out, file=f)
- 			print('HTML_FILE_EXTENSION=.xhtml', file=f)
- 			if (self.args.pdf):
-@@ -184,7 +185,7 @@ def update_test(self,testmgr):
- 					print('Non-existing file %s after \'check:\' statement' % check_file)
- 					return
- 				# convert output to canonical form
--				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
-+				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file))
- 				if data:
- 					# strip version
- 					data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n')
-@@ -326,7 +327,7 @@ def perform_test(self,testmgr):
- 			tests.append(glob.glob('%s/*.xml' % (docbook_output)))
- 			tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
- 			tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
--			exe_string = '%s --nonet --postvalid %s' % (self.args.xmllint,tests)
-+			exe_string = '%s --noout --nonet --postvalid %s' % (self.args.xmllint,tests)
- 			exe_string1 = exe_string
- 			exe_string += ' %s' % (redirx)
- 			exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
-@@ -346,7 +347,11 @@ def perform_test(self,testmgr):
- 				redirx=' 2> %s/temp >nul:'%html_output
- 			else:
- 				redirx='2>%s/temp >/dev/null'%html_output
--			exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml' % (self.args.xmllint,html_output)
-+			check_file = []
-+			check_file.append(glob.glob('%s/*.xhtml' % (html_output)))
-+			check_file.append(glob.glob('%s/*/*/*.xhtml' % (html_output)))
-+			check_file = ' '.join(list(itertools.chain.from_iterable(check_file))).replace(self.args.outputdir +'/','').replace('\\','/')
-+			exe_string = '%s --noout --path dtd --nonet --postvalid %s' % (self.args.xmllint,check_file)
- 			exe_string1 = exe_string
- 			exe_string += ' %s' % (redirx)
- 			exe_string += ' %s more "%s/temp"' % (separ,html_output)
diff --git a/gnu/packages/patches/doxygen-test.patch b/gnu/packages/patches/doxygen-test.patch
deleted file mode 100644
index 1c0d4eb946..0000000000
--- a/gnu/packages/patches/doxygen-test.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Modify the expected outcome of test 012 so that it passes when bibtex is
-not in the path, as we do not wish to add texlive as an input just for this
-test.
-
-diff -u -r doxygen-1.8.7.orig/testing/012/citelist.xml doxygen-1.8.7/testing/012/citelist.xml
---- doxygen-1.8.7.orig/testing/012/citelist.xml	2014-04-24 23:43:34.000000000 +0200
-+++ doxygen-1.8.7/testing/012/citelist.xml	2014-04-24 23:49:43.000000000 +0200
-@@ -6,38 +6,6 @@
-     <briefdescription>
-     </briefdescription>
-     <detaileddescription>
--      <para>
--        <variablelist>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_Be09"/>[1]</term>
--          </varlistentry>
--          <listitem>
--            <para>P.<nonbreakablespace/>Belotti. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_5">Disjunctive cuts for non-convex MINLP</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 117<ndash/>144.</para>
--            <para/>
--          </listitem>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_BertholdHeinzVigerske2009"/>[2]</term>
--          </varlistentry>
--          <listitem>
--            <para>T.<nonbreakablespace/>Berthold, S.<nonbreakablespace/>Heinz, and S.<nonbreakablespace/>Vigerske. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_15">Extending a CIP framework to solve MIQCPs</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 427<ndash/>444.</para>
--            <para/>
--          </listitem>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_knuth79"/>[3]</term>
--          </varlistentry>
--          <listitem>
--            <para>Donald<nonbreakablespace/>E. Knuth. <emphasis>Tex and Metafont, New Directions in Typesetting</emphasis>. American Mathematical Society and Digital Press, Stanford, 1979.</para>
--            <para/>
--          </listitem>
--          <varlistentry>
--            <term><anchor id="citelist_1CITEREF_LeLe12"/>[4]</term>
--          </varlistentry>
--          <listitem>
--            <para>Jon Lee and Sven Leyffer, editors. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3"><emphasis>Mixed Integer Nonlinear Programming</emphasis></ulink>, volume 154 of <emphasis>The IMA Volumes in Mathematics and its Applications</emphasis>. Springer, 2012.</para>
--            <para/>
--          </listitem>
--        </variablelist>
--      </para>
-     </detaileddescription>
-   </compounddef>
- </doxygen>
-diff -u -r doxygen-1.8.7.orig/testing/012/indexpage.xml doxygen-1.8.7/testing/012/indexpage.xml
---- doxygen-1.8.7.orig/testing/012/indexpage.xml	2014-04-24 23:43:34.000000000 +0200
-+++ doxygen-1.8.7/testing/012/indexpage.xml	2014-04-24 23:44:05.000000000 +0200
-@@ -6,8 +6,8 @@
-     <briefdescription>
-     </briefdescription>
-     <detaileddescription>
--      <para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[3]</ref> for more info.</para>
--      <para>Other references with cross references see <ref refid="citelist_1CITEREF_Be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_BertholdHeinzVigerske2009" kindref="member">[2]</ref> for more info. </para>
-+      <para>See knuth79 for more info.</para>
-+      <para>Other references with cross references see Be09 and BertholdHeinzVigerske2009 for more info. </para>
-     </detaileddescription>
-   </compounddef>
- </doxygen>
diff --git a/gnu/packages/patches/evolution-data-server-printableoptions.patch b/gnu/packages/patches/evolution-data-server-printableoptions.patch
new file mode 100644
index 0000000000..e40c5f3875
--- /dev/null
+++ b/gnu/packages/patches/evolution-data-server-printableoptions.patch
@@ -0,0 +1,57 @@
+Patch adapted from upstream c3915bb99638c1ccf57217097b14b5db69bcac96
+by Milan Crha:
+
+    PrintableOptions.cmake: Correct variable name comparison
+    
+    CMake 3.20.1 errors out with:
+    
+    CMake Error at cmake/modules/PrintableOptions.cmake:38 (message):
+       variable name cannot be empty
+     Call Stack (most recent call first):
+       CMakeLists.txt:152 (add_printable_variable)
+    
+    Change how the parameter value is compared, to fix it.
+
+--- a/cmake/modules/PrintableOptions.cmake
++++ b/cmake/modules/PrintableOptions.cmake
+@@ -19,32 +19,32 @@
+ #    prints all the build options previously added with the above functions
+ 
+ macro(add_printable_variable_bare _name)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "variable name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	list(APPEND _printable_options ${_name})
+ endmacro()
+ 
+ macro(add_printable_option _name _description _default_value)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "option name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	option(${_name} ${_description} ${_default_value})
+ 	add_printable_variable_bare(${_name})
+ endmacro()
+ 
+ macro(add_printable_variable _name _description _default_value)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "variable name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	set(${_name} ${_default_value} CACHE STRING ${_description})
+ 	add_printable_variable_bare(${_name})
+ endmacro()
+ 
+ macro(add_printable_variable_path _name _description _default_value)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "path variable name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	set(${_name} ${_default_value} CACHE PATH ${_description})
+ 	add_printable_variable_bare(${_name})
+ endmacro()
diff --git a/gnu/packages/patches/evolution-printableoptions.patch b/gnu/packages/patches/evolution-printableoptions.patch
new file mode 100644
index 0000000000..55bee381f4
--- /dev/null
+++ b/gnu/packages/patches/evolution-printableoptions.patch
@@ -0,0 +1,57 @@
+Patch adapted from evolution-data-server's
+c3915bb99638c1ccf57217097b14b5db69bcac96 upstream patch by Milan Crha:
+
+    PrintableOptions.cmake: Correct variable name comparison
+    
+    CMake 3.20.1 errors out with:
+    
+    CMake Error at cmake/modules/PrintableOptions.cmake:38 (message):
+       variable name cannot be empty
+     Call Stack (most recent call first):
+       CMakeLists.txt:152 (add_printable_variable)
+    
+    Change how the parameter value is compared, to fix it.
+
+--- a/cmake/modules/PrintableOptions.cmake
++++ b/cmake/modules/PrintableOptions.cmake
+@@ -19,32 +19,32 @@
+ #    prints all the build options previously added with the above functions
+ 
+ macro(add_printable_variable_bare _name)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "variable name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	list(APPEND _printable_options ${_name})
+ endmacro()
+ 
+ macro(add_printable_option _name _description _default_value)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "option name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	option(${_name} ${_description} ${_default_value})
+ 	add_printable_variable_bare(${_name})
+ endmacro()
+ 
+ macro(add_printable_variable _name _description _default_value)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "variable name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	set(${_name} ${_default_value} CACHE STRING ${_description})
+ 	add_printable_variable_bare(${_name})
+ endmacro()
+ 
+ macro(add_printable_variable_path _name _description _default_value)
+-	if(_name STREQUAL "")
++	if("${_name}" STREQUAL "")
+ 		message(FATAL_ERROR "path variable name cannot be empty")
+-	endif(_name STREQUAL "")
++	endif("${_name}" STREQUAL "")
+ 	set(${_name} ${_default_value} CACHE PATH ${_description})
+ 	add_printable_variable_bare(${_name})
+ endmacro()
diff --git a/gnu/packages/patches/findutils-test-rwlock-threads.patch b/gnu/packages/patches/findutils-test-rwlock-threads.patch
deleted file mode 100644
index 3062577c21..0000000000
--- a/gnu/packages/patches/findutils-test-rwlock-threads.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Skip "test-rwlock1" when multithreading is disabled, which is the case
-during bootstrapping on architectures not supported by GNU Mes.
-
-Taken from upstream gnulib:
-https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=fdff8bd09a7f053381f8bdb107ab5280b7c95959
-
-diff --git a/gnulib-tests/test-rwlock1.c b/gnulib-tests/test-rwlock1.c
---- a/gnulib-tests/test-rwlock1.c
-+++ b/gnulib-tests/test-rwlock1.c
-@@ -21,6 +21,8 @@
- 
- #include <config.h>
- 
-+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
-+
- #include "glthread/lock.h"
- 
- #include <errno.h>
-@@ -151,3 +153,18 @@ main ()
-       sleep (1);
-     }
- }
-+
-+#else
-+
-+/* No multithreading available.  */
-+
-+#include <stdio.h>
-+
-+int
-+main ()
-+{
-+  fputs ("Skipping test: multithreading not enabled\n", stderr);
-+  return 77;
-+}
-+
-+#endif
-
diff --git a/gnu/packages/patches/fontconfig-cache-ignore-mtime.patch b/gnu/packages/patches/fontconfig-cache-ignore-mtime.patch
new file mode 100644
index 0000000000..b6e942ee10
--- /dev/null
+++ b/gnu/packages/patches/fontconfig-cache-ignore-mtime.patch
@@ -0,0 +1,15 @@
+Pretend that stat's mtime is broken, so that the fontconfig cache does not
+depend upon modification time to determine if a cache is stale.
+
+diff --git a/src/fcstat.c b/src/fcstat.c
+index 5a2bd7c..d603a96 100644
+--- a/src/fcstat.c
++++ b/src/fcstat.c
+@@ -431,6 +431,7 @@ FcIsFsMmapSafe (int fd)
+ FcBool
+ FcIsFsMtimeBroken (const FcChar8 *dir)
+ {
++    return FcTrue;
+     int fd = FcOpen ((const char *) dir, O_RDONLY);
+ 
+     if (fd != -1)
diff --git a/gnu/packages/patches/fontconfig-hurd-path-max.patch b/gnu/packages/patches/fontconfig-hurd-path-max.patch
deleted file mode 100644
index f804e6801f..0000000000
--- a/gnu/packages/patches/fontconfig-hurd-path-max.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Avoid usage of PATH_MAX.
-
-Taken from https://salsa.debian.org/freedesktop-team/fontconfig/-/blob/master/debian/patches/path_max.patch
-
-Index: fontconfig-2.13.1/src/fccfg.c
-===================================================================
---- fontconfig-2.13.1.orig/src/fccfg.c
-+++ fontconfig-2.13.1/src/fccfg.c
-@@ -2231,7 +2231,7 @@ FcConfigRealFilename (FcConfig		*config,
- 
-     if (n)
-     {
--	FcChar8 buf[PATH_MAX];
-+	FcChar8 buf[FC_PATH_MAX];
- 	ssize_t len;
- 
- 	if (sysroot)
diff --git a/gnu/packages/patches/freeglut-gcc-compat.patch b/gnu/packages/patches/freeglut-gcc-compat.patch
new file mode 100644
index 0000000000..126bbd89f4
--- /dev/null
+++ b/gnu/packages/patches/freeglut-gcc-compat.patch
@@ -0,0 +1,53 @@
+Fix build failure with GCC 10.
+
+Taken from upstream:
+https://github.com/dcnieho/FreeGLUT/commit/b9998bbc1e1c329f6bf69c24606a2be7a4973b8c
+
+diff --git a/src/fg_gl2.c b/src/fg_gl2.c
+--- a/src/fg_gl2.c
++++ b/src/fg_gl2.c
+@@ -27,6 +27,20 @@
+ #include "fg_internal.h"
+ #include "fg_gl2.h"
+ 
++#ifndef GL_ES_VERSION_2_0
++/* GLES2 has the corresponding entry points built-in, and these fgh-prefixed
++ * names are defined in fg_gl2.h header to reference them, for any other case,
++ * define them as function pointers here.
++ */
++FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++FGH_PFNGLBUFFERDATAPROC fghBufferData;
++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++#endif
++
+ void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
+   if (fgStructure.CurrentWindow != NULL)
+     fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
+diff --git a/src/fg_gl2.h b/src/fg_gl2.h
+--- a/src/fg_gl2.h
++++ b/src/fg_gl2.h
+@@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+ typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
+ typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+ 
+-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+-FGH_PFNGLBUFFERDATAPROC fghBufferData;
+-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
++extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+ 
+ #    endif
+ 
diff --git a/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch b/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch
deleted file mode 100644
index 1358e30633..0000000000
--- a/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Do not override PYTHONPATH when calling Python code from the Haskell
-daemons.  This is necessary because the Python library dependencies are
-only available through PYTHONPATH.
-
-diff --git a/src/Ganeti/Query/Exec.hs b/src/Ganeti/Query/Exec.hs
---- a/src/Ganeti/Query/Exec.hs
-+++ b/src/Ganeti/Query/Exec.hs
-@@ -99,12 +99,10 @@ spawnJobProcess jid = withErrorLogAt CRITICAL (show jid) $
-   do
-     use_debug <- isDebugMode
-     env_ <- (M.toList . M.insert "GNT_DEBUG" (if use_debug then "1" else "0")
--            . M.insert "PYTHONPATH" AC.pythondir
-             . M.fromList)
-            `liftM` getEnvironment
-     execPy <- P.jqueueExecutorPy
-     logDebug $ "Executing " ++ AC.pythonPath ++ " " ++ execPy
--               ++ " with PYTHONPATH=" ++ AC.pythondir
- 
-     (master, child) <- pipeClient connectConfig
-     let (rh, wh) = clientToHandle child
-
diff --git a/gnu/packages/patches/gcc-10-cross-environment-variables.patch b/gnu/packages/patches/gcc-10-cross-environment-variables.patch
new file mode 100644
index 0000000000..414198657d
--- /dev/null
+++ b/gnu/packages/patches/gcc-10-cross-environment-variables.patch
@@ -0,0 +1,51 @@
+Search path environment variables for cross-compilers.  See the discussion
+at <http://gcc.gnu.org/ml/gcc/2013-02/msg00124.html>.
+
+Note: Touch 'C_INCLUDE_PATH' et al. rather than 'CPATH', as discussed
+at <http://bugs.gnu.org/22186>.
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4474,7 +4474,7 @@ process_command (unsigned int decoded_options_count,
+     }
+ 
+   temp = env.get (LIBRARY_PATH_ENV);
+-  if (temp && *cross_compile == '0')
++  if (temp)
+     {
+       const char *startp, *endp;
+       char *nstore = (char *) alloca (strlen (temp) + 3);
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -472,8 +472,8 @@ register_include_chains (cpp_reader *pfile, const char *sysroot,
+ 			 int stdinc, int cxx_stdinc, int verbose)
+ {
+   static const char *const lang_env_vars[] =
+-    { "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
+-      "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH" };
++    { "CROSS_C_INCLUDE_PATH", "CROSS_CPLUS_INCLUDE_PATH",
++      "CROSS_OBJC_INCLUDE_PATH", "CROSS_OBJCPLUS_INCLUDE_PATH" };
+   cpp_options *cpp_opts = cpp_get_options (pfile);
+   size_t idx = (cpp_opts->objc ? 2: 0);
+ 
+@@ -484,7 +484,7 @@ register_include_chains (cpp_reader *pfile, const char *sysroot,
+ 
+   /* CPATH and language-dependent environment variables may add to the
+      include chain.  */
+-  add_env_var_paths ("CPATH", INC_BRACKET);
++  add_env_var_paths ("CROSS_CPATH", INC_BRACKET);
+   add_env_var_paths (lang_env_vars[idx], INC_SYSTEM);
+ 
+   target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc);
+diff --git a/gcc/system.h b/gcc/system.h
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -1244,4 +1244,6 @@ void gcc_stablesort (void *, size_t, size_t,
+    of the number.  */
+ #define PRsa(n) "%" #n PRIu64 "%c"
+ 
++#define LIBRARY_PATH_ENV "CROSS_LIBRARY_PATH"
++
+ #endif /* ! GCC_SYSTEM_H */
diff --git a/gnu/packages/patches/gcc-cross-gxx-include-dir.patch b/gnu/packages/patches/gcc-cross-gxx-include-dir.patch
new file mode 100644
index 0000000000..d6c4ffddc4
--- /dev/null
+++ b/gnu/packages/patches/gcc-cross-gxx-include-dir.patch
@@ -0,0 +1,73 @@
+This patch reverts upstream commit b4d3485e4fc1d:
+
+  https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=b4d3485e4fc1d029e620a59deb54b3f4f3f6b209
+
+Otherwise, GCC ends up searching the wrong target directory for cross-headers.
+
+diff --git a/gcc/configure b/gcc/configure
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -3689,11 +3689,6 @@ esac
+ fi
+ 
+ 
+-# If both --with-sysroot and --with-gxx-include-dir are passed, we interpolate
+-# the former in the latter and, upon success, compute gcc_gxx_include_dir as
+-# relative to the sysroot.
+-gcc_gxx_include_dir_add_sysroot=0
+-
+ # This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO.
+ if test x${gcc_gxx_include_dir} = x; then
+   if test x${enable_version_specific_runtime_libs} = xyes; then
+@@ -3705,10 +3700,15 @@ if test x${gcc_gxx_include_dir} = x; then
+     fi
+     gcc_gxx_include_dir="\$(libsubdir)/\$(libsubdir_to_prefix)$libstdcxx_incdir"
+   fi
+-elif test "${with_sysroot+set}" = set; then
++fi
++
++gcc_gxx_include_dir_add_sysroot=0
++if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 715fcba0482..88136e232df 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -204,11 +204,6 @@ no)	;;
+ *)	gcc_gxx_include_dir=$with_gxx_include_dir ;;
+ esac])
+ 
+-# If both --with-sysroot and --with-gxx-include-dir are passed, we interpolate
+-# the former in the latter and, upon success, compute gcc_gxx_include_dir as
+-# relative to the sysroot.
+-gcc_gxx_include_dir_add_sysroot=0
+-
+ # This logic must match libstdc++-v3/acinclude.m4:GLIBCXX_EXPORT_INSTALL_INFO.
+ if test x${gcc_gxx_include_dir} = x; then
+   if test x${enable_version_specific_runtime_libs} = xyes; then
+@@ -220,10 +215,15 @@ if test x${gcc_gxx_include_dir} = x; then
+     fi
+     gcc_gxx_include_dir="\$(libsubdir)/\$(libsubdir_to_prefix)$libstdcxx_incdir"
+   fi
+-elif test "${with_sysroot+set}" = set; then
++fi
++
++gcc_gxx_include_dir_add_sysroot=0
++if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
diff --git a/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch b/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch
new file mode 100644
index 0000000000..6329b129d3
--- /dev/null
+++ b/gnu/packages/patches/gd-Revert-fix-303-gdlib.pc-use-Requires-instead-of-Libs.patch
@@ -0,0 +1,179 @@
+From 9b31dfda73ee2d1b56b3f0dcfd3246c2faa592fe Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout@zaclys.net>
+Date: Sun, 28 Mar 2021 19:47:25 +0200
+Subject: [PATCH] Revert "fix #303: gdlib.pc: use Requires instead of Libs
+ (#537)"
+
+This reverts commit 28ecfe77c817aff8ce56422d3e4e8533a281bc76.
+---
+ CMakeLists.txt        | 12 ------------
+ config/gdlib.pc.cmake |  4 +---
+ config/gdlib.pc.in    |  4 +---
+ configure.ac          | 11 +----------
+ src/CMakeLists.txt    |  6 ------
+ 5 files changed, 3 insertions(+), 34 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 57cd95d..6bd0c73 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -53,8 +53,6 @@ SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+   "Single Directory for all static libraries."
+   )
+ 
+-SET(PKG_REQUIRES_PRIVATES "")
+-
+ if (USE_EXT_GD)
+ 	message("Using GD at: ${USE_EXT_GD}")
+ 	INCLUDE_DIRECTORIES(BEFORE ${GD_INCLUDE_DIR})
+@@ -170,13 +168,11 @@ else (USE_EXT_GD)
+ 		INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
+ 		SET(HAVE_FT2BUILD_H 1)
+ 		SET(HAVE_LIBFREETYPE 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES freetype2)
+ 	ENDIF(FREETYPE_FOUND)
+ 
+ 	IF(ZLIB_FOUND)
+ 		INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
+ 		SET(HAVE_LIBZ 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES zlib)
+ 	ENDIF(ZLIB_FOUND)
+ 
+ 	IF(WEBP_FOUND)
+@@ -192,7 +188,6 @@ else (USE_EXT_GD)
+ 	IF(PNG_FOUND)
+ 		INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
+ 		SET(HAVE_LIBPNG 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES libpng)
+ 	ENDIF(PNG_FOUND)
+ 
+ 	IF(ICONV_FOUND)
+@@ -209,25 +204,21 @@ else (USE_EXT_GD)
+ 	IF(XPM_FOUND)
+ 		INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR})
+ 		SET(HAVE_LIBXPM 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES xpm)
+ 	ENDIF(XPM_FOUND)
+ 
+ 	IF(JPEG_FOUND)
+ 		INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
+ 		SET(HAVE_LIBJPEG 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES libjpeg)
+ 	ENDIF(JPEG_FOUND)
+ 
+ 	IF(TIFF_FOUND)
+ 		INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
+ 		SET(HAVE_LIBTIFF 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES libtiff-4)
+ 	ENDIF(TIFF_FOUND)
+ 
+ 	IF(FONTCONFIG_FOUND)
+ 		INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR})
+ 		SET(HAVE_LIBFONTCONFIG 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVATES fontconfig)
+ 	ELSE (FONTCONFIG_FOUND)
+ 		SET(FONTCONFIG_LIBRARY "")
+ 		SET(FONTCONFIG_INCLUDE_DIR "")
+@@ -236,11 +227,8 @@ else (USE_EXT_GD)
+ 
+ 	IF(RAQM_FOUND)
+ 		INCLUDE_DIRECTORIES(${RAQM_INCLUDE_DIR})
+-		SET(HAVE_RAQM 1)
+-		LIST(APPEND PKG_REQUIRES_PRIVAES raqm)
+ 	ENDIF(RAQM_FOUND)
+ 
+-	string(REPLACE ";" ", " PKG_REQUIRES_PRIVATES "${PKG_REQUIRES_PRIVATES}")
+ 	SET(HAVE_CONFIG_H 1)
+ 
+ 	ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+diff --git a/config/gdlib.pc.cmake b/config/gdlib.pc.cmake
+index 5fc8af4..d1a0dda 100644
+--- a/config/gdlib.pc.cmake
++++ b/config/gdlib.pc.cmake
+@@ -6,8 +6,6 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+ Name: gd
+ Description: GD graphics library
+ Version: @GDLIB_VERSION@
+-Requires:
+-Requires.private: @PKG_REQUIRES_PRIVATES@
+ Cflags: -I${includedir}
+-Libs.private: @LIBS_PRIVATES@
++Libs.private: @LIBGD_DEP_LIBS@
+ Libs: -L${libdir} -lgd
+diff --git a/config/gdlib.pc.in b/config/gdlib.pc.in
+index d6bc375..b980a60 100644
+--- a/config/gdlib.pc.in
++++ b/config/gdlib.pc.in
+@@ -6,8 +6,6 @@ includedir=@includedir@
+ Name: gd
+ Description: GD graphics library
+ Version: @VERSION@
+-Requires:
+-Requires.private: @PKG_REQUIRES_PRIVATES@
+ Cflags: -I${includedir}
+-Libs.private: @LIBS_PRIVATES@ @LIBICONV@
++Libs.private: @LIBS@ @LIBICONV@
+ Libs: -L${libdir} -lgd
+diff --git a/configure.ac b/configure.ac
+index 535db68..329c99c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -33,9 +33,6 @@ AC_SUBST(GDLIB_LT_CURRENT)
+ AC_SUBST(GDLIB_LT_REVISION)
+ AC_SUBST(GDLIB_LT_AGE)
+ 
+-AC_SUBST(LIBS_PRIVATES)
+-AC_SUBST(PKG_REQUIRES_PRIVATES)
+-
+ AM_INIT_AUTOMAKE([1.11 foreign dist-xz -Wall -Werror subdir-objects])
+ AC_CONFIG_HEADERS([src/config.h:src/config.hin])
+ 
+@@ -133,7 +130,6 @@ m4_define([GD_LIB_CHECK], [dnl
+   AC_MSG_RESULT([$gd_with_lib])
+ 
+   gd_found_lib=no
+-  gd_require_pkg_name=""
+   if test "$gd_with_lib" != "no"; then
+     save_CPPFLAGS=$CPPFLAGS
+     save_LDFLAGS=$LDFLAGS
+@@ -165,11 +161,6 @@ m4_define([GD_LIB_CHECK], [dnl
+       $1][_CFLAGS="$gd_lib_cflags $][$1][_CFLAGS"
+       AS_VAR_APPEND([LIBS], [" $][$1][_LIBS"])
+       AS_VAR_APPEND([CPPFLAGS], [" $][$1][_CFLAGS"])
+-      if test -z "$gd_require_pkg_name"; then
+-        AS_VAR_APPEND([LIBS_PRIVATES], [" $][$1][_LIBS"])
+-      else
+-        AS_VAR_APPEND([PKG_REQUIRES_PRIVATES], ["  $gd_require_pkg_name"])
+-      fi
+     elif test "$gd_with_lib" = "yes"; then
+       AC_MSG_ERROR([$3 requested but not found])
+     else
+@@ -189,7 +180,7 @@ dnl $4 - pkg-config module to look for
+ dnl $5 - fallback test for the feature
+ m4_define([GD_LIB_PKG_CHECK], [dnl
+   GD_LIB_CHECK([$1], [$2], [$3], [dnl
+-    PKG_CHECK_MODULES([$1], [$4], [gd_found_lib=yes gd_require_pkg_name="$4"], [$5])
++    PKG_CHECK_MODULES([$1], [$4], [gd_found_lib=yes], [$5])
+   ])
+ ])
+ 
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 509c422..49adbd6 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -142,12 +142,6 @@ if (BUILD_STATIC_LIBS)
+ 	target_link_libraries(${GD_LIB_STATIC} ${LIBGD_DEP_LIBS})
+ endif()
+ 
+-SET(LIBS_PRIVATES
+-	${ICONV_LIBRARIES}
+-	${LIQ_LIBRARIES}
+-	${WEBP_LIBRARIES}
+-)
+-
+ set(GD_PROGRAMS gdcmpgif)
+ 
+ if (PNG_FOUND)
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/gdb-9.2-sim-ppc-fno-common.patch b/gnu/packages/patches/gdb-9.2-sim-ppc-fno-common.patch
new file mode 100644
index 0000000000..dae126f7d3
--- /dev/null
+++ b/gnu/packages/patches/gdb-9.2-sim-ppc-fno-common.patch
@@ -0,0 +1,123 @@
+From a2d12a56679db64d96e02a65933b2911f14c52a2 Mon Sep 17 00:00:00 2001
+From: Sebastian Huber <sebastian.huber@embedded-brains.de>
+Date: Wed, 1 Jul 2020 19:29:55 +0200
+Subject: [PATCH] sim/ppc: Fix linker error with -fno-common
+
+GCC 10 enables -fno-common by default.  This resulted in a multiple
+definition linker error since global variables were declared and defined
+in a header file:
+
+  ld: ld-insn.o:sim/ppc/ld-insn.h:221: multiple definition of
+  `max_model_fields_len'; igen.o:sim/ppc/ld-insn.h:221: first defined here
+
+sim/ppc
+
+	* ld-insn.h (last_model, last_model_data, last_model_function,
+	last_model_internal, last_model_macro, last_model_static):
+	Delete.
+	(max_model_fields_len, model_data, model_functions,
+	model_internal, model_macros, model_static, models): Declare, but do not
+	define.
+	* ld-insn.c (last_model, last_model_data, last_model_function,
+	last_model_internal, last_model_macro, last_model_static,
+	max_model_fields_len, model_data, model_functions,
+	model_internal, model_macros, model_static, models): Define.
+
+(cherry picked from commit ad8464f799a4c96c7ab8bdfec3f95846cf54f9b0)
+---
+
+This patch is a trivial backport from the upstream commit mentioned above.
+Only the ChangeLog had to be adapted.
+
+ sim/ppc/ChangeLog | 13 +++++++++++++
+ sim/ppc/ld-insn.c | 18 ++++++++++++++++++
+ sim/ppc/ld-insn.h | 24 +++++++-----------------
+ 3 files changed, 38 insertions(+), 17 deletions(-)
+
+diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
+index 665c7606d9eb..8f7150cee6b9 100644
+--- a/sim/ppc/ChangeLog
++++ b/sim/ppc/ChangeLog
+@@ -1,3 +1,16 @@
++2020-07-03  Sebastian Huber  <sebastian.huber@embedded-brains.de>
++
++	* ld-insn.h (last_model, last_model_data, last_model_function,
++	last_model_internal, last_model_macro, last_model_static):
++	Delete.
++	(max_model_fields_len, model_data, model_functions,
++	model_internal, model_macros, model_static, models): Declare, but do not
++	define.
++	* ld-insn.c (last_model, last_model_data, last_model_function,
++	last_model_internal, last_model_macro, last_model_static,
++	max_model_fields_len, model_data, model_functions,
++	model_internal, model_macros, model_static, models): Define.
++
+ 2019-01-26  Tom Tromey  <tom@tromey.com>
+ 
+ 	* Makefile.in (version.c): Use sim's create-version.sh.
+diff --git a/sim/ppc/ld-insn.c b/sim/ppc/ld-insn.c
+index e39131ca1334..585071a861ff 100644
+--- a/sim/ppc/ld-insn.c
++++ b/sim/ppc/ld-insn.c
+@@ -28,6 +28,24 @@
+ 
+ #include "igen.h"
+ 
++static model *last_model;
++
++static insn *last_model_macro;
++static insn *last_model_function;
++static insn *last_model_internal;
++static insn *last_model_static;
++static insn *last_model_data;
++
++model *models;
++
++insn *model_macros;
++insn *model_functions;
++insn *model_internal;
++insn *model_static;
++insn *model_data;
++
++int max_model_fields_len;
++
+ static void
+ update_depth(insn_table *entry,
+ 	     lf *file,
+diff --git a/sim/ppc/ld-insn.h b/sim/ppc/ld-insn.h
+index 88318ffa2b34..52baeaa2d846 100644
+--- a/sim/ppc/ld-insn.h
++++ b/sim/ppc/ld-insn.h
+@@ -200,25 +200,15 @@ extern insn_table *load_insn_table
+  table_include *includes,
+  cache_table **cache_rules);
+ 
+-model *models;
+-model *last_model;
++extern model *models;
+ 
+-insn *model_macros;
+-insn *last_model_macro;
++extern insn *model_macros;
++extern insn *model_functions;
++extern insn *model_internal;
++extern insn *model_static;
++extern insn *model_data;
+ 
+-insn *model_functions;
+-insn *last_model_function;
+-
+-insn *model_internal;
+-insn *last_model_internal;
+-
+-insn *model_static;
+-insn *last_model_static;
+-
+-insn *model_data;
+-insn *last_model_data;
+-
+-int max_model_fields_len;
++extern int max_model_fields_len;
+ 
+ extern void insn_table_insert_insn
+ (insn_table *table,
diff --git a/gnu/packages/patches/gdb-hurd.patch b/gnu/packages/patches/gdb-hurd.patch
index 0af8d4dc28..c4763cecbd 100644
--- a/gnu/packages/patches/gdb-hurd.patch
+++ b/gnu/packages/patches/gdb-hurd.patch
@@ -1,69 +1,30 @@
-Taken from upstream, removed ChangeLog.
+Taken from upstream.
 
-From 6930bffe3373690b3431d6291f9f7c116d6a1ec4 Mon Sep 17 00:00:00 2001
+From dca11eb872c96f86388890b3750e450cc2a68700 Mon Sep 17 00:00:00 2001
 From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Date: Sat, 30 May 2020 18:35:59 +0000
-Subject: [PATCH] hurd: fix gnu_debug_flag type
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
+Date: Mon, 21 Dec 2020 16:01:07 +0000
+Subject: [PATCH] hurd: Fix getting VM_MIN/MAX_ADDRESS
 
-Fixes
-
-../../gdb/gnu-nat.c:96:6: error: conflicting declaration ‘bool gnu_debug_flag’
-   96 | bool gnu_debug_flag = false;
-../../gdb/gnu-nat.c: In function ‘void _initialize_gnu_nat()’:
-../../gdb/gnu-nat.c:3511:7: error: cannot
+gnu-nat.c was getting the inclusion of vm_param.h only by luck. We need
+to explicitly include it to be sure to get the definitions of
+VM_MIN/MAX_ADDRESS.
 
 gdb/ChangeLog:
 
-	* gnu-nat.h (gnu_debug_flag): Set type to bool.
+	* gnu-nat.c: Include <mach/vm_param.h>.
 ---
- gdb/ChangeLog | 4 ++++
- gdb/gnu-nat.h | 2 +-
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h
-index 77c57817b2..766f716587 100644
---- a/gdb/gnu-nat.h
-+++ b/gdb/gnu-nat.h
-@@ -111,7 +111,7 @@ extern char *proc_string (struct proc *proc);
- 	      __proc_pid (__proc), __proc->tid, \
- 	      host_address_to_string (__proc) , ##args); } while (0)
- 
--extern int gnu_debug_flag;
-+extern bool gnu_debug_flag;
- 
- #define debug(msg, args...) \
-  do { if (gnu_debug_flag) \
--- 
-Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
-Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
-
-commit 366f550a593c7e6bae3699a4b6d65fe937af5603
-Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Date:   Sat May 30 18:41:30 2020 +0000
-
-    hurd: add missing include
-    
-    Fixes
-    
-    ../../gdb/gnu-nat.c:2522:14: error: ‘target_gdbarch’ was not declared in this scope; did you mean ‘target_detach’?
-     2522 |    paddress (target_gdbarch (), memaddr), pulongest (len),
-    
-    gdb/Changelog:
-    
-            * gnu-nat.c: Include "gdbarch.h".
+ gdb/gnu-nat.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
-index 3b438a9a43..9b93488b41 100644
+index 1693ce0c43d..6f290be0d51 100644
 --- a/gdb/gnu-nat.c
 +++ b/gdb/gnu-nat.c
-@@ -64,6 +64,7 @@ extern "C"
- #include "language.h"
- #include "target.h"
- #include "gdbsupport/gdb_wait.h"
-+#include "gdbarch.h"
- #include "gdbcmd.h"
- #include "gdbcore.h"
- #include "gdbthread.h"
+@@ -32,6 +32,7 @@ extern "C"
+ #include <mach/message.h>
+ #include <mach/notify.h>
+ #include <mach/vm_attributes.h>
++#include <mach/vm_param.h>
+ 
+ #include <hurd.h>
+ #include <hurd/interrupt.h>
diff --git a/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch b/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch
deleted file mode 100644
index e6ac4de00b..0000000000
--- a/gnu/packages/patches/gdk-pixbuf-CVE-2020-29385.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Fix CVE-2020-29385.  Note that we omit the binary test file
-tests/test-images/fail/hang_114.gif from the following commit, to avoid
-requiring 'git' to apply the patch.
-
-
-From bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81 Mon Sep 17 00:00:00 2001
-From: Robert Ancell <robert.ancell@canonical.com>
-Date: Mon, 30 Nov 2020 12:26:12 +1300
-Subject: [PATCH] gif: Fix LZW decoder accepting invalid LZW code.
-
-The code value after a reset wasn't being validated, which means we would
-accept invalid codes. This could cause an infinite loop in the decoder.
-
-Fixes CVE-2020-29385
-
-Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/164
----
- gdk-pixbuf/lzw.c                    |  13 +++++++------
- tests/test-images/fail/hang_114.gif | Bin 0 -> 5561 bytes
- 2 files changed, 7 insertions(+), 6 deletions(-)
- create mode 100644 tests/test-images/fail/hang_114.gif
-
-diff --git a/gdk-pixbuf/lzw.c b/gdk-pixbuf/lzw.c
-index 9e052a6f7..105daf2b1 100644
---- a/gdk-pixbuf/lzw.c
-+++ b/gdk-pixbuf/lzw.c
-@@ -195,19 +195,20 @@ lzw_decoder_feed (LZWDecoder *self,
-                                 if (self->last_code != self->clear_code && self->code_table_size < MAX_CODES) {
-                                         if (self->code < self->code_table_size)
-                                                 add_code (self, self->code);
--                                        else if (self->code == self->code_table_size)
-+                                        else
-                                                 add_code (self, self->last_code);
--                                        else {
--                                                /* Invalid code received - just stop here */
--                                                self->last_code = self->eoi_code;
--                                                return output_length;
--                                        }
- 
-                                         /* When table is full increase code size */
-                                         if (self->code_table_size == (1 << self->code_size) && self->code_size < LZW_CODE_MAX)
-                                                 self->code_size++;
-                                 }
- 
-+                                /* Invalid code received - just stop here */
-+                                if (self->code >= self->code_table_size) {
-+                                        self->last_code = self->eoi_code;
-+                                        return output_length;
-+                                }
-+
-                                 /* Convert codeword into indexes */
-                                 n_written += write_indexes (self, output + n_written, output_length - n_written);
-                         }
diff --git a/gnu/packages/patches/gdm-default-session.patch b/gnu/packages/patches/gdm-default-session.patch
index 9ab2829cdb..3ff8d0da7c 100644
--- a/gnu/packages/patches/gdm-default-session.patch
+++ b/gnu/packages/patches/gdm-default-session.patch
@@ -4,11 +4,9 @@ and not in the directories listed in $XDG_DATA_DIRS.  The latter includes
 /run/current-system/profile, and only then.
 
 Fixes <https://bugs.gnu.org/37831>.
-
-diff -ur a/daemon/gdm-session.c b/daemon/gdm-session.c
---- a/daemon/gdm-session.c	2019-09-25 10:40:24.000000000 -0400
-+++ b/daemon/gdm-session.c	2020-04-18 18:30:02.671856808 -0400
-@@ -348,24 +348,18 @@
+--- a/daemon/gdm-session.c	2021-07-23 15:16:15.164201000 +0000
++++ b/daemon/gdm-session.c	2021-09-26 08:18:58.730134555 +0000
+@@ -354,13 +354,12 @@
          GArray *search_array = NULL;
          char **search_dirs;
          int i;
@@ -19,22 +17,23 @@ diff -ur a/daemon/gdm-session.c b/daemon/gdm-session.c
                  DMCONFDIR "/Sessions/",
                  DATADIR "/gdm/BuiltInSessions/",
 -                DATADIR "/xsessions/",
-+                "/run/current-system/profile/share/xsessions/"
++                "/run/current-system/profile/share/xsessions/",
          };
  
          static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
- 
+@@ -368,11 +367,6 @@
          search_array = g_array_new (TRUE, TRUE, sizeof (char *));
  
--        for (i = 0; system_data_dirs[i]; i++) {
--                gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
--                g_array_append_val (search_array, dir);
--        }
+         if (type == NULL || g_str_equal (type, "x11")) {
+-                for (i = 0; system_data_dirs[i]; i++) {
+-                        gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
+-                        g_array_append_val (search_array, dir);
+-                }
 -
-         g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
+                 g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
+         }
  
- #ifdef ENABLE_WAYLAND_SUPPORT
-@@ -373,16 +367,7 @@
+@@ -382,16 +376,7 @@
  #ifdef ENABLE_USER_DISPLAY_SERVER
                  g_array_prepend_val (search_array, wayland_search_dir);
  
diff --git a/gnu/packages/patches/gdm-elogind-support.patch b/gnu/packages/patches/gdm-elogind-support.patch
new file mode 100644
index 0000000000..39cd12dd22
--- /dev/null
+++ b/gnu/packages/patches/gdm-elogind-support.patch
@@ -0,0 +1,211 @@
+https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/113
+
+From 462cc0f5346f5913cf7151044f1c232c5d21c1c3 Mon Sep 17 00:00:00 2001
+From: Dudemanguy <random342@airmail.cc>
+Date: Mon, 5 Oct 2020 18:41:55 -0500
+Subject: [PATCH] meson: allow building with elogind
+
+Currently, the GDM meson build has a hard dependency on systemd.
+However, GDM can function just fine if one is using elogind. This allows
+a user to build GDM against libelogind and also disable the systemd
+system and user units.
+---
+ common/meson.build                       |  2 +-
+ data/meson.build                         | 62 ++++++++++++++----------
+ data/pam-arch/gdm-launch-environment.pam |  1 +
+ libgdm/meson.build                       |  2 +-
+ meson.build                              | 36 +++++++++-----
+ meson_options.txt                        |  5 +-
+ 6 files changed, 66 insertions(+), 42 deletions(-)
+
+diff --git a/common/meson.build b/common/meson.build
+index 074dd92e1..bca58f7c4 100644
+--- a/common/meson.build
++++ b/common/meson.build
+@@ -11,7 +11,7 @@ libgdmcommon_src = files(
+ )
+ 
+ libgdmcommon_deps = [
+-  libsystemd_dep,
++  logind_dep,
+   gobject_dep,
+   gio_dep,
+   gio_unix_dep,
+diff --git a/data/meson.build b/data/meson.build
+index 7c5222eaf..403336c31 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -168,41 +168,53 @@ else
+   service_config.set('PLYMOUTH_QUIT_SERVICE', '')
+ endif
+ 
+-if get_option('systemdsystemunitdir') != ''
+-  systemd_systemunitdir = get_option('systemdsystemunitdir')
+-else
+-  systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
++systemdsystemunitdir = get_option('systemdsystemunitdir')
++if systemdsystemunitdir != 'no'
++  assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd system unit dir or disable it')
++  if get_option('systemdsystemunitdir') != ''
++    systemd_systemunitdir = get_option('systemdsystemunitdir')
++  else
++    systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
++  endif
+ endif
+ 
+-if get_option('systemduserunitdir') != ''
+-  systemd_userunitdir = get_option('systemduserunitdir')
+-else
+-  systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
+-                                                           define_variable: ['prefix', get_option('prefix')])
++systemduserunitdir = get_option('systemduserunitdir')
++if systemduserunitdir != 'no'
++  assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
++  if get_option('systemduserunitdir') != ''
++    systemd_userunitdir = get_option('systemduserunitdir')
++  else
++    systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
++                                                             define_variable: ['prefix', get_option('prefix')])
++  endif
+ endif
+ 
+-configure_file(
+-  input: 'gdm.service.in',
+-  output: '@BASENAME@',
+-  configuration: service_config,
+-  install_dir: systemd_systemunitdir,
+-  format: 'cmake'
+-)
++if systemdsystemunitdir != 'no'
++  configure_file(
++    input: 'gdm.service.in',
++    output: '@BASENAME@',
++    configuration: service_config,
++    install_dir: systemd_systemunitdir,
++    format: 'cmake'
++  )
++endif
+ 
+ gdm_gnome_session_wanted_targets = []
+ foreach component: gdm_gnome_user_session_wanted_components
+   gdm_gnome_session_wanted_targets += 'Wants=@0@.target'.format(component)
+ endforeach
+ 
+-configure_file(
+-  input: 'session.conf.in',
+-  output: 'session.conf',
+-  configuration: {
+-    'requires_component': gdm_gnome_shell_component,
+-    'wants_required_components': '\n'.join(gdm_gnome_session_wanted_targets),
+-  },
+-  install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d',
+-)
++if systemduserunitdir != 'no'
++  configure_file(
++    input: 'session.conf.in',
++    output: 'session.conf',
++    configuration: {
++      'requires_component': gdm_gnome_shell_component,
++      'wants_required_components': '\n'.join(gdm_gnome_session_wanted_targets),
++    },
++    install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d',
++  )
++endif
+ 
+ # XSession
+ if get_option('gdm-xsession')
+diff --git a/libgdm/meson.build b/libgdm/meson.build
+index 3f8cafbb7..83e95151b 100644
+--- a/libgdm/meson.build
++++ b/libgdm/meson.build
+@@ -56,7 +56,7 @@ libgdm_deps = [
+   glib_dep,
+   gio_dep,
+   gio_unix_dep,
+-  libsystemd_dep,
++  logind_dep,
+   libgdmcommon_dep,
+ ]
+ 
+diff --git a/meson.build b/meson.build
+index e6fcf4b8b..a86a486b7 100644
+--- a/meson.build
++++ b/meson.build
+@@ -92,21 +92,30 @@ xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
+ if xdmcp_dep.found() and get_option('tcp-wrappers')
+   libwrap_dep = cc.find_library('libwrap')
+ endif
+-# systemd
+-systemd_dep = dependency('systemd')
+-libsystemd_dep = dependency('libsystemd')
+-if meson.version().version_compare('>= 0.53')
+-  systemd_multiseat_x = find_program('systemd-multi-seat-x',
+-    required: false,
+-    dirs: [
+-      systemd_dep.get_pkgconfig_variable('systemdutildir'),
+-      '/lib/systemd',
+-      '/usr/lib/systemd',
+-    ])
++
++logind_provider = get_option('logind-provider')
++systemd_dep = dependency('systemd', required: false)
++if logind_provider == 'systemd'
++  libsystemd_dep = dependency('libsystemd')
++  logind_dep = libsystemd_dep
++  if meson.version().version_compare('>= 0.53')
++    systemd_multiseat_x = find_program('systemd-multi-seat-x',
++      required: false,
++      dirs: [
++        systemd_dep.get_pkgconfig_variable('systemdutildir'),
++        '/lib/systemd',
++        '/usr/lib/systemd',
++      ])
++  else
++    systemd_multiseat_x = find_program('systemd-multi-seat-x', required: false)
++  endif
++  systemd_x_server = systemd_multiseat_x.found()? systemd_multiseat_x.path() : '/lib/systemd/systemd-multi-seat-x'
+ else
+-  systemd_multiseat_x = find_program('systemd-multi-seat-x', required: false)
++  elogind_dep = dependency('libelogind')
++  logind_dep = elogind_dep
++  systemd_x_server = 'disabled'
+ endif
+-systemd_x_server = systemd_multiseat_x.found()? systemd_multiseat_x.path() : '/lib/systemd/systemd-multi-seat-x'
++
+ # Plymouth
+ plymouth_dep = dependency('ply-boot-client', required: get_option('plymouth'))
+ # Check for Solaris auditing API (ADT)
+@@ -313,6 +322,7 @@ summary({
+     'PAM Syslog': have_pam_syslog,
+     'Supports PAM Extensions': pam_extensions_supported,
+     'SeLinux': libselinux_dep.found(),
++    'Logind Provider': get_option('logind-provider'),
+     'Use GDM Xsession': get_option('gdm-xsession'),
+     'Use UserDisplayServer': get_option('user-display-server'),
+     'Use SystemdJournal': get_option('systemd-journal'),
+diff --git a/meson_options.txt b/meson_options.txt
+index 14e0b908b..5135d7d66 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -12,6 +12,7 @@ option('initial-vt', type: 'integer', value: 1, description: 'Initial virtual te
+ option('ipv6', type: 'boolean', value: false, description: 'Enables compilation of IPv6 code.')
+ option('lang-file', type: 'string', value: '', description: 'File containing default language settings.')
+ option('libaudit', type: 'feature', value: 'auto', description: 'Add Linux audit support.')
++option('logind-provider', type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', description: 'Which logind library to use.')
+ option('log-dir', type: 'string', value: '/var/log/gdm', description: 'Log directory.')
+ option('pam-mod-dir', type: 'string', value: '', description: 'Directory to install PAM modules in.')
+ option('pam-prefix', type: 'string', value: '', description: 'Specify where PAM files go.')
+@@ -27,8 +28,8 @@ option('solaris', type: 'boolean', value: false, description: 'Build for Solaris
+ option('split-authentication', type: 'boolean', value: true, description: 'Enable multiple simultaneous PAM conversations during login.')
+ option('sysconfsubdir', type: 'string', value: 'gdm', description: 'Directory name used under sysconfdir.')
+ option('systemd-journal', type: 'boolean', value: true, description: 'Use journald support.')
+-option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files.')
+-option('systemduserunitdir', type: 'string', value: '', description: 'Directory for systemd user service files.')
++option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files, or \'no\' to disable.')
++option('systemduserunitdir', type: 'string', value: '', description: 'Directory for systemd user service files, or \'no\' to disable.')
+ option('tcp-wrappers', type: 'boolean', value: false, description: 'Use TCP wrappers.')
+ option('udev-dir', type: 'string', value: '', description: 'Directory for udev rules file.')
+ option('user', type: 'string', value: 'gdm', description: 'GDM\'s username.')
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch b/gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch
new file mode 100644
index 0000000000..366fb91668
--- /dev/null
+++ b/gnu/packages/patches/gdm-remove-hardcoded-xwayland-path.patch
@@ -0,0 +1,22 @@
+Remove check for hardcoded Xwayland path in gdm.
+
+---
+ daemon/gdm-local-display-factory.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
+index da1093bb..37355c06 100644
+--- a/daemon/gdm-local-display-factory.c
++++ b/daemon/gdm-local-display-factory.c
+@@ -203,7 +203,7 @@ gdm_local_display_factory_use_wayland (void)
+ #ifdef ENABLE_WAYLAND_SUPPORT
+         gboolean wayland_enabled = FALSE;
+         if (gdm_settings_direct_get_boolean (GDM_KEY_WAYLAND_ENABLE, &wayland_enabled)) {
+-                if (wayland_enabled && g_file_test ("/usr/bin/Xwayland", G_FILE_TEST_IS_EXECUTABLE) )
++                if (wayland_enabled)
+                         return TRUE;
+         }
+ #endif
+--
+2.33.0
+
diff --git a/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch b/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch
new file mode 100644
index 0000000000..44ab6a9471
--- /dev/null
+++ b/gnu/packages/patches/gdm-wayland-session-wrapper-from-env.patch
@@ -0,0 +1,35 @@
+Get wayland-session wrapper from environment.
+
+---
+ daemon/gdm-session.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
+index 4e303e70..1deca4e9 100644
+--- a/daemon/gdm-session.c
++++ b/daemon/gdm-session.c
+@@ -2888,8 +2888,9 @@ gdm_session_start_session (GdmSession *self,
+                                                            allow_remote_connections? "--allow-remote-connections " : "",
+                                                            command);
+                         } else {
+-                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
++                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s %s\"",
+                                                            register_session ? "--register-session " : "",
++                                                           g_getenv ("GDM_WAYLAND_SESSION"),
+                                                            command);
+                         }
+                 } else if (run_xsession_script) {
+@@ -2942,8 +2942,9 @@
+                                                            register_session ? "--register-session " : "",
+                                                            self->selected_program);
+                         } else {
+-                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
++                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s %s\"",
+                                                            register_session ? "--register-session " : "",
++                                                           g_getenv ("GDM_WAYLAND_SESSION"),
+                                                            self->selected_program);
+                         }
+                 } else {
+--
+2.33.0
+
diff --git a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch b/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
deleted file mode 100644
index b6658d7c7f..0000000000
--- a/gnu/packages/patches/ghostscript-CVE-2020-15900.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix CVE-2020-15900.
-
-https://cve.circl.lu/cve/CVE-2020-15900
-https://artifex.com/security-advisories/CVE-2020-15900
-
-Taken from upstream:
-https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=5d499272b95a6b890a1397e11d20937de000d31b
-
-diff --git a/psi/zstring.c b/psi/zstring.c
---- a/psi/zstring.c
-+++ b/psi/zstring.c
-@@ -142,13 +142,18 @@ search_impl(i_ctx_t *i_ctx_p, bool forward)
-     return 0;
- found:
-     op->tas.type_attrs = op1->tas.type_attrs;
--    op->value.bytes = ptr;
--    r_set_size(op, size);
-+    op->value.bytes = ptr;				/* match */
-+    op->tas.rsize = size;				/* match */
-     push(2);
--    op[-1] = *op1;
--    r_set_size(op - 1, ptr - op[-1].value.bytes);
--    op1->value.bytes = ptr + size;
--    r_set_size(op1, count + (!forward ? (size - 1) : 0));
-+    op[-1] = *op1;					/* pre */
-+    op[-3].value.bytes = ptr + size;			/* post */
-+    if (forward) {
-+        op[-1].tas.rsize = ptr - op[-1].value.bytes;	/* pre */
-+        op[-3].tas.rsize = count;			/* post */
-+    } else {
-+        op[-1].tas.rsize = count;			/* pre */
-+        op[-3].tas.rsize -= count + size;		/* post */
-+    }
-     make_true(op);
-     return 0;
- }
diff --git a/gnu/packages/patches/ghostscript-freetype-compat.patch b/gnu/packages/patches/ghostscript-freetype-compat.patch
deleted file mode 100644
index cc225b5ad6..0000000000
--- a/gnu/packages/patches/ghostscript-freetype-compat.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Fix build with FreeType 2.10.3 and newer.
-
-Taken from upstream:
-https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=41ef9a0bc36b9db7115fbe9623f989bfb47bbade
-
-diff --git a/base/fapi_ft.c b/base/fapi_ft.c
---- a/base/fapi_ft.c
-+++ b/base/fapi_ft.c
-@@ -125,7 +125,7 @@ static void
- delete_inc_int_info(gs_fapi_server * a_server,
-                     FT_IncrementalRec * a_inc_int_info);
- 
--FT_CALLBACK_DEF(void *)
-+static void *
- FF_alloc(FT_Memory memory, long size)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -133,7 +133,7 @@ FF_alloc(FT_Memory memory, long size)
-     return (gs_malloc(mem, size, 1, "FF_alloc"));
- }
- 
--FT_CALLBACK_DEF(void *)
-+static void *
-     FF_realloc(FT_Memory memory, long cur_size, long new_size, void *block)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
-@@ -153,7 +153,7 @@ FT_CALLBACK_DEF(void *)
-     return (tmp);
- }
- 
--FT_CALLBACK_DEF(void)
-+static void
-     FF_free(FT_Memory memory, void *block)
- {
-     gs_memory_t *mem = (gs_memory_t *) memory->user;
diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
index 92ddbdade0..b19f3ab5d9 100644
--- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch
+++ b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
@@ -20,3 +20,25 @@ index 0fb067e..b342e2c 100644
      {
          struct tm tms;
          time_t t;
+--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
++++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
+@@ -692,6 +692,9 @@
+             pdf_xml_attribute_name(s, "xmlns:xmp");
+             pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
+             pdf_xml_tag_end(s);
++            if (!getenv("GS_GENERATE_UUIDS") ||
++                (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++                 strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+             {
+                 pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
+                 pdf_xml_tag_end(s);
+@@ -700,6 +701,9 @@
+                 pdf_xml_tag_close(s, "xmp:ModifyDate");
+                 pdf_xml_newline(s);
+             }
++            if (!getenv("GS_GENERATE_UUIDS") ||
++                (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 &&
++                 strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+             {
+                 pdf_xml_tag_open_beg(s, "xmp:CreateDate");
+                 pdf_xml_tag_end(s);
diff --git a/gnu/packages/patches/glade-gls-set-script-name.patch b/gnu/packages/patches/glade-gls-set-script-name.patch
new file mode 100644
index 0000000000..61fbdf3914
--- /dev/null
+++ b/gnu/packages/patches/glade-gls-set-script-name.patch
@@ -0,0 +1,32 @@
+Taken from upstream:
+https://gitlab.gnome.org/GNOME/glade/-/commit/eb0429d318c017b57b9e59de1d5b3f142a0f455e.
+
+From 6cf1d3e11d4f8035f33c3003d33f6465896025a5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
+Date: Tue, 18 May 2021 19:54:50 +0200
+Subject: [PATCH] plugins: Define an invalid but non-null file path as script
+ path
+
+This is following the gjs applications behaviors, setting a valid string
+as the script path that will be shown in JS stack traces, even though
+won't load a real file through g_file_new_for_commandline_arg()
+---
+ plugins/gjs/glade-gjs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/gjs/glade-gjs.c b/plugins/gjs/glade-gjs.c
+index e1779665..aeae9906 100644
+--- a/plugins/gjs/glade-gjs.c
++++ b/plugins/gjs/glade-gjs.c
+@@ -93,7 +93,7 @@ glade_gjs_init (const gchar *name)
+ 
+   /* Importing the module will create all the GTypes so that glade can use them at runtime */
+   retval = gjs_context_eval (gjs_context_get_current (),
+-                             import_sentence, -1, NULL,
++                             import_sentence, -1, "<glade-gjs>",
+                              &exit_status,
+                              &error);
+   if (!retval && error)
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/glade-test-widget-null-icon.patch b/gnu/packages/patches/glade-test-widget-null-icon.patch
new file mode 100644
index 0000000000..75668a2f68
--- /dev/null
+++ b/gnu/packages/patches/glade-test-widget-null-icon.patch
@@ -0,0 +1,30 @@
+Taken from upstream:
+https://gitlab.gnome.org/GNOME/glade/-/commit/6cf1d3e11d4f8035f33c3003d33f6465896025a5.
+
+From eb0429d318c017b57b9e59de1d5b3f142a0f455e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
+Date: Wed, 19 May 2021 00:10:29 +0200
+Subject: [PATCH] tests: Do not create a file icon when no filename is provided
+
+This would fail otherwise as GFileIcon requires a GFile parameter on
+construction.
+---
+ tests/create-widgets.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tests/create-widgets.c b/tests/create-widgets.c
+index 2094059d..db8311f8 100644
+--- a/tests/create-widgets.c
++++ b/tests/create-widgets.c
+@@ -106,6 +106,8 @@ main (int   argc,
+       if (G_TYPE_IS_INSTANTIATABLE (adaptor_type) && !G_TYPE_IS_ABSTRACT (adaptor_type) &&
+           /* FIXME: can not create a themed icon without a name */
+           !g_type_is_a (adaptor_type, G_TYPE_THEMED_ICON) &&
++          /* FIXME: can not create a file icon without a file name */
++          !g_type_is_a (adaptor_type, G_TYPE_FILE_ICON) &&
+           /* FIXME: GtkPopoverMenu gives a few warnings */
+           !g_type_is_a (adaptor_type, GTK_TYPE_POPOVER_MENU) &&
+           /* FIXME: GtkFileChooserNative is hard to test here */
+-- 
+GitLab
+
diff --git a/gnu/packages/patches/glib-CVE-2021-27218.patch b/gnu/packages/patches/glib-CVE-2021-27218.patch
deleted file mode 100644
index 00fa5ebf79..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27218.patch
+++ /dev/null
@@ -1,132 +0,0 @@
-Backport of:
-
-From 0f384c88a241bbbd884487b1c40b7b75f1e638d3 Mon Sep 17 00:00:00 2001
-From: Krzesimir Nowak <qdlacz@gmail.com>
-Date: Wed, 10 Feb 2021 23:51:07 +0100
-Subject: [PATCH] gbytearray: Do not accept too large byte arrays
-
-GByteArray uses guint for storing the length of the byte array, but it
-also has a constructor (g_byte_array_new_take) that takes length as a
-gsize. gsize may be larger than guint (64 bits for gsize vs 32 bits
-for guint). It is possible to call the function with a value greater
-than G_MAXUINT, which will result in silent length truncation. This
-may happen as a result of unreffing GBytes into GByteArray, so rather
-be loud about it.
-
-(Test case tweaked by Philip Withnall.)
-
-(Backport 2.66: Add #include gstrfuncsprivate.h in the test case for
-`g_memdup2()`.)
----
- glib/garray.c      |  6 ++++++
- glib/gbytes.c      |  4 ++++
- glib/tests/bytes.c | 35 ++++++++++++++++++++++++++++++++++-
- 3 files changed, 44 insertions(+), 1 deletion(-)
-
-diff --git a/glib/garray.c b/glib/garray.c
-index 942e74c9f..fb1a42aaf 100644
---- a/glib/garray.c
-+++ b/glib/garray.c
-@@ -2013,6 +2013,10 @@ g_byte_array_new (void)
-  * Create byte array containing the data. The data will be owned by the array
-  * and will be freed with g_free(), i.e. it could be allocated using g_strdup().
-  *
-+ * Do not use it if @len is greater than %G_MAXUINT. #GByteArray
-+ * stores the length of its data in #guint, which may be shorter than
-+ * #gsize.
-+ *
-  * Since: 2.32
-  *
-  * Returns: (transfer full): a new #GByteArray
-@@ -2024,6 +2028,8 @@ g_byte_array_new_take (guint8 *data,
-   GByteArray *array;
-   GRealArray *real;
- 
-+  g_return_val_if_fail (len <= G_MAXUINT, NULL);
-+
-   array = g_byte_array_new ();
-   real = (GRealArray *)array;
-   g_assert (real->data == NULL);
-diff --git a/glib/gbytes.c b/glib/gbytes.c
-index 7b72886e5..d56abe6c3 100644
---- a/glib/gbytes.c
-+++ b/glib/gbytes.c
-@@ -519,6 +519,10 @@ g_bytes_unref_to_data (GBytes *bytes,
-  * g_bytes_new(), g_bytes_new_take() or g_byte_array_free_to_bytes(). In all
-  * other cases the data is copied.
-  *
-+ * Do not use it if @bytes contains more than %G_MAXUINT
-+ * bytes. #GByteArray stores the length of its data in #guint, which
-+ * may be shorter than #gsize, that @bytes is using.
-+ *
-  * Returns: (transfer full): a new mutable #GByteArray containing the same byte data
-  *
-  * Since: 2.32
-diff --git a/glib/tests/bytes.c b/glib/tests/bytes.c
-index 5ea5c2b35..15a6aaad6 100644
---- a/glib/tests/bytes.c
-+++ b/glib/tests/bytes.c
-@@ -10,12 +10,12 @@
-  */
- 
- #undef G_DISABLE_ASSERT
--#undef G_LOG_DOMAIN
- 
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "glib.h"
-+#include "glib/gstrfuncsprivate.h"
- 
- /* Keep in sync with glib/gbytes.c */
- struct _GBytes
-@@ -333,6 +333,38 @@ test_to_array_transferred (void)
-   g_byte_array_unref (array);
- }
- 
-+static void
-+test_to_array_transferred_oversize (void)
-+{
-+  g_test_message ("g_bytes_unref_to_array() can only take GBytes up to "
-+                  "G_MAXUINT in length; test that longer ones are rejected");
-+
-+  if (sizeof (guint) >= sizeof (gsize))
-+    {
-+      g_test_skip ("Skipping test as guint is not smaller than gsize");
-+    }
-+  else if (g_test_undefined ())
-+    {
-+      GByteArray *array = NULL;
-+      GBytes *bytes = NULL;
-+      gpointer data = g_memdup2 (NYAN, N_NYAN);
-+      gsize len = ((gsize) G_MAXUINT) + 1;
-+
-+      bytes = g_bytes_new_take (data, len);
-+      g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
-+                             "g_byte_array_new_take: assertion 'len <= G_MAXUINT' failed");
-+      array = g_bytes_unref_to_array (g_steal_pointer (&bytes));
-+      g_test_assert_expected_messages ();
-+      g_assert_null (array);
-+
-+      g_free (data);
-+    }
-+  else
-+    {
-+      g_test_skip ("Skipping test as testing undefined behaviour is disabled");
-+    }
-+}
-+
- static void
- test_to_array_two_refs (void)
- {
-@@ -410,6 +442,7 @@ main (int argc, char *argv[])
-   g_test_add_func ("/bytes/to-array/transfered", test_to_array_transferred);
-   g_test_add_func ("/bytes/to-array/two-refs", test_to_array_two_refs);
-   g_test_add_func ("/bytes/to-array/non-malloc", test_to_array_non_malloc);
-+  g_test_add_func ("/bytes/to-array/transferred/oversize", test_to_array_transferred_oversize);
-   g_test_add_func ("/bytes/null", test_null);
- 
-   return g_test_run ();
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-01.patch b/gnu/packages/patches/glib-CVE-2021-27219-01.patch
deleted file mode 100644
index 5db360d468..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-01.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-Backport of:
-
-From 5e5f75a77e399c638be66d74e5daa8caeb433e00 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:30:52 +0000
-Subject: [PATCH 01/11] gstrfuncs: Add internal g_memdup2() function
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This will replace the existing `g_memdup()` function for use within
-GLib. It has an unavoidable security flaw of taking its `byte_size`
-argument as a `guint` rather than as a `gsize`. Most callers will
-expect it to be a `gsize`, and may pass in large values which could
-silently be truncated, resulting in an undersize allocation compared
-to what the caller expects.
-
-This could lead to a classic buffer overflow vulnerability for many
-callers of `g_memdup()`.
-
-`g_memdup2()`, in comparison, takes its `byte_size` as a `gsize`.
-
-Spotted by Kevin Backhouse of GHSL.
-
-In GLib 2.68, `g_memdup2()` will be a new public API. In this version
-for backport to older stable releases, it’s a new `static inline` API
-in a private header, so that use of `g_memdup()` within GLib can be
-fixed without adding a new API in a stable release series.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: GHSL-2021-045
-Helps: #2319
----
- docs/reference/glib/meson.build |  1 +
- glib/gstrfuncsprivate.h         | 55 +++++++++++++++++++++++++++++++++
- glib/meson.build                |  1 +
- glib/tests/strfuncs.c           | 23 ++++++++++++++
- 4 files changed, 80 insertions(+)
- create mode 100644 glib/gstrfuncsprivate.h
-
-diff --git a/docs/reference/glib/meson.build b/docs/reference/glib/meson.build
-index bba7649f0..ee39f6d04 100644
---- a/docs/reference/glib/meson.build
-+++ b/docs/reference/glib/meson.build
-@@ -22,6 +22,7 @@ if get_option('gtk_doc')
-     'gprintfint.h',
-     'gmirroringtable.h',
-     'gscripttable.h',
-+    'gstrfuncsprivate.h',
-     'glib-mirroring-tab',
-     'gnulib',
-     'pcre',
-diff --git a/glib/gstrfuncsprivate.h b/glib/gstrfuncsprivate.h
-new file mode 100644
-index 000000000..85c88328a
---- /dev/null
-+++ b/glib/gstrfuncsprivate.h
-@@ -0,0 +1,55 @@
-+/* GLIB - Library of useful routines for C programming
-+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#include <glib.h>
-+#include <string.h>
-+
-+/*
-+ * g_memdup2:
-+ * @mem: (nullable): the memory to copy.
-+ * @byte_size: the number of bytes to copy.
-+ *
-+ * Allocates @byte_size bytes of memory, and copies @byte_size bytes into it
-+ * from @mem. If @mem is %NULL it returns %NULL.
-+ *
-+ * This replaces g_memdup(), which was prone to integer overflows when
-+ * converting the argument from a #gsize to a #guint.
-+ *
-+ * This static inline version is a backport of the new public API from
-+ * GLib 2.68, kept internal to GLib for backport to older stable releases.
-+ * See https://gitlab.gnome.org/GNOME/glib/-/issues/2319.
-+ *
-+ * Returns: (nullable): a pointer to the newly-allocated copy of the memory,
-+ *    or %NULL if @mem is %NULL.
-+ * Since: 2.68
-+ */
-+static inline gpointer
-+g_memdup2 (gconstpointer mem,
-+           gsize         byte_size)
-+{
-+  gpointer new_mem;
-+
-+  if (mem && byte_size != 0)
-+    {
-+      new_mem = g_malloc (byte_size);
-+      memcpy (new_mem, mem, byte_size);
-+    }
-+  else
-+    new_mem = NULL;
-+
-+  return new_mem;
-+}
-diff --git a/glib/meson.build b/glib/meson.build
-index aaf5f00f5..5a6eea397 100644
---- a/glib/meson.build
-+++ b/glib/meson.build
-@@ -268,6 +268,7 @@ glib_sources = files(
-   'gslist.c',
-   'gstdio.c',
-   'gstrfuncs.c',
-+  'gstrfuncsprivate.h',
-   'gstring.c',
-   'gstringchunk.c',
-   'gtestutils.c',
-diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c
-index e1f9619c7..d968afff9 100644
---- a/glib/tests/strfuncs.c
-+++ b/glib/tests/strfuncs.c
-@@ -32,6 +32,8 @@
- #include <string.h>
- #include "glib.h"
- 
-+#include "gstrfuncsprivate.h"
-+
- #if defined (_MSC_VER) && (_MSC_VER <= 1800)
- #define isnan(x) _isnan(x)
- 
-@@ -219,6 +221,26 @@ test_memdup (void)
-   g_free (str_dup);
- }
- 
-+/* Testing g_memdup2() function with various positive and negative cases */
-+static void
-+test_memdup2 (void)
-+{
-+  gchar *str_dup = NULL;
-+  const gchar *str = "The quick brown fox jumps over the lazy dog";
-+
-+  /* Testing negative cases */
-+  g_assert_null (g_memdup2 (NULL, 1024));
-+  g_assert_null (g_memdup2 (str, 0));
-+  g_assert_null (g_memdup2 (NULL, 0));
-+
-+  /* Testing normal usage cases */
-+  str_dup = g_memdup2 (str, strlen (str) + 1);
-+  g_assert_nonnull (str_dup);
-+  g_assert_cmpstr (str, ==, str_dup);
-+
-+  g_free (str_dup);
-+}
-+
- /* Testing g_strpcpy() function with various positive and negative cases */
- static void
- test_stpcpy (void)
-@@ -2523,6 +2545,7 @@ main (int   argc,
-   g_test_add_func ("/strfuncs/has-prefix", test_has_prefix);
-   g_test_add_func ("/strfuncs/has-suffix", test_has_suffix);
-   g_test_add_func ("/strfuncs/memdup", test_memdup);
-+  g_test_add_func ("/strfuncs/memdup2", test_memdup2);
-   g_test_add_func ("/strfuncs/stpcpy", test_stpcpy);
-   g_test_add_func ("/strfuncs/str_match_string", test_str_match_string);
-   g_test_add_func ("/strfuncs/str_tokenize_and_fold", test_str_tokenize_and_fold);
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-02.patch b/gnu/packages/patches/glib-CVE-2021-27219-02.patch
deleted file mode 100644
index 431959fa8f..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-02.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-Backport of:
-
-From be8834340a2d928ece82025463ae23dee2c333d0 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:37:56 +0000
-Subject: [PATCH 02/11] gio: Use g_memdup2() instead of g_memdup() in obvious
- places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()`), so that they use
-`g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gdbusconnection.c                 | 5 +++--
- gio/gdbusinterfaceskeleton.c          | 3 ++-
- gio/gfile.c                           | 7 ++++---
- gio/gsettingsschema.c                 | 5 +++--
- gio/gwin32registrykey.c               | 8 +++++---
- gio/tests/async-close-output-stream.c | 6 ++++--
- gio/tests/gdbus-export.c              | 5 +++--
- gio/win32/gwinhttpfile.c              | 9 +++++----
- 8 files changed, 29 insertions(+), 19 deletions(-)
-
-diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
-index f1f0921d4..d56453486 100644
---- a/gio/gdbusconnection.c
-+++ b/gio/gdbusconnection.c
-@@ -110,6 +110,7 @@
- #include "gasyncinitable.h"
- #include "giostream.h"
- #include "gasyncresult.h"
-+#include "gstrfuncsprivate.h"
- #include "gtask.h"
- #include "gmarshal-internal.h"
- 
-@@ -3997,7 +3998,7 @@ _g_dbus_interface_vtable_copy (const GDBusInterfaceVTable *vtable)
-   /* Don't waste memory by copying padding - remember to update this
-    * when changing struct _GDBusInterfaceVTable in gdbusconnection.h
-    */
--  return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
-+  return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
- }
- 
- static void
-@@ -4014,7 +4015,7 @@ _g_dbus_subtree_vtable_copy (const GDBusSubtreeVTable *vtable)
-   /* Don't waste memory by copying padding - remember to update this
-    * when changing struct _GDBusSubtreeVTable in gdbusconnection.h
-    */
--  return g_memdup ((gconstpointer) vtable, 3 * sizeof (gpointer));
-+  return g_memdup2 ((gconstpointer) vtable, 3 * sizeof (gpointer));
- }
- 
- static void
-diff --git a/gio/gdbusinterfaceskeleton.c b/gio/gdbusinterfaceskeleton.c
-index 4a06516c1..4a4b719a5 100644
---- a/gio/gdbusinterfaceskeleton.c
-+++ b/gio/gdbusinterfaceskeleton.c
-@@ -28,6 +28,7 @@
- #include "gdbusmethodinvocation.h"
- #include "gdbusconnection.h"
- #include "gmarshal-internal.h"
-+#include "gstrfuncsprivate.h"
- #include "gtask.h"
- #include "gioerror.h"
- 
-@@ -701,7 +702,7 @@ add_connection_locked (GDBusInterfaceSkeleton *interface_,
-        * properly before building the hooked_vtable, so we create it
-        * once at the last minute.
-        */
--      interface_->priv->hooked_vtable = g_memdup (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
-+      interface_->priv->hooked_vtable = g_memdup2 (g_dbus_interface_skeleton_get_vtable (interface_), sizeof (GDBusInterfaceVTable));
-       interface_->priv->hooked_vtable->method_call = skeleton_intercept_handle_method_call;
-     }
- 
-diff --git a/gio/gfile.c b/gio/gfile.c
-index ba93f7c75..88b341e7d 100644
---- a/gio/gfile.c
-+++ b/gio/gfile.c
-@@ -60,6 +60,7 @@
- #include "gasyncresult.h"
- #include "gioerror.h"
- #include "glibintl.h"
-+#include "gstrfuncsprivate.h"
- 
- 
- /**
-@@ -7884,7 +7885,7 @@ measure_disk_usage_progress (gboolean reporting,
-   g_main_context_invoke_full (g_task_get_context (task),
-                               g_task_get_priority (task),
-                               measure_disk_usage_invoke_progress,
--                              g_memdup (&progress, sizeof progress),
-+                              g_memdup2 (&progress, sizeof progress),
-                               g_free);
- }
- 
-@@ -7902,7 +7903,7 @@ measure_disk_usage_thread (GTask        *task,
-                                  data->progress_callback ? measure_disk_usage_progress : NULL, task,
-                                  &result.disk_usage, &result.num_dirs, &result.num_files,
-                                  &error))
--    g_task_return_pointer (task, g_memdup (&result, sizeof result), g_free);
-+    g_task_return_pointer (task, g_memdup2 (&result, sizeof result), g_free);
-   else
-     g_task_return_error (task, error);
- }
-@@ -7926,7 +7927,7 @@ g_file_real_measure_disk_usage_async (GFile                        *file,
- 
-   task = g_task_new (file, cancellable, callback, user_data);
-   g_task_set_source_tag (task, g_file_real_measure_disk_usage_async);
--  g_task_set_task_data (task, g_memdup (&data, sizeof data), g_free);
-+  g_task_set_task_data (task, g_memdup2 (&data, sizeof data), g_free);
-   g_task_set_priority (task, io_priority);
- 
-   g_task_run_in_thread (task, measure_disk_usage_thread);
-diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
-index 3a60b8c64..dded9b1ca 100644
---- a/gio/gsettingsschema.c
-+++ b/gio/gsettingsschema.c
-@@ -20,6 +20,7 @@
- 
- #include "gsettingsschema-internal.h"
- #include "gsettings.h"
-+#include "gstrfuncsprivate.h"
- 
- #include "gvdb/gvdb-reader.h"
- #include "strinfo.c"
-@@ -1058,9 +1059,9 @@ g_settings_schema_list_children (GSettingsSchema *schema)
- 
-       if (g_str_has_suffix (key, "/"))
-         {
--          gint length = strlen (key);
-+          gsize length = strlen (key);
- 
--          strv[j] = g_memdup (key, length);
-+          strv[j] = g_memdup2 (key, length);
-           strv[j][length - 1] = '\0';
-           j++;
-         }
-diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
-index c19fede4e..619fd48af 100644
---- a/gio/gwin32registrykey.c
-+++ b/gio/gwin32registrykey.c
-@@ -28,6 +28,8 @@
- #include <ntstatus.h>
- #include <winternl.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- #ifndef _WDMDDK_
- typedef enum _KEY_INFORMATION_CLASS {
-   KeyBasicInformation,
-@@ -247,7 +249,7 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
-   new_iter->value_name_size = iter->value_name_size;
- 
-   if (iter->value_data != NULL)
--    new_iter->value_data = g_memdup (iter->value_data, iter->value_data_size);
-+    new_iter->value_data = g_memdup2 (iter->value_data, iter->value_data_size);
- 
-   new_iter->value_data_size = iter->value_data_size;
- 
-@@ -268,8 +270,8 @@ g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter)
-   new_iter->value_data_expanded_charsize = iter->value_data_expanded_charsize;
- 
-   if (iter->value_data_expanded_u8 != NULL)
--    new_iter->value_data_expanded_u8 = g_memdup (iter->value_data_expanded_u8,
--                                                 iter->value_data_expanded_charsize);
-+    new_iter->value_data_expanded_u8 = g_memdup2 (iter->value_data_expanded_u8,
-+                                                  iter->value_data_expanded_charsize);
- 
-   new_iter->value_data_expanded_u8_size = iter->value_data_expanded_charsize;
- 
-diff --git a/gio/tests/async-close-output-stream.c b/gio/tests/async-close-output-stream.c
-index 5f6620275..d3f97a119 100644
---- a/gio/tests/async-close-output-stream.c
-+++ b/gio/tests/async-close-output-stream.c
-@@ -24,6 +24,8 @@
- #include <stdlib.h>
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- #define DATA_TO_WRITE "Hello world\n"
- 
- typedef struct
-@@ -147,9 +149,9 @@ prepare_data (SetupData *data,
- 
-   data->expected_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (data->data_stream));
- 
--  g_assert_cmpint (data->expected_size, >, 0);
-+  g_assert_cmpuint (data->expected_size, >, 0);
- 
--  data->expected_output = g_memdup (written, (guint)data->expected_size);
-+  data->expected_output = g_memdup2 (written, data->expected_size);
- 
-   /* then recreate the streams and prepare them for the asynchronous close */
-   destroy_streams (data);
-diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c
-index 506c7458a..5513306f8 100644
---- a/gio/tests/gdbus-export.c
-+++ b/gio/tests/gdbus-export.c
-@@ -23,6 +23,7 @@
- #include <string.h>
- 
- #include "gdbus-tests.h"
-+#include "gstrfuncsprivate.h"
- 
- /* all tests rely on a shared mainloop */
- static GMainLoop *loop = NULL;
-@@ -671,7 +672,7 @@ subtree_introspect (GDBusConnection       *connection,
-       g_assert_not_reached ();
-     }
- 
--  return g_memdup (interfaces, 2 * sizeof (void *));
-+  return g_memdup2 (interfaces, 2 * sizeof (void *));
- }
- 
- static const GDBusInterfaceVTable *
-@@ -727,7 +728,7 @@ dynamic_subtree_introspect (GDBusConnection       *connection,
- {
-   const GDBusInterfaceInfo *interfaces[2] = { &dyna_interface_info, NULL };
- 
--  return g_memdup (interfaces, 2 * sizeof (void *));
-+  return g_memdup2 (interfaces, 2 * sizeof (void *));
- }
- 
- static const GDBusInterfaceVTable *
-diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c
-index cf5eed31d..040ee8564 100644
---- a/gio/win32/gwinhttpfile.c
-+++ b/gio/win32/gwinhttpfile.c
-@@ -29,6 +29,7 @@
- #include "gio/gfile.h"
- #include "gio/gfileattribute.h"
- #include "gio/gfileinfo.h"
-+#include "gstrfuncsprivate.h"
- #include "gwinhttpfile.h"
- #include "gwinhttpfileinputstream.h"
- #include "gwinhttpfileoutputstream.h"
-@@ -393,10 +394,10 @@ g_winhttp_file_resolve_relative_path (GFile      *file,
-   child = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
-   child->vfs = winhttp_file->vfs;
-   child->url = winhttp_file->url;
--  child->url.lpszScheme = g_memdup (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
--  child->url.lpszHostName = g_memdup (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
--  child->url.lpszUserName = g_memdup (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
--  child->url.lpszPassword = g_memdup (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-+  child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
-+  child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
-+  child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
-+  child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-   child->url.lpszUrlPath = wnew_path;
-   child->url.dwUrlPathLength = wcslen (wnew_path);
-   child->url.lpszExtraInfo = NULL;
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-03.patch b/gnu/packages/patches/glib-CVE-2021-27219-03.patch
deleted file mode 100644
index 99e849c43c..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-03.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-From 6110caea45b235420b98cd41d845cc92238f6781 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:39:25 +0000
-Subject: [PATCH 03/11] gobject: Use g_memdup2() instead of g_memdup() in
- obvious places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()`), so that they use
-`g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gobject/gsignal.c     | 3 ++-
- gobject/gtype.c       | 9 +++++----
- gobject/gtypemodule.c | 3 ++-
- gobject/tests/param.c | 4 +++-
- 4 files changed, 12 insertions(+), 7 deletions(-)
-
-diff --git a/gobject/gsignal.c b/gobject/gsignal.c
-index 77d8f211e..41c54ab57 100644
---- a/gobject/gsignal.c
-+++ b/gobject/gsignal.c
-@@ -28,6 +28,7 @@
- #include <signal.h>
- 
- #include "gsignal.h"
-+#include "gstrfuncsprivate.h"
- #include "gtype-private.h"
- #include "gbsearcharray.h"
- #include "gvaluecollector.h"
-@@ -1730,7 +1731,7 @@ g_signal_newv (const gchar       *signal_name,
-   node->single_va_closure_is_valid = FALSE;
-   node->flags = signal_flags & G_SIGNAL_FLAGS_MASK;
-   node->n_params = n_params;
--  node->param_types = g_memdup (param_types, sizeof (GType) * n_params);
-+  node->param_types = g_memdup2 (param_types, sizeof (GType) * n_params);
-   node->return_type = return_type;
-   node->class_closure_bsa = NULL;
-   if (accumulator)
-diff --git a/gobject/gtype.c b/gobject/gtype.c
-index 7d3789400..8441b90e9 100644
---- a/gobject/gtype.c
-+++ b/gobject/gtype.c
-@@ -33,6 +33,7 @@
- 
- #include "glib-private.h"
- #include "gconstructor.h"
-+#include "gstrfuncsprivate.h"
- 
- #ifdef G_OS_WIN32
- #include <windows.h>
-@@ -1470,7 +1471,7 @@ type_add_interface_Wm (TypeNode             *node,
-   iholder->next = iface_node_get_holders_L (iface);
-   iface_node_set_holders_W (iface, iholder);
-   iholder->instance_type = NODE_TYPE (node);
--  iholder->info = info ? g_memdup (info, sizeof (*info)) : NULL;
-+  iholder->info = info ? g_memdup2 (info, sizeof (*info)) : NULL;
-   iholder->plugin = plugin;
- 
-   /* create an iface entry for this type */
-@@ -1731,7 +1732,7 @@ type_iface_retrieve_holder_info_Wm (TypeNode *iface,
-         INVALID_RECURSION ("g_type_plugin_*", iholder->plugin, NODE_NAME (iface));
-       
-       check_interface_info_I (iface, instance_type, &tmp_info);
--      iholder->info = g_memdup (&tmp_info, sizeof (tmp_info));
-+      iholder->info = g_memdup2 (&tmp_info, sizeof (tmp_info));
-     }
-   
-   return iholder;	/* we don't modify write lock upon returning NULL */
-@@ -2016,10 +2017,10 @@ type_iface_vtable_base_init_Wm (TypeNode *iface,
-       IFaceEntry *pentry = type_lookup_iface_entry_L (pnode, iface);
-       
-       if (pentry)
--	vtable = g_memdup (pentry->vtable, iface->data->iface.vtable_size);
-+	vtable = g_memdup2 (pentry->vtable, iface->data->iface.vtable_size);
-     }
-   if (!vtable)
--    vtable = g_memdup (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
-+    vtable = g_memdup2 (iface->data->iface.dflt_vtable, iface->data->iface.vtable_size);
-   entry->vtable = vtable;
-   vtable->g_type = NODE_TYPE (iface);
-   vtable->g_instance_type = NODE_TYPE (node);
-diff --git a/gobject/gtypemodule.c b/gobject/gtypemodule.c
-index 4ecaf8c88..20911fafd 100644
---- a/gobject/gtypemodule.c
-+++ b/gobject/gtypemodule.c
-@@ -19,6 +19,7 @@
- 
- #include <stdlib.h>
- 
-+#include "gstrfuncsprivate.h"
- #include "gtypeplugin.h"
- #include "gtypemodule.h"
- 
-@@ -436,7 +437,7 @@ g_type_module_register_type (GTypeModule     *module,
-   module_type_info->loaded = TRUE;
-   module_type_info->info = *type_info;
-   if (type_info->value_table)
--    module_type_info->info.value_table = g_memdup (type_info->value_table,
-+    module_type_info->info.value_table = g_memdup2 (type_info->value_table,
- 						   sizeof (GTypeValueTable));
- 
-   return module_type_info->type;
-diff --git a/gobject/tests/param.c b/gobject/tests/param.c
-index 758289bf8..971cff162 100644
---- a/gobject/tests/param.c
-+++ b/gobject/tests/param.c
-@@ -2,6 +2,8 @@
- #include <glib-object.h>
- #include <stdlib.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- static void
- test_param_value (void)
- {
-@@ -851,7 +853,7 @@ main (int argc, char *argv[])
-             test_path = g_strdup_printf ("/param/implement/subprocess/%d-%d-%d-%d",
-                                          data.change_this_flag, data.change_this_type,
-                                          data.use_this_flag, data.use_this_type);
--            test_data = g_memdup (&data, sizeof (TestParamImplementData));
-+            test_data = g_memdup2 (&data, sizeof (TestParamImplementData));
-             g_test_add_data_func_full (test_path, test_data, test_param_implement_child, g_free);
-             g_free (test_path);
-           }
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-04.patch b/gnu/packages/patches/glib-CVE-2021-27219-04.patch
deleted file mode 100644
index 3ae01f34b1..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-04.patch
+++ /dev/null
@@ -1,308 +0,0 @@
-Backport of:
-
-From 0736b7c1e7cf4232c5d7eb2b0fbfe9be81bd3baa Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:41:21 +0000
-Subject: [PATCH 04/11] glib: Use g_memdup2() instead of g_memdup() in obvious
- places
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Convert all the call sites which use `g_memdup()`’s length argument
-trivially (for example, by passing a `sizeof()` or an existing `gsize`
-variable), so that they use `g_memdup2()` instead.
-
-In almost all of these cases the use of `g_memdup()` would not have
-caused problems, but it will soon be deprecated, so best port away from
-it
-
-In particular, this fixes an overflow within `g_bytes_new()`, identified
-as GHSL-2021-045 by GHSL team member Kevin Backhouse.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Fixes: GHSL-2021-045
-Helps: #2319
----
- glib/gbytes.c               | 6 ++++--
- glib/gdir.c                 | 3 ++-
- glib/ghash.c                | 7 ++++---
- glib/giochannel.c           | 3 ++-
- glib/gslice.c               | 3 ++-
- glib/gtestutils.c           | 3 ++-
- glib/gvariant.c             | 7 ++++---
- glib/gvarianttype.c         | 3 ++-
- glib/tests/array-test.c     | 4 +++-
- glib/tests/option-context.c | 6 ++++--
- 10 files changed, 29 insertions(+), 16 deletions(-)
-
-diff --git a/glib/gbytes.c b/glib/gbytes.c
-index d56abe6c3..dee494820 100644
---- a/glib/gbytes.c
-+++ b/glib/gbytes.c
-@@ -34,6 +34,8 @@
- 
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- /**
-  * GBytes:
-  *
-@@ -95,7 +97,7 @@ g_bytes_new (gconstpointer data,
- {
-   g_return_val_if_fail (data != NULL || size == 0, NULL);
- 
--  return g_bytes_new_take (g_memdup (data, size), size);
-+  return g_bytes_new_take (g_memdup2 (data, size), size);
- }
- 
- /**
-@@ -499,7 +501,7 @@ g_bytes_unref_to_data (GBytes *bytes,
-        * Copy: Non g_malloc (or compatible) allocator, or static memory,
-        * so we have to copy, and then unref.
-        */
--      result = g_memdup (bytes->data, bytes->size);
-+      result = g_memdup2 (bytes->data, bytes->size);
-       *size = bytes->size;
-       g_bytes_unref (bytes);
-     }
-diff --git a/glib/gdir.c b/glib/gdir.c
-index 6b85e99c8..6747a8c6f 100644
---- a/glib/gdir.c
-+++ b/glib/gdir.c
-@@ -37,6 +37,7 @@
- #include "gconvert.h"
- #include "gfileutils.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtestutils.h"
- #include "glibintl.h"
- 
-@@ -112,7 +113,7 @@ g_dir_open_with_errno (const gchar *path,
-     return NULL;
- #endif
- 
--  return g_memdup (&dir, sizeof dir);
-+  return g_memdup2 (&dir, sizeof dir);
- }
- 
- /**
-diff --git a/glib/ghash.c b/glib/ghash.c
-index e61b03788..26f26062b 100644
---- a/glib/ghash.c
-+++ b/glib/ghash.c
-@@ -34,6 +34,7 @@
- #include "gmacros.h"
- #include "glib-private.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gatomic.h"
- #include "gtestutils.h"
- #include "gslice.h"
-@@ -964,7 +965,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
-       if (hash_table->have_big_keys)
-         {
-           if (key != value)
--            hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
-+            hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
-           /* Keys and values are both big now, so no need for further checks */
-           return;
-         }
-@@ -972,7 +973,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
-         {
-           if (key != value)
-             {
--              hash_table->values = g_memdup (hash_table->keys, sizeof (guint) * hash_table->size);
-+              hash_table->values = g_memdup2 (hash_table->keys, sizeof (guint) * hash_table->size);
-               is_a_set = FALSE;
-             }
-         }
-@@ -1000,7 +1001,7 @@ g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer
- 
-   /* Just split if necessary */
-   if (is_a_set && key != value)
--    hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size);
-+    hash_table->values = g_memdup2 (hash_table->keys, sizeof (gpointer) * hash_table->size);
- 
- #endif
- }
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 1956e9dc6..15927c391 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -37,6 +37,7 @@
- #include "giochannel.h"
- 
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtestutils.h"
- #include "glibintl.h"
- 
-@@ -892,7 +893,7 @@ g_io_channel_set_line_term (GIOChannel	*channel,
-     length = strlen (line_term);
- 
-   g_free (channel->line_term);
--  channel->line_term = line_term ? g_memdup (line_term, length) : NULL;
-+  channel->line_term = line_term ? g_memdup2 (line_term, length) : NULL;
-   channel->line_term_len = length;
- }
- 
-diff --git a/glib/gslice.c b/glib/gslice.c
-index 4c758c3be..bcdbb8853 100644
---- a/glib/gslice.c
-+++ b/glib/gslice.c
-@@ -41,6 +41,7 @@
- #include "gmain.h"
- #include "gmem.h"               /* gslice.h */
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gutils.h"
- #include "gtrashstack.h"
- #include "gtestutils.h"
-@@ -350,7 +351,7 @@ g_slice_get_config_state (GSliceConfig ckey,
-       array[i++] = allocator->contention_counters[address];
-       array[i++] = allocator_get_magazine_threshold (allocator, address);
-       *n_values = i;
--      return g_memdup (array, sizeof (array[0]) * *n_values);
-+      return g_memdup2 (array, sizeof (array[0]) * *n_values);
-     default:
-       return NULL;
-     }
-diff --git a/glib/gtestutils.c b/glib/gtestutils.c
-index dd789482f..5887ecc36 100644
---- a/glib/gtestutils.c
-+++ b/glib/gtestutils.c
-@@ -49,6 +49,7 @@
- #include "gpattern.h"
- #include "grand.h"
- #include "gstrfuncs.h"
-+#include "gstrfuncsprivate.h"
- #include "gtimer.h"
- #include "gslice.h"
- #include "gspawn.h"
-@@ -3798,7 +3799,7 @@ g_test_log_extract (GTestLogBuffer *tbuffer)
-       if (p <= tbuffer->data->str + mlength)
-         {
-           g_string_erase (tbuffer->data, 0, mlength);
--          tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup (&msg, sizeof (msg)));
-+          tbuffer->msgs = g_slist_prepend (tbuffer->msgs, g_memdup2 (&msg, sizeof (msg)));
-           return TRUE;
-         }
- 
-diff --git a/glib/gvariant.c b/glib/gvariant.c
-index b61bf7278..d6f68a9ea 100644
---- a/glib/gvariant.c
-+++ b/glib/gvariant.c
-@@ -33,6 +33,7 @@
- 
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
- 
- /**
-  * SECTION:gvariant
-@@ -725,7 +726,7 @@ g_variant_new_variant (GVariant *value)
-   g_variant_ref_sink (value);
- 
-   return g_variant_new_from_children (G_VARIANT_TYPE_VARIANT,
--                                      g_memdup (&value, sizeof value),
-+                                      g_memdup2 (&value, sizeof value),
-                                       1, g_variant_is_trusted (value));
- }
- 
-@@ -1229,7 +1230,7 @@ g_variant_new_fixed_array (const GVariantType  *element_type,
-       return NULL;
-     }
- 
--  data = g_memdup (elements, n_elements * element_size);
-+  data = g_memdup2 (elements, n_elements * element_size);
-   value = g_variant_new_from_data (array_type, data,
-                                    n_elements * element_size,
-                                    FALSE, g_free, data);
-@@ -1908,7 +1909,7 @@ g_variant_dup_bytestring (GVariant *value,
-   if (length)
-     *length = size;
- 
--  return g_memdup (original, size + 1);
-+  return g_memdup2 (original, size + 1);
- }
- 
- /**
-diff --git a/glib/gvarianttype.c b/glib/gvarianttype.c
-index 1a228f73b..07659ff12 100644
---- a/glib/gvarianttype.c
-+++ b/glib/gvarianttype.c
-@@ -28,6 +28,7 @@
- 
- #include <string.h>
- 
-+#include "gstrfuncsprivate.h"
- 
- /**
-  * SECTION:gvarianttype
-@@ -1181,7 +1182,7 @@ g_variant_type_new_tuple (const GVariantType * const *items,
-   g_assert (offset < sizeof buffer);
-   buffer[offset++] = ')';
- 
--  return (GVariantType *) g_memdup (buffer, offset);
-+  return (GVariantType *) g_memdup2 (buffer, offset);
- }
- 
- /**
-diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
-index 3fcf1136a..11982f822 100644
---- a/glib/tests/array-test.c
-+++ b/glib/tests/array-test.c
-@@ -29,6 +29,8 @@
- #include <string.h>
- #include "glib.h"
- 
-+#include "gstrfuncsprivate.h"
-+
- /* Test data to be passed to any function which calls g_array_new(), providing
-  * the parameters for that call. Most #GArray tests should be repeated for all
-  * possible values of #ArrayTestData. */
-@@ -1642,7 +1644,7 @@ byte_array_new_take (void)
-   GByteArray *gbarray;
-   guint8 *data;
- 
--  data = g_memdup ("woooweeewow", 11);
-+  data = g_memdup2 ("woooweeewow", 11);
-   gbarray = g_byte_array_new_take (data, 11);
-   g_assert (gbarray->data == data);
-   g_assert_cmpuint (gbarray->len, ==, 11);
-diff --git a/glib/tests/option-context.c b/glib/tests/option-context.c
-index 149d22353..88d2b80d1 100644
---- a/glib/tests/option-context.c
-+++ b/glib/tests/option-context.c
-@@ -27,6 +27,8 @@
- #include <string.h>
- #include <locale.h>
- 
-+#include "gstrfuncsprivate.h"
-+
- static GOptionEntry main_entries[] = {
-   { "main-switch", 0, 0,
-     G_OPTION_ARG_NONE, NULL,
-@@ -256,7 +258,7 @@ join_stringv (int argc, char **argv)
- static char **
- copy_stringv (char **argv, int argc)
- {
--  return g_memdup (argv, sizeof (char *) * (argc + 1));
-+  return g_memdup2 (argv, sizeof (char *) * (argc + 1));
- }
- 
- static void
-@@ -2323,7 +2325,7 @@ test_group_parse (void)
-   g_option_context_add_group (context, group);
- 
-   argv = split_string ("program --test arg1 -f arg2 --group-test arg3 --frob arg4 -z arg5", &argc);
--  orig_argv = g_memdup (argv, (argc + 1) * sizeof (char *));
-+  orig_argv = g_memdup2 (argv, (argc + 1) * sizeof (char *));
- 
-   retval = g_option_context_parse (context, &argc, &argv, &error);
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-05.patch b/gnu/packages/patches/glib-CVE-2021-27219-05.patch
deleted file mode 100644
index 62bce1b188..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-05.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 0cbad673215ec8a049b7fe2ff44b0beed31b376e Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 16:12:24 +0000
-Subject: [PATCH 05/11] gwinhttpfile: Avoid arithmetic overflow when
- calculating a size
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The members of `URL_COMPONENTS` (`winhttp_file->url`) are `DWORD`s, i.e.
-32-bit unsigned integers. Adding to and multiplying them may cause them
-to overflow the unsigned integer bounds, even if the result is passed to
-`g_memdup2()` which accepts a `gsize`.
-
-Cast the `URL_COMPONENTS` members to `gsize` first to ensure that the
-arithmetic is done in terms of `gsize`s rather than unsigned integers.
-
-Spotted by Sebastian Dröge.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/win32/gwinhttpfile.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/gio/win32/gwinhttpfile.c b/gio/win32/gwinhttpfile.c
-index 040ee8564..246ec0578 100644
---- a/gio/win32/gwinhttpfile.c
-+++ b/gio/win32/gwinhttpfile.c
-@@ -394,10 +394,10 @@ g_winhttp_file_resolve_relative_path (GFile      *file,
-   child = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
-   child->vfs = winhttp_file->vfs;
-   child->url = winhttp_file->url;
--  child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, (winhttp_file->url.dwSchemeLength+1)*2);
--  child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, (winhttp_file->url.dwHostNameLength+1)*2);
--  child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, (winhttp_file->url.dwUserNameLength+1)*2);
--  child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, (winhttp_file->url.dwPasswordLength+1)*2);
-+  child->url.lpszScheme = g_memdup2 (winhttp_file->url.lpszScheme, ((gsize) winhttp_file->url.dwSchemeLength + 1) * 2);
-+  child->url.lpszHostName = g_memdup2 (winhttp_file->url.lpszHostName, ((gsize) winhttp_file->url.dwHostNameLength + 1) * 2);
-+  child->url.lpszUserName = g_memdup2 (winhttp_file->url.lpszUserName, ((gsize) winhttp_file->url.dwUserNameLength + 1) * 2);
-+  child->url.lpszPassword = g_memdup2 (winhttp_file->url.lpszPassword, ((gsize) winhttp_file->url.dwPasswordLength + 1) * 2);
-   child->url.lpszUrlPath = wnew_path;
-   child->url.dwUrlPathLength = wcslen (wnew_path);
-   child->url.lpszExtraInfo = NULL;
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-06.patch b/gnu/packages/patches/glib-CVE-2021-27219-06.patch
deleted file mode 100644
index 4e2435f5fd..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-06.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From f9ee2275cbc312c0b4cdbc338a4fbb76eb36fb9a Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:49:00 +0000
-Subject: [PATCH 06/11] gdatainputstream: Handle stop_chars_len internally as
- gsize
-
-Previously it was handled as a `gssize`, which meant that if the
-`stop_chars` string was longer than `G_MAXSSIZE` there would be an
-overflow.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gdatainputstream.c | 25 +++++++++++++++++--------
- 1 file changed, 17 insertions(+), 8 deletions(-)
-
-diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c
-index 2e7750cb5..2cdcbda19 100644
---- a/gio/gdatainputstream.c
-+++ b/gio/gdatainputstream.c
-@@ -27,6 +27,7 @@
- #include "gioenumtypes.h"
- #include "gioerror.h"
- #include "glibintl.h"
-+#include "gstrfuncsprivate.h"
- 
- #include <string.h>
- 
-@@ -856,7 +857,7 @@ static gssize
- scan_for_chars (GDataInputStream *stream,
- 		gsize            *checked_out,
- 		const char       *stop_chars,
--                gssize            stop_chars_len)
-+                gsize             stop_chars_len)
- {
-   GBufferedInputStream *bstream;
-   const char *buffer;
-@@ -952,7 +953,7 @@ typedef struct
-   gsize checked;
- 
-   gchar *stop_chars;
--  gssize stop_chars_len;
-+  gsize stop_chars_len;
-   gsize length;
- } GDataInputStreamReadData;
- 
-@@ -1078,12 +1079,17 @@ g_data_input_stream_read_async (GDataInputStream    *stream,
- {
-   GDataInputStreamReadData *data;
-   GTask *task;
-+  gsize stop_chars_len_unsigned;
- 
-   data = g_slice_new0 (GDataInputStreamReadData);
--  if (stop_chars_len == -1)
--    stop_chars_len = strlen (stop_chars);
--  data->stop_chars = g_memdup (stop_chars, stop_chars_len);
--  data->stop_chars_len = stop_chars_len;
-+
-+  if (stop_chars_len < 0)
-+    stop_chars_len_unsigned = strlen (stop_chars);
-+  else
-+    stop_chars_len_unsigned = (gsize) stop_chars_len;
-+
-+  data->stop_chars = g_memdup2 (stop_chars, stop_chars_len_unsigned);
-+  data->stop_chars_len = stop_chars_len_unsigned;
-   data->last_saw_cr = FALSE;
- 
-   task = g_task_new (stream, cancellable, callback, user_data);
-@@ -1338,17 +1344,20 @@ g_data_input_stream_read_upto (GDataInputStream  *stream,
-   gssize found_pos;
-   gssize res;
-   char *data_until;
-+  gsize stop_chars_len_unsigned;
- 
-   g_return_val_if_fail (G_IS_DATA_INPUT_STREAM (stream), NULL);
- 
-   if (stop_chars_len < 0)
--    stop_chars_len = strlen (stop_chars);
-+    stop_chars_len_unsigned = strlen (stop_chars);
-+  else
-+    stop_chars_len_unsigned = (gsize) stop_chars_len;
- 
-   bstream = G_BUFFERED_INPUT_STREAM (stream);
- 
-   checked = 0;
- 
--  while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len)) == -1)
-+  while ((found_pos = scan_for_chars (stream, &checked, stop_chars, stop_chars_len_unsigned)) == -1)
-     {
-       if (g_buffered_input_stream_get_available (bstream) ==
-           g_buffered_input_stream_get_buffer_size (bstream))
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-07.patch b/gnu/packages/patches/glib-CVE-2021-27219-07.patch
deleted file mode 100644
index dad3d285f4..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-07.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-Backport of:
-
-From 2aaf593a9eb96d84fe3be740aca2810a97d95592 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:50:37 +0000
-Subject: [PATCH 07/11] gwin32: Use gsize internally in g_wcsdup()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This allows it to handle strings up to length `G_MAXSIZE` — previously
-it would overflow with such strings.
-
-Update the several copies of it identically.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gwin32appinfo.c     | 33 ++++++++++++++++++++++++++-------
- gio/gwin32registrykey.c | 34 ++++++++++++++++++++++++++--------
- 2 files changed, 52 insertions(+), 15 deletions(-)
-
-diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c
-index 9f335b370..dd7a96a4a 100644
---- a/gio/gwin32appinfo.c
-+++ b/gio/gwin32appinfo.c
-@@ -464,15 +464,34 @@ static GWin32RegistryKey *applications_key;
- /* Watch this key */
- static GWin32RegistryKey *classes_root_key;
- 
-+static gsize
-+g_utf16_len (const gunichar2 *str)
-+{
-+  gsize result;
-+
-+  for (result = 0; str[0] != 0; str++, result++)
-+    ;
-+
-+  return result;
-+}
-+
- static gunichar2 *
--g_wcsdup (const gunichar2 *str, gssize str_size)
-+g_wcsdup (const gunichar2 *str, gssize str_len)
- {
--  if (str_size == -1)
--    {
--      str_size = wcslen (str) + 1;
--      str_size *= sizeof (gunichar2);
--    }
--  return g_memdup (str, str_size);
-+  gsize str_len_unsigned;
-+  gsize str_size;
-+
-+  g_return_val_if_fail (str != NULL, NULL);
-+
-+  if (str_len < 0)
-+    str_len_unsigned = g_utf16_len (str);
-+  else
-+    str_len_unsigned = (gsize) str_len;
-+
-+  g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
-+  str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
-+
-+  return g_memdup2 (str, str_size);
- }
- 
- #define URL_ASSOCIATIONS L"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\"
-diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
-index 619fd48af..fbd65311a 100644
---- a/gio/gwin32registrykey.c
-+++ b/gio/gwin32registrykey.c
-@@ -127,16 +127,34 @@ typedef enum
-   G_WIN32_REGISTRY_UPDATED_PATH = 1,
- } GWin32RegistryKeyUpdateFlag;
- 
-+static gsize
-+g_utf16_len (const gunichar2 *str)
-+{
-+  gsize result;
-+
-+  for (result = 0; str[0] != 0; str++, result++)
-+    ;
-+
-+  return result;
-+}
-+
- static gunichar2 *
--g_wcsdup (const gunichar2 *str,
--          gssize           str_size)
-+g_wcsdup (const gunichar2 *str, gssize str_len)
- {
--  if (str_size == -1)
--    {
--      str_size = wcslen (str) + 1;
--      str_size *= sizeof (gunichar2);
--    }
--  return g_memdup (str, str_size);
-+  gsize str_len_unsigned;
-+  gsize str_size;
-+
-+  g_return_val_if_fail (str != NULL, NULL);
-+
-+  if (str_len < 0)
-+    str_len_unsigned = g_utf16_len (str);
-+  else
-+    str_len_unsigned = (gsize) str_len;
-+
-+  g_assert (str_len_unsigned <= G_MAXSIZE / sizeof (gunichar2) - 1);
-+  str_size = (str_len_unsigned + 1) * sizeof (gunichar2);
-+
-+  return g_memdup2 (str, str_size);
- }
- 
- /**
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-08.patch b/gnu/packages/patches/glib-CVE-2021-27219-08.patch
deleted file mode 100644
index 2c021ad317..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-08.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From ba8ca443051f93a74c0d03d62e70402036f967a5 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 13:58:32 +0000
-Subject: [PATCH 08/11] gkeyfilesettingsbackend: Handle long keys when
- converting paths
-
-Previously, the code in `convert_path()` could not handle keys longer
-than `G_MAXINT`, and would overflow if that was exceeded.
-
-Convert the code to use `gsize` and `g_memdup2()` throughout, and
-change from identifying the position of the final slash in the string
-using a signed offset `i`, to using a pointer to the character (and
-`strrchr()`). This allows the slash to be at any position in a
-`G_MAXSIZE`-long string, without sacrificing a bit of the offset for
-indicating whether a slash was found.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gkeyfilesettingsbackend.c | 21 ++++++++++-----------
- 1 file changed, 10 insertions(+), 11 deletions(-)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index cd5765afd..25b057672 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -33,6 +33,7 @@
- #include "gfilemonitor.h"
- #include "gsimplepermission.h"
- #include "gsettingsbackendinternal.h"
-+#include "gstrfuncsprivate.h"
- #include "giomodule-priv.h"
- #include "gportalsupport.h"
- 
-@@ -145,8 +146,8 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
-               gchar                   **group,
-               gchar                   **basename)
- {
--  gint key_len = strlen (key);
--  gint i;
-+  gsize key_len = strlen (key);
-+  const gchar *last_slash;
- 
-   if (key_len < kfsb->prefix_len ||
-       memcmp (key, kfsb->prefix, kfsb->prefix_len) != 0)
-@@ -155,38 +156,36 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
-   key_len -= kfsb->prefix_len;
-   key += kfsb->prefix_len;
- 
--  for (i = key_len; i >= 0; i--)
--    if (key[i] == '/')
--      break;
-+  last_slash = strrchr (key, '/');
- 
-   if (kfsb->root_group)
-     {
-       /* if a root_group was specified, make sure the user hasn't given
-        * a path that ghosts that group name
-        */
--      if (i == kfsb->root_group_len && memcmp (key, kfsb->root_group, i) == 0)
-+      if (last_slash != NULL && (last_slash - key) == kfsb->root_group_len && memcmp (key, kfsb->root_group, last_slash - key) == 0)
-         return FALSE;
-     }
-   else
-     {
-       /* if no root_group was given, ensure that the user gave a path */
--      if (i == -1)
-+      if (last_slash == NULL)
-         return FALSE;
-     }
- 
-   if (group)
-     {
--      if (i >= 0)
-+      if (last_slash != NULL)
-         {
--          *group = g_memdup (key, i + 1);
--          (*group)[i] = '\0';
-+          *group = g_memdup2 (key, (last_slash - key) + 1);
-+          (*group)[(last_slash - key)] = '\0';
-         }
-       else
-         *group = g_strdup (kfsb->root_group);
-     }
- 
-   if (basename)
--    *basename = g_memdup (key + i + 1, key_len - i);
-+    *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
- 
-   return TRUE;
- }
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-09.patch b/gnu/packages/patches/glib-CVE-2021-27219-09.patch
deleted file mode 100644
index 4de0c1b349..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-09.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 65ec7f4d6e8832c481f6e00e2eb007b9a60024ce Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:00:53 +0000
-Subject: [PATCH 09/11] gsocket: Use gsize to track native sockaddr's size
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Don’t use an `int`, that’s potentially too small. In practical terms,
-this is not a problem, since no socket address is going to be that big.
-
-By making these changes we can use `g_memdup2()` without warnings,
-though. Fewer warnings is good.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gsocket.c | 16 ++++++++++------
- 1 file changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/gio/gsocket.c b/gio/gsocket.c
-index 66073af83..a3af149e8 100644
---- a/gio/gsocket.c
-+++ b/gio/gsocket.c
-@@ -75,6 +75,7 @@
- #include "gcredentialsprivate.h"
- #include "glibintl.h"
- #include "gioprivate.h"
-+#include "gstrfuncsprivate.h"
- 
- #ifdef G_OS_WIN32
- /* For Windows XP runtime compatibility, but use the system's if_nametoindex() if available */
-@@ -174,7 +175,7 @@ static gboolean     g_socket_datagram_based_condition_wait       (GDatagramBased
-                                                                   GError          **error);
- 
- static GSocketAddress *
--cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len);
-+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len);
- 
- static gssize
- g_socket_receive_message_with_timeout  (GSocket                 *socket,
-@@ -260,7 +261,7 @@ struct _GSocketPrivate
-   struct {
-     GSocketAddress *addr;
-     struct sockaddr *native;
--    gint native_len;
-+    gsize native_len;
-     guint64 last_used;
-   } recv_addr_cache[RECV_ADDR_CACHE_SIZE];
- };
-@@ -5211,14 +5212,14 @@ g_socket_send_messages_with_timeout (GSocket        *socket,
- }
- 
- static GSocketAddress *
--cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
-+cache_recv_address (GSocket *socket, struct sockaddr *native, size_t native_len)
- {
-   GSocketAddress *saddr;
-   gint i;
-   guint64 oldest_time = G_MAXUINT64;
-   gint oldest_index = 0;
- 
--  if (native_len <= 0)
-+  if (native_len == 0)
-     return NULL;
- 
-   saddr = NULL;
-@@ -5226,7 +5227,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
-     {
-       GSocketAddress *tmp = socket->priv->recv_addr_cache[i].addr;
-       gpointer tmp_native = socket->priv->recv_addr_cache[i].native;
--      gint tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
-+      gsize tmp_native_len = socket->priv->recv_addr_cache[i].native_len;
- 
-       if (!tmp)
-         continue;
-@@ -5256,7 +5257,7 @@ cache_recv_address (GSocket *socket, struct sockaddr *native, int native_len)
-       g_free (socket->priv->recv_addr_cache[oldest_index].native);
-     }
- 
--  socket->priv->recv_addr_cache[oldest_index].native = g_memdup (native, native_len);
-+  socket->priv->recv_addr_cache[oldest_index].native = g_memdup2 (native, native_len);
-   socket->priv->recv_addr_cache[oldest_index].native_len = native_len;
-   socket->priv->recv_addr_cache[oldest_index].addr = g_object_ref (saddr);
-   socket->priv->recv_addr_cache[oldest_index].last_used = g_get_monotonic_time ();
-@@ -5404,6 +5405,9 @@ g_socket_receive_message_with_timeout (GSocket                 *socket,
-     /* do it */
-     while (1)
-       {
-+        /* addrlen has to be of type int because that’s how WSARecvFrom() is defined */
-+        G_STATIC_ASSERT (sizeof addr <= G_MAXINT);
-+
- 	addrlen = sizeof addr;
- 	if (address)
- 	  result = WSARecvFrom (socket->priv->fd,
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-10.patch b/gnu/packages/patches/glib-CVE-2021-27219-10.patch
deleted file mode 100644
index 36198b8eef..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-10.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 777b95a88f006d39d9fe6d3321db17e7b0d4b9a4 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:07:39 +0000
-Subject: [PATCH 10/11] gtlspassword: Forbid very long TLS passwords
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The public API `g_tls_password_set_value_full()` (and the vfunc it
-invokes) can only accept a `gssize` length. Ensure that nul-terminated
-strings passed to `g_tls_password_set_value()` can’t exceed that length.
-Use `g_memdup2()` to avoid an overflow if they’re longer than
-`G_MAXUINT` similarly.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- gio/gtlspassword.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
-index 1e437a7b6..dbcec41a8 100644
---- a/gio/gtlspassword.c
-+++ b/gio/gtlspassword.c
-@@ -23,6 +23,7 @@
- #include "glibintl.h"
- 
- #include "gioenumtypes.h"
-+#include "gstrfuncsprivate.h"
- #include "gtlspassword.h"
- 
- #include <string.h>
-@@ -287,9 +288,14 @@ g_tls_password_set_value (GTlsPassword  *password,
-   g_return_if_fail (G_IS_TLS_PASSWORD (password));
- 
-   if (length < 0)
--    length = strlen ((gchar *)value);
-+    {
-+      /* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
-+      gsize length_unsigned = strlen ((gchar *) value);
-+      g_return_if_fail (length_unsigned > G_MAXSSIZE);
-+      length = (gssize) length_unsigned;
-+    }
- 
--  g_tls_password_set_value_full (password, g_memdup (value, length), length, g_free);
-+  g_tls_password_set_value_full (password, g_memdup2 (value, (gsize) length), length, g_free);
- }
- 
- /**
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-11.patch b/gnu/packages/patches/glib-CVE-2021-27219-11.patch
deleted file mode 100644
index 4413cb9827..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-11.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From ecdf91400e9a538695a0895b95ad7e8abcdf1749 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Thu, 4 Feb 2021 14:09:40 +0000
-Subject: [PATCH 11/11] giochannel: Forbid very long line terminator strings
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The public API `GIOChannel.line_term_len` is only a `guint`. Ensure that
-nul-terminated strings passed to `g_io_channel_set_line_term()` can’t
-exceed that length. Use `g_memdup2()` to avoid a warning (`g_memdup()`
-is due to be deprecated), but not to avoid a bug, since it’s also
-limited to `G_MAXUINT`.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-Helps: #2319
----
- glib/giochannel.c | 17 +++++++++++++----
- 1 file changed, 13 insertions(+), 4 deletions(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 15927c391..66c6591f0 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -884,16 +884,25 @@ g_io_channel_set_line_term (GIOChannel	*channel,
-                             const gchar	*line_term,
- 			    gint         length)
- {
-+  guint length_unsigned;
-+
-   g_return_if_fail (channel != NULL);
-   g_return_if_fail (line_term == NULL || length != 0); /* Disallow "" */
- 
-   if (line_term == NULL)
--    length = 0;
--  else if (length < 0)
--    length = strlen (line_term);
-+    length_unsigned = 0;
-+  else if (length >= 0)
-+    length_unsigned = (guint) length;
-+  else
-+    {
-+      /* FIXME: We’re constrained by line_term_len being a guint here */
-+      gsize length_size = strlen (line_term);
-+      g_return_if_fail (length_size > G_MAXUINT);
-+      length_unsigned = (guint) length_size;
-+    }
- 
-   g_free (channel->line_term);
--  channel->line_term = line_term ? g_memdup2 (line_term, length) : NULL;
-+  channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
-   channel->line_term_len = length;
- }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-12.patch b/gnu/packages/patches/glib-CVE-2021-27219-12.patch
deleted file mode 100644
index 4fdbb81750..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-12.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f8273b9aded135fe07094faebd527e43851aaf6e Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
-Date: Sun, 7 Feb 2021 23:32:40 +0100
-Subject: [PATCH 1/5] giochannel: Fix length_size bounds check
-
-The inverted condition is an obvious error introduced by ecdf91400e9a.
-
-Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2323
-
-(cherry picked from commit a149bf2f9030168051942124536e303af8ba6176)
----
- glib/giochannel.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 66c6591f0..0d9d5f223 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -897,7 +897,7 @@ g_io_channel_set_line_term (GIOChannel	*channel,
-     {
-       /* FIXME: We’re constrained by line_term_len being a guint here */
-       gsize length_size = strlen (line_term);
--      g_return_if_fail (length_size > G_MAXUINT);
-+      g_return_if_fail (length_size <= G_MAXUINT);
-       length_unsigned = (guint) length_size;
-     }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-13.patch b/gnu/packages/patches/glib-CVE-2021-27219-13.patch
deleted file mode 100644
index 6a287cc3a2..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-13.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From e069c50467712e6d607822afd6b6c15c2c343dff Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:34:50 +0000
-Subject: [PATCH 2/5] giochannel: Don't store negative line_term_len in
- GIOChannel struct
-
-Adding test coverage indicated that this was another bug in 0cc11f74.
-
-Fixes: 0cc11f74 "giochannel: Forbid very long line terminator strings"
-Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2323
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit 5dc8b0014c03e7491d93b90275ab442e888a9628)
----
- glib/giochannel.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/glib/giochannel.c b/glib/giochannel.c
-index 0d9d5f223..4c39b9dc0 100644
---- a/glib/giochannel.c
-+++ b/glib/giochannel.c
-@@ -903,7 +903,7 @@ g_io_channel_set_line_term (GIOChannel	*channel,
- 
-   g_free (channel->line_term);
-   channel->line_term = line_term ? g_memdup2 (line_term, length_unsigned) : NULL;
--  channel->line_term_len = length;
-+  channel->line_term_len = length_unsigned;
- }
- 
- /**
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-14.patch b/gnu/packages/patches/glib-CVE-2021-27219-14.patch
deleted file mode 100644
index 78de2846da..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-14.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4506d1859a863087598c8d122740bae25b65b099 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:04:48 +0000
-Subject: [PATCH 4/5] gtlspassword: Fix inverted assertion
-
-The intention here was to assert that the length of the password fits
-in a gssize. Passwords more than half the size of virtual memory are
-probably excessive.
-
-Fixes: a8b204ff "gtlspassword: Forbid very long TLS passwords"
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit 61bb52ec42de1082bfb06ce1c737fc295bfe60b8)
----
- gio/gtlspassword.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/gio/gtlspassword.c b/gio/gtlspassword.c
-index dbcec41a8..bd86a6dfe 100644
---- a/gio/gtlspassword.c
-+++ b/gio/gtlspassword.c
-@@ -291,7 +291,7 @@ g_tls_password_set_value (GTlsPassword  *password,
-     {
-       /* FIXME: g_tls_password_set_value_full() doesn’t support unsigned gsize */
-       gsize length_unsigned = strlen ((gchar *) value);
--      g_return_if_fail (length_unsigned > G_MAXSSIZE);
-+      g_return_if_fail (length_unsigned <= G_MAXSSIZE);
-       length = (gssize) length_unsigned;
-     }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-15.patch b/gnu/packages/patches/glib-CVE-2021-27219-15.patch
deleted file mode 100644
index 37ef85b4fa..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-15.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 3d1550354c3c6a8491c39881752d51cb7515f2c2 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <smcv@collabora.com>
-Date: Mon, 8 Feb 2021 10:22:39 +0000
-Subject: [PATCH 5/5] tls-interaction: Add test coverage for various ways to
- set the password
-
-Signed-off-by: Simon McVittie <smcv@collabora.com>
-(cherry picked from commit df4501316ca3903072400504a5ea76498db19538)
----
- gio/tests/tls-interaction.c | 55 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 55 insertions(+)
-
-diff --git a/gio/tests/tls-interaction.c b/gio/tests/tls-interaction.c
-index 4f0737d7e..5661e8e0d 100644
---- a/gio/tests/tls-interaction.c
-+++ b/gio/tests/tls-interaction.c
-@@ -174,6 +174,38 @@ test_interaction_ask_password_finish_failure (GTlsInteraction    *interaction,
- }
- 
- 
-+/* Return a copy of @str that is allocated in a silly way, to exercise
-+ * custom free-functions. The returned pointer points to a copy of @str
-+ * in a buffer of the form "BEFORE \0 str \0 AFTER". */
-+static guchar *
-+special_dup (const char *str)
-+{
-+  GString *buf = g_string_new ("BEFORE");
-+  guchar *ret;
-+
-+  g_string_append_c (buf, '\0');
-+  g_string_append (buf, str);
-+  g_string_append_c (buf, '\0');
-+  g_string_append (buf, "AFTER");
-+  ret = (guchar *) g_string_free (buf, FALSE);
-+  return ret + strlen ("BEFORE") + 1;
-+}
-+
-+
-+/* Free a copy of @str that was made with special_dup(), after asserting
-+ * that it has not been corrupted. */
-+static void
-+special_free (gpointer p)
-+{
-+  gchar *s = p;
-+  gchar *buf = s - strlen ("BEFORE") - 1;
-+
-+  g_assert_cmpstr (buf, ==, "BEFORE");
-+  g_assert_cmpstr (s + strlen (s) + 1, ==, "AFTER");
-+  g_free (buf);
-+}
-+
-+
- static GTlsInteractionResult
- test_interaction_ask_password_sync_success (GTlsInteraction    *interaction,
-                                             GTlsPassword       *password,
-@@ -181,6 +213,8 @@ test_interaction_ask_password_sync_success (GTlsInteraction    *interaction,
-                                             GError            **error)
- {
-   TestInteraction *self;
-+  const guchar *value;
-+  gsize len;
- 
-   g_assert (TEST_IS_INTERACTION (interaction));
-   self = TEST_INTERACTION (interaction);
-@@ -192,6 +226,27 @@ test_interaction_ask_password_sync_success (GTlsInteraction    *interaction,
-   g_assert (error != NULL);
-   g_assert (*error == NULL);
- 
-+  /* Exercise different ways to set the value */
-+  g_tls_password_set_value (password, (const guchar *) "foo", 4);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "foo", 4);
-+
-+  g_tls_password_set_value (password, (const guchar *) "bar", -1);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "bar", 3);
-+
-+  g_tls_password_set_value_full (password, special_dup ("baa"), 4, special_free);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "baa", 4);
-+
-+  g_tls_password_set_value_full (password, special_dup ("baz"), -1, special_free);
-+  len = 0;
-+  value = g_tls_password_get_value (password, &len);
-+  g_assert_cmpmem (value, len, "baz", 3);
-+
-   /* Don't do this in real life. Include a null terminator for testing */
-   g_tls_password_set_value (password, (const guchar *)"the password", 13);
-   return G_TLS_INTERACTION_HANDLED;
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-16.patch b/gnu/packages/patches/glib-CVE-2021-27219-16.patch
deleted file mode 100644
index 43635e72ed..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-16.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From cb9ee701ef46c1819eed4e2a4dc181682bdfc176 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:16:39 +0000
-Subject: [PATCH 1/3] gkeyfilesettingsbackend: Fix basename handling when group
- is unset
-
-Fix an effective regression in commit
-7781a9cbd2fd0aa84bee0f4eee88470640ff6706, which happens when
-`convert_path()` is called with a `key` which contains no slashes. In
-that case, the `key` is entirely the `basename`.
-
-Prior to commit 7781a9cb, the code worked through a fluke of `i == -1`
-cancelling out with the various additions in the `g_memdup()` call, and
-effectively resulting in `g_strdup (key)`.
-
-Spotted by Guido Berhoerster.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/gkeyfilesettingsbackend.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index 25b057672..861c3a661 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -185,7 +185,12 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
-     }
- 
-   if (basename)
--    *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
-+    {
-+      if (last_slash != NULL)
-+        *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
-+      else
-+        *basename = g_strdup (key);
-+    }
- 
-   return TRUE;
- }
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-17.patch b/gnu/packages/patches/glib-CVE-2021-27219-17.patch
deleted file mode 100644
index 3153979071..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-17.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 31e0d403ba635dbbacbfbff74295e5db02558d76 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:19:30 +0000
-Subject: [PATCH 2/3] gkeyfilesettingsbackend: Disallow empty key or group
- names
-
-These should never have been allowed; they will result in precondition
-failures from the `GKeyFile` later on in the code.
-
-A test will be added for this shortly.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/gkeyfilesettingsbackend.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/gio/gkeyfilesettingsbackend.c b/gio/gkeyfilesettingsbackend.c
-index 861c3a661..de216e615 100644
---- a/gio/gkeyfilesettingsbackend.c
-+++ b/gio/gkeyfilesettingsbackend.c
-@@ -158,6 +158,13 @@ convert_path (GKeyfileSettingsBackend  *kfsb,
- 
-   last_slash = strrchr (key, '/');
- 
-+  /* Disallow empty group names or key names */
-+  if (key_len == 0 ||
-+      (last_slash != NULL &&
-+       (*(last_slash + 1) == '\0' ||
-+        last_slash == key)))
-+    return FALSE;
-+
-   if (kfsb->root_group)
-     {
-       /* if a root_group was specified, make sure the user hasn't given
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-27219-18.patch b/gnu/packages/patches/glib-CVE-2021-27219-18.patch
deleted file mode 100644
index c18d44ddeb..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-27219-18.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-Backport of:
-
-From 221c26685354dea2b2732df94404e8e5e77a1591 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 10 Feb 2021 21:21:36 +0000
-Subject: [PATCH 3/3] tests: Add tests for key name handling in the keyfile
- backend
-
-This tests the two recent commits.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
----
- gio/tests/gsettings.c | 171 +++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 170 insertions(+), 1 deletion(-)
-
-diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c
-index baadca8f5..afe594a23 100644
---- a/gio/tests/gsettings.c
-+++ b/gio/tests/gsettings.c
-@@ -1,3 +1,4 @@
-+#include <errno.h>
- #include <stdlib.h>
- #include <locale.h>
- #include <libintl.h>
-@@ -1740,6 +1741,14 @@ key_changed_cb (GSettings *settings, const gchar *key, gpointer data)
-   (*b) = TRUE;
- }
- 
-+typedef struct
-+{
-+  const gchar *path;
-+  const gchar *root_group;
-+  const gchar *keyfile_group;
-+  const gchar *root_path;
-+} KeyfileTestData;
-+
- /*
-  * Test that using a keyfile works
-  */
-@@ -1834,7 +1843,11 @@ test_keyfile (Fixture       *fixture,
-   g_free (str);
- 
-   g_settings_set (settings, "farewell", "s", "cheerio");
--  
-+
-+  /* Check that empty keys/groups are not allowed. */
-+  g_assert_false (g_settings_is_writable (settings, ""));
-+  g_assert_false (g_settings_is_writable (settings, "/"));
-+
-   /* When executing as root, changing the mode of the keyfile will have
-    * no effect on the writability of the settings.
-    */
-@@ -1866,6 +1879,149 @@ test_keyfile (Fixture       *fixture,
-   g_free (keyfile_path);
- }
- 
-+/*
-+ * Test that using a keyfile works with a schema with no path set.
-+ */
-+static void
-+test_keyfile_no_path (Fixture       *fixture,
-+                      gconstpointer  user_data)
-+{
-+  const KeyfileTestData *test_data = user_data;
-+  GSettingsBackend *kf_backend;
-+  GSettings *settings;
-+  GKeyFile *keyfile;
-+  gboolean writable;
-+  gchar *key = NULL;
-+  GError *error = NULL;
-+  gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+  keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+  store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+  kf_backend = g_keyfile_settings_backend_new (store_path, test_data->root_path, test_data->root_group);
-+  settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, test_data->path);
-+  g_object_unref (kf_backend);
-+
-+  g_settings_reset (settings, "test-boolean");
-+  g_assert_true (g_settings_get_boolean (settings, "test-boolean"));
-+
-+  writable = g_settings_is_writable (settings, "test-boolean");
-+  g_assert_true (writable);
-+  g_settings_set (settings, "test-boolean", "b", FALSE);
-+
-+  g_assert_false (g_settings_get_boolean (settings, "test-boolean"));
-+
-+  g_settings_delay (settings);
-+  g_settings_set (settings, "test-boolean", "b", TRUE);
-+  g_settings_apply (settings);
-+
-+  keyfile = g_key_file_new ();
-+  g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
-+
-+  g_assert_true (g_key_file_get_boolean (keyfile, test_data->keyfile_group, "test-boolean", NULL));
-+
-+  g_key_file_free (keyfile);
-+
-+  g_settings_reset (settings, "test-boolean");
-+  g_settings_apply (settings);
-+  keyfile = g_key_file_new ();
-+  g_assert_true (g_key_file_load_from_file (keyfile, store_path, 0, NULL));
-+
-+  g_assert_false (g_key_file_get_string (keyfile, test_data->keyfile_group, "test-boolean", &error));
-+  g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND);
-+  g_clear_error (&error);
-+
-+  /* Check that empty keys/groups are not allowed. */
-+  g_assert_false (g_settings_is_writable (settings, ""));
-+  g_assert_false (g_settings_is_writable (settings, "/"));
-+
-+  /* Keys which ghost the root group name are not allowed. This can only be
-+   * tested when the path is `/` as otherwise it acts as a prefix and prevents
-+   * any ghosting. */
-+  if (g_str_equal (test_data->path, "/"))
-+    {
-+      key = g_strdup_printf ("%s/%s", test_data->root_group, "");
-+      g_assert_false (g_settings_is_writable (settings, key));
-+      g_free (key);
-+
-+      key = g_strdup_printf ("%s/%s", test_data->root_group, "/");
-+      g_assert_false (g_settings_is_writable (settings, key));
-+      g_free (key);
-+
-+      key = g_strdup_printf ("%s/%s", test_data->root_group, "test-boolean");
-+      g_assert_false (g_settings_is_writable (settings, key));
-+      g_free (key);
-+    }
-+
-+  g_key_file_free (keyfile);
-+  g_object_unref (settings);
-+
-+  /* Clean up the temporary directory. */
-+  g_assert_cmpint (g_chmod (keyfile_path, 0777) == 0 ? 0 : errno, ==, 0);
-+  g_assert_cmpint (g_remove (store_path) == 0 ? 0 : errno, ==, 0);
-+  g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+  g_free (store_path);
-+  g_free (keyfile_path);
-+}
-+
-+/*
-+ * Test that a keyfile rejects writes to keys outside its root path.
-+ */
-+static void
-+test_keyfile_outside_root_path (Fixture       *fixture,
-+                                gconstpointer  user_data)
-+{
-+  GSettingsBackend *kf_backend;
-+  GSettings *settings;
-+  gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+  keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+  store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+  kf_backend = g_keyfile_settings_backend_new (store_path, "/tests/basic-types/", "root");
-+  settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/tests/");
-+  g_object_unref (kf_backend);
-+
-+  g_assert_false (g_settings_is_writable (settings, "test-boolean"));
-+
-+  g_object_unref (settings);
-+
-+  /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
-+   * don’t error on failure. */
-+  g_remove (store_path);
-+  g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+  g_free (store_path);
-+  g_free (keyfile_path);
-+}
-+
-+/*
-+ * Test that a keyfile rejects writes to keys in the root if no root group is set.
-+ */
-+static void
-+test_keyfile_no_root_group (Fixture       *fixture,
-+                            gconstpointer  user_data)
-+{
-+  GSettingsBackend *kf_backend;
-+  GSettings *settings;
-+  gchar *keyfile_path = NULL, *store_path = NULL;
-+
-+  keyfile_path = g_build_filename (fixture->tmp_dir, "keyfile", NULL);
-+  store_path = g_build_filename (keyfile_path, "gsettings.store", NULL);
-+  kf_backend = g_keyfile_settings_backend_new (store_path, "/", NULL);
-+  settings = g_settings_new_with_backend_and_path ("org.gtk.test.no-path", kf_backend, "/");
-+  g_object_unref (kf_backend);
-+
-+  g_assert_false (g_settings_is_writable (settings, "test-boolean"));
-+  g_assert_true (g_settings_is_writable (settings, "child/test-boolean"));
-+
-+  g_object_unref (settings);
-+
-+  /* Clean up the temporary directory. The keyfile probably doesn’t exist, so
-+   * don’t error on failure. */
-+  g_remove (store_path);
-+  g_assert_cmpint (g_rmdir (keyfile_path) == 0 ? 0 : errno, ==, 0);
-+  g_free (store_path);
-+  g_free (keyfile_path);
-+}
-+
- /* Test that getting child schemas works
-  */
- static void
-@@ -2844,6 +3000,14 @@ main (int argc, char *argv[])
-   gchar *override_text;
-   gchar *enums;
-   gint result;
-+  const KeyfileTestData keyfile_test_data_explicit_path = { "/tests/", "root", "tests", "/" };
-+  const KeyfileTestData keyfile_test_data_empty_path = { "/", "root", "root", "/" };
-+  const KeyfileTestData keyfile_test_data_long_path = {
-+    "/tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch/",
-+    "root",
-+    "tests/path/is/very/long/and/this/makes/some/comparisons/take/a/different/branch",
-+    "/"
-+  };
- 
- /* Meson build sets this */
- #ifdef TEST_LOCALE_PATH
-@@ -2967,6 +3131,11 @@ main (int argc, char *argv[])
-     }
- 
-   g_test_add ("/gsettings/keyfile", Fixture, NULL, setup, test_keyfile, teardown);
-+  g_test_add ("/gsettings/keyfile/explicit-path", Fixture, &keyfile_test_data_explicit_path, setup, test_keyfile_no_path, teardown);
-+  g_test_add ("/gsettings/keyfile/empty-path", Fixture, &keyfile_test_data_empty_path, setup, test_keyfile_no_path, teardown);
-+  g_test_add ("/gsettings/keyfile/long-path", Fixture, &keyfile_test_data_long_path, setup, test_keyfile_no_path, teardown);
-+  g_test_add ("/gsettings/keyfile/outside-root-path", Fixture, NULL, setup, test_keyfile_outside_root_path, teardown);
-+  g_test_add ("/gsettings/keyfile/no-root-group", Fixture, NULL, setup, test_keyfile_no_root_group, teardown);
-   g_test_add_func ("/gsettings/child-schema", test_child_schema);
-   g_test_add_func ("/gsettings/strinfo", test_strinfo);
-   g_test_add_func ("/gsettings/enums", test_enums);
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-CVE-2021-28153.patch b/gnu/packages/patches/glib-CVE-2021-28153.patch
deleted file mode 100644
index 54443186d9..0000000000
--- a/gnu/packages/patches/glib-CVE-2021-28153.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-Backport of:
-
-From 317b3b587058a05dca95d56dac26568c5b098d33 Mon Sep 17 00:00:00 2001
-From: Philip Withnall <pwithnall@endlessos.org>
-Date: Wed, 24 Feb 2021 17:35:40 +0000
-Subject: [PATCH] glocalfileoutputstream: Fix CREATE_REPLACE_DESTINATION
- with symlinks
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The `G_FILE_CREATE_REPLACE_DESTINATION` flag is equivalent to unlinking
-the destination file and re-creating it from scratch. That did
-previously work, but in the process the code would call `open(O_CREAT)`
-on the file. If the file was a dangling symlink, this would create the
-destination file (empty). That’s not an intended side-effect, and has
-security implications if the symlink is controlled by a lower-privileged
-process.
-
-Fix that by not opening the destination file if it’s a symlink, and
-adjusting the rest of the code to cope with
- - the fact that `fd == -1` is not an error iff `is_symlink` is true,
- - and that `original_stat` will contain the `lstat()` results for the
-   symlink now, rather than the `stat()` results for its target (again,
-   iff `is_symlink` is true).
-
-This means that the target of the dangling symlink is no longer created,
-which was the bug. The symlink itself continues to be replaced (as
-before) with the new file — this is the intended behaviour of
-`g_file_replace()`.
-
-The behaviour for non-symlink cases, or cases where the symlink was not
-dangling, should be unchanged.
-
-Includes a unit test.
-
-Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-
-Fixes: #2325
----
- gio/glocalfileoutputstream.c |  70 ++++++++++++++++-------
- gio/tests/file.c             | 108 +++++++++++++++++++++++++++++++++++
- 2 files changed, 158 insertions(+), 20 deletions(-)
-
-diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c
-index a3dd62172..553fcbbae 100644
---- a/gio/glocalfileoutputstream.c
-+++ b/gio/glocalfileoutputstream.c
-@@ -874,16 +874,22 @@ handle_overwrite_open (const char    *filename,
-       /* Could be a symlink, or it could be a regular ELOOP error,
-        * but then the next open will fail too. */
-       is_symlink = TRUE;
--      fd = g_open (filename, open_flags, mode);
-+      if (!(flags & G_FILE_CREATE_REPLACE_DESTINATION))
-+        fd = g_open (filename, open_flags, mode);
-     }
--#else
--  fd = g_open (filename, open_flags, mode);
--  errsv = errno;
-+#else  /* if !O_NOFOLLOW */
-   /* This is racy, but we do it as soon as possible to minimize the race */
-   is_symlink = g_file_test (filename, G_FILE_TEST_IS_SYMLINK);
-+
-+  if (!is_symlink || !(flags & G_FILE_CREATE_REPLACE_DESTINATION))
-+    {
-+      fd = g_open (filename, open_flags, mode);
-+      errsv = errno;
-+    }
- #endif
- 
--  if (fd == -1)
-+  if (fd == -1 &&
-+      (!is_symlink || !(flags & G_FILE_CREATE_REPLACE_DESTINATION)))
-     {
-       char *display_name = g_filename_display_name (filename);
-       g_set_error (error, G_IO_ERROR,
-@@ -893,13 +899,25 @@ handle_overwrite_open (const char    *filename,
-       g_free (display_name);
-       return -1;
-     }
--  
-+
-+  if (!is_symlink)
-+    {
- #ifdef G_OS_WIN32
--  res = GLIB_PRIVATE_CALL (g_win32_fstat) (fd, &original_stat);
-+      res = GLIB_PRIVATE_CALL (g_win32_fstat) (fd, &original_stat);
- #else
--  res = fstat (fd, &original_stat);
-+      res = fstat (fd, &original_stat);
- #endif
--  errsv = errno;
-+      errsv = errno;
-+    }
-+  else
-+    {
-+#ifdef G_OS_WIN32
-+      res = GLIB_PRIVATE_CALL (g_win32_lstat_utf8) (filename, &original_stat);
-+#else
-+      res = g_lstat (filename, &original_stat);
-+#endif
-+      errsv = errno;
-+    }
- 
-   if (res != 0)
-     {
-@@ -916,16 +934,27 @@ handle_overwrite_open (const char    *filename,
-   if (!S_ISREG (original_stat.st_mode))
-     {
-       if (S_ISDIR (original_stat.st_mode))
--	g_set_error_literal (error,
--                             G_IO_ERROR,
--                             G_IO_ERROR_IS_DIRECTORY,
--                             _("Target file is a directory"));
--      else
--	g_set_error_literal (error,
--                             G_IO_ERROR,
--                             G_IO_ERROR_NOT_REGULAR_FILE,
--                             _("Target file is not a regular file"));
--      goto err_out;
-+        {
-+          g_set_error_literal (error,
-+                               G_IO_ERROR,
-+                               G_IO_ERROR_IS_DIRECTORY,
-+                               _("Target file is a directory"));
-+          goto err_out;
-+        }
-+      else if (!is_symlink ||
-+#ifdef S_ISLNK
-+               !S_ISLNK (original_stat.st_mode)
-+#else
-+               FALSE
-+#endif
-+               )
-+        {
-+          g_set_error_literal (error,
-+                               G_IO_ERROR,
-+                               G_IO_ERROR_NOT_REGULAR_FILE,
-+                               _("Target file is not a regular file"));
-+          goto err_out;
-+        }
-     }
-   
-   if (etag != NULL)
-@@ -1006,7 +1035,8 @@ handle_overwrite_open (const char    *filename,
- 	    }
- 	}
- 
--      g_close (fd, NULL);
-+      if (fd >= 0)
-+        g_close (fd, NULL);
-       *temp_filename = tmp_filename;
-       return tmpfd;
-     }
-diff --git a/gio/tests/file.c b/gio/tests/file.c
-index efb2eaadd..bc55f3af4 100644
---- a/gio/tests/file.c
-+++ b/gio/tests/file.c
-@@ -804,6 +804,113 @@ test_replace_cancel (void)
-   g_object_unref (tmpdir);
- }
- 
-+static void
-+test_replace_symlink (void)
-+{
-+#ifdef G_OS_UNIX
-+  gchar *tmpdir_path = NULL;
-+  GFile *tmpdir = NULL, *source_file = NULL, *target_file = NULL;
-+  GFileOutputStream *stream = NULL;
-+  const gchar *new_contents = "this is a test message which should be written to source and not target";
-+  gsize n_written;
-+  GFileEnumerator *enumerator = NULL;
-+  GFileInfo *info = NULL;
-+  gchar *contents = NULL;
-+  gsize length = 0;
-+  GError *local_error = NULL;
-+
-+  g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2325");
-+  g_test_summary ("Test that G_FILE_CREATE_REPLACE_DESTINATION doesn’t follow symlinks");
-+
-+  /* Create a fresh, empty working directory. */
-+  tmpdir_path = g_dir_make_tmp ("g_file_replace_symlink_XXXXXX", &local_error);
-+  g_assert_no_error (local_error);
-+  tmpdir = g_file_new_for_path (tmpdir_path);
-+
-+  g_test_message ("Using temporary directory %s", tmpdir_path);
-+  g_free (tmpdir_path);
-+
-+  /* Create symlink `source` which points to `target`. */
-+  source_file = g_file_get_child (tmpdir, "source");
-+  target_file = g_file_get_child (tmpdir, "target");
-+  g_file_make_symbolic_link (source_file, "target", NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  /* Ensure that `target` doesn’t exist */
-+  g_assert_false (g_file_query_exists (target_file, NULL));
-+
-+  /* Replace the `source` symlink with a regular file using
-+   * %G_FILE_CREATE_REPLACE_DESTINATION, which should replace it *without*
-+   * following the symlink */
-+  stream = g_file_replace (source_file, NULL, FALSE  /* no backup */,
-+                           G_FILE_CREATE_REPLACE_DESTINATION, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_output_stream_write_all (G_OUTPUT_STREAM (stream), new_contents, strlen (new_contents),
-+                             &n_written, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_cmpint (n_written, ==, strlen (new_contents));
-+
-+  g_output_stream_close (G_OUTPUT_STREAM (stream), NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_clear_object (&stream);
-+
-+  /* At this point, there should still only be one file: `source`. It should
-+   * now be a regular file. `target` should not exist. */
-+  enumerator = g_file_enumerate_children (tmpdir,
-+                                          G_FILE_ATTRIBUTE_STANDARD_NAME ","
-+                                          G_FILE_ATTRIBUTE_STANDARD_TYPE,
-+                                          G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  info = g_file_enumerator_next_file (enumerator, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_nonnull (info);
-+
-+  g_assert_cmpstr (g_file_info_get_name (info), ==, "source");
-+  g_assert_cmpint (g_file_info_get_file_type (info), ==, G_FILE_TYPE_REGULAR);
-+
-+  g_clear_object (&info);
-+
-+  info = g_file_enumerator_next_file (enumerator, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_null (info);
-+
-+  g_file_enumerator_close (enumerator, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+  g_clear_object (&enumerator);
-+
-+  /* Double-check that `target` doesn’t exist */
-+  g_assert_false (g_file_query_exists (target_file, NULL));
-+
-+  /* Check the content of `source`. */
-+  g_file_load_contents (source_file,
-+                        NULL,
-+                        &contents,
-+                        &length,
-+                        NULL,
-+                        &local_error);
-+  g_assert_no_error (local_error);
-+  g_assert_cmpstr (contents, ==, new_contents);
-+  g_assert_cmpuint (length, ==, strlen (new_contents));
-+  g_free (contents);
-+
-+  /* Tidy up. */
-+  g_file_delete (source_file, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_file_delete (tmpdir, NULL, &local_error);
-+  g_assert_no_error (local_error);
-+
-+  g_clear_object (&target_file);
-+  g_clear_object (&source_file);
-+  g_clear_object (&tmpdir);
-+#else  /* if !G_OS_UNIX */
-+  g_test_skip ("Symlink replacement tests can only be run on Unix")
-+#endif
-+}
-+
- static void
- on_file_deleted (GObject      *object,
- 		 GAsyncResult *result,
-@@ -1754,6 +1861,7 @@ main (int argc, char *argv[])
-   g_test_add_data_func ("/file/async-create-delete/4096", GINT_TO_POINTER (4096), test_create_delete);
-   g_test_add_func ("/file/replace-load", test_replace_load);
-   g_test_add_func ("/file/replace-cancel", test_replace_cancel);
-+  g_test_add_func ("/file/replace-symlink", test_replace_symlink);
-   g_test_add_func ("/file/async-delete", test_async_delete);
- #ifdef G_OS_UNIX
-   g_test_add_func ("/file/copy-preserve-mode", test_copy_preserve_mode);
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/glib-networking-gnutls-binding.patch b/gnu/packages/patches/glib-networking-gnutls-binding.patch
new file mode 100644
index 0000000000..91d0743056
--- /dev/null
+++ b/gnu/packages/patches/glib-networking-gnutls-binding.patch
@@ -0,0 +1,21 @@
+Skip failing test in 'test_connection_binding_match_tls_unique'
+in 'tls/tests/connection.c' when building glib-networking against
+GnuTLS 3.7.2.  The failure stems from the fact that
+'gnutls_session_channel_binding' returns GNUTLS_E_INVALID_REQUEST
+is known upstream:
+
+  https://gitlab.gnome.org/GNOME/glib-networking/-/issues/164
+
+diff --git a/tls/tests/connection.c b/tls/tests/connection.c
+index 036df04..347c7a4 100644
+--- a/tls/tests/connection.c
++++ b/tls/tests/connection.c
+@@ -3037,8 +3037,6 @@ main (int   argc,
+               setup_connection, test_connection_missing_server_identity, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/peer-certificate-notify", TestConnection, NULL,
+               setup_connection, test_peer_certificate_notify, teardown_connection);
+-  g_test_add ("/tls/" BACKEND "/connection/binding/match-tls-unique", TestConnection, NULL,
+-              setup_connection, test_connection_binding_match_tls_unique, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/binding/match-tls-server-end-point", TestConnection, NULL,
+               setup_connection, test_connection_binding_match_tls_server_end_point, teardown_connection);
+   g_test_add ("/tls/" BACKEND "/connection/binding/match-tls-exporter", TestConnection, NULL,
diff --git a/gnu/packages/patches/glib-skip-failing-test.patch b/gnu/packages/patches/glib-skip-failing-test.patch
new file mode 100644
index 0000000000..c7706aaa74
--- /dev/null
+++ b/gnu/packages/patches/glib-skip-failing-test.patch
@@ -0,0 +1,27 @@
+This test timed out on powerpc-linux even after extending the
+test_timeout_slow to 1800 seconds. Previously we tried to work around
+this test by extending test_timeout_slow by 1.5 its previous value.
+
+---
+ gio/tests/meson.build | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/gio/tests/meson.build b/gio/tests/meson.build
+index a926ae0..4fdbe7a 100644
+--- a/gio/tests/meson.build
++++ b/gio/tests/meson.build
+@@ -317,10 +317,6 @@ if host_machine.system() != 'windows'
+         'extra_sources' : [extra_sources, gdbus_test_codegen_generated, gdbus_test_codegen_generated_interface_info],
+         'c_args' : ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32'],
+       },
+-      'gdbus-threading' : {
+-        'extra_sources' : extra_sources,
+-        'suite' : ['slow'],
+-      },
+       'gmenumodel' : {
+         'extra_sources' : extra_sources,
+         'suite' : ['slow'],
+
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/glib-tests-timer.patch b/gnu/packages/patches/glib-tests-timer.patch
deleted file mode 100644
index e37425c0c8..0000000000
--- a/gnu/packages/patches/glib-tests-timer.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-* On i686 floating-point roundoff errors could sometimes cause this check to
-  fail depending on the elapsed microseconds.  Improve rounding by adding a
-  fractional bit.
-
---- glib-2.40.0/glib/tests/timer.c	2014-03-05 08:05:42.000000000 -0600
-+++ glib-2.40.0/glib/tests/timer.c	2014-07-10 16:33:12.746862822 -0500
-@@ -35,7 +35,7 @@
-   elapsed = g_timer_elapsed (timer, &micros);
- 
-   g_assert_cmpfloat (elapsed, <, 1.0);
--  g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6)) % 1000000);
-+  g_assert_cmpuint (micros, ==, ((guint64)(elapsed * 1e6 + 0.5)) % 1000000);
- 
-   g_timer_destroy (timer);
- }
diff --git a/gnu/packages/patches/glibc-2.27-git-fixes.patch b/gnu/packages/patches/glibc-2.27-git-fixes.patch
deleted file mode 100644
index 4ed67c7c25..0000000000
--- a/gnu/packages/patches/glibc-2.27-git-fixes.patch
+++ /dev/null
@@ -1,702 +0,0 @@
-These commits are cherry-picked from the "release/2.27/master" branch.
-
-https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.27/master
-
-Currently, we have the following (with NEWS and ChangeLog entries omitted).
-
-56170e064e2b21ce204f0817733e92f1730541ea
-516fa6080481a1433c173320b1c1432868e1e38a
-f36553bf6a4f69070f99badbdab5802b43e6e211
-7c6304182b9f422b782ace1cdd3efbde056aec36
-78a90c2f74a2012dd3eff302189e47ff6779a757
-1e52d8e65a58c49a48549053a1b89c06240e0c6c
-55ad82e45c313454de657931898e974a7a036cad
-
-From 56170e064e2b21ce204f0817733e92f1730541ea Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenko@redhat.com>
-Date: Wed, 7 Feb 2018 13:53:10 +0100
-Subject: [PATCH] Linux: use reserved name __key in pkey_get [BZ #22797]
-
-_key is not reserved name and we should avoid using that. It seems that
-it was simple typo when pkey_* was implemented.
-
-(cherry picked from commit 388ff7bd0d57d7061fdd39a2f26f65687e8058da)
-
-diff --git a/sysdeps/unix/sysv/linux/bits/mman-shared.h b/sysdeps/unix/sysv/linux/bits/mman-shared.h
-index 7715e680ca..d15ba95c9d 100644
---- a/sysdeps/unix/sysv/linux/bits/mman-shared.h
-+++ b/sysdeps/unix/sysv/linux/bits/mman-shared.h
-@@ -61,7 +61,7 @@ int pkey_set (int __key, unsigned int __access_rights) __THROW;
- 
- /* Return the access rights for the current thread for KEY, which must
-    have been allocated using pkey_alloc.  */
--int pkey_get (int _key) __THROW;
-+int pkey_get (int __key) __THROW;
- 
- /* Free an allocated protection key, which must have been allocated
-    using pkey_alloc.  */
-
-From 516fa6080481a1433c173320b1c1432868e1e38a Mon Sep 17 00:00:00 2001
-From: "Dmitry V. Levin" <ldv@altlinux.org>
-Date: Fri, 29 Dec 2017 23:19:32 +0000
-Subject: [PATCH] linux/aarch64: sync sys/ptrace.h with Linux 4.15 [BZ #22433]
-
-Remove compat-specific constants that were never exported by kernel
-headers under these names.  Before linux commit v3.7-rc1~16^2~1 they
-were exported with COMPAT_ prefix, and since that commit they are not
-exported at all.
-
-* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h (__ptrace_request):
-Remove arm-specific PTRACE_GET_THREAD_AREA, PTRACE_GETHBPREGS,
-and PTRACE_SETHBPREGS.
-
-(cherry picked from commit 2fd4bbaa1446f1be700e10c526cf585a796c4991)
-
-diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
-index 4be45b95ff..444edbb702 100644
---- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
-+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
-@@ -78,18 +78,10 @@ enum __ptrace_request
-   PTRACE_DETACH = 17,
- #define PT_DETACH PTRACE_DETACH
- 
--  PTRACE_GET_THREAD_AREA = 22,
--
-   /* Continue and stop at the next entry to or return from syscall.  */
-   PTRACE_SYSCALL = 24,
- #define PT_SYSCALL PTRACE_SYSCALL
- 
--  /* Get all hardware breakpoint registers.  */
--  PTRACE_GETHBPREGS = 29,
--
--  /* Set all hardware breakpoint registers.  */
--  PTRACE_SETHBPREGS = 30,
--
-   /* Set ptrace filter options.  */
-   PTRACE_SETOPTIONS = 0x4200,
- #define PT_SETOPTIONS PTRACE_SETOPTIONS
-
-From f36553bf6a4f69070f99badbdab5802b43e6e211 Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Mon, 19 Feb 2018 21:59:30 +0100
-Subject: [PATCH] =?UTF-8?q?Add=20missing=20=E2=80=9Creorder-end=E2=80=9D?=
- =?UTF-8?q?=20in=20LC=5FCOLLATE=20of=20et=5FEE=20[BZ=20#22517]?=
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-	[BZ #22517]
-	* localedata/locales/et_EE (LC_COLLATE): add missing “reorder-end”
-
-(cherry picked from commit 7ec5f9465e732e668d0dc94ac078ba68056d6d0a)
-
-diff --git a/localedata/locales/et_EE b/localedata/locales/et_EE
-index 9cb55b568f..bab7493c98 100644
---- a/localedata/locales/et_EE
-+++ b/localedata/locales/et_EE
-@@ -103,6 +103,8 @@ reorder-after <w>
- <U00FC> <u-diaresis>;<BAS>;<MIN>;IGNORE % ü
- <U00DC> <u-diaresis>;<BAS>;<CAP>;IGNORE % Ü
- 
-+reorder-end
-+
- END LC_COLLATE
- 
- LC_CTYPE
-
-From 7c6304182b9f422b782ace1cdd3efbde056aec36 Mon Sep 17 00:00:00 2001
-From: DJ Delorie <dj@redhat.com>
-Date: Thu, 1 Mar 2018 23:20:45 -0500
-Subject: [PATCH] [BZ #22342] Fix netgroup cache keys.
-
-Unlike other nscd caches, the netgroup cache contains two types of
-records - those for "iterate through a netgroup" (i.e. setnetgrent())
-and those for "is this user in this netgroup" (i.e. innetgr()),
-i.e. full and partial records.  The timeout code assumes these records
-have the same key for the group name, so that the collection of records
-that is "this netgroup" can be expired as a unit.
-
-However, the keys are not the same, as the in-netgroup key is generated
-by nscd rather than being passed to it from elsewhere, and is generated
-without the trailing NUL.  All other keys have the trailing NUL, and as
-noted in the linked BZ, debug statements confirm that two keys for the
-same netgroup are added to the cache with two different lengths.
-
-The result of this is that as records in the cache expire, the purge
-code only cleans out one of the two types of entries, resulting in
-stale, possibly incorrect, and possibly inconsistent cache data.
-
-The patch simply includes the existing NUL in the computation for the
-key length ('key' points to the char after the NUL, and 'group' to the
-first char of the group, so 'key-group' includes the first char to the
-NUL, inclusive).
-
-	[BZ #22342]
-	* nscd/netgroupcache.c (addinnetgrX): Include trailing NUL in
-	key value.
-
-Reviewed-by: Carlos O'Donell <carlos@redhat.com>
-(cherry picked from commit 1c81d55fc4b07b51adf68558ba74ce975153e580)
-
-diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
-index b832c9315f..2f187b208c 100644
---- a/nscd/netgroupcache.c
-+++ b/nscd/netgroupcache.c
-@@ -480,7 +480,7 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
- {
-   const char *group = key;
-   key = (char *) rawmemchr (key, '\0') + 1;
--  size_t group_len = key - group - 1;
-+  size_t group_len = key - group;
-   const char *host = *key++ ? key : NULL;
-   if (host != NULL)
-     key = (char *) rawmemchr (key, '\0') + 1;
-
-From 78a90c2f74a2012dd3eff302189e47ff6779a757 Mon Sep 17 00:00:00 2001
-From: Andreas Schwab <schwab@linux-m68k.org>
-Date: Fri, 2 Mar 2018 23:07:14 +0100
-Subject: [PATCH] Fix multiple definitions of __nss_*_database (bug 22918)
-
-(cherry picked from commit eaf6753f8aac33a36deb98c1031d1bad7b593d2d)
-
-diff --git a/nscd/gai.c b/nscd/gai.c
-index d081747797..576fd0045b 100644
---- a/nscd/gai.c
-+++ b/nscd/gai.c
-@@ -45,3 +45,6 @@
- #ifdef HAVE_LIBIDN
- # include <libidn/idn-stub.c>
- #endif
-+
-+/* Some variables normally defined in libc.  */
-+service_user *__nss_hosts_database attribute_hidden;
-diff --git a/nss/nsswitch.c b/nss/nsswitch.c
-index d5e655974f..b0f0c11a3e 100644
---- a/nss/nsswitch.c
-+++ b/nss/nsswitch.c
-@@ -62,7 +62,7 @@ static service_library *nss_new_service (name_database *database,
- 
- /* Declare external database variables.  */
- #define DEFINE_DATABASE(name)						      \
--  extern service_user *__nss_##name##_database attribute_hidden;	      \
-+  service_user *__nss_##name##_database attribute_hidden;		      \
-   weak_extern (__nss_##name##_database)
- #include "databases.def"
- #undef DEFINE_DATABASE
-diff --git a/nss/nsswitch.h b/nss/nsswitch.h
-index eccb535ef5..63573b9ebc 100644
---- a/nss/nsswitch.h
-+++ b/nss/nsswitch.h
-@@ -226,10 +226,10 @@ libc_hidden_proto (__nss_hostname_digits_dots)
- #define MAX_NR_ADDRS    48
- 
- /* Prototypes for __nss_*_lookup2 functions.  */
--#define DEFINE_DATABASE(arg)				    \
--  service_user *__nss_##arg##_database attribute_hidden;    \
--  int __nss_##arg##_lookup2 (service_user **, const char *, \
--			     const char *, void **);	    \
-+#define DEFINE_DATABASE(arg)						      \
-+  extern service_user *__nss_##arg##_database attribute_hidden;		      \
-+  int __nss_##arg##_lookup2 (service_user **, const char *,		      \
-+			     const char *, void **);			      \
-   libc_hidden_proto (__nss_##arg##_lookup2)
- #include "databases.def"
- #undef DEFINE_DATABASE
-diff --git a/posix/tst-rfc3484-2.c b/posix/tst-rfc3484-2.c
-index f509534ca9..8c64ac59ff 100644
---- a/posix/tst-rfc3484-2.c
-+++ b/posix/tst-rfc3484-2.c
-@@ -58,6 +58,7 @@ _res_hconf_init (void)
- #undef	USE_NSCD
- #include "../sysdeps/posix/getaddrinfo.c"
- 
-+service_user *__nss_hosts_database attribute_hidden;
- 
- /* This is the beginning of the real test code.  The above defines
-    (among other things) the function rfc3484_sort.  */
-diff --git a/posix/tst-rfc3484-3.c b/posix/tst-rfc3484-3.c
-index ae44087a10..1c61aaf844 100644
---- a/posix/tst-rfc3484-3.c
-+++ b/posix/tst-rfc3484-3.c
-@@ -58,6 +58,7 @@ _res_hconf_init (void)
- #undef	USE_NSCD
- #include "../sysdeps/posix/getaddrinfo.c"
- 
-+service_user *__nss_hosts_database attribute_hidden;
- 
- /* This is the beginning of the real test code.  The above defines
-    (among other things) the function rfc3484_sort.  */
-diff --git a/posix/tst-rfc3484.c b/posix/tst-rfc3484.c
-index 7f191abbbc..8f45848e44 100644
---- a/posix/tst-rfc3484.c
-+++ b/posix/tst-rfc3484.c
-@@ -58,6 +58,7 @@ _res_hconf_init (void)
- #undef	USE_NSCD
- #include "../sysdeps/posix/getaddrinfo.c"
- 
-+service_user *__nss_hosts_database attribute_hidden;
- 
- /* This is the beginning of the real test code.  The above defines
-    (among other things) the function rfc3484_sort.  */
-
-From 1e52d8e65a58c49a48549053a1b89c06240e0c6c Mon Sep 17 00:00:00 2001
-From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date: Fri, 17 Nov 2017 16:04:29 -0200
-Subject: [PATCH] i386: Fix i386 sigaction sa_restorer initialization
- (BZ#21269)
-
-This patch fixes the i386 sa_restorer field initialization for sigaction
-syscall for kernel with vDSO.  As described in bug report, i386 Linux
-(and compat on x86_64) interprets SA_RESTORER clear with nonzero
-sa_restorer as a request for stack switching if the SS segment is 'funny'.
-This means that anything that tries to mix glibc's signal handling with
-segmentation (for instance through modify_ldt syscall) is randomly broken
-depending on what values lands in sa_restorer.
-
-The testcase added  is based on Linux test tools/testing/selftests/x86/ldt_gdt.c,
-more specifically in do_multicpu_tests function.  The main changes are:
-
-  - C11 atomics instead of plain access.
-
-  - Remove x86_64 support which simplifies the syscall handling and fallbacks.
-
-  - Replicate only the test required to trigger the issue.
-
-Checked on i686-linux-gnu.
-
-	[BZ #21269]
-	* sysdeps/unix/sysv/linux/i386/Makefile (tests): Add tst-bz21269.
-	* sysdeps/unix/sysv/linux/i386/sigaction.c (SET_SA_RESTORER): Clear
-	sa_restorer for vDSO case.
-	* sysdeps/unix/sysv/linux/i386/tst-bz21269.c: New file.
-
-(cherry picked from commit 68448be208ee06e76665918b37b0a57e3e00c8b4)
-
-diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
-index 4080b8c966..da716e2c1b 100644
---- a/sysdeps/unix/sysv/linux/i386/Makefile
-+++ b/sysdeps/unix/sysv/linux/i386/Makefile
-@@ -3,6 +3,9 @@ default-abi := 32
- 
- ifeq ($(subdir),misc)
- sysdep_routines += ioperm iopl vm86
-+
-+tests += tst-bz21269
-+$(objpfx)tst-bz21269: $(shared-thread-library)
- endif
- 
- ifeq ($(subdir),elf)
-diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c
-index a5eb9e0d3e..177ff60ee6 100644
---- a/sysdeps/unix/sysv/linux/i386/sigaction.c
-+++ b/sysdeps/unix/sysv/linux/i386/sigaction.c
-@@ -42,7 +42,6 @@ extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
- #endif
- extern void restore (void) asm ("__restore") attribute_hidden;
- 
--
- /* If ACT is not NULL, change the action for SIG to *ACT.
-    If OACT is not NULL, put the old action for SIG in *OACT.  */
- int
-@@ -65,6 +64,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
- 	  kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
- 			      ? &restore_rt : &restore);
- 	}
-+      else
-+	kact.sa_restorer = NULL;
-     }
- 
-   /* XXX The size argument hopefully will have to be changed to the
-diff --git a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
-new file mode 100644
-index 0000000000..353e36507d
---- /dev/null
-+++ b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
-@@ -0,0 +1,233 @@
-+/* Test for i386 sigaction sa_restorer handling (BZ#21269)
-+   Copyright (C) 2017 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
-+/* This is based on Linux test tools/testing/selftests/x86/ldt_gdt.c,
-+   more specifically in do_multicpu_tests function.  The main changes
-+   are:
-+
-+   - C11 atomics instead of plain access.
-+   - Remove x86_64 support which simplifies the syscall handling
-+     and fallbacks.
-+   - Replicate only the test required to trigger the issue for the
-+     BZ#21269.  */
-+
-+#include <stdatomic.h>
-+
-+#include <asm/ldt.h>
-+#include <linux/futex.h>
-+
-+#include <setjmp.h>
-+#include <signal.h>
-+#include <errno.h>
-+#include <sys/syscall.h>
-+#include <sys/mman.h>
-+
-+#include <support/xunistd.h>
-+#include <support/check.h>
-+#include <support/xthread.h>
-+
-+static int
-+xset_thread_area (struct user_desc *u_info)
-+{
-+  long ret = syscall (SYS_set_thread_area, u_info);
-+  TEST_VERIFY_EXIT (ret == 0);
-+  return ret;
-+}
-+
-+static void
-+xmodify_ldt (int func, const void *ptr, unsigned long bytecount)
-+{
-+  TEST_VERIFY_EXIT (syscall (SYS_modify_ldt, 1, ptr, bytecount) == 0);
-+}
-+
-+static int
-+futex (int *uaddr, int futex_op, int val, void *timeout, int *uaddr2,
-+	int val3)
-+{
-+  return syscall (SYS_futex, uaddr, futex_op, val, timeout, uaddr2, val3);
-+}
-+
-+static void
-+xsethandler (int sig, void (*handler)(int, siginfo_t *, void *), int flags)
-+{
-+  struct sigaction sa = { 0 };
-+  sa.sa_sigaction = handler;
-+  sa.sa_flags = SA_SIGINFO | flags;
-+  TEST_VERIFY_EXIT (sigemptyset (&sa.sa_mask) == 0);
-+  TEST_VERIFY_EXIT (sigaction (sig, &sa, 0) == 0);
-+}
-+
-+static jmp_buf jmpbuf;
-+
-+static void
-+sigsegv_handler (int sig, siginfo_t *info, void *ctx_void)
-+{
-+  siglongjmp (jmpbuf, 1);
-+}
-+
-+/* Points to an array of 1024 ints, each holding its own index.  */
-+static const unsigned int *counter_page;
-+static struct user_desc *low_user_desc;
-+static struct user_desc *low_user_desc_clear; /* Used to delete GDT entry.  */
-+static int gdt_entry_num;
-+
-+static void
-+setup_counter_page (void)
-+{
-+  long page_size = sysconf (_SC_PAGE_SIZE);
-+  TEST_VERIFY_EXIT (page_size > 0);
-+  unsigned int *page = xmmap (NULL, page_size, PROT_READ | PROT_WRITE,
-+			      MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
-+  for (int i = 0; i < (page_size / sizeof (unsigned int)); i++)
-+    page[i] = i;
-+  counter_page = page;
-+}
-+
-+static void
-+setup_low_user_desc (void)
-+{
-+  low_user_desc = xmmap (NULL, 2 * sizeof (struct user_desc),
-+			 PROT_READ | PROT_WRITE,
-+			 MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
-+
-+  low_user_desc->entry_number    = -1;
-+  low_user_desc->base_addr       = (unsigned long) &counter_page[1];
-+  low_user_desc->limit           = 0xffff;
-+  low_user_desc->seg_32bit       = 1;
-+  low_user_desc->contents        = 0;
-+  low_user_desc->read_exec_only  = 0;
-+  low_user_desc->limit_in_pages  = 1;
-+  low_user_desc->seg_not_present = 0;
-+  low_user_desc->useable         = 0;
-+
-+  xset_thread_area (low_user_desc);
-+
-+  low_user_desc_clear = low_user_desc + 1;
-+  low_user_desc_clear->entry_number = gdt_entry_num;
-+  low_user_desc_clear->read_exec_only = 1;
-+  low_user_desc_clear->seg_not_present = 1;
-+}
-+
-+/* Possible values of futex:
-+   0: thread is idle.
-+   1: thread armed.
-+   2: thread should clear LDT entry 0.
-+   3: thread should exit.  */
-+static atomic_uint ftx;
-+
-+static void *
-+threadproc (void *ctx)
-+{
-+  while (1)
-+    {
-+      futex ((int *) &ftx, FUTEX_WAIT, 1, NULL, NULL, 0);
-+      while (atomic_load (&ftx) != 2)
-+	{
-+	  if (atomic_load (&ftx) >= 3)
-+	    return NULL;
-+	}
-+
-+      /* clear LDT entry 0.  */
-+      const struct user_desc desc = { 0 };
-+      xmodify_ldt (1, &desc, sizeof (desc));
-+
-+      /* If ftx == 2, set it to zero,  If ftx == 100, quit.  */
-+      if (atomic_fetch_add (&ftx, -2) != 2)
-+	return NULL;
-+    }
-+}
-+
-+
-+/* As described in testcase, for historical reasons x86_32 Linux (and compat
-+   on x86_64) interprets SA_RESTORER clear with nonzero sa_restorer as a
-+   request for stack switching if the SS segment is 'funny' (this is default
-+   scenario for vDSO system).  This means that anything that tries to mix
-+   signal handling with segmentation should explicit clear the sa_restorer.
-+
-+   This testcase check if sigaction in fact does it by changing the local
-+   descriptor table (LDT) through the modify_ldt syscall and triggering
-+   a synchronous segfault on iret fault by trying to install an invalid
-+   segment.  With a correct zeroed sa_restorer it should not trigger an
-+   'real' SEGSEGV and allows the siglongjmp in signal handler.  */
-+
-+static int
-+do_test (void)
-+{
-+  setup_counter_page ();
-+  setup_low_user_desc ();
-+
-+  pthread_t thread;
-+  unsigned short orig_ss;
-+
-+  xsethandler (SIGSEGV, sigsegv_handler, 0);
-+  /* 32-bit kernels send SIGILL instead of SIGSEGV on IRET faults.  */
-+  xsethandler (SIGILL, sigsegv_handler, 0);
-+
-+  thread = xpthread_create (0, threadproc, 0);
-+
-+  asm volatile ("mov %%ss, %0" : "=rm" (orig_ss));
-+
-+  for (int i = 0; i < 5; i++)
-+    {
-+      if (sigsetjmp (jmpbuf, 1) != 0)
-+	continue;
-+
-+      /* Make sure the thread is ready after the last test. */
-+      while (atomic_load (&ftx) != 0)
-+	;
-+
-+      struct user_desc desc = {
-+	.entry_number       = 0,
-+	.base_addr          = 0,
-+	.limit              = 0xffff,
-+	.seg_32bit          = 1,
-+	.contents           = 0,
-+	.read_exec_only     = 0,
-+	.limit_in_pages     = 1,
-+	.seg_not_present    = 0,
-+	.useable            = 0
-+      };
-+
-+      xmodify_ldt (0x11, &desc, sizeof (desc));
-+
-+      /* Arm the thread.  */
-+      ftx = 1;
-+      futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
-+
-+      asm volatile ("mov %0, %%ss" : : "r" (0x7));
-+
-+      /* Fire up thread modify_ldt call.  */
-+      atomic_store (&ftx, 2);
-+
-+      while (atomic_load (&ftx) != 0)
-+	;
-+
-+      /* On success, modify_ldt will segfault us synchronously and we will
-+	 escape via siglongjmp.  */
-+      support_record_failure ();
-+    }
-+
-+  atomic_store (&ftx, 100);
-+  futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
-+
-+  xpthread_join (thread);
-+
-+  return 0;
-+}
-+
-+#include <support/test-driver.c>
-
-From 55ad82e45c313454de657931898e974a7a036cad Mon Sep 17 00:00:00 2001
-From: Andrew Senkevich <andrew.n.senkevich@gmail.com>
-Date: Fri, 23 Mar 2018 16:19:45 +0100
-Subject: [PATCH] Fix i386 memmove issue (bug 22644).
-
-	[BZ #22644]
-	* sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S: Fixed
-	branch conditions.
-	* string/test-memmove.c (do_test2): New testcase.
-
-(cherry picked from commit cd66c0e584c6d692bc8347b5e72723d02b8a8ada)
-
-diff --git a/string/test-memmove.c b/string/test-memmove.c
-index edc7a4c3bf..64e3651ba4 100644
---- a/string/test-memmove.c
-+++ b/string/test-memmove.c
-@@ -24,6 +24,7 @@
- # define TEST_NAME "memmove"
- #endif
- #include "test-string.h"
-+#include <support/test-driver.h>
- 
- char *simple_memmove (char *, const char *, size_t);
- 
-@@ -245,6 +246,60 @@ do_random_tests (void)
-     }
- }
- 
-+static void
-+do_test2 (void)
-+{
-+  size_t size = 0x20000000;
-+  uint32_t * large_buf;
-+
-+  large_buf = mmap ((void*) 0x70000000, size, PROT_READ | PROT_WRITE,
-+		    MAP_PRIVATE | MAP_ANON, -1, 0);
-+
-+  if (large_buf == MAP_FAILED)
-+    error (EXIT_UNSUPPORTED, errno, "Large mmap failed");
-+
-+  if ((uintptr_t) large_buf > 0x80000000 - 128
-+      || 0x80000000 - (uintptr_t) large_buf > 0x20000000)
-+    {
-+      error (0, 0, "Large mmap allocated improperly");
-+      ret = EXIT_UNSUPPORTED;
-+      munmap ((void *) large_buf, size);
-+      return;
-+    }
-+
-+  size_t bytes_move = 0x80000000 - (uintptr_t) large_buf;
-+  size_t arr_size = bytes_move / sizeof (uint32_t);
-+  size_t i;
-+
-+  FOR_EACH_IMPL (impl, 0)
-+    {
-+      for (i = 0; i < arr_size; i++)
-+        large_buf[i] = (uint32_t) i;
-+
-+      uint32_t * dst = &large_buf[33];
-+
-+#ifdef TEST_BCOPY
-+      CALL (impl, (char *) large_buf, (char *) dst, bytes_move);
-+#else
-+      CALL (impl, (char *) dst, (char *) large_buf, bytes_move);
-+#endif
-+
-+      for (i = 0; i < arr_size; i++)
-+	{
-+	  if (dst[i] != (uint32_t) i)
-+	    {
-+	      error (0, 0,
-+		     "Wrong result in function %s dst \"%p\" src \"%p\" offset \"%zd\"",
-+		     impl->name, dst, large_buf, i);
-+	      ret = 1;
-+	      break;
-+	    }
-+	}
-+    }
-+
-+  munmap ((void *) large_buf, size);
-+}
-+
- int
- test_main (void)
- {
-@@ -284,6 +339,9 @@ test_main (void)
-     }
- 
-   do_random_tests ();
-+
-+  do_test2 ();
-+
-   return ret;
- }
- 
-diff --git a/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S b/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
-index 9c3bbe7e17..9aa17de99c 100644
---- a/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
-+++ b/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
-@@ -72,7 +72,7 @@ ENTRY (MEMCPY)
- 	cmp	%edx, %eax
- 
- # ifdef USE_AS_MEMMOVE
--	jg	L(check_forward)
-+	ja	L(check_forward)
- 
- L(mm_len_0_or_more_backward):
- /* Now do checks for lengths. We do [0..16], [16..32], [32..64], [64..128]
-@@ -81,7 +81,7 @@ L(mm_len_0_or_more_backward):
- 	jbe	L(mm_len_0_16_bytes_backward)
- 
- 	cmpl	$32, %ecx
--	jg	L(mm_len_32_or_more_backward)
-+	ja	L(mm_len_32_or_more_backward)
- 
- /* Copy [0..32] and return.  */
- 	movdqu	(%eax), %xmm0
-@@ -92,7 +92,7 @@ L(mm_len_0_or_more_backward):
- 
- L(mm_len_32_or_more_backward):
- 	cmpl	$64, %ecx
--	jg	L(mm_len_64_or_more_backward)
-+	ja	L(mm_len_64_or_more_backward)
- 
- /* Copy [0..64] and return.  */
- 	movdqu	(%eax), %xmm0
-@@ -107,7 +107,7 @@ L(mm_len_32_or_more_backward):
- 
- L(mm_len_64_or_more_backward):
- 	cmpl	$128, %ecx
--	jg	L(mm_len_128_or_more_backward)
-+	ja	L(mm_len_128_or_more_backward)
- 
- /* Copy [0..128] and return.  */
- 	movdqu	(%eax), %xmm0
-@@ -132,7 +132,7 @@ L(mm_len_128_or_more_backward):
- 	add	%ecx, %eax
- 	cmp	%edx, %eax
- 	movl	SRC(%esp), %eax
--	jle	L(forward)
-+	jbe	L(forward)
- 	PUSH (%esi)
- 	PUSH (%edi)
- 	PUSH (%ebx)
-@@ -269,7 +269,7 @@ L(check_forward):
- 	add	%edx, %ecx
- 	cmp	%eax, %ecx
- 	movl	LEN(%esp), %ecx
--	jle	L(forward)
-+	jbe	L(forward)
- 
- /* Now do checks for lengths. We do [0..16], [0..32], [0..64], [0..128]
- 	separately.  */
diff --git a/gnu/packages/patches/glibc-2.27-supported-locales.patch b/gnu/packages/patches/glibc-2.27-supported-locales.patch
deleted file mode 100644
index 2888052bb8..0000000000
--- a/gnu/packages/patches/glibc-2.27-supported-locales.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This patch is taken from debian's glibc package (generate-supported.mk).
-It install the localedata/SUPPORTED file of the glibc. This file lists
-all the supported locales of the glibc.
-
-diff --git a/localedata/Makefile.old b/localedata/Makefile
-index 34877c0..a61d9b9 100644
---- a/localedata/Makefile.old
-+++ b/localedata/Makefile
-@@ -91,7 +91,8 @@ endif
- # Files to install.
- install-others := $(addprefix $(inst_i18ndir)/, \
- 			      $(addsuffix .gz, $(charmaps)) \
--			      $(locales))
-+			      $(locales)) \
-+                   $(inst_i18ndir)/SUPPORTED
- 
- tests: $(objdir)/iconvdata/gconv-modules
- 
-@@ -195,6 +196,14 @@ endif
- 
- include SUPPORTED
- 
-+$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
-+	for locale in $(SUPPORTED-LOCALES); do \
-+		[ $$locale = true ] && continue; \
-+		echo $$locale | sed 's,/, ,' >> LOCALES; \
-+	done
-+	$(make-target-directory)
-+	$(INSTALL_DATA) LOCALES $@
-+
- INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
- 
- # Sometimes the whole collection of locale files should be installed.
diff --git a/gnu/packages/patches/glibc-2.28-git-fixes.patch b/gnu/packages/patches/glibc-2.28-git-fixes.patch
deleted file mode 100644
index 7e370ef0b1..0000000000
--- a/gnu/packages/patches/glibc-2.28-git-fixes.patch
+++ /dev/null
@@ -1,248 +0,0 @@
-This file contains fixes from the "release/2.28/master" branch:
-https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.28/master
-
-Currently we have these commits (sans tests and ChangeLog updates):
-7f11842e7483da7aa9fa3031be122021978ef600
-726e1554ce4db5e35af41cb0110c54c5e1232054
-4b25485f03158959cff45379eecc1d73c7dcdd11
-d05b05d1570ba3ae354a2f5a3cfeefb373b09979
-bfcfa22589f2b4277a65e60c6b736b6bbfbd87d0
-2f498f3d140ab5152bd784df2be7af7d9c5e63ed
-
-diff --git a/htl/Versions b/htl/Versions
-index 6a63a1b8a1..c5a616da10 100644
---- a/htl/Versions
-+++ b/htl/Versions
-@@ -150,6 +150,8 @@ libpthread {
-     __cthread_keycreate;
-     __cthread_getspecific;
-     __cthread_setspecific;
-+    __pthread_getspecific;
-+    __pthread_setspecific;
-     __pthread_getattr_np;
-     __pthread_attr_getstack;
-   }
-
-diff --git a/sysdeps/htl/pt-getspecific.c b/sysdeps/htl/pt-getspecific.c
-index a0227a67f6..64ddf9551a 100644
---- a/sysdeps/htl/pt-getspecific.c
-+++ b/sysdeps/htl/pt-getspecific.c
-@@ -36,3 +36,4 @@ __pthread_getspecific (pthread_key_t key)
-   return self->thread_specifics[key];
- }
- strong_alias (__pthread_getspecific, pthread_getspecific);
-+hidden_def (__pthread_getspecific)
-diff --git a/sysdeps/htl/pt-setspecific.c b/sysdeps/htl/pt-setspecific.c
-index a46a12f157..02aff417ef 100644
---- a/sysdeps/htl/pt-setspecific.c
-+++ b/sysdeps/htl/pt-setspecific.c
-@@ -48,3 +48,4 @@ __pthread_setspecific (pthread_key_t key, const void *value)
-   return 0;
- }
- strong_alias (__pthread_setspecific, pthread_setspecific);
-+hidden_def (__pthread_setspecific)
-diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
-index 132ac1718e..71c2fcd9c6 100644
---- a/sysdeps/htl/pthreadP.h
-+++ b/sysdeps/htl/pthreadP.h
-@@ -68,6 +68,8 @@ struct __pthread_cancelation_handler **___pthread_get_cleanup_stack (void) attri
- 
- #if IS_IN (libpthread)
- hidden_proto (__pthread_key_create)
-+hidden_proto (__pthread_getspecific)
-+hidden_proto (__pthread_setspecific)
- hidden_proto (_pthread_mutex_init)
- #endif
- 
-diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
-index 3bde0cf4f0..bc140b5a7f 100644
---- a/sysdeps/unix/sysv/linux/getdents64.c
-+++ b/sysdeps/unix/sysv/linux/getdents64.c
-@@ -33,41 +33,80 @@ strong_alias (__getdents64, __getdents)
- # include <shlib-compat.h>
- 
- # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
--# include <olddirent.h>
-+#  include <olddirent.h>
-+#  include <unistd.h>
- 
--/* kernel definition of as of 3.2.  */
--struct compat_linux_dirent
-+static ssize_t
-+handle_overflow (int fd, __off64_t offset, ssize_t count)
- {
--  /* Both d_ino and d_off are compat_ulong_t which are defined in all
--     architectures as 'u32'.  */
--  uint32_t        d_ino;
--  uint32_t        d_off;
--  unsigned short  d_reclen;
--  char            d_name[1];
--};
-+  /* If this is the first entry in the buffer, we can report the
-+     error.  */
-+  if (count == 0)
-+    {
-+      __set_errno (EOVERFLOW);
-+      return -1;
-+    }
-+
-+  /* Otherwise, seek to the overflowing entry, so that the next call
-+     will report the error, and return the data read so far..  */
-+  if (__lseek64 (fd, offset, SEEK_SET) != 0)
-+    return -1;
-+  return count;
-+}
- 
- ssize_t
- __old_getdents64 (int fd, char *buf, size_t nbytes)
- {
--  ssize_t retval = INLINE_SYSCALL_CALL (getdents, fd, buf, nbytes);
-+  /* We do not move the individual directory entries.  This is only
-+     possible if the target type (struct __old_dirent64) is smaller
-+     than the source type.  */
-+  _Static_assert (offsetof (struct __old_dirent64, d_name)
-+		  <= offsetof (struct dirent64, d_name),
-+		  "__old_dirent64 is larger than dirent64");
-+  _Static_assert (__alignof__ (struct __old_dirent64)
-+		  <= __alignof__ (struct dirent64),
-+		  "alignment of __old_dirent64 is larger than dirent64");
- 
--  /* The kernel added the d_type value after the name.  Change this now.  */
--  if (retval != -1)
-+  ssize_t retval = INLINE_SYSCALL_CALL (getdents64, fd, buf, nbytes);
-+  if (retval > 0)
-     {
--      union
--      {
--	struct compat_linux_dirent k;
--	struct dirent u;
--      } *kbuf = (void *) buf;
--
--      while ((char *) kbuf < buf + retval)
-+      char *p = buf;
-+      char *end = buf + retval;
-+      while (p < end)
- 	{
--	  char d_type = *((char *) kbuf + kbuf->k.d_reclen - 1);
--	  memmove (kbuf->u.d_name, kbuf->k.d_name,
--		   strlen (kbuf->k.d_name) + 1);
--	  kbuf->u.d_type = d_type;
-+	  struct dirent64 *source = (struct dirent64 *) p;
-+
-+	  /* Copy out the fixed-size data.  */
-+	  __ino_t ino = source->d_ino;
-+	  __off64_t offset = source->d_off;
-+	  unsigned int reclen = source->d_reclen;
-+	  unsigned char type = source->d_type;
-+
-+	  /* Check for ino_t overflow.  */
-+	  if (__glibc_unlikely (ino != source->d_ino))
-+	    return handle_overflow (fd, offset, p - buf);
-+
-+	  /* Convert to the target layout.  Use a separate struct and
-+	     memcpy to side-step aliasing issues.  */
-+	  struct __old_dirent64 result;
-+	  result.d_ino = ino;
-+	  result.d_off = offset;
-+	  result.d_reclen = reclen;
-+	  result.d_type = type;
-+
-+	  /* Write the fixed-sized part of the result to the
-+	     buffer.  */
-+	  size_t result_name_offset = offsetof (struct __old_dirent64, d_name);
-+	  memcpy (p, &result, result_name_offset);
-+
-+	  /* Adjust the position of the name if necessary.  Copy
-+	     everything until the end of the record, including the
-+	     terminating NUL byte.  */
-+	  if (result_name_offset != offsetof (struct dirent64, d_name))
-+	    memmove (p + result_name_offset, source->d_name,
-+		     reclen - offsetof (struct dirent64, d_name));
- 
--	  kbuf = (void *) ((char *) kbuf + kbuf->k.d_reclen);
-+	  p += reclen;
- 	}
-      }
-   return retval;
-
-diff --git a/misc/error.c b/misc/error.c
-index b4e8b6c938..03378e2f2a 100644
---- a/misc/error.c
-+++ b/misc/error.c
-@@ -319,6 +319,7 @@ error (int status, int errnum, const char *message, ...)
- 
-   va_start (args, message);
-   error_tail (status, errnum, message, args);
-+  va_end (args);
- 
- #ifdef _LIBC
-   _IO_funlockfile (stderr);
-@@ -390,6 +391,7 @@ error_at_line (int status, int errnum, const char *file_name,
- 
-   va_start (args, message);
-   error_tail (status, errnum, message, args);
-+  va_end (args);
- 
- #ifdef _LIBC
-   _IO_funlockfile (stderr);
-
-diff --git a/nscd/nscd_conf.c b/nscd/nscd_conf.c
-index 265a02434d..7293b795b6 100644
---- a/nscd/nscd_conf.c
-+++ b/nscd/nscd_conf.c
-@@ -190,7 +190,10 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb])
- 	  if (!arg1)
- 	    error (0, 0, _("Must specify user name for server-user option"));
- 	  else
--	    server_user = xstrdup (arg1);
-+	    {
-+	      free ((char *) server_user);
-+	      server_user = xstrdup (arg1);
-+	    }
- 	}
-       else if (strcmp (entry, "stat-user") == 0)
- 	{
-@@ -198,6 +201,7 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb])
- 	    error (0, 0, _("Must specify user name for stat-user option"));
- 	  else
- 	    {
-+	      free ((char *) stat_user);
- 	      stat_user = xstrdup (arg1);
- 
- 	      struct passwd *pw = getpwnam (stat_user);
-
-diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index cfd34b66b9..35b0bfc5d2 100644
---- a/nss/nss_files/files-alias.c
-+++ b/nss/nss_files/files-alias.c
-@@ -221,6 +221,13 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- 			{
- 			  while (! feof_unlocked (listfile))
- 			    {
-+			      if (room_left < 2)
-+				{
-+				  free (old_line);
-+				  fclose (listfile);
-+				  goto no_more_room;
-+				}
-+
- 			      first_unused[room_left - 1] = '\xff';
- 			      line = fgets_unlocked (first_unused, room_left,
- 						     listfile);
-@@ -229,6 +236,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- 			      if (first_unused[room_left - 1] != '\xff')
- 				{
- 				  free (old_line);
-+				  fclose (listfile);
- 				  goto no_more_room;
- 				}
- 
-@@ -256,6 +264,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- 						       + __alignof__ (char *)))
- 					{
- 					  free (old_line);
-+					  fclose (listfile);
- 					  goto no_more_room;
- 					}
- 				      room_left -= ((first_unused - cp)
-
diff --git a/gnu/packages/patches/glibc-2.28-supported-locales.patch b/gnu/packages/patches/glibc-2.28-supported-locales.patch
deleted file mode 100644
index 2888052bb8..0000000000
--- a/gnu/packages/patches/glibc-2.28-supported-locales.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This patch is taken from debian's glibc package (generate-supported.mk).
-It install the localedata/SUPPORTED file of the glibc. This file lists
-all the supported locales of the glibc.
-
-diff --git a/localedata/Makefile.old b/localedata/Makefile
-index 34877c0..a61d9b9 100644
---- a/localedata/Makefile.old
-+++ b/localedata/Makefile
-@@ -91,7 +91,8 @@ endif
- # Files to install.
- install-others := $(addprefix $(inst_i18ndir)/, \
- 			      $(addsuffix .gz, $(charmaps)) \
--			      $(locales))
-+			      $(locales)) \
-+                   $(inst_i18ndir)/SUPPORTED
- 
- tests: $(objdir)/iconvdata/gconv-modules
- 
-@@ -195,6 +196,14 @@ endif
- 
- include SUPPORTED
- 
-+$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
-+	for locale in $(SUPPORTED-LOCALES); do \
-+		[ $$locale = true ] && continue; \
-+		echo $$locale | sed 's,/, ,' >> LOCALES; \
-+	done
-+	$(make-target-directory)
-+	$(INSTALL_DATA) LOCALES $@
-+
- INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
- 
- # Sometimes the whole collection of locale files should be installed.
diff --git a/gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch
new file mode 100644
index 0000000000..1c3fe427f9
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.31-hurd-clock_gettime_monotonic.patch
@@ -0,0 +1,84 @@
+This is needed to run Python on the Hurd, especially during the build of
+python-boot0.
+
+Adapted from https://salsa.debian.org/glibc-team/glibc/-/blob/glibc-2.31/debian/patches/hurd-i386/unsubmitted-clock_t_centiseconds.diff
+
+Use the realtime clock for the monotonic clock. This is of course not a proper
+implementation (which is being done in Mach), but will permit to fix at least
+the iceweasel stack.
+
+vlc however doesn't build when _POSIX_CLOCK_SELECTION is enabled but
+_POSIX_TIMERS is not, and they refuse to fix that (see #765578), so disable the
+former.
+
+From 0aa1dfd580cf9ad7b812c307b128decb782b825f Mon Sep 17 00:00:00 2001
+From: Jan Nieuwenhuizen <janneke@gnu.org>
+Date: Mon, 2 Mar 2020 18:59:04 +0100
+Subject: [PATCH 2/2] Use realtime clock for the monotonic clock.
+
+---
+ sysdeps/mach/clock_gettime.c       | 2 +-
+ sysdeps/mach/hurd/bits/posix_opt.h | 6 +++---
+ sysdeps/posix/clock_getres.c       | 1 +
+ sysdeps/pthread/timer_create.c     | 2 +-
+ 4 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
+index ac3547df3c..af8681ba4e 100644
+--- a/sysdeps/mach/clock_gettime.c
++++ b/sysdeps/mach/clock_gettime.c
+@@ -25,7 +25,7 @@
+ int
+ __clock_gettime (clockid_t clock_id, struct timespec *ts)
+ {
+-  if (clock_id != CLOCK_REALTIME)
++  if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME)
+     {
+       errno = EINVAL;
+       return -1;
+diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
+index 0050151332..27b3a28ab7 100644
+--- a/sysdeps/mach/hurd/bits/posix_opt.h
++++ b/sysdeps/mach/hurd/bits/posix_opt.h
+@@ -163,10 +163,10 @@
+ #define _POSIX_THREAD_PROCESS_SHARED	-1
+ 
+ /* The monotonic clock might be available.  */
+-#define _POSIX_MONOTONIC_CLOCK	0
++#define _POSIX_MONOTONIC_CLOCK	200809L
+ 
+-/* The clock selection interfaces are available.  */
+-#define _POSIX_CLOCK_SELECTION	200809L
++/* The clock selection interfaces are not really available yet.  */
++#define _POSIX_CLOCK_SELECTION	-1
+ 
+ /* Advisory information interfaces could be available in future.  */
+ #define _POSIX_ADVISORY_INFO	0
+diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
+index fcd79fd554..1dd02aa449 100644
+--- a/sysdeps/posix/clock_getres.c
++++ b/sysdeps/posix/clock_getres.c
+@@ -52,6 +52,7 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
+   switch (clock_id)
+     {
+     case CLOCK_REALTIME:
++    case CLOCK_MONOTONIC:
+       retval = realtime_getres (res);
+       break;
+ 
+diff --git a/sysdeps/pthread/timer_create.c b/sysdeps/pthread/timer_create.c
+index 9d8a9ea8ae..3430582c09 100644
+--- a/sysdeps/pthread/timer_create.c
++++ b/sysdeps/pthread/timer_create.c
+@@ -48,7 +48,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
+       return -1;
+     }
+ 
+-  if (clock_id != CLOCK_REALTIME)
++  if (clock_id != CLOCK_REALTIME && clock_id != CLOCK_MONOTONIC)
+     {
+       __set_errno (EINVAL);
+       return -1;
+-- 
+2.24.0
+
diff --git a/gnu/packages/patches/glibc-bootstrap-system.patch b/gnu/packages/patches/glibc-bootstrap-system.patch
index db6457e939..9c0fac3ff5 100644
--- a/gnu/packages/patches/glibc-bootstrap-system.patch
+++ b/gnu/packages/patches/glibc-bootstrap-system.patch
@@ -3,17 +3,10 @@ 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
-@@ -140,7 +140,7 @@ do_system (const char *line)
-   __posix_spawnattr_setflags (&spawn_attr,
- 			      POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
- 
--  status = __posix_spawn (&pid, SHELL_PATH, 0, &spawn_attr,
-+  status = __posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
- 			  (char *const[]){ (char*) SHELL_NAME,
- 					   (char*) "-c",
- 					   (char *) line, NULL },
+In addition, status should be initialized to 0 and not -1.
+
+diff --git a/libio/iopopen.c b/libio/iopopen.c
+index ebc381ed7c..e0d3ed1bc3 100644
 --- a/libio/iopopen.c
 +++ b/libio/iopopen.c
 @@ -85,7 +85,7 @@ spawn_process (posix_spawn_file_actions_t *fa, FILE *fp, const char *command,
@@ -25,6 +18,28 @@ instead uses the hard-coded absolute file name of `bash'.
  		     (char *const[]){ (char*) "sh", (char*) "-c",
  		     (char *) command, NULL }, __environ) != 0)
      return false;
+diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
+index a03f478fc7..94da6facf3 100644
+--- a/sysdeps/posix/system.c
++++ b/sysdeps/posix/system.c
+@@ -101,7 +101,7 @@ cancel_handler (void *arg)
+ static int
+ do_system (const char *line)
+ {
+-  int status = -1;
++  int status = 0;
+   int ret;
+   pid_t pid;
+   struct sigaction sa;
+@@ -145,7 +145,7 @@ do_system (const char *line)
+   __posix_spawnattr_setflags (&spawn_attr,
+ 			      POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
+ 
+-  ret = __posix_spawn (&pid, SHELL_PATH, 0, &spawn_attr,
++  ret = __posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
+ 		       (char *const[]){ (char *) SHELL_NAME,
+ 					(char *) "-c",
+ 					(char *) line, NULL },
 
 --- a/include/spawn.h
 +++ b/include/spawn.h
diff --git a/gnu/packages/patches/glibc-cross-objcopy.patch b/gnu/packages/patches/glibc-cross-objcopy.patch
new file mode 100644
index 0000000000..e4c693aa44
--- /dev/null
+++ b/gnu/packages/patches/glibc-cross-objcopy.patch
@@ -0,0 +1,159 @@
+Use 'powerpc64le-linux-gnu-objcopy' rather than 'objcopy' when cross-compiling
+to powerpc64le-linux-gnu: <https://issues.guix.gnu.org/49417>.
+
+Patch submitted:
+  <https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html>
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 13a791ffde..5b370c07a2 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -118,8 +118,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ AC_SUBST(AR)
+-OBJCOPY=`$CC -print-prog-name=objcopy`
+-AC_SUBST(OBJCOPY)
+ GPROF=`$CC -print-prog-name=gprof`
+ AC_SUBST(GPROF)
+ 
+diff --git a/configure b/configure
+index fe0eda1cd5..3a08270734 100755
+--- a/configure
++++ b/configure
+@@ -654,7 +654,6 @@ MAKE
+ LD
+ AS
+ GPROF
+-OBJCOPY
+ AR
+ LN_S
+ INSTALL_DATA
+@@ -689,6 +688,7 @@ sysheaders
+ ac_ct_CXX
+ CXXFLAGS
+ CXX
++OBJCOPY
+ OBJDUMP
+ READELF
+ CPP
+@@ -3054,6 +3054,98 @@ else
+   OBJDUMP="$ac_cv_prog_OBJDUMP"
+ fi
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
++set dummy ${ac_tool_prefix}objcopy; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_OBJCOPY+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$OBJCOPY"; then
++  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++OBJCOPY=$ac_cv_prog_OBJCOPY
++if test -n "$OBJCOPY"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
++$as_echo "$OBJCOPY" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_OBJCOPY"; then
++  ac_ct_OBJCOPY=$OBJCOPY
++  # Extract the first word of "objcopy", so it can be a program name with args.
++set dummy objcopy; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_OBJCOPY"; then
++  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
++if test -n "$ac_ct_OBJCOPY"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5
++$as_echo "$ac_ct_OBJCOPY" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_OBJCOPY" = x; then
++    OBJCOPY="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    OBJCOPY=$ac_ct_OBJCOPY
++  fi
++else
++  OBJCOPY="$ac_cv_prog_OBJCOPY"
++fi
++
+ 
+ # We need the C++ compiler only for testing.
+ ac_ext=cpp
+@@ -4645,8 +4737,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ 
+-OBJCOPY=`$CC -print-prog-name=objcopy`
+-
+ GPROF=`$CC -print-prog-name=gprof`
+ 
+ 
+diff --git a/configure.ac b/configure.ac
+index 924af12738..2148cd2ec8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,6 +53,7 @@ AC_SUBST(cross_compiling)
+ AC_PROG_CPP
+ AC_CHECK_TOOL(READELF, readelf, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
++AC_CHECK_TOOL(OBJCOPY, objcopy, false)
+ 
+ # We need the C++ compiler only for testing.
+ AC_PROG_CXX
diff --git a/gnu/packages/patches/glibc-cross-objdump.patch b/gnu/packages/patches/glibc-cross-objdump.patch
new file mode 100644
index 0000000000..1660d915f7
--- /dev/null
+++ b/gnu/packages/patches/glibc-cross-objdump.patch
@@ -0,0 +1,159 @@
+Arrange so that glibc uses 'TRIPLET-objdump -f' rather than 'objdump -f'
+to determine the 'OUTPUT_FORMAT' value in libc.so when cross-compiling.
+
+Patch submitted upstream:
+  <https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html>.
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index c195c4db56..13a791ffde 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -118,8 +118,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ AC_SUBST(AR)
+-OBJDUMP=`$CC -print-prog-name=objdump`
+-AC_SUBST(OBJDUMP)
+ OBJCOPY=`$CC -print-prog-name=objcopy`
+ AC_SUBST(OBJCOPY)
+ GPROF=`$CC -print-prog-name=gprof`
+diff --git a/configure b/configure
+index 9619c10991..fe0eda1cd5 100755
+--- a/configure
++++ b/configure
+@@ -655,7 +655,6 @@ LD
+ AS
+ GPROF
+ OBJCOPY
+-OBJDUMP
+ AR
+ LN_S
+ INSTALL_DATA
+@@ -690,6 +689,7 @@ sysheaders
+ ac_ct_CXX
+ CXXFLAGS
+ CXX
++OBJDUMP
+ READELF
+ CPP
+ cross_compiling
+@@ -2962,6 +2962,98 @@ else
+   READELF="$ac_cv_prog_READELF"
+ fi
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
++set dummy ${ac_tool_prefix}objdump; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_OBJDUMP+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$OBJDUMP"; then
++  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++OBJDUMP=$ac_cv_prog_OBJDUMP
++if test -n "$OBJDUMP"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
++$as_echo "$OBJDUMP" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_OBJDUMP"; then
++  ac_ct_OBJDUMP=$OBJDUMP
++  # Extract the first word of "objdump", so it can be a program name with args.
++set dummy objdump; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_OBJDUMP"; then
++  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_OBJDUMP="objdump"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
++if test -n "$ac_ct_OBJDUMP"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
++$as_echo "$ac_ct_OBJDUMP" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_OBJDUMP" = x; then
++    OBJDUMP="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    OBJDUMP=$ac_ct_OBJDUMP
++  fi
++else
++  OBJDUMP="$ac_cv_prog_OBJDUMP"
++fi
++
+ 
+ # We need the C++ compiler only for testing.
+ ac_ext=cpp
+@@ -4553,8 +4645,6 @@ AS=`$CC -print-prog-name=as`
+ LD=`$CC -print-prog-name=ld`
+ AR=`$CC -print-prog-name=ar`
+ 
+-OBJDUMP=`$CC -print-prog-name=objdump`
+-
+ OBJCOPY=`$CC -print-prog-name=objcopy`
+ 
+ GPROF=`$CC -print-prog-name=gprof`
+diff --git a/configure.ac b/configure.ac
+index 34ecbba540..924af12738 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,6 +52,7 @@ fi
+ AC_SUBST(cross_compiling)
+ AC_PROG_CPP
+ AC_CHECK_TOOL(READELF, readelf, false)
++AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ 
+ # We need the C++ compiler only for testing.
+ AC_PROG_CXX
diff --git a/gnu/packages/patches/glibc-dl-cache.patch b/gnu/packages/patches/glibc-dl-cache.patch
new file mode 100644
index 0000000000..68c3a94846
--- /dev/null
+++ b/gnu/packages/patches/glibc-dl-cache.patch
@@ -0,0 +1,140 @@
+Read the shared library cache relative to $ORIGIN instead of reading
+from /etc/ld.so.cache.  Also arrange so that this cache takes
+precedence over RUNPATH.
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 93d185e788..e0760a1f40 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -171,6 +171,51 @@ _dl_cache_libcmp (const char *p1, const char *p2)
+   return *p1 - *p2;
+ }
+ 
++/* Special value representing the lack of an ld.so cache.  */
++static const char ld_so_cache_lacking[] = "/ld.so cache is lacking";
++
++/* Return the per-application ld.so cache, relative to $ORIGIN, or NULL if
++   that fails for some reason.  Do not return the system-wide LD_SO_CACHE
++   since on a foreign distro it would contain invalid information.  */
++static const char *
++ld_so_cache (void)
++{
++  static const char *loader_cache;
++
++  if (loader_cache == NULL)
++    {
++      static const char store[] = @STORE_DIRECTORY@;
++      const char *origin = _dl_get_origin ();
++
++      /* Check whether ORIGIN is something like "/gnu/store/…-foo/bin".  */
++      if (strncmp (store, origin, strlen (store)) == 0
++	  && origin[sizeof store - 1] == '/')
++	{
++	  char *store_item_end = strchr (origin + sizeof store, '/');
++
++	  if (store_item_end != NULL)
++	    {
++	      static const char suffix[] = "/etc/ld.so.cache";
++	      size_t store_item_len = store_item_end - origin;
++
++	      /* Note: We can't use 'malloc' because it can be interposed.
++		 Likewise, 'strncpy' is not available.  */
++	      char *cache = alloca (strlen (origin) + sizeof suffix);
++
++	      strcpy (cache, origin);
++	      strcpy (cache + store_item_len, suffix);
++
++	      loader_cache = __strdup (cache) ?: ld_so_cache_lacking;
++	    }
++	  else
++	    loader_cache = ld_so_cache_lacking;
++	}
++      else
++	loader_cache = ld_so_cache_lacking;
++    }
++
++  return loader_cache;
++}
+ 
+ /* Look up NAME in ld.so.cache and return the file name stored there, or null
+    if none is found.  The cache is loaded if it was not already.  If loading
+@@ -190,12 +235,15 @@ _dl_load_cache_lookup (const char *name)
+ 
+   /* Print a message if the loading of libs is traced.  */
+   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+-    _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
++    _dl_debug_printf (" search cache=%s\n", ld_so_cache ());
++
++  if (__glibc_unlikely (ld_so_cache () == ld_so_cache_lacking))
++    return NULL;
+ 
+   if (cache == NULL)
+     {
+       /* Read the contents of the file.  */
+-      void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
++      void *file = _dl_sysdep_read_whole_file (ld_so_cache (), &cachesize,
+ 					       PROT_READ);
+ 
+       /* We can handle three different cache file formats here:
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index f3201e7c14..a69aec3428 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2152,28 +2152,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 			loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
+ 			LA_SER_LIBPATH, &found_other_class);
+ 
+-      /* Look at the RUNPATH information for this binary.  */
+-      if (fd == -1 && loader != NULL
+-	  && cache_rpath (loader, &loader->l_runpath_dirs,
+-			  DT_RUNPATH, "RUNPATH"))
+-	fd = open_path (name, namelen, mode,
+-			&loader->l_runpath_dirs, &realname, &fb, loader,
+-			LA_SER_RUNPATH, &found_other_class);
+-
+-      if (fd == -1)
+-        {
+-          realname = _dl_sysdep_open_object (name, namelen, &fd);
+-          if (realname != NULL)
+-            {
+-              fd = open_verify (realname, fd,
+-                                &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
+-                                LA_SER_CONFIG, mode, &found_other_class,
+-                                false);
+-              if (fd == -1)
+-                free (realname);
+-            }
+-        }
+-
+ #ifdef USE_LDCONFIG
+       if (fd == -1
+ 	  && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2232,6 +2210,28 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 	}
+ #endif
+ 
++      /* Look at the RUNPATH information for this binary.  */
++      if (fd == -1 && loader != NULL
++	  && cache_rpath (loader, &loader->l_runpath_dirs,
++			  DT_RUNPATH, "RUNPATH"))
++	fd = open_path (name, namelen, mode,
++			&loader->l_runpath_dirs, &realname, &fb, loader,
++			LA_SER_RUNPATH, &found_other_class);
++
++      if (fd == -1)
++        {
++          realname = _dl_sysdep_open_object (name, namelen, &fd);
++          if (realname != NULL)
++            {
++              fd = open_verify (realname, fd,
++                                &fb, loader ?: GL(dl_ns)[nsid]._ns_loaded,
++                                LA_SER_CONFIG, mode, &found_other_class,
++                                false);
++              if (fd == -1)
++                free (realname);
++            }
++        }
++
+       /* Finally, try the default path.  */
+       if (fd == -1
+ 	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
diff --git a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
index 1c3fe427f9..e31f99a1ce 100644
--- a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
+++ b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
@@ -24,18 +24,17 @@ Subject: [PATCH 2/2] Use realtime clock for the monotonic clock.
  4 files changed, 6 insertions(+), 5 deletions(-)
 
 diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
-index ac3547df3c..af8681ba4e 100644
+index 6862fc8c..be1449bf 100644
 --- a/sysdeps/mach/clock_gettime.c
 +++ b/sysdeps/mach/clock_gettime.c
-@@ -25,7 +25,7 @@
- int
- __clock_gettime (clockid_t clock_id, struct timespec *ts)
- {
--  if (clock_id != CLOCK_REALTIME)
-+  if (clock_id != CLOCK_MONOTONIC && clock_id != CLOCK_REALTIME)
-     {
-       errno = EINVAL;
-       return -1;
+@@ -32,6 +32,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *ts)
+   switch (clock_id) {
+ 
+     case CLOCK_REALTIME:
++    case CLOCK_MONOTONIC:
+       {
+ 	/* __host_get_time can only fail if passed an invalid host_t.
+ 	   __mach_host_self could theoretically fail (producing an
 diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
 index 0050151332..27b3a28ab7 100644
 --- a/sysdeps/mach/hurd/bits/posix_opt.h
diff --git a/gnu/packages/patches/glibc-skip-c++.patch b/gnu/packages/patches/glibc-skip-c++.patch
new file mode 100644
index 0000000000..b2cbe76d3b
--- /dev/null
+++ b/gnu/packages/patches/glibc-skip-c++.patch
@@ -0,0 +1,31 @@
+When building, say, glibc 2.31 using a compiler that's itself linked
+against 2.33, linking fails with:
+
+  gcc -Wl,-rpath-link=/tmp/guix-build-glibc-2.31.drv-0/build:/tmp/guix-build-glibc-2.31.drv-0/build/math:/tmp/guix-build-glibc-2.31.drv-0/build/elf:/tmp/guix-build-glibc-2.31.drv-0/build/dlfcn:/tmp/guix-build-glibc-2.31.drv-0/build/nss:/tmp/guix-build-glibc-2.31.drv-0/build/nis:/tmp/guix-build-glibc-2.31.drv-0/build/rt:/tmp/guix-build-glibc-2.31.drv-0/build/resolv:/tmp/guix-build-glibc-2.31.drv-0/build/mathvec:/tmp/guix-build-glibc-2.31.drv-0/build/support:/tmp/guix-build-glibc-2.31.drv-0/build/crypt:/tmp/guix-build-glibc-2.31.drv-0/build/nptl -nostdlib -nostartfiles -o /tmp/guix-build-glibc-2.31.drv-0/build/support/links-dso-program    -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both /tmp/guix-build-glibc-2.31.drv-0/build/csu/crt1.o /tmp/guix-build-glibc-2.31.drv-0/build/csu/crti.o `gcc  --print-file-name=crtbegin.o` /tmp/guix-build-glibc-2.31.drv-0/build/support/links-dso-program.o -lstdc++ -lgcc -lgcc_s  -Wl,-dynamic-linker=/gnu/store/...-glibc-2.31/lib/ld-linux-x86-64.so.2  /tmp/guix-build-glibc-2.31.drv-0/build/libc.so.6 /tmp/guix-build-glibc-2.31.drv-0/build/libc_nonshared.a -Wl,--as-needed /tmp/guix-build-glibc-2.31.drv-0/build/elf/ld.so -Wl,--no-as-needed -lgcc  `gcc  --print-file-name=crtend.o` /tmp/guix-build-glibc-2.31.drv-0/build/csu/crtn.o
+  ld: /gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so: undefined reference to `fstat64@GLIBC_2.33'
+  ld: /gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so: undefined reference to `lstat@GLIBC_2.33'
+  ld: /gnu/store/...-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../../libstdc++.so: undefined reference to `stat@GLIBC_2.33'
+  collect2: error: ld returned 1 exit status
+
+This is unsurprising given that libstdc++.so here is linked against 2.33,
+whereas libc.so.6 here is 2.31.
+
+This patch works around it by not building the offending program.
+
+diff --git a/support/Makefile b/support/Makefile
+index bb9889ef..6614943b 100644
+--- a/support/Makefile
++++ b/support/Makefile
+@@ -210,12 +210,7 @@ CFLAGS-support_paths.c = \
+ # -fexcess-precision=standard.
+ CFLAGS-timespec.c += -fexcess-precision=standard
+ 
+-ifeq (,$(CXX))
+ LINKS_DSO_PROGRAM = links-dso-program-c
+-else
+-LINKS_DSO_PROGRAM = links-dso-program
+-LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
+-endif
+ 
+ ifeq (yes,$(have-selinux))
+ LDLIBS-$(LINKS_DSO_PROGRAM) += -lselinux
diff --git a/gnu/packages/patches/glibc-static-nss.patch b/gnu/packages/patches/glibc-static-nss.patch
new file mode 100644
index 0000000000..1a9db616cc
--- /dev/null
+++ b/gnu/packages/patches/glibc-static-nss.patch
@@ -0,0 +1,1244 @@
+This patch reinstates support for static NSS, which glibc 2.33 broke:
+
+  https://sourceware.org/bugzilla/show_bug.cgi?id=27959
+
+Patch obtained by running:
+
+  git diff f0c28504a9877be5da3ed1215f2da2d5914bbb0b..f9c8b11ed7726b858cd7b7cea0d3d7c5233d78cf
+  git diff 5e1ce61e3e71fb7ffe53f58fe96e67cb15f94854{^,}
+  git diff 135425a1dd50cbe2b9db0628d6c2b36c7889f30b{^,}
+
+It corresponds to these changes:
+
+  f9c8b11ed7 * nss: Access nss_files through direct references
+  6212bb67f4 * nss_files: Move into libc
+  36861a968a * nss_files: Add generic code for set*ent, end*ent and file open
+  f0c28504a9 * nss_files: Allocate nscd file registration data on the heap
+  5e1ce61e3e * nss: Fix NSS_DECLARE_MODULE_FUNCTIONS handling of _nss_*_endnetgrent
+  135425a1dd * nss: Fix build error with --disable-nscd
+
+... plus a manual fix in 'files-network.c' to address this compilation error:
+
+  nss_files/files-network.c: In function ‘_nss_files_parse_netent’:
+  nss_files/files-network.c:72:20: error: implicit declaration of function ‘__inet_network’; did you mean ‘inet_network’? [-Werror=implicit-function-declaration]
+     72 |    result->n_net = __inet_network (addr);
+	|                    ^~~~~~~~~~~~~~
+  nss_files/files-parse.c:106:3: note: in definition of macro ‘LINE_PARSER’
+    106 |   BODY;               \
+	|   ^~~~
+
+diff --git a/include/libc-symbols.h b/include/libc-symbols.h
+index 127ea656c2..d41ecf4384 100644
+--- a/include/libc-symbols.h
++++ b/include/libc-symbols.h
+@@ -798,29 +798,6 @@ for linking")
+ # define libdl_hidden_data_ver(local, name)
+ #endif
+ 
+-#if IS_IN (libnss_files)
+-# define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+-# define libnss_files_hidden_tls_proto(name, attrs...) \
+-  hidden_tls_proto (name, ##attrs)
+-# define libnss_files_hidden_def(name) hidden_def (name)
+-# define libnss_files_hidden_weak(name) hidden_weak (name)
+-# define libnss_files_hidden_ver(local, name) hidden_ver (local, name)
+-# define libnss_files_hidden_data_def(name) hidden_data_def (name)
+-# define libnss_files_hidden_tls_def(name) hidden_tls_def (name)
+-# define libnss_files_hidden_data_weak(name) hidden_data_weak (name)
+-# define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name)
+-#else
+-# define libnss_files_hidden_proto(name, attrs...)
+-# define libnss_files_hidden_tls_proto(name, attrs...)
+-# define libnss_files_hidden_def(name)
+-# define libnss_files_hidden_weak(name)
+-# define libnss_files_hidden_ver(local, name)
+-# define libnss_files_hidden_data_def(name)
+-# define libnss_files_hidden_tls_def(name)
+-# define libnss_files_hidden_data_weak(name)
+-# define libnss_files_hidden_data_ver(local, name)
+-#endif
+-
+ #if IS_IN (libnsl)
+ # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+ # define libnsl_hidden_tls_proto(name, attrs...) \
+diff --git a/include/netdb.h b/include/netdb.h
+index 82e102ff76..4dcdbb8cd4 100644
+--- a/include/netdb.h
++++ b/include/netdb.h
+@@ -217,7 +217,7 @@ extern enum nss_status _nss_netgroup_parseline (char **cursor,
+ 						struct __netgrent *result,
+ 						char *buffer, size_t buflen,
+ 						int *errnop);
+-libnss_files_hidden_proto (_nss_netgroup_parseline)
++libc_hidden_proto (_nss_netgroup_parseline)
+ 
+ #define DECLARE_NSS_PROTOTYPES(service)					      \
+ extern enum nss_status _nss_ ## service ## _setprotoent (int);		      \
+diff --git a/include/nss_files.h b/include/nss_files.h
+index 6a0dcdb85b..6190cac6be 100644
+--- a/include/nss_files.h
++++ b/include/nss_files.h
+@@ -19,7 +19,11 @@
+ #ifndef _NSS_FILES_H
+ #define _NSS_FILES_H
+ 
++#include <nss.h>
+ #include <stdio.h>
++#if IS_IN (libc)
++#include <libc-lock.h>
++#endif
+ 
+ /* Open PATH for reading, as a data source for nss_files.  */
+ FILE *__nss_files_fopen (const char *path);
+@@ -47,6 +51,63 @@ int __nss_readline_seek (FILE *fp, off64_t offset) attribute_hidden;
+ int __nss_parse_line_result (FILE *fp, off64_t offset, int parse_line_result);
+ libc_hidden_proto (__nss_parse_line_result)
+ 
++/* Per-file data.  Used by the *ent functions that need to preserve
++   state across calls.  */
++struct nss_files_per_file_data
++{
++  FILE *stream;
++#if IS_IN (libc)
++  /* The size of locks changes between libc and nss_files, so this
++     member must be last and is only available in libc.  */
++  __libc_lock_define (, lock);
++#endif
++};
++
++/* File index for __nss_files_data_get.  */
++enum nss_files_file
++  {
++    nss_file_aliasent,
++    nss_file_etherent,
++    nss_file_grent,
++    nss_file_hostent,
++    nss_file_netent,
++    nss_file_protoent,
++    nss_file_pwent,
++    nss_file_rpcent,
++    nss_file_servent,
++    nss_file_sgent,
++    nss_file_spent,
++
++    nss_file_count
++  };
++
++/* Obtains a pointer to the per-file data for FILE, which is written
++   to *PDATA, and tries to open the file at PATH for it.  On success,
++   returns NSS_STATUS_SUCCESS, and the caller must later call
++   __nss_files_data_put.  On failure, NSS_STATUS_TRYAGAIN is returned,
++   and *ERRNOP and *HERRNOP are updated if these pointers are not
++   null.  */
++enum nss_status __nss_files_data_open (struct nss_files_per_file_data **pdata,
++                                       enum nss_files_file file,
++                                       const char *path,
++                                       int *errnop, int *herrnop);
++libc_hidden_proto (__nss_files_data_open)
++
++/* Unlock the per-file data, previously obtained by
++   __nss_files_data_open.  */
++void __nss_files_data_put (struct nss_files_per_file_data *data);
++libc_hidden_proto (__nss_files_data_put)
++
++/* Performs the set*ent operation for FILE.  PATH is the file to
++   open.  */
++enum nss_status __nss_files_data_setent (enum nss_files_file file,
++                                           const char *path);
++libc_hidden_proto (__nss_files_data_setent)
++
++/* Performs the end*ent operation for FILE.  */
++enum nss_status __nss_files_data_endent (enum nss_files_file file);
++libc_hidden_proto (__nss_files_data_endent)
++
+ struct parser_data;
+ 
+ /* Instances of the parse_line function from
+@@ -64,16 +125,25 @@ extern nss_files_parse_line _nss_files_parse_servent;
+ extern nss_files_parse_line _nss_files_parse_sgent;
+ extern nss_files_parse_line _nss_files_parse_spent;
+ 
+-libnss_files_hidden_proto (_nss_files_parse_etherent)
++libc_hidden_proto (_nss_files_parse_etherent)
+ libc_hidden_proto (_nss_files_parse_grent)
+-libnss_files_hidden_proto (_nss_files_parse_netent)
+-libnss_files_hidden_proto (_nss_files_parse_protoent)
++libc_hidden_proto (_nss_files_parse_netent)
++libc_hidden_proto (_nss_files_parse_protoent)
+ libc_hidden_proto (_nss_files_parse_pwent)
+-libnss_files_hidden_proto (_nss_files_parse_rpcent)
+-libnss_files_hidden_proto (_nss_files_parse_servent)
++libc_hidden_proto (_nss_files_parse_rpcent)
++libc_hidden_proto (_nss_files_parse_servent)
+ libc_hidden_proto (_nss_files_parse_sgent)
+ libc_hidden_proto (_nss_files_parse_spent)
+ 
++NSS_DECLARE_MODULE_FUNCTIONS (files)
++#undef DEFINE_NSS_FUNCTION
++#define DEFINE_NSS_FUNCTION(x) libc_hidden_proto (_nss_files_##x)
++#include <nss/function.def>
++#undef DEFINE_NSS_FUNCTION
++
++void _nss_files_init (void (*cb) (size_t, struct traced_file *));
++libc_hidden_proto (_nss_files_init)
++
+ /* Generic implementation of fget*ent_r.  Reads lines from FP until
+    EOF or a successful parse into *RESULT using PARSER.  Returns 0 on
+    success, ENOENT on EOF, ERANGE on too-small buffer.  */
+diff --git a/nss/Makefile b/nss/Makefile
+index 9682a31e20..63a386af18 100644
+--- a/nss/Makefile
++++ b/nss/Makefile
+@@ -31,7 +31,8 @@ routines		= nsswitch getnssent getnssent_r digits_dots \
+ 			  compat-lookup nss_hash nss_files_fopen \
+ 			  nss_readline nss_parse_line_result \
+ 			  nss_fgetent_r nss_module nss_action \
+-			  nss_action_parse nss_database
++			  nss_action_parse nss_database nss_files_data \
++			  nss_files_functions
+ 
+ # These are the databases that go through nss dispatch.
+ # Caution: if you add a database here, you must add its real name
+@@ -98,9 +99,11 @@ subdir-dirs = $(services:%=nss_%)
+ vpath %.c $(subdir-dirs) ../locale/programs ../intl
+ 
+ 
+-libnss_files-routines	:= $(addprefix files-, \
+-			     $(filter-out key, $(databases))) \
+-			   files-initgroups files-init
++routines += \
++  $(addprefix files-, $(filter-out key, $(databases))) \
++  files-init \
++  files-initgroups \
++  # routines
+ 
+ libnss_db-dbs		:= $(addprefix db-,\
+ 				       $(filter-out hosts network key alias,\
+@@ -116,12 +119,9 @@ libnss_compat-routines	:= $(addprefix compat-,grp pwd spwd initgroups) \
+ install-others		+= $(inst_vardbdir)/Makefile
+ 
+ # Build static module into libc if requested
+-libnss_files-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ libnss_db-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ libnss_compat-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ ifeq ($(build-static-nss),yes)
+-routines                += $(libnss_files-routines)
+-static-only-routines    += $(libnss_files-routines)
+ tests-static		+= tst-nss-static
+ endif
+ extra-test-objs		+= nss_test1.os nss_test2.os
+@@ -138,8 +138,6 @@ libnss-libc = $(common-objpfx)linkobj/libc.so
+ # for new links:
+ $(services:%=$(objpfx)libnss_%.so): libc-for-link = $(libnss-libc)
+ 
+-$(objpfx)libnss_db.so: $(objpfx)libnss_files.so
+-
+ $(libnss_db-dbs:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
+ 	@rm -f $@.new
+ 	(echo '#define EXTERN_PARSER';\
+diff --git a/nss/Versions b/nss/Versions
+index fdddea104c..e551524aa9 100644
+--- a/nss/Versions
++++ b/nss/Versions
+@@ -19,11 +19,12 @@ libc {
+     __nss_services_lookup2; __nss_next2; __nss_lookup;
+     __nss_hash; __nss_database_get;
+     __nss_files_fopen; __nss_readline; __nss_parse_line_result;
+-  }
+-}
++    __nss_files_data_endent;
++    __nss_files_data_open;
++    __nss_files_data_put;
++    __nss_files_data_setent;
+ 
+-libnss_files {
+-  GLIBC_PRIVATE {
++    # Routines formerly in libnss_files.so.2.
+     _nss_files_setaliasent;
+     _nss_files_endaliasent;
+     _nss_files_getaliasbyname_r;
+@@ -109,6 +110,14 @@ libnss_files {
+   }
+ }
+ 
++libnss_files {
++  GLIBC_PRIVATE {
++    # Keep a version node (with a synthesized local: * directive) so that
++    # __bss_* symbols are hidden on targets that need it.
++    __libnss_files_version_placeholder;
++  }
++}
++
+ libnss_db {
+   GLIBC_PRIVATE {
+     _nss_db_setetherent;
+diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
+index b4b989d9bb..c158a891bd 100644
+--- a/nss/nss_files/files-XXX.c
++++ b/nss/nss_files/files-XXX.c
+@@ -45,10 +45,12 @@
+ # include <netdb.h>
+ # define H_ERRNO_PROTO	, int *herrnop
+ # define H_ERRNO_ARG	, herrnop
++# define H_ERRNO_ARG_OR_NULL herrnop
+ # define H_ERRNO_SET(val) (*herrnop = (val))
+ #else
+ # define H_ERRNO_PROTO
+ # define H_ERRNO_ARG
++# define H_ERRNO_ARG_OR_NULL NULL
+ # define H_ERRNO_SET(val) ((void) 0)
+ #endif
+ 
+@@ -58,15 +60,11 @@
+ # define EXTRA_ARGS_VALUE
+ #endif
+ 
+-/* Locks the static variables in this file.  */
+-__libc_lock_define_initialized (static, lock)
+ 
+ /* Maintenance of the stream open on the database file.  For getXXent
+    operations the stream needs to be held open across calls, the other
+    getXXbyYY operations all use their own stream.  */
+ 
+-static FILE *stream;
+-
+ /* Open database file if not already opened.  */
+ static enum nss_status
+ internal_setent (FILE **stream)
+@@ -91,42 +89,16 @@ internal_setent (FILE **stream)
+ enum nss_status
+ CONCAT(_nss_files_set,ENTNAME) (int stayopen)
+ {
+-  enum nss_status status;
+-
+-  __libc_lock_lock (lock);
+-
+-  status = internal_setent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return status;
++  return __nss_files_data_setent (CONCAT (nss_file_, ENTNAME), DATAFILE);
+ }
++libc_hidden_def (CONCAT (_nss_files_set,ENTNAME))
+ 
+-
+-/* Close the database file.  */
+-static void
+-internal_endent (FILE **stream)
+-{
+-  if (*stream != NULL)
+-    {
+-      fclose (*stream);
+-      *stream = NULL;
+-    }
+-}
+-
+-
+-/* Thread-safe, exported version of that.  */
+ enum nss_status
+ CONCAT(_nss_files_end,ENTNAME) (void)
+ {
+-  __libc_lock_lock (lock);
+-
+-  internal_endent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return NSS_STATUS_SUCCESS;
++  return __nss_files_data_endent (CONCAT (nss_file_, ENTNAME));
+ }
++libc_hidden_def (CONCAT (_nss_files_end,ENTNAME))
+ 
+ 
+ /* Parsing the database file into `struct STRUCTURE' data structures.  */
+@@ -194,28 +166,22 @@ CONCAT(_nss_files_get,ENTNAME_r) (struct STRUCTURE *result, char *buffer,
+ 				  size_t buflen, int *errnop H_ERRNO_PROTO)
+ {
+   /* Return next entry in host file.  */
+-  enum nss_status status = NSS_STATUS_SUCCESS;
+-
+-  __libc_lock_lock (lock);
+ 
+-  /* Be prepared that the set*ent function was not called before.  */
+-  if (stream == NULL)
+-    {
+-      int save_errno = errno;
+-
+-      status = internal_setent (&stream);
+-
+-      __set_errno (save_errno);
+-    }
+-
+-  if (status == NSS_STATUS_SUCCESS)
+-    status = internal_getent (stream, result, buffer, buflen, errnop
+-			      H_ERRNO_ARG EXTRA_ARGS_VALUE);
++  struct nss_files_per_file_data *data;
++  enum nss_status status = __nss_files_data_open (&data,
++						  CONCAT (nss_file_, ENTNAME),
++						  DATAFILE,
++						  errnop, H_ERRNO_ARG_OR_NULL);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
+ 
+-  __libc_lock_unlock (lock);
++  status = internal_getent (data->stream, result, buffer, buflen, errnop
++			    H_ERRNO_ARG EXTRA_ARGS_VALUE);
+ 
++  __nss_files_data_put (data);
+   return status;
+ }
++libc_hidden_def (CONCAT (_nss_files_get,ENTNAME_r))
+ 
+ /* Macro for defining lookup functions for this file-based database.
+ 
+@@ -248,8 +214,9 @@ _nss_files_get##name##_r (proto,					      \
+ 	     == NSS_STATUS_SUCCESS)					      \
+ 	{ break_if_match }						      \
+ 									      \
+-      internal_endent (&stream);					      \
++      fclose (stream);							      \
+     }									      \
+ 									      \
+   return status;							      \
+-}
++}									      \
++libc_hidden_def (_nss_files_get##name##_r)
+diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
+index 30971bfe56..8c6e176ff6 100644
+--- a/nss/nss_files/files-alias.c
++++ b/nss/nss_files/files-alias.c
+@@ -31,18 +31,11 @@
+ #include "nsswitch.h"
+ #include <nss_files.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+-/* Locks the static variables in this file.  */
+-__libc_lock_define_initialized (static, lock)
+ 
+ /* Maintenance of the stream open on the database file.  For getXXent
+    operations the stream needs to be held open across calls, the other
+    getXXbyYY operations all use their own stream.  */
+ 
+-static FILE *stream;
+-
+-
+ static enum nss_status
+ internal_setent (FILE **stream)
+ {
+@@ -66,42 +59,16 @@ internal_setent (FILE **stream)
+ enum nss_status
+ _nss_files_setaliasent (void)
+ {
+-  enum nss_status status;
+-
+-  __libc_lock_lock (lock);
+-
+-  status = internal_setent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return status;
++  return __nss_files_data_setent (nss_file_aliasent, "/etc/aliases");
+ }
++libc_hidden_def (_nss_files_setaliasent)
+ 
+-
+-/* Close the database file.  */
+-static void
+-internal_endent (FILE **stream)
+-{
+-  if (*stream != NULL)
+-    {
+-      fclose (*stream);
+-      *stream = NULL;
+-    }
+-}
+-
+-
+-/* Thread-safe, exported version of that.  */
+ enum nss_status
+ _nss_files_endaliasent (void)
+ {
+-  __libc_lock_lock (lock);
+-
+-  internal_endent (&stream);
+-
+-  __libc_lock_unlock (lock);
+-
+-  return NSS_STATUS_SUCCESS;
++  return __nss_files_data_endent (nss_file_aliasent);
+ }
++libc_hidden_def (_nss_files_endaliasent)
+ 
+ /* Parsing the database file into `struct aliasent' data structures.  */
+ static enum nss_status
+@@ -131,7 +98,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+       /* Read the first line.  It must contain the alias name and
+ 	 possibly some alias names.  */
+       first_unused[room_left - 1] = '\xff';
+-      line = fgets_unlocked (first_unused, room_left, stream);
++      line = __fgets_unlocked (first_unused, room_left, stream);
+       if (line == NULL)
+ 	/* Nothing to read.  */
+ 	break;
+@@ -220,7 +187,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+ 		      /* If the file does not exist we simply ignore
+ 			 the statement.  */
+ 		      if (listfile != NULL
+-			  && (old_line = strdup (line)) != NULL)
++			  && (old_line = __strdup (line)) != NULL)
+ 			{
+ 			  while (! feof_unlocked (listfile))
+ 			    {
+@@ -232,8 +199,8 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+ 				}
+ 
+ 			      first_unused[room_left - 1] = '\xff';
+-			      line = fgets_unlocked (first_unused, room_left,
+-						     listfile);
++			      line = __fgets_unlocked (first_unused, room_left,
++						       listfile);
+ 			      if (line == NULL)
+ 				break;
+ 			      if (first_unused[room_left - 1] != '\xff')
+@@ -335,7 +302,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
+ 		  /* The just read character is a white space and so
+ 		     can be ignored.  */
+ 		  first_unused[room_left - 1] = '\xff';
+-		  line = fgets_unlocked (first_unused, room_left, stream);
++		  line = __fgets_unlocked (first_unused, room_left, stream);
+ 		  if (line == NULL)
+ 		    {
+ 		      /* Continuation line without any data and
+@@ -369,29 +336,25 @@ _nss_files_getaliasent_r (struct aliasent *result, char *buffer, size_t buflen,
+ 			  int *errnop)
+ {
+   /* Return next entry in host file.  */
+-  enum nss_status status = NSS_STATUS_SUCCESS;
+ 
+-  __libc_lock_lock (lock);
+-
+-  /* Be prepared that the set*ent function was not called before.  */
+-  if (stream == NULL)
+-    status = internal_setent (&stream);
+-
+-  if (status == NSS_STATUS_SUCCESS)
+-    {
+-      result->alias_local = 1;
++  struct nss_files_per_file_data *data;
++  enum nss_status status = __nss_files_data_open (&data, nss_file_aliasent,
++						  "/etc/aliases", errnop, NULL);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
+ 
+-      /* Read lines until we get a definite result.  */
+-      do
+-	status = get_next_alias (stream, NULL, result, buffer, buflen, errnop);
+-      while (status == NSS_STATUS_RETURN);
+-    }
++  result->alias_local = 1;
+ 
+-  __libc_lock_unlock (lock);
++  /* Read lines until we get a definite result.  */
++  do
++    status = get_next_alias (data->stream, NULL, result, buffer, buflen,
++			     errnop);
++  while (status == NSS_STATUS_RETURN);
+ 
++  __nss_files_data_put (data);
+   return status;
+ }
+-
++libc_hidden_def (_nss_files_getaliasent_r)
+ 
+ enum nss_status
+ _nss_files_getaliasbyname_r (const char *name, struct aliasent *result,
+@@ -418,9 +381,10 @@ _nss_files_getaliasbyname_r (const char *name, struct aliasent *result,
+       do
+ 	status = get_next_alias (stream, name, result, buffer, buflen, errnop);
+       while (status == NSS_STATUS_RETURN);
+-    }
+ 
+-  internal_endent (&stream);
++      fclose (stream);
++    }
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_getaliasbyname_r)
+diff --git a/nss/nss_files/files-ethers.c b/nss/nss_files/files-ethers.c
+index 2fe7f81e4b..7c2c2b9833 100644
+--- a/nss/nss_files/files-ethers.c
++++ b/nss/nss_files/files-ethers.c
+@@ -20,8 +20,6 @@
+ #include <netinet/if_ether.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ struct etherent_data {};
+ 
+ #define ENTNAME		etherent
+diff --git a/nss/nss_files/files-grp.c b/nss/nss_files/files-grp.c
+index 49be38e8b1..a716d948e2 100644
+--- a/nss/nss_files/files-grp.c
++++ b/nss/nss_files/files-grp.c
+@@ -19,8 +19,6 @@
+ #include <grp.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	group
+ #define ENTNAME		grent
+ #define DATABASE	"group"
+diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
+index 2b47ec3e53..d54d91d038 100644
+--- a/nss/nss_files/files-hosts.c
++++ b/nss/nss_files/files-hosts.c
+@@ -26,8 +26,6 @@
+ #include <alloc_buffer.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ /* Get implementation for some internal functions.  */
+ #include "../resolv/res_hconf.h"
+ 
+@@ -57,12 +55,13 @@ LINE_PARSER
+    STRING_FIELD (addr, isspace, 1);
+ 
+    /* Parse address.  */
+-   if (inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr)
++   if (__inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr)
+        > 0)
+      af = af == AF_UNSPEC ? AF_INET : af;
+    else
+      {
+-       if (af == AF_INET && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
++       if (af == AF_INET
++	   && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+ 	 {
+ 	   if (IN6_IS_ADDR_V4MAPPED (entdata->host_addr))
+ 	     memcpy (entdata->host_addr, entdata->host_addr + 12, INADDRSZ);
+@@ -76,7 +75,7 @@ LINE_PARSER
+ 	     return 0;
+ 	 }
+        else if (af == AF_UNSPEC
+-		&& inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
++		&& __inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+ 	 af = AF_INET6;
+        else
+ 	 /* Illegal address: ignore line.  */
+@@ -349,7 +348,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
+ 	status = gethostbyname3_multi
+ 	  (stream, name, af, result, buffer, buflen, errnop, herrnop);
+ 
+-      internal_endent (&stream);
++      fclose (stream);
+     }
+ 
+   if (canonp && status == NSS_STATUS_SUCCESS)
+@@ -357,6 +356,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_gethostbyname3_r)
+ 
+ enum nss_status
+ _nss_files_gethostbyname_r (const char *name, struct hostent *result,
+@@ -366,6 +366,7 @@ _nss_files_gethostbyname_r (const char *name, struct hostent *result,
+   return _nss_files_gethostbyname3_r (name, AF_INET, result, buffer, buflen,
+ 				      errnop, herrnop, NULL, NULL);
+ }
++libc_hidden_def (_nss_files_gethostbyname_r)
+ 
+ enum nss_status
+ _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result,
+@@ -375,6 +376,7 @@ _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result,
+   return _nss_files_gethostbyname3_r (name, af, result, buffer, buflen,
+ 				      errnop, herrnop, NULL, NULL);
+ }
++libc_hidden_def (_nss_files_gethostbyname2_r)
+ 
+ enum nss_status
+ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+@@ -475,7 +477,7 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 	  status = NSS_STATUS_SUCCESS;
+ 	}
+ 
+-      internal_endent (&stream);
++      fclose (stream);
+     }
+   else if (status == NSS_STATUS_TRYAGAIN)
+     {
+@@ -490,3 +492,4 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_gethostbyname4_r)
+diff --git a/nss/nss_files/files-init.c b/nss/nss_files/files-init.c
+index 717c9fd334..18ed288d04 100644
+--- a/nss/nss_files/files-init.c
++++ b/nss/nss_files/files-init.c
+@@ -21,8 +21,7 @@
+ #include <string.h>
+ #include <nscd/nscd.h>
+ #include <nss.h>
+-
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
++#include <nss_files.h>
+ 
+ static void
+ register_file (void (*cb) (size_t, struct traced_file *),
+@@ -49,5 +48,6 @@ _nss_files_init (void (*cb) (size_t, struct traced_file *))
+   register_file (cb, servdb, "/etc/services", 0);
+   register_file (cb, netgrdb, "/etc/netgroup", 0);
+ }
++libc_hidden_def (_nss_files_init)
+ 
+ #endif
+diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c
+index 6fcea40b55..b44211e50b 100644
+--- a/nss/nss_files/files-initgroups.c
++++ b/nss/nss_files/files-initgroups.c
+@@ -28,8 +28,6 @@
+ #include <nss.h>
+ #include <nss_files.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ enum nss_status
+ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
+ 			   long int *size, gid_t **groupsp, long int limit,
+@@ -129,3 +127,4 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
+ 
+   return status == NSS_STATUS_SUCCESS && !any ? NSS_STATUS_NOTFOUND : status;
+ }
++libc_hidden_def (_nss_files_initgroups_dyn)
+diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c
+index f8c821c2f0..75bfbd9e44 100644
+--- a/nss/nss_files/files-netgrp.c
++++ b/nss/nss_files/files-netgrp.c
+@@ -28,11 +28,9 @@
+ #include "netgroup.h"
+ #include <nss_files.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define DATAFILE	"/etc/netgroup"
+ 
+-libnss_files_hidden_proto (_nss_files_endnetgrent)
++libc_hidden_proto (_nss_files_endnetgrent)
+ 
+ #define EXPAND(needed)							      \
+   do									      \
+@@ -152,7 +150,7 @@ _nss_files_setnetgrent (const char *group, struct __netgrent *result)
+ 
+   return status;
+ }
+-
++libc_hidden_def (_nss_files_setnetgrent)
+ 
+ enum nss_status
+ _nss_files_endnetgrent (struct __netgrent *result)
+@@ -164,7 +162,7 @@ _nss_files_endnetgrent (struct __netgrent *result)
+   result->cursor = NULL;
+   return NSS_STATUS_SUCCESS;
+ }
+-libnss_files_hidden_def (_nss_files_endnetgrent)
++libc_hidden_def (_nss_files_endnetgrent)
+ 
+ static char *
+ strip_whitespace (char *str)
+@@ -279,7 +277,7 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
+ 
+   return status;
+ }
+-libnss_files_hidden_def (_nss_netgroup_parseline)
++libc_hidden_def (_nss_netgroup_parseline)
+ 
+ 
+ enum nss_status
+@@ -293,3 +291,4 @@ _nss_files_getnetgrent_r (struct __netgrent *result, char *buffer,
+ 
+   return status;
+ }
++libc_hidden_def (_nss_files_getnetgrent_r)
+diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c
+index 9cd7d7dc79..217ed78609 100644
+--- a/nss/nss_files/files-network.c
++++ b/nss/nss_files/files-network.c
+@@ -22,8 +22,6 @@
+ #include <stdint.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		netent
+ #define DATABASE	"networks"
+ #define NEED_H_ERRNO
+@@ -71,7 +69,7 @@ LINE_PARSER
+        *cp = '\0';
+        addr = newp;
+      }
+-   result->n_net = inet_network (addr);
++   result->n_net = inet_network (addr);
+    result->n_addrtype = AF_INET;
+ 
+  })
+diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c
+index 68c51c7cbf..997eac573a 100644
+--- a/nss/nss_files/files-parse.c
++++ b/nss/nss_files/files-parse.c
+@@ -74,13 +74,7 @@ struct parser_data
+ /* Export the line parser function so it can be used in nss_db.  */
+ # define parser_stclass /* Global */
+ # define parse_line CONCAT(_nss_files_parse_,ENTNAME)
+-# if IS_IN (libc)
+-/* We are defining one of the functions that actually lives in libc
+-   because it is used to implement fget*ent and suchlike.  */
+-#  define nss_files_parse_hidden_def(name) libc_hidden_def (name)
+-# else
+-#  define nss_files_parse_hidden_def(name) libnss_files_hidden_def (name)
+-# endif
++# define nss_files_parse_hidden_def(name) libc_hidden_def (name)
+ #endif
+ 
+ 
+diff --git a/nss/nss_files/files-proto.c b/nss/nss_files/files-proto.c
+index 98d082c642..13072692c1 100644
+--- a/nss/nss_files/files-proto.c
++++ b/nss/nss_files/files-proto.c
+@@ -19,8 +19,6 @@
+ #include <netdb.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		protoent
+ #define DATABASE	"protocols"
+ 
+diff --git a/nss/nss_files/files-pwd.c b/nss/nss_files/files-pwd.c
+index b04165ddde..5c74c6da9b 100644
+--- a/nss/nss_files/files-pwd.c
++++ b/nss/nss_files/files-pwd.c
+@@ -19,8 +19,6 @@
+ #include <pwd.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	passwd
+ #define ENTNAME		pwent
+ #define DATABASE	"passwd"
+diff --git a/nss/nss_files/files-rpc.c b/nss/nss_files/files-rpc.c
+index eeb2725d2c..3dea8f18f2 100644
+--- a/nss/nss_files/files-rpc.c
++++ b/nss/nss_files/files-rpc.c
+@@ -19,8 +19,6 @@
+ #include <rpc/netdb.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		rpcent
+ #define DATABASE	"rpc"
+ 
+diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c
+index f4f0985377..a8d83e094e 100644
+--- a/nss/nss_files/files-service.c
++++ b/nss/nss_files/files-service.c
+@@ -20,8 +20,6 @@
+ #include <netdb.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define ENTNAME		servent
+ #define DATABASE	"services"
+ 
+diff --git a/nss/nss_files/files-sgrp.c b/nss/nss_files/files-sgrp.c
+index 6b1c9eac02..213a408e7b 100644
+--- a/nss/nss_files/files-sgrp.c
++++ b/nss/nss_files/files-sgrp.c
+@@ -19,8 +19,6 @@
+ #include <gshadow.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	sgrp
+ #define ENTNAME		sgent
+ #define DATABASE	"gshadow"
+diff --git a/nss/nss_files/files-spwd.c b/nss/nss_files/files-spwd.c
+index 976deaf918..d031257a20 100644
+--- a/nss/nss_files/files-spwd.c
++++ b/nss/nss_files/files-spwd.c
+@@ -19,8 +19,6 @@
+ #include <shadow.h>
+ #include <nss.h>
+ 
+-NSS_DECLARE_MODULE_FUNCTIONS (files)
+-
+ #define STRUCTURE	spwd
+ #define ENTNAME		spent
+ #define DATABASE	"shadow"
+diff --git a/nss/nss_files_data.c b/nss/nss_files_data.c
+new file mode 100644
+index 0000000000..80fbfe5fff
+--- /dev/null
++++ b/nss/nss_files_data.c
+@@ -0,0 +1,161 @@
++/* Returns a pointer to the global nss_files data structure.
++   Copyright (C) 2021 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <nss_files.h>
++
++#include <allocate_once.h>
++#include <errno.h>
++#include <netdb.h>
++#include <nss.h>
++#include <stdlib.h>
++
++/* This collects all per file-data.   */
++struct nss_files_data
++{
++  struct nss_files_per_file_data files[nss_file_count];
++};
++
++/* For use with allocate_once.  */
++static void *nss_files_global;
++static void *
++nss_files_global_allocate (void *closure)
++{
++  struct nss_files_data *result = malloc (sizeof (*result));
++  if (result != NULL)
++    {
++      for (int i = 0; i < nss_file_count; ++i)
++        {
++          result->files[i].stream = NULL;
++          __libc_lock_init (result->files[i].lock);
++        }
++    }
++  return result;
++}
++/* Like __nss_files_data_open, but does not perform the open call.  */
++static enum nss_status
++__nss_files_data_get (struct nss_files_per_file_data **pdata,
++                      enum nss_files_file file, int *errnop, int *herrnop)
++{
++  struct nss_files_data *data = allocate_once (&nss_files_global,
++                                               nss_files_global_allocate,
++                                               NULL, NULL);
++  if (data == NULL)
++    {
++      if (errnop != NULL)
++        *errnop = errno;
++      if (herrnop != NULL)
++        {
++          __set_h_errno (NETDB_INTERNAL);
++          *herrnop = NETDB_INTERNAL;
++        }
++      return NSS_STATUS_TRYAGAIN;
++    }
++
++  *pdata = &data->files[file];
++  __libc_lock_lock ((*pdata)->lock);
++  return NSS_STATUS_SUCCESS;
++}
++
++/* Helper function for opening the backing file at PATH.  */
++static enum nss_status
++__nss_files_data_internal_open (struct nss_files_per_file_data *data,
++                                const char *path)
++{
++  enum nss_status status = NSS_STATUS_SUCCESS;
++
++  if (data->stream == NULL)
++    {
++      data->stream = __nss_files_fopen (path);
++
++      if (data->stream == NULL)
++        status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
++    }
++
++  return status;
++}
++
++
++enum nss_status
++__nss_files_data_open (struct nss_files_per_file_data **pdata,
++                       enum nss_files_file file, const char *path,
++                       int *errnop, int *herrnop)
++{
++  enum nss_status status = __nss_files_data_get (pdata, file, errnop, herrnop);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
++
++  /* Be prepared that the set*ent function was not called before.  */
++  if ((*pdata)->stream == NULL)
++    {
++      int saved_errno = errno;
++      status = __nss_files_data_internal_open (*pdata, path);
++      __set_errno (saved_errno);
++      if (status != NSS_STATUS_SUCCESS)
++        __nss_files_data_put (*pdata);
++    }
++
++  return status;
++}
++
++libc_hidden_def (__nss_files_data_open)
++
++void
++__nss_files_data_put (struct nss_files_per_file_data *data)
++{
++  __libc_lock_unlock (data->lock);
++}
++libc_hidden_def (__nss_files_data_put)
++
++enum nss_status
++__nss_files_data_setent (enum nss_files_file file, const char *path)
++{
++  struct nss_files_per_file_data *data;
++  enum nss_status status = __nss_files_data_get (&data, file, NULL, NULL);
++  if (status != NSS_STATUS_SUCCESS)
++    return status;
++
++  if (data->stream == NULL)
++    status = __nss_files_data_internal_open (data, path);
++  else
++    rewind (data->stream);
++
++  __nss_files_data_put (data);
++  return status;
++}
++libc_hidden_def (__nss_files_data_setent)
++
++enum nss_status
++__nss_files_data_endent (enum nss_files_file file)
++{
++  /* No cleanup is necessary if not initialized.  */
++  struct nss_files_data *data = atomic_load_acquire (&nss_files_global);
++  if (data == NULL)
++    return NSS_STATUS_SUCCESS;
++
++  struct nss_files_per_file_data *fdata = &data->files[file];
++  __libc_lock_lock (fdata->lock);
++  if (fdata->stream != NULL)
++    {
++      fclose (fdata->stream);
++      fdata->stream = NULL;
++    }
++  __libc_lock_unlock (fdata->lock);
++
++  return NSS_STATUS_SUCCESS;
++}
++libc_hidden_def (__nss_files_data_endent)
+diff --git a/nss/nss_files_functions.c b/nss/nss_files_functions.c
+new file mode 100644
+index 0000000000..85720b4311
+--- /dev/null
++++ b/nss/nss_files_functions.c
+@@ -0,0 +1,43 @@
++/* Direct access for nss_files functions for NSS module loading.
++   Copyright (C) 2021 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include <nss_module.h>
++#include <nss_files.h>
++
++void
++__nss_files_functions (nss_module_functions_untyped pointers)
++{
++  void **fptr = pointers;
++
++  /* Functions which are not implemented.  */
++#define _nss_files_getcanonname_r NULL
++#define _nss_files_gethostbyaddr2_r NULL
++#define _nss_files_getpublickey NULL
++#define _nss_files_getsecretkey NULL
++#define _nss_files_netname2user NULL
++
++#undef DEFINE_NSS_FUNCTION
++#define DEFINE_NSS_FUNCTION(x) *fptr++ = _nss_files_##x;
++#include "function.def"
++
++#ifdef PTR_MANGLE
++  void **end = fptr;
++  for (fptr = pointers; fptr != end; ++fptr)
++    PTR_MANGLE (*fptr);
++#endif
++}
+diff --git a/nss/nss_module.c b/nss/nss_module.c
+index 60c070c851..7b42c585a4 100644
+--- a/nss/nss_module.c
++++ b/nss/nss_module.c
+@@ -30,6 +30,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <nss_files.h>
+ 
+ /* Suffix after .so of NSS service modules.  This is a bit of magic,
+    but we assume LIBNSS_FILES_SO looks like "libnss_files.so.2" and we
+@@ -110,10 +111,45 @@ static const function_name nss_function_name_array[] =
+ #include "function.def"
+   };
+ 
++static bool
++module_load_nss_files (struct nss_module *module)
++{
++  if (is_nscd)
++    {
++      void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
++#  ifdef PTR_DEMANGLE
++      PTR_DEMANGLE (cb);
++#  endif
++      _nss_files_init (cb);
++    }
++
++  /* Initialize the function pointers, following the double-checked
++     locking idiom.  */
++  __libc_lock_lock (nss_module_list_lock);
++  switch ((enum nss_module_state) atomic_load_acquire (&module->state))
++    {
++    case nss_module_uninitialized:
++    case nss_module_failed:
++      __nss_files_functions (module->functions.untyped);
++      module->handle = NULL;
++      /* Synchronizes with unlocked __nss_module_load atomic_load_acquire.  */
++      atomic_store_release (&module->state, nss_module_loaded);
++      break;
++    case nss_module_loaded:
++      /* Nothing to clean up.  */
++      break;
++    }
++  __libc_lock_unlock (nss_module_list_lock);
++  return true;
++}
++
+ /* Internal implementation of __nss_module_load.  */
+ static bool
+ module_load (struct nss_module *module)
+ {
++  if (strcmp (module->name, "files") == 0)
++    return module_load_nss_files (module);
++
+   void *handle;
+   {
+     char *shlib_name;
+@@ -360,7 +396,7 @@ __nss_module_freeres (void)
+   struct nss_module *current = nss_module_list;
+   while (current != NULL)
+     {
+-      if (current->state == nss_module_loaded)
++      if (current->state == nss_module_loaded && current->handle != NULL)
+         __libc_dlclose (current->handle);
+ 
+       struct nss_module *next = current->next;
+diff --git a/nss/nss_module.h b/nss/nss_module.h
+index 05c4791d11..c1a1d90b60 100644
+--- a/nss/nss_module.h
++++ b/nss/nss_module.h
+@@ -38,6 +38,10 @@ struct nss_module_functions
+ typedef void *nss_module_functions_untyped[sizeof (struct nss_module_functions)
+                                            / sizeof (void *)];
+ 
++/* Locate the nss_files functions, as if by dlopen/dlsym.  */
++void __nss_files_functions (nss_module_functions_untyped pointers)
++  attribute_hidden;
++
+ /* Initialization state of a NSS module.  */
+ enum nss_module_state
+ {
+diff --git a/nss/nss_readline.c b/nss/nss_readline.c
+index 4b3ecbccc8..a2f397a11f 100644
+--- a/nss/nss_readline.c
++++ b/nss/nss_readline.c
+@@ -40,7 +40,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset)
+       *poffset = __ftello64 (fp);
+ 
+       buf[len - 1] = '\xff';        /* Marker to recognize truncation.  */
+-      if (fgets_unlocked (buf, len, fp) == NULL)
++      if (__fgets_unlocked (buf, len, fp) == NULL)
+         {
+           if (feof_unlocked (fp))
+             {
+@@ -61,7 +61,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset)
+            line on the next call.  */
+         return __nss_readline_seek (fp, *poffset);
+ 
+-      /* fgets_unlocked succeeded.  */
++      /* __fgets_unlocked succeeded.  */
+ 
+       /* Remove leading whitespace.  */
+       char *p = buf;
+diff --git a/nss/nss.h b/nss/nss.h
+index ae213f9a6c..c6d62adc0f 100644
+--- a/nss/nss.h
++++ b/nss/nss.h
+@@ -196,7 +196,7 @@ typedef enum nss_status nss_setspent (int);
+   extern nss_endgrent _nss_##module##_endgrent;                          \
+   extern nss_endhostent _nss_##module##_endhostent;                      \
+   extern nss_endnetent _nss_##module##_endnetent;                        \
+-  extern nss_endnetgrent _nss_##module##__endnetgrent;                   \
++  extern nss_endnetgrent _nss_##module##_endnetgrent;                    \
+   extern nss_endprotoent _nss_##module##_endprotoent;                    \
+   extern nss_endpwent _nss_##module##_endpwent;                          \
+   extern nss_endrpcent _nss_##module##_endrpcent;                        \
+diff --git a/nss/nss_module.c b/nss/nss_module.c
+index 7b42c585a4..7ea5ad9887 100644
+--- a/nss/nss_module.c
++++ b/nss/nss_module.c
+@@ -114,14 +114,16 @@ static const function_name nss_function_name_array[] =
+ static bool
+ module_load_nss_files (struct nss_module *module)
+ {
++#ifdef USE_NSCD
+   if (is_nscd)
+     {
+       void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
+-#  ifdef PTR_DEMANGLE
++# ifdef PTR_DEMANGLE
+       PTR_DEMANGLE (cb);
+-#  endif
++# endif
+       _nss_files_init (cb);
+     }
++#endif
+ 
+   /* Initialize the function pointers, following the double-checked
+      locking idiom.  */
diff --git a/gnu/packages/patches/gnome-online-miners-tracker-3.patch b/gnu/packages/patches/gnome-online-miners-tracker-3.patch
new file mode 100644
index 0000000000..0f89c56695
--- /dev/null
+++ b/gnu/packages/patches/gnome-online-miners-tracker-3.patch
@@ -0,0 +1,1505 @@
+Apply the following merge requests:
+
+https://gitlab.gnome.org/GNOME/gnome-online-miners/-/merge_requests/3
+https://gitlab.gnome.org/GNOME/gnome-online-miners/-/merge_requests/4
+
+to add tracker 3 support and fix a use after free error.
+
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 7147b33..4fb4d80 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -221,6 +221,7 @@ gom_miner_check_pending_jobs (GTask *task)
+     return;
+ 
+   g_task_return_boolean (task, TRUE);
++  g_clear_object (&cleanup_job->self);
+   g_slice_free (CleanupJob, cleanup_job);
+ }
+ 
+@@ -461,7 +462,9 @@ miner_job_process_ready_cb (GObject *source,
+   cleanup_job->pending_jobs = g_list_remove (cleanup_job->pending_jobs,
+                                              account_miner_job);
+ 
++  /* This will free the cleanup job data if there are no more pending jobs. */
+   gom_miner_check_pending_jobs (account_miner_job->parent_task);
++
+   gom_account_miner_job_free (account_miner_job);
+ }
+ 
+@@ -520,10 +523,9 @@ cleanup_old_accounts_done (gpointer data)
+       job->old_datasources = NULL;
+     }
+ 
++  /* This will free the task data if there are no more pending jobs */
+   gom_miner_check_pending_jobs (task);
+ 
+-  g_clear_object (&job->self);
+-
+   return FALSE;
+ }
+ 
+@@ -690,6 +692,8 @@ gom_miner_cleanup_old_accounts (GomMiner *self,
+ {
+   CleanupJob *job = g_slice_new0 (CleanupJob);
+ 
++  g_return_if_fail (GOM_IS_MINER (self));
++
+   job->self = g_object_ref (self);
+   job->content_objects = content_objects;
+   job->acc_objects = acc_objects;
+
+diff --git a/src/gom-application.c b/src/gom-application.c
+index fadd388..9e558f5 100644
+--- a/src/gom-application.c
++++ b/src/gom-application.c
+@@ -229,10 +229,16 @@ gom_application_constructed (GObject *object)
+ {
+   GomApplication *self = GOM_APPLICATION (object);
+   const gchar *display_name;
++  GError *error = NULL;
+ 
+   G_OBJECT_CLASS (gom_application_parent_class)->constructed (object);
+ 
+-  self->miner = g_object_new (self->miner_type, NULL);
++  self->miner = g_initable_new (self->miner_type, NULL, &error, NULL);
++
++  if (self->miner == NULL) {
++    g_error (error->message);
++  }
++
+   display_name = gom_miner_get_display_name (self->miner);
+   gom_dbus_set_display_name (self->skeleton, display_name);
+ }
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 7147b33..1dd9bb8 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -28,7 +28,11 @@
+ 
+ #include "gom-miner.h"
+ 
+-G_DEFINE_TYPE (GomMiner, gom_miner, G_TYPE_OBJECT)
++static void gom_miner_initable_interface_init (GInitableIface *iface);
++
++G_DEFINE_TYPE_WITH_CODE (GomMiner, gom_miner, G_TYPE_OBJECT,
++                         G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gom_miner_initable_interface_init))
++
+ 
+ struct _GomMinerPrivate {
+   GoaClient *client;
+@@ -132,20 +136,21 @@ gom_miner_dispose (GObject *object)
+ }
+ 
+ static void
+-gom_miner_init_goa (GomMiner *self)
++gom_miner_init_goa (GomMiner  *self,
++                    GError   **error)
+ {
+   GoaAccount *account;
+   GoaObject *object;
+   const gchar *provider_type;
+   GList *accounts, *l;
+   GomMinerClass *miner_class = GOM_MINER_GET_CLASS (self);
++  GError *inner_error = NULL;
+ 
+-  self->priv->client = goa_client_new_sync (NULL, &self->priv->client_error);
++  self->priv->client = goa_client_new_sync (NULL, &inner_error);
+ 
+-  if (self->priv->client_error != NULL)
++  if (inner_error)
+     {
+-      g_critical ("Unable to create GoaClient: %s - indexing for %s will not work",
+-                  self->priv->client_error->message, miner_class->goa_provider_type);
++      g_propagate_error (error, inner_error);
+       return;
+     }
+ 
+@@ -170,16 +175,34 @@ gom_miner_init_goa (GomMiner *self)
+   g_list_free_full (accounts, g_object_unref);
+ }
+ 
+-static void
+-gom_miner_constructed (GObject *obj)
++static gboolean
++gom_miner_initable_init (GInitable     *initable,
++                         GCancellable  *cancellable,
++                         GError       **error)
+ {
+-  GomMiner *self = GOM_MINER (obj);
++  GError *inner_error = NULL;
++  GomMiner *self;
+ 
+-  G_OBJECT_CLASS (gom_miner_parent_class)->constructed (obj);
++  self = GOM_MINER (initable);
+ 
+-  gom_miner_init_goa (self);
++  self->priv->connection = tracker_sparql_connection_get (cancellable, &inner_error);
++  if (inner_error)
++    {
++      g_propagate_prefixed_error (error, inner_error, "Unable to connect to Tracker store: ");
++      return FALSE;
++    }
++
++  gom_miner_init_goa (self, &inner_error);
++  if (inner_error)
++    {
++      g_propagate_prefixed_error (error, inner_error, "Unable to connect to GNOME Online Accounts: ");
++      return FALSE;
++    }
++
++  return TRUE;
+ }
+ 
++
+ static void
+ gom_miner_init (GomMiner *self)
+ {
+@@ -187,14 +210,12 @@ gom_miner_init (GomMiner *self)
+ 
+   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GOM_TYPE_MINER, GomMinerPrivate);
+   self->priv->display_name = g_strdup ("");
++}
+ 
+-  self->priv->connection = tracker_sparql_connection_get (NULL, &self->priv->connection_error);
+-  if (self->priv->connection_error != NULL)
+-    {
+-      g_critical ("Unable to create TrackerSparqlConnection: %s - indexing for %s will not work",
+-                  self->priv->connection_error->message,
+-                  klass->goa_provider_type);
+-    }
++static void
++gom_miner_initable_interface_init (GInitableIface *iface)
++{
++  iface->init = gom_miner_initable_init;
+ }
+ 
+ static void
+@@ -202,7 +223,6 @@ gom_miner_class_init (GomMinerClass *klass)
+ {
+   GObjectClass *oclass = G_OBJECT_CLASS (klass);
+ 
+-  oclass->constructed = gom_miner_constructed;
+   oclass->dispose = gom_miner_dispose;
+ 
+   cleanup_pool = g_thread_pool_new (cleanup_job, NULL, 1, FALSE, NULL);
+diff --git a/configure.ac b/configure.ac
+index 06cba71..6c61247 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,7 +21,7 @@ AC_HEADER_STDC
+ 
+ GDATA_MIN_VERSION=0.15.2
+ GFBGRAPH_MIN_VERSION=0.2.2
+-GLIB_MIN_VERSION=2.35.1
++GLIB_MIN_VERSION=2.56.0
+ GOA_MIN_VERSION=3.13.3
+ GRILO_MIN_VERSION=0.3.0
+ ZAPOJIT_MIN_VERSION=0.0.2
+@@ -36,7 +36,7 @@ PKG_CHECK_MODULES(GIO, [gio-2.0 gio-unix-2.0])
+ PKG_CHECK_MODULES(GOA, [goa-1.0 >= $GOA_MIN_VERSION])
+ AC_DEFINE([GOA_API_IS_SUBJECT_TO_CHANGE], [], [We are aware that GOA's API can change])
+ 
+-PKG_CHECK_MODULES(TRACKER, [tracker-miner-2.0 tracker-sparql-2.0])
++PKG_CHECK_MODULES(TRACKER, [tracker-sparql-3.0])
+ 
+ # Facebook
+ AC_ARG_ENABLE([facebook], [AS_HELP_STRING([--enable-facebook], [Enable Facebook miner])], [], [enable_facebook=yes])
+diff --git a/src/gom-application.c b/src/gom-application.c
+index 9e558f5..b435e26 100644
+--- a/src/gom-application.c
++++ b/src/gom-application.c
+@@ -233,7 +233,9 @@ gom_application_constructed (GObject *object)
+ 
+   G_OBJECT_CLASS (gom_application_parent_class)->constructed (object);
+ 
+-  self->miner = g_initable_new (self->miner_type, NULL, &error, NULL);
++  self->miner = g_initable_new (self->miner_type, NULL, &error,
++                                "bus-name", g_application_get_application_id (G_APPLICATION (self)),
++                                NULL);
+ 
+   if (self->miner == NULL) {
+     g_error (error->message);
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 1dd9bb8..ba76ebb 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -33,12 +33,13 @@ static void gom_miner_initable_interface_init (GInitableIface *iface);
+ G_DEFINE_TYPE_WITH_CODE (GomMiner, gom_miner, G_TYPE_OBJECT,
+                          G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gom_miner_initable_interface_init))
+ 
+-
+ struct _GomMinerPrivate {
+   GoaClient *client;
+   GError *client_error;
+ 
++  gchar *bus_name;
+   TrackerSparqlConnection *connection;
++  TrackerEndpointDBus *endpoint;
+   GError *connection_error;
+ 
+   gchar *display_name;
+@@ -62,6 +63,14 @@ typedef struct {
+   gpointer service;
+ } InsertSharedContentData;
+ 
++typedef enum
++{
++    PROP_BUS_NAME = 1,
++    N_PROPERTIES
++} GomMinerProperty;
++
++static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
++
+ static GThreadPool *cleanup_pool;
+ 
+ static void cleanup_job (gpointer data, gpointer user_data);
+@@ -135,6 +144,58 @@ gom_miner_dispose (GObject *object)
+   G_OBJECT_CLASS (gom_miner_parent_class)->dispose (object);
+ }
+ 
++static void
++gom_miner_init_database (GomMiner      *self,
++                         GCancellable  *cancellable,
++                         GError       **error)
++{
++  TrackerSparqlConnectionFlags flags;
++  g_autoptr (GFile) store_path = NULL;
++  g_autoptr (GDBusConnection) bus = NULL;
++  GError *inner_error = NULL;
++
++  flags = TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STEMMER |
++          TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_UNACCENT |
++          TRACKER_SPARQL_CONNECTION_FLAGS_FTS_ENABLE_STOP_WORDS |
++          TRACKER_SPARQL_CONNECTION_FLAGS_FTS_IGNORE_NUMBERS;
++
++  store_path = g_file_new_build_filename (g_get_user_cache_dir (),
++                                          "gnome-online-miners",
++                                          self->priv->bus_name,
++                                          NULL);
++
++  self->priv->connection = tracker_sparql_connection_new (flags,
++                                                          store_path,
++                                                          tracker_sparql_get_ontology_nepomuk (),
++                                                          cancellable,
++                                                          &inner_error);
++
++  if (inner_error)
++    {
++      g_propagate_error (error, inner_error);
++      return;
++    }
++
++  bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &inner_error);
++
++  if (inner_error)
++    {
++      g_propagate_error (error, inner_error);
++      return;
++    }
++
++  self->priv->endpoint = tracker_endpoint_dbus_new (self->priv->connection,
++                                                    bus,
++                                                    NULL, /* object path */
++                                                    cancellable,
++                                                    &inner_error);
++  if (inner_error)
++    {
++      g_propagate_error (error, inner_error);
++      return;
++    }
++}
++
+ static void
+ gom_miner_init_goa (GomMiner  *self,
+                     GError   **error)
+@@ -185,10 +246,10 @@ gom_miner_initable_init (GInitable     *initable,
+ 
+   self = GOM_MINER (initable);
+ 
+-  self->priv->connection = tracker_sparql_connection_get (cancellable, &inner_error);
++  gom_miner_init_database (self, cancellable, &inner_error);
+   if (inner_error)
+     {
+-      g_propagate_prefixed_error (error, inner_error, "Unable to connect to Tracker store: ");
++      g_propagate_prefixed_error (error, inner_error, "Unable to set up Tracker database: ");
+       return FALSE;
+     }
+ 
+@@ -212,6 +273,47 @@ gom_miner_init (GomMiner *self)
+   self->priv->display_name = g_strdup ("");
+ }
+ 
++static void
++gom_miner_set_property (GObject      *object,
++                        guint         property_id,
++                        const GValue *value,
++                        GParamSpec   *pspec)
++{
++  GomMiner *self = GOM_MINER (object);
++
++  switch ((GomMinerProperty) property_id)
++    {
++      case PROP_BUS_NAME:
++        g_free (self->priv->bus_name);
++        self->priv->bus_name = g_value_dup_string (value);
++        break;
++
++      default:
++        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
++        break;
++    }
++}
++
++static void
++gom_miner_get_property (GObject    *object,
++                        guint       property_id,
++                        GValue     *value,
++                        GParamSpec *pspec)
++{
++  GomMiner *self = GOM_MINER (object);
++
++  switch ((GomMinerProperty) property_id)
++    {
++       case PROP_BUS_NAME:
++         g_value_set_string (value, self->priv->bus_name);
++         break;
++
++       default:
++         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
++         break;
++    }
++}
++
+ static void
+ gom_miner_initable_interface_init (GInitableIface *iface)
+ {
+@@ -224,6 +326,19 @@ gom_miner_class_init (GomMinerClass *klass)
+   GObjectClass *oclass = G_OBJECT_CLASS (klass);
+ 
+   oclass->dispose = gom_miner_dispose;
++  oclass->set_property = gom_miner_set_property;
++  oclass->get_property = gom_miner_get_property;
++
++  obj_properties[PROP_BUS_NAME] = g_param_spec_string ("bus-name",
++                                                       "Bus Name",
++                                                       "D-Bus name of the miner",
++                                                       NULL  /* default value */,
++                                                       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
++                                                       G_PARAM_STATIC_STRINGS);
++
++  g_object_class_install_properties (oclass,
++                                     N_PROPERTIES,
++                                     obj_properties);
+ 
+   cleanup_pool = g_thread_pool_new (cleanup_job, NULL, 1, FALSE, NULL);
+ 
+diff --git a/src/gom-miner.h b/src/gom-miner.h
+index 8f83139..5dcfc8d 100644
+--- a/src/gom-miner.h
++++ b/src/gom-miner.h
+@@ -61,6 +61,7 @@ typedef struct _GomMinerPrivate GomMinerPrivate;
+ typedef struct {
+   GomMiner *miner;
+   TrackerSparqlConnection *connection;
++  gchar *bus_name;
+ 
+   GoaAccount *account;
+   GHashTable *services;
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 68818c4..5666c16 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -408,7 +408,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+   gchar *retval = NULL;
+   gchar *select = NULL;
+ 
+-  g_return_val_if_fail (TRACKER_SPARQL_IS_CONNECTION (connection), NULL);
++  g_return_val_if_fail (TRACKER_IS_SPARQL_CONNECTION (connection), NULL);
+   g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
+   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+   g_return_val_if_fail (make != NULL || model != NULL, NULL);
+
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 5666c16..63a4c29 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -208,6 +208,6 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+   insert = g_string_new (NULL);
+   g_string_append_printf
+     (insert,
+-     "INSERT OR REPLACE %s { <%s> a nie:InformationElement ; %s %s }",
++     "INSERT OR REPLACE %s { <%s> a nie:InformationElement, nie:DataObject ; %s %s }",
+      graph_str, resource, property_name, quoted);
+   g_free (quoted);
+
+diff --git a/src/gom-facebook-miner.c b/src/gom-facebook-miner.c
+index ff42ca5..fc89096 100644
+--- a/src/gom-facebook-miner.c
++++ b/src/gom-facebook-miner.c
+@@ -70,7 +70,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+@@ -239,7 +239,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", album_link);
+ 
+   if (*error != NULL)
+@@ -248,7 +248,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", album_description);
+ 
+   if (*error != NULL)
+@@ -257,7 +257,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", album_name);
+ 
+   if (*error != NULL)
+@@ -274,7 +274,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+@@ -284,7 +284,7 @@ account_miner_job_process_album (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:contentCreated", album_created_time);
+ 
+   if (*error != NULL)
+
+diff --git a/src/gom-flickr-miner.c b/src/gom-flickr-miner.c
+index 9ac338e..dc7349e 100644
+--- a/src/gom-flickr-miner.c
++++ b/src/gom-flickr-miner.c
+@@ -143,14 +143,14 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+ 
+   if (*error != NULL)
+@@ -166,7 +166,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+         (connection, cancellable, error,
+          NULL,
+-         datasource_urn, parent_identifier,
++         TRACKER_PICTURES_GRAPH, parent_identifier,
+          "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+       g_free (parent_identifier);
+ 
+@@ -176,7 +176,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:isPartOf", parent_resource_urn);
+       g_free (parent_resource_urn);
+ 
+@@ -187,7 +187,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", grl_media_get_title (entry->media));
+ 
+   if (*error != NULL)
+@@ -202,7 +202,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   created_time = modification_date = grl_media_get_creation_date (entry->media);
+   new_mtime = g_date_time_to_unix (modification_date);
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -221,7 +221,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:contentCreated", date);
+       g_free (date);
+     }
+@@ -233,7 +233,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", url);
+ 
+   if (*error != NULL)
+@@ -242,7 +242,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", grl_media_get_description (entry->media));
+ 
+   if (*error != NULL)
+@@ -254,7 +254,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:mimeType", mime);
+       g_free (mime);
+ 
+@@ -265,7 +265,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   contact_resource = gom_tracker_utils_ensure_contact_resource
+     (connection,
+      cancellable, error,
+-     datasource_urn, grl_media_get_author (entry->media));
++     TRACKER_PICTURES_GRAPH, grl_media_get_author (entry->media));
+ 
+   if (*error != NULL)
+     goto out;
+@@ -273,7 +273,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+diff --git a/src/gom-gdata-miner.c b/src/gom-gdata-miner.c
+index 7872431..d0deb80 100644
+--- a/src/gom-gdata-miner.c
++++ b/src/gom-gdata-miner.c
+@@ -120,7 +120,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_DOCUMENTS_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+@@ -187,7 +187,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection,
+       parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+         (connection, cancellable, error,
+          NULL,
+-         datasource_urn, parent_resource_id,
++         GOM_GRAPH, parent_resource_id,
+          "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+       g_free (parent_resource_id);
+ 
+@@ -219,7 +219,7 @@ account_miner_job_process_entry (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_toggle_favorite
+     (connection,
+      cancellable, error,
+-     resource, starred);
++     TRACKER_PICTURES_GRAPH, resource, starred);
+ 
+   if (*error != NULL)
+     goto out;
+@@ -400,14 +400,14 @@ account_miner_job_process_photo (TrackerSparqlConnection *connection,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", "nmm:Photo", NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+   if (*error != NULL)
+     goto out;
+@@ -566,6 +566,7 @@ account_miner_job_process_photo (TrackerSparqlConnection *connection,
+       equipment_resource = gom_tracker_utils_ensure_equipment_resource (connection,
+                                                                         cancellable,
+                                                                         error,
++                                                                        TRACKER_PICTURES_GRAPH,
+                                                                         make,
+                                                                         model);
+ 
+@@ -665,7 +666,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", "nfo:DataContainer",
+      NULL);
+ 
+@@ -674,7 +675,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+ 
+   gom_tracker_update_datasource
+     (connection, datasource_urn,
+-     resource_exists, identifier, resource,
++     resource_exists, TRACKER_PICTURES_GRAPH, resource,
+      cancellable, error);
+ 
+   if (*error != NULL)
+@@ -685,7 +686,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+    */
+   new_mtime = gdata_entry_get_updated (GDATA_ENTRY (album));
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -703,7 +704,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", alternate_uri);
+ 
+   if (*error != NULL)
+@@ -713,7 +714,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", summary);
+ 
+   if (*error != NULL)
+@@ -723,7 +724,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", title);
+ 
+   if (*error != NULL)
+@@ -743,7 +744,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+@@ -755,7 +756,7 @@ account_miner_job_process_album (TrackerSparqlConnection *connection,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:contentCreated", date);
+   g_free (date);
+ 
+@@ -865,7 +866,7 @@ insert_shared_content_photos (TrackerSparqlConnection *connection,
+   if (!gom_tracker_sparql_connection_insert_or_replace_triple (connection,
+                                                                cancellable,
+                                                                &local_error,
+-                                                               datasource_urn,
++                                                               TRACKER_PICTURES_GRAPH,
+                                                                source_urn,
+                                                                "nie:relatedTo",
+                                                                photo_resource_urn))
+@@ -878,7 +879,7 @@ insert_shared_content_photos (TrackerSparqlConnection *connection,
+   if (!gom_tracker_sparql_connection_insert_or_replace_triple (connection,
+                                                                cancellable,
+                                                                &local_error,
+-                                                               datasource_urn,
++                                                               TRACKER_PICTURES_GRAPH,
+                                                                photo_resource_urn,
+                                                                "nie:links",
+                                                                source_urn))
+
+diff --git a/src/gom-media-server-miner.c b/src/gom-media-server-miner.c
+index 490869e..32e08c6 100644
+--- a/src/gom-media-server-miner.c
++++ b/src/gom-media-server-miner.c
+@@ -65,14 +65,14 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+   if (*error != NULL)
+     goto out;
+@@ -81,7 +81,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", photo->url);
+ 
+   if (*error != NULL)
+@@ -90,7 +90,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:mimeType", photo->mimetype);
+ 
+   if (*error != NULL)
+@@ -99,7 +99,7 @@ account_miner_job_process_photo (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:title", photo->name);
+ 
+   if (*error != NULL)
+
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index ba76ebb..40b111d 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -375,7 +375,7 @@ gom_miner_ensure_datasource (GomMiner *self,
+                           "  <%s> a nie:DataSource ; nao:identifier \"%s\" . "
+                           "  <%s> a nie:InformationElement ; nie:rootElementOf <%s> ; nie:version \"%d\""
+                           "}",
+-                          datasource_urn,
++                          GOM_GRAPH,
+                           datasource_urn, klass->miner_identifier,
+                           root_element_urn, datasource_urn, klass->version);
+ 
+@@ -400,8 +400,8 @@ gom_account_miner_job_query_existing (GomAccountMinerJob *job,
+ 
+   select = g_string_new (NULL);
+   g_string_append_printf (select,
+-                          "SELECT ?urn nao:identifier(?urn) WHERE { ?urn nie:dataSource <%s> }",
+-                          job->datasource_urn);
++                          "SELECT ?urn ?id WHERE { GRAPH <%s> { ?urn nie:dataSource <%s> ; nao:identifier ?id . } }",
++                          GOM_GRAPH, job->datasource_urn);
+ 
+   cursor = tracker_sparql_connection_query (job->connection,
+                                             select->str,
+@@ -414,9 +414,21 @@ gom_account_miner_job_query_existing (GomAccountMinerJob *job,
+ 
+   while (tracker_sparql_cursor_next (cursor, cancellable, error))
+     {
+-      g_hash_table_insert (job->previous_resources,
+-                           g_strdup (tracker_sparql_cursor_get_string (cursor, 1, NULL)),
+-                           g_strdup (tracker_sparql_cursor_get_string (cursor, 0, NULL)));
++      const gchar *urn, *identifier;
++
++      urn = tracker_sparql_cursor_get_string (cursor, 0, NULL);
++      identifier = tracker_sparql_cursor_get_string (cursor, 1, NULL);
++
++      if (identifier != NULL)
++        {
++          g_hash_table_insert (job->previous_resources,
++                               g_strdup (identifier),
++                               g_strdup (urn));
++        }
++      else
++        {
++          g_warning ("Missing identifier for urn %s", urn);
++        }
+     }
+ 
+   g_object_unref (cursor);
+@@ -488,16 +500,19 @@ gom_account_miner_job (GTask *task,
+   if (error != NULL)
+     goto out;
+ 
++  g_debug ("account miner: Querying existing accounts stored in database");
+   gom_account_miner_job_query_existing (job, &error);
+ 
+   if (error != NULL)
+     goto out;
+ 
++  g_debug ("account miner: Querying remote server");
+   gom_account_miner_job_query (job, &error);
+ 
+   if (error != NULL)
+     goto out;
+ 
++  g_debug ("account miner: Removing stale accounts");
+   gom_account_miner_job_cleanup_previous (job, &error);
+ 
+   if (error != NULL)
+@@ -751,10 +766,15 @@ cleanup_job (gpointer data,
+ 
+   /* find all our datasources in the tracker DB */
+   select = g_string_new (NULL);
+-  g_string_append_printf (select, "SELECT ?datasource nie:version(?root) WHERE { "
+-                          "?datasource a nie:DataSource . "
+-                          "?datasource nao:identifier \"%s\" . "
+-                          "OPTIONAL { ?root nie:rootElementOf ?datasource } }",
++  g_string_append_printf (select,
++                          "SELECT ?datasource nie:version(?root) WHERE { "
++                          "  GRAPH <%s> { "
++                          "    ?datasource a nie:DataSource . "
++                          "    ?datasource nao:identifier \"%s\" . "
++                          "    OPTIONAL { ?root nie:rootElementOf ?datasource } "
++                          "  }"
++                          "}",
++                          GOM_GRAPH,
+                           klass->miner_identifier);
+ 
+   cursor = tracker_sparql_connection_query (self->priv->connection,
+
+diff --git a/src/gom-miner.h b/src/gom-miner.h
+index 5dcfc8d..8f83139 100644
+--- a/src/gom-miner.h
++++ b/src/gom-miner.h
+@@ -61,7 +61,6 @@ typedef struct _GomMinerPrivate GomMinerPrivate;
+ typedef struct {
+   GomMiner *miner;
+   TrackerSparqlConnection *connection;
+-  gchar *bus_name;
+ 
+   GoaAccount *account;
+   GHashTable *services;
+
+diff --git a/src/gom-owncloud-miner.c b/src/gom-owncloud-miner.c
+index 34d303b..623f2e1 100644
+--- a/src/gom-owncloud-miner.c
++++ b/src/gom-owncloud-miner.c
+@@ -100,14 +100,14 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_DOCUMENTS_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_DOCUMENTS_GRAPH, resource,
+                                  cancellable, error);
+ 
+   if (*error != NULL)
+@@ -117,7 +117,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+   modification_time = g_date_time_new_from_timeval_local (&tv);
+   new_mtime = g_date_time_to_unix (modification_time);
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_DOCUMENTS_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -133,7 +133,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_DOCUMENTS_GRAPH, resource,
+      "nie:url", uri);
+ 
+   if (*error != NULL)
+@@ -156,7 +156,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+           parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+             (connection, cancellable, error,
+              NULL,
+-             datasource_urn, parent_identifier,
++             GOM_GRAPH, parent_identifier,
+              "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+           g_checksum_reset (checksum);
+           g_free (parent_identifier);
+@@ -168,7 +168,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+           gom_tracker_sparql_connection_insert_or_replace_triple
+             (connection,
+              cancellable, error,
+-             datasource_urn, resource,
++             TRACKER_DOCUMENTS_GRAPH, resource,
+              "nie:isPartOf", parent_resource_urn);
+           g_free (parent_resource_urn);
+ 
+@@ -182,7 +182,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+           gom_tracker_sparql_connection_insert_or_replace_triple
+             (connection,
+              cancellable, error,
+-             datasource_urn, resource,
++             TRACKER_DOCUMENTS_GRAPH, resource,
+              "nie:mimeType", mime);
+ 
+           if (*error != NULL)
+@@ -194,7 +194,7 @@ account_miner_job_process_file (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_DOCUMENTS_GRAPH, resource,
+      "nfo:fileName", display_name);
+ 
+   if (*error != NULL)
+@@ -416,6 +416,11 @@ query_owncloud (GomAccountMinerJob *job,
+   mount = g_volume_get_mount (volume);
+   if (mount == NULL)
+     {
++      g_autofree gchar *volume_name;
++
++      volume_name = g_volume_get_name (volume);
++      g_debug ("Mounting Online Account volume %s", volume_name);
++
+       data.error = error;
+ 
+       context = g_main_context_new ();
+@@ -436,6 +441,7 @@ query_owncloud (GomAccountMinerJob *job,
+     }
+ 
+   root = g_mount_get_root (mount);
++  g_debug ("Got volume from gnome-online-accounts: root is %s", g_file_peek_path (root));
+   account_miner_job_traverse_dir (job, connection, previous_resources, datasource_urn, root, TRUE, cancellable, error);
+ 
+   g_object_unref (root);
+
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 63a4c29..469583e 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -26,16 +26,11 @@
+ #include "gom-tracker.h"
+ #include "gom-utils.h"
+ 
+-static gchar *
+-_tracker_utils_format_into_graph (const gchar *graph)
+-{
+-  return (graph != NULL) ? g_strdup_printf ("INTO <%s> ", graph) : g_strdup ("");
+-}
+-
+ static gboolean
+ gom_tracker_sparql_connection_get_string_attribute (TrackerSparqlConnection *connection,
+                                                     GCancellable *cancellable,
+                                                     GError **error,
++                                                    const gchar *graph,
+                                                     const gchar *resource,
+                                                     const gchar *attribute,
+                                                     gchar **value)
+@@ -45,8 +40,8 @@ gom_tracker_sparql_connection_get_string_attribute (TrackerSparqlConnection *con
+   const gchar *string_value = NULL;
+   gboolean res;
+ 
+-  g_string_append_printf (select, "SELECT ?val { <%s> %s ?val }",
+-                          resource, attribute);
++  g_string_append_printf (select, "SELECT ?val { GRAPH <%s> { <%s> %s ?val } }",
++                          graph, resource, attribute);
+   cursor = tracker_sparql_connection_query (connection,
+                                             select->str,
+                                             cancellable, error);
+@@ -86,7 +81,8 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+                                                const gchar *class,
+                                                ...)
+ {
+-  GString *select, *insert, *inner;
++  GString *select, *inner;
++  gchar *insert;
+   va_list args;
+   const gchar *arg;
+   TrackerSparqlCursor *cursor;
+@@ -98,6 +94,8 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+   gchar *key = NULL, *val = NULL;
+   gboolean exists = FALSE;
+ 
++  g_return_val_if_fail (graph != NULL, NULL);
++
+   /* build the inner query with all the classes */
+   va_start (args, class);
+   inner = g_string_new (NULL);
+@@ -112,7 +110,7 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+   /* query if such a resource is already in the DB */
+   select = g_string_new (NULL);
+   g_string_append_printf (select,
+-                          "SELECT ?urn WHERE { ?urn %s }", inner->str);
++                          "SELECT ?urn WHERE { GRAPH <%s> { ?urn %s } }", graph, inner->str);
+ 
+   cursor = tracker_sparql_connection_query (connection,
+                                             select->str,
+@@ -138,19 +136,12 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+     }
+ 
+   /* not found, create the resource */
+-  insert = g_string_new (NULL);
+-  graph_str = _tracker_utils_format_into_graph (graph);
+-
+-  g_string_append_printf (insert, "INSERT %s { _:res %s }",
+-                          graph_str, inner->str);
+-  g_free (graph_str);
+-  g_string_free (inner, TRUE);
+-
++  insert = g_strdup_printf ("INSERT INTO <%s> { _:res %s }",
++                            graph, inner->str);
+   insert_res =
+-    tracker_sparql_connection_update_blank (connection, insert->str,
++    tracker_sparql_connection_update_blank (connection, insert,
+                                             G_PRIORITY_DEFAULT, NULL, error);
+-
+-  g_string_free (insert, TRUE);
++  g_free (insert);
+ 
+   if (*error != NULL)
+     goto out;
+@@ -194,10 +185,10 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+                                                         const gchar *property_value)
+ {
+   GString *insert;
+-  gchar *graph_str, *quoted;
++  gchar *quoted;
+   gboolean retval = TRUE;
+ 
+-  graph_str = _tracker_utils_format_into_graph (graph);
++  g_return_val_if_fail (graph != NULL, FALSE);
+ 
+   /* the "null" value must not be quoted */
+   if (property_value == NULL)
+@@ -208,8 +199,8 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+   insert = g_string_new (NULL);
+   g_string_append_printf
+     (insert,
+-     "INSERT OR REPLACE %s { <%s> a nie:InformationElement, nie:DataObject ; %s %s }",
+-     graph_str, resource, property_name, quoted);
++     "INSERT OR REPLACE INTO <%s> { <%s> a nie:InformationElement, nie:DataObject ; %s %s }",
++     graph, resource, property_name, quoted);
+   g_free (quoted);
+ 
+   g_debug ("Insert or replace triple: query %s", insert->str);
+@@ -223,8 +214,6 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+   if (*error != NULL)
+     retval = FALSE;
+ 
+-  g_free (graph_str);
+-
+   return retval;
+ }
+ 
+@@ -271,6 +260,7 @@ gboolean
+ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connection,
+                                                GCancellable *cancellable,
+                                                GError **error,
++                                               const gchar *graph,
+                                                const gchar *resource,
+                                                gboolean favorite)
+ {
+@@ -279,15 +269,15 @@ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connecti
+   gboolean retval = TRUE;
+ 
+   if (favorite)
+-    op_str = "INSERT OR REPLACE";
++    op_str = "INSERT OR REPLACE INTO";
+   else
+-    op_str = "DELETE";
++    op_str = "DELETE FROM";
+ 
+   update = g_string_new (NULL);
+   g_string_append_printf
+     (update,
+-     "%s { <%s> nao:hasTag nao:predefined-tag-favorite }",
+-     op_str, resource);
++     "%s <%s> { <%s> nao:hasTag nao:predefined-tag-favorite }",
++     op_str, graph, resource);
+ 
+   g_debug ("Toggle favorite: query %s", update->str);
+ 
+@@ -321,9 +311,13 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection,
+   mail_uri = g_strconcat ("mailto:", email, NULL);
+   select = g_string_new (NULL);
+   g_string_append_printf (select,
+-                          "SELECT ?urn WHERE { ?urn a nco:Contact . "
+-                          "?urn nco:hasEmailAddress ?mail . "
+-                          "FILTER (fn:contains(?mail, \"%s\" )) }", mail_uri);
++                          "SELECT ?urn WHERE { "
++                          "  GRAPH <%s> { "
++                          "    ?urn a nco:Contact . "
++                          "    ?urn nco:hasEmailAddress ?mail . "
++                          "    FILTER (fn:contains(?mail, \"%s\" )) "
++                          "  }"
++                          "}", TRACKER_CONTACTS_GRAPH, mail_uri);
+ 
+   cursor = tracker_sparql_connection_query (connection,
+                                             select->str,
+@@ -351,8 +345,9 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection,
+   insert = g_string_new (NULL);
+ 
+   g_string_append_printf (insert,
+-                          "INSERT { <%s> a nco:EmailAddress ; nco:emailAddress \"%s\" . "
++                          "INSERT INTO <%s> { <%s> a nco:EmailAddress ; nco:emailAddress \"%s\" . "
+                           "_:res a nco:Contact ; nco:hasEmailAddress <%s> ; nco:fullname \"%s\" . }",
++                          TRACKER_CONTACTS_GRAPH,
+                           mail_uri, email,
+                           mail_uri, fullname);
+ 
+@@ -397,6 +392,7 @@ gchar *
+ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection,
+                                              GCancellable *cancellable,
+                                              GError **error,
++                                             const gchar *graph,
+                                              const gchar *make,
+                                              const gchar *model)
+ {
+@@ -416,7 +412,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+   equip_uri = tracker_sparql_escape_uri_printf ("urn:equipment:%s:%s:",
+                                                 make != NULL ? make : "",
+                                                 model != NULL ? model : "");
+-  select = g_strdup_printf ("SELECT <%s> WHERE { }", equip_uri);
++  select = g_strdup_printf ("SELECT <%s> WHERE { GRAPH <%s> { } }", equip_uri, graph);
+ 
+   local_error = NULL;
+   cursor = tracker_sparql_connection_query (connection, select, cancellable, &local_error);
+@@ -449,7 +445,8 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+     }
+ 
+   /* not found, create the resource */
+-  insert = g_strdup_printf ("INSERT { <%s> a nfo:Equipment ; nfo:manufacturer \"%s\" ; nfo:model \"%s\" }",
++  insert = g_strdup_printf ("INSERT INTO <%s> { <%s> a nfo:Equipment ; nfo:manufacturer \"%s\" ; nfo:model \"%s\" }",
++                            graph,
+                             equip_uri,
+                             make,
+                             model);
+@@ -480,7 +477,7 @@ void
+ gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+                                const gchar              *datasource_urn,
+                                gboolean                  resource_exists,
+-                               const gchar              *identifier,
++                               const gchar              *graph,
+                                const gchar              *resource,
+                                GCancellable             *cancellable,
+                                GError                  **error)
+@@ -498,7 +495,7 @@ gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+ 
+       res = gom_tracker_sparql_connection_get_string_attribute
+         (connection, cancellable, error,
+-         resource, "nie:dataSource", &old_value);
++         graph, resource, "nie:dataSource", &old_value);
+       g_clear_error (error);
+ 
+       if (res)
+@@ -514,7 +511,7 @@ gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+   if (set_datasource)
+     gom_tracker_sparql_connection_set_triple
+       (connection, cancellable, error,
+-       identifier, resource,
++       graph, resource,
+        "nie:dataSource", datasource_urn);
+ }
+ 
+@@ -522,7 +519,7 @@ gboolean
+ gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+                           gint64                    new_mtime,
+                           gboolean                  resource_exists,
+-                          const gchar              *identifier,
++                          const gchar              *graph,
+                           const gchar              *resource,
+                           GCancellable             *cancellable,
+                           GError                  **error)
+@@ -536,7 +533,7 @@ gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+     {
+       res = gom_tracker_sparql_connection_get_string_attribute
+         (connection, cancellable, error,
+-         resource, "nie:contentLastModified", &old_value);
++         graph, resource, "nie:contentLastModified", &old_value);
+       g_clear_error (error);
+ 
+       if (res)
+@@ -552,7 +549,7 @@ gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+   date = gom_iso8601_from_timestamp (new_mtime);
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection, cancellable, error,
+-     identifier, resource,
++     graph, resource,
+      "nie:contentLastModified", date);
+   g_free (date);
+ 
+diff --git a/src/gom-tracker.h b/src/gom-tracker.h
+index 94a39e8..a5ae6fd 100644
+--- a/src/gom-tracker.h
++++ b/src/gom-tracker.h
+@@ -29,6 +29,14 @@
+ 
+ G_BEGIN_DECLS
+ 
++/* The graph where we store account meta information */
++#define GOM_GRAPH "tracker.api.gnome.org/ontology/v3/gnome-online-miners"
++
++/* Graphs where we store content information */
++#define TRACKER_CONTACTS_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Contacts"
++#define TRACKER_DOCUMENTS_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Documents"
++#define TRACKER_PICTURES_GRAPH "http://tracker.api.gnome.org/ontology/v3/tracker#Pictures"
++
+ gchar *gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connection,
+                                                       GCancellable *cancellable,
+                                                       GError **error,
+@@ -57,6 +65,7 @@ gboolean gom_tracker_sparql_connection_set_triple (TrackerSparqlConnection *conn
+ gboolean gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connection,
+                                                         GCancellable *cancellable,
+                                                         GError **error,
++                                                        const gchar *graph,
+                                                         const gchar *resource,
+                                                         gboolean favorite);
+ 
+@@ -69,20 +78,21 @@ gchar* gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *conne
+ gchar *gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection,
+                                                     GCancellable *cancellable,
+                                                     GError **error,
++                                                    const gchar *graph,
+                                                     const gchar *make,
+                                                     const gchar *model);
+ 
+ void gom_tracker_update_datasource (TrackerSparqlConnection  *connection,
+                                     const gchar              *datasource_urn,
+                                     gboolean                  resource_exists,
+-                                    const gchar              *identifier,
++                                    const gchar              *graph,
+                                     const gchar              *resource,
+                                     GCancellable             *cancellable,
+                                     GError                  **error);
+ gboolean gom_tracker_update_mtime (TrackerSparqlConnection  *connection,
+                                    gint64                    new_mtime,
+                                    gboolean                  resource_exists,
+-                                   const gchar              *identifier,
++                                   const gchar              *graph,
+                                    const gchar              *resource,
+                                    GCancellable             *cancellable,
+                                    GError                  **error);
+diff --git a/src/gom-zpj-miner.c b/src/gom-zpj-miner.c
+index 6dff947..1372de5 100644
+--- a/src/gom-zpj-miner.c
++++ b/src/gom-zpj-miner.c
+@@ -70,14 +70,14 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+     (connection,
+      cancellable, error,
+      &resource_exists,
+-     datasource_urn, identifier,
++     TRACKER_PICTURES_GRAPH, identifier,
+      "nfo:RemoteDataObject", class, NULL);
+ 
+   if (*error != NULL)
+     goto out;
+ 
+   gom_tracker_update_datasource (connection, datasource_urn,
+-                                 resource_exists, identifier, resource,
++                                 resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                  cancellable, error);
+ 
+   if (*error != NULL)
+@@ -86,7 +86,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   updated_time = zpj_skydrive_entry_get_updated_time (entry);
+   new_mtime = g_date_time_to_unix (updated_time);
+   mtime_changed = gom_tracker_update_mtime (connection, new_mtime,
+-                                            resource_exists, identifier, resource,
++                                            resource_exists, TRACKER_PICTURES_GRAPH, resource,
+                                             cancellable, error);
+ 
+   if (*error != NULL)
+@@ -102,7 +102,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:url", identifier);
+ 
+   if (*error != NULL)
+@@ -119,7 +119,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       parent_resource_urn = gom_tracker_sparql_connection_ensure_resource
+         (connection, cancellable, error,
+          NULL,
+-         datasource_urn, parent_identifier,
++         TRACKER_PICTURES_GRAPH, parent_identifier,
+          "nfo:RemoteDataObject", "nfo:DataContainer", NULL);
+       g_free (parent_identifier);
+ 
+@@ -129,7 +129,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+       gom_tracker_sparql_connection_insert_or_replace_triple
+         (connection,
+          cancellable, error,
+-         datasource_urn, resource,
++         TRACKER_PICTURES_GRAPH, resource,
+          "nie:isPartOf", parent_resource_urn);
+       g_free (parent_resource_urn);
+ 
+@@ -142,7 +142,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+           gom_tracker_sparql_connection_insert_or_replace_triple
+             (connection,
+              cancellable, error,
+-             datasource_urn, resource,
++             TRACKER_PICTURES_GRAPH, resource,
+              "nie:mimeType", mime);
+           g_free (mime);
+ 
+@@ -154,7 +154,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:description", zpj_skydrive_entry_get_description (entry));
+ 
+   if (*error != NULL)
+@@ -163,7 +163,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nfo:fileName", name);
+ 
+   if (*error != NULL)
+@@ -180,7 +180,7 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nco:creator", contact_resource);
+   g_free (contact_resource);
+ 
+@@ -192,6 +192,6 @@ account_miner_job_process_entry (GomAccountMinerJob *job,
+   gom_tracker_sparql_connection_insert_or_replace_triple
+     (connection,
+      cancellable, error,
+-     datasource_urn, resource,
++     TRACKER_PICTURES_GRAPH, resource,
+      "nie:contentCreated", date);
+   g_free (date);
+
+diff --git a/src/gom-miner.c b/src/gom-miner.c
+index 40b111d..f9e4be0 100644
+--- a/src/gom-miner.c
++++ b/src/gom-miner.c
+@@ -381,7 +381,6 @@ gom_miner_ensure_datasource (GomMiner *self,
+ 
+   tracker_sparql_connection_update (self->priv->connection,
+                                     datasource_insert->str,
+-                                    G_PRIORITY_DEFAULT,
+                                     cancellable,
+                                     error);
+ 
+@@ -468,7 +467,6 @@ gom_account_miner_job_cleanup_previous (GomAccountMinerJob *job,
+ 
+   tracker_sparql_connection_update (job->connection,
+                                     delete->str,
+-                                    G_PRIORITY_DEFAULT,
+                                     cancellable,
+                                     error);
+ 
+@@ -708,7 +706,6 @@ cleanup_job_do_cleanup (CleanupJob *job, GCancellable *cancellable)
+ 
+   tracker_sparql_connection_update (self->priv->connection,
+                                     update->str,
+-                                    G_PRIORITY_DEFAULT,
+                                     cancellable,
+                                     &error);
+   g_string_free (update, TRUE);
+
+diff --git a/src/gom-tracker.c b/src/gom-tracker.c
+index 469583e..716fc14 100644
+--- a/src/gom-tracker.c
++++ b/src/gom-tracker.c
+@@ -138,9 +138,7 @@ gom_tracker_sparql_connection_ensure_resource (TrackerSparqlConnection *connecti
+   /* not found, create the resource */
+   insert = g_strdup_printf ("INSERT INTO <%s> { _:res %s }",
+                             graph, inner->str);
+-  insert_res =
+-    tracker_sparql_connection_update_blank (connection, insert,
+-                                            G_PRIORITY_DEFAULT, NULL, error);
++  insert_res = tracker_sparql_connection_update_blank (connection, insert, NULL, error);
+   g_free (insert);
+ 
+   if (*error != NULL)
+@@ -205,9 +203,7 @@ gom_tracker_sparql_connection_insert_or_replace_triple (TrackerSparqlConnection
+ 
+   g_debug ("Insert or replace triple: query %s", insert->str);
+ 
+-  tracker_sparql_connection_update (connection, insert->str,
+-                                    G_PRIORITY_DEFAULT, cancellable,
+-                                    error);
++  tracker_sparql_connection_update (connection, insert->str, cancellable, error);
+ 
+   g_string_free (insert, TRUE);
+ 
+@@ -235,9 +231,7 @@ gom_tracker_sparql_connection_set_triple (TrackerSparqlConnection *connection,
+      "DELETE { <%s> %s ?val } WHERE { <%s> %s ?val }", resource,
+      property_name, resource, property_name);
+ 
+-  tracker_sparql_connection_update (connection, delete->str,
+-                                    G_PRIORITY_DEFAULT, cancellable,
+-                                    error);
++  tracker_sparql_connection_update (connection, delete->str, cancellable, error);
+ 
+   g_string_free (delete, TRUE);
+   if (*error != NULL)
+@@ -281,9 +275,7 @@ gom_tracker_sparql_connection_toggle_favorite (TrackerSparqlConnection *connecti
+ 
+   g_debug ("Toggle favorite: query %s", update->str);
+ 
+-  tracker_sparql_connection_update (connection, update->str,
+-                                    G_PRIORITY_DEFAULT, cancellable,
+-                                    error);
++  tracker_sparql_connection_update (connection, update->str, cancellable, error);
+ 
+   g_string_free (update, TRUE);
+ 
+@@ -351,9 +343,7 @@ gom_tracker_utils_ensure_contact_resource (TrackerSparqlConnection *connection,
+                           mail_uri, email,
+                           mail_uri, fullname);
+ 
+-  insert_res =
+-    tracker_sparql_connection_update_blank (connection, insert->str,
+-                                            G_PRIORITY_DEFAULT, cancellable, error);
++  insert_res = tracker_sparql_connection_update_blank (connection, insert->str, cancellable, error);
+ 
+   g_string_free (insert, TRUE);
+ 
+@@ -452,7 +442,7 @@ gom_tracker_utils_ensure_equipment_resource (TrackerSparqlConnection *connection
+                             model);
+ 
+   local_error = NULL;
+-  tracker_sparql_connection_update (connection, insert, G_PRIORITY_DEFAULT, cancellable, &local_error);
++  tracker_sparql_connection_update (connection, insert, cancellable, &local_error);
+   if (local_error != NULL)
+     {
+       g_propagate_error (error, local_error);
diff --git a/gnu/packages/patches/gnome-shell-CVE-2020-17489.patch b/gnu/packages/patches/gnome-shell-CVE-2020-17489.patch
deleted file mode 100644
index 4b7748950e..0000000000
--- a/gnu/packages/patches/gnome-shell-CVE-2020-17489.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 05b7aec747282f62212b605249d518280ff80059 Mon Sep 17 00:00:00 2001
-From: Ray Strode <rstrode@redhat.com>
-Date: Mon, 27 Jul 2020 10:58:22 -0400
-Subject: [PATCH] loginDialog: Reset auth prompt on vt switch before fade in
-
-At the moment, if a user switches to the login screen vt,
-the login screen fades in whatever was on screen prior, and
-then does a reset.
-
-It makes more sense to reset first, so we fade in what the
-user is going to interact with instead of what they interacted
-with before.
-
-Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2997
----
- js/gdm/loginDialog.js | 9 ++++-----
- 1 file changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
-index c3f90dc58..6b35ebb16 100644
---- a/js/gdm/loginDialog.js
-+++ b/js/gdm/loginDialog.js
-@@ -920,16 +920,15 @@ var LoginDialog = GObject.registerClass({
-         if (this.opacity == 255 && this._authPrompt.verificationStatus == AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
-             return;
- 
-+        if (this._authPrompt.verificationStatus !== AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
-+            this._authPrompt.reset();
-+
-         this._bindOpacity();
-         this.ease({
-             opacity: 255,
-             duration: _FADE_ANIMATION_TIME,
-             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
--            onComplete: () => {
--                if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.NOT_VERIFYING)
--                    this._authPrompt.reset();
--                this._unbindOpacity();
--            }
-+            onComplete: () => this._unbindOpacity(),
-         });
-     }
- 
--- 
-2.30.1
-
diff --git a/gnu/packages/patches/gnome-shell-disable-test.patch b/gnu/packages/patches/gnome-shell-disable-test.patch
index b4c7e73cd7..c61ff4a942 100644
--- a/gnu/packages/patches/gnome-shell-disable-test.patch
+++ b/gnu/packages/patches/gnome-shell-disable-test.patch
@@ -1,17 +1,16 @@
 This test seems to require a D-Bus connection not available in the build
 environment.
 
-diff -ur /tmp/guix-build-gnome-shell-3.34.2.drv-0/gnome-shell-3.34.2/src/st/meson.build b/src/st/meson.build
---- /tmp/guix-build-gnome-shell-3.34.2.drv-0/gnome-shell-3.34.2/src/st/meson.build	1969-12-31 19:00:00.000000000 -0500
-+++ b/src/st/meson.build	2019-12-23 00:46:14.721198022 -0500
-@@ -132,18 +132,6 @@
+--- a/src/st/meson.build	2021-09-21 19:07:38.673049200 +0000
++++ b/src/st/meson.build	2021-09-26 18:23:38.461569826 +0000
+@@ -191,18 +191,6 @@
    sources: st_enums[1]
  )
  
 -test_theme = executable('test-theme',
 -  sources: 'test-theme.c',
 -  c_args: st_cflags,
--  dependencies: [mutter_dep, gtk_dep],
+-  dependencies: [mutter_dep, gtk_dep, libxml_dep],
 -  build_rpath: mutter_typelibdir,
 -  link_with: libst
 -)
diff --git a/gnu/packages/patches/gnome-shell-theme.patch b/gnu/packages/patches/gnome-shell-theme.patch
deleted file mode 100644
index 3fa0670c43..0000000000
--- a/gnu/packages/patches/gnome-shell-theme.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Adjust GNOME-Shell so that it uses a Guix theme by default.
-
-Patch by Ludovic Courtès <ludo@gnu.org>.
-
-diff -ur a/data/gnome-shell-theme.gresource.xml b/data/gnome-shell-theme.gresource.xml
---- a/data/gnome-shell-theme.gresource.xml	2019-12-11 15:06:31.000000000 -0500
-+++ b/data/gnome-shell-theme.gresource.xml	2019-12-21 00:31:55.895866241 -0500
-@@ -19,6 +19,8 @@
-     <file>no-events.svg</file>
-     <file>no-notifications.svg</file>
-     <file>noise-texture.png</file>
-+    <file>guix-background.png</file>
-+    <file>guix-logo.png</file>
-     <file>pad-osd.css</file>
-     <file alias="icons/pointer-double-click-symbolic.svg">pointer-double-click-symbolic.svg</file>
-     <file alias="icons/pointer-drag-symbolic.svg">pointer-drag-symbolic.svg</file>
-diff -ur a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
---- a/data/theme/gnome-shell-sass/_common.scss	2019-12-11 15:06:31.000000000 -0500
-+++ b/data/theme/gnome-shell-sass/_common.scss	2019-12-21 00:33:49.495832135 -0500
-@@ -1994,7 +1994,16 @@
-   }
- }
- 
--  .login-dialog-logo-bin { padding: 24px 0px; }
-+  .login-dialog-logo-bin {
-+      /* Make it a bit narrower than .login-dialog-user-list.  */
-+      width: 12em;
-+      height: 8em;
-+      background: url(resource:///org/gnome/shell/theme/guix-logo.png);
-+      background-color: transparent;
-+      background-repeat: no-repeat;
-+      background-size: contain;
-+      background-position: center; }
-+
-   .login-dialog-banner { color: darken($osd_fg_color,10%); }
-   .login-dialog-button-box { spacing: 5px; }
-   .login-dialog-message-warning { color: $warning_color; }
-@@ -2143,9 +2152,10 @@
- }
- 
- #lockDialogGroup {
--  background: lighten(#2e3436, 8%) url(resource:///org/gnome/shell/theme/noise-texture.png);
--  background-repeat: repeat;
--}
-+  background: lighten(#2e3436, 8%) url(resource:///org/gnome/shell/theme/guix-background.png);
-+  background-repeat: no-repeat;
-+  background-size: cover;
-+  background-position: center; }
- 
- #screenShieldNotifications {
-   StButton#vhandle, StButton#hhandle {
diff --git a/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch b/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch
deleted file mode 100644
index c680e86495..0000000000
--- a/gnu/packages/patches/gnome-todo-delete-esource-duplicate.patch
+++ /dev/null
@@ -1,10 +0,0 @@
-From: Emmanuele Bassi <ebassi@gnome.org>
-
-See also: https://gitlab.gnome.org/GNOME/gnome-todo/commit/6cdabc4dd0c6c804a093b94c269461ce376fed4f
---- gnome-todo-3.28.1/plugins/eds/gtd-eds-autoptr.h.orig	2020-05-06 14:20:49.589902539 +0200
-+++ gnome-todo-3.28.1/plugins/eds/gtd-eds-autoptr.h	2020-05-06 14:20:54.593919721 +0200
-@@ -25,4 +25,3 @@
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (ECalComponent, g_object_unref);
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (ECalComponentId, e_cal_component_free_id);
- G_DEFINE_AUTOPTR_CLEANUP_FUNC (ECalClient, g_object_unref);
--G_DEFINE_AUTOPTR_CLEANUP_FUNC (ESource, g_object_unref);
diff --git a/gnu/packages/patches/gnupg-1-build-with-gcc10.patch b/gnu/packages/patches/gnupg-1-build-with-gcc10.patch
new file mode 100644
index 0000000000..40b2aff98e
--- /dev/null
+++ b/gnu/packages/patches/gnupg-1-build-with-gcc10.patch
@@ -0,0 +1,64 @@
+Borrowed from Debian
+https://sources.debian.org/src/gnupg1/1.4.23-1.1/debian/patches/0006-fix-for-gcc10.patch/
+
+Subject: Fix build with gcc-10
+Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Date: 2021-01-04
+Bug: https://dev.gnupg.org/T5215
+Bug-Debian: https://bugs.debian.org/957293
+
+--- a/g10/options.h
++++ b/g10/options.h
+@@ -29,6 +29,8 @@
+ /* Norcraft can't cope with common symbols */
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE
+ #endif
+--- a/include/cipher.h
++++ b/include/cipher.h
+@@ -117,6 +117,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE
+ #endif
+--- a/include/iobuf.h
++++ b/include/iobuf.h
+@@ -72,6 +72,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE 
+ #endif
+--- a/include/memory.h
++++ b/include/memory.h
+@@ -93,6 +93,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE 
+ #endif
+--- a/include/mpi.h
++++ b/include/mpi.h
+@@ -38,6 +38,8 @@
+ #ifndef EXTERN_UNLESS_MAIN_MODULE
+ #if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
+ #define EXTERN_UNLESS_MAIN_MODULE extern
++#elif defined (__GNUC__) && __GNUC__ >= 10
++#define EXTERN_UNLESS_MAIN_MODULE __attribute__((__common__))
+ #else
+ #define EXTERN_UNLESS_MAIN_MODULE 
+ #endif
diff --git a/gnu/packages/patches/gnutls-CVE-2021-20231.patch b/gnu/packages/patches/gnutls-CVE-2021-20231.patch
deleted file mode 100644
index 5186522eee..0000000000
--- a/gnu/packages/patches/gnutls-CVE-2021-20231.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 15beb4b193b2714d88107e7dffca781798684e7e Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <ueno@gnu.org>
-Date: Fri, 29 Jan 2021 14:06:05 +0100
-Subject: [PATCH 1/2] key_share: avoid use-after-free around realloc
-
-Signed-off-by: Daiki Ueno <ueno@gnu.org>
----
- lib/ext/key_share.c | 12 +++++-------
- 1 file changed, 5 insertions(+), 7 deletions(-)
-
-diff --git a/lib/ext/key_share.c b/lib/ext/key_share.c
-index ab8abf8fe..a8c4bb5cf 100644
---- a/lib/ext/key_share.c
-+++ b/lib/ext/key_share.c
-@@ -664,14 +664,14 @@ key_share_send_params(gnutls_session_t session,
- {
- 	unsigned i;
- 	int ret;
--	unsigned char *lengthp;
--	unsigned int cur_length;
- 	unsigned int generated = 0;
- 	const gnutls_group_entry_st *group;
- 	const version_entry_st *ver;
- 
- 	/* this extension is only being sent on client side */
- 	if (session->security_parameters.entity == GNUTLS_CLIENT) {
-+		unsigned int length_pos;
-+
- 		ver = _gnutls_version_max(session);
- 		if (unlikely(ver == NULL || ver->key_shares == 0))
- 			return 0;
-@@ -679,16 +679,13 @@ key_share_send_params(gnutls_session_t session,
- 		if (!have_creds_for_tls13(session))
- 			return 0;
- 
--		/* write the total length later */
--		lengthp = &extdata->data[extdata->length];
-+		length_pos = extdata->length;
- 
- 		ret =
- 		    _gnutls_buffer_append_prefix(extdata, 16, 0);
- 		if (ret < 0)
- 			return gnutls_assert_val(ret);
- 
--		cur_length = extdata->length;
--
- 		if (session->internals.hsk_flags & HSK_HRR_RECEIVED) { /* we know the group */
- 			group = get_group(session);
- 			if (unlikely(group == NULL))
-@@ -736,7 +733,8 @@ key_share_send_params(gnutls_session_t session,
- 		}
- 
- 		/* copy actual length */
--		_gnutls_write_uint16(extdata->length - cur_length, lengthp);
-+		_gnutls_write_uint16(extdata->length - length_pos - 2,
-+				     &extdata->data[length_pos]);
- 
- 	} else { /* server */
- 		ver = get_version(session);
--- 
-2.30.2
-
diff --git a/gnu/packages/patches/gnutls-CVE-2021-20232.patch b/gnu/packages/patches/gnutls-CVE-2021-20232.patch
deleted file mode 100644
index dc3a0be690..0000000000
--- a/gnu/packages/patches/gnutls-CVE-2021-20232.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 75a937d97f4fefc6f9b08e3791f151445f551cb3 Mon Sep 17 00:00:00 2001
-From: Daiki Ueno <ueno@gnu.org>
-Date: Fri, 29 Jan 2021 14:06:23 +0100
-Subject: [PATCH 2/2] pre_shared_key: avoid use-after-free around realloc
-
-Signed-off-by: Daiki Ueno <ueno@gnu.org>
----
- lib/ext/pre_shared_key.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/lib/ext/pre_shared_key.c b/lib/ext/pre_shared_key.c
-index a042c6488..380bf39ed 100644
---- a/lib/ext/pre_shared_key.c
-+++ b/lib/ext/pre_shared_key.c
-@@ -267,7 +267,7 @@ client_send_params(gnutls_session_t session,
- 	size_t spos;
- 	gnutls_datum_t username = {NULL, 0};
- 	gnutls_datum_t user_key = {NULL, 0}, rkey = {NULL, 0};
--	gnutls_datum_t client_hello;
-+	unsigned client_hello_len;
- 	unsigned next_idx;
- 	const mac_entry_st *prf_res = NULL;
- 	const mac_entry_st *prf_psk = NULL;
-@@ -428,8 +428,7 @@ client_send_params(gnutls_session_t session,
- 	assert(extdata->length >= sizeof(mbuffer_st));
- 	assert(ext_offset >= (ssize_t)sizeof(mbuffer_st));
- 	ext_offset -= sizeof(mbuffer_st);
--	client_hello.data = extdata->data+sizeof(mbuffer_st);
--	client_hello.size = extdata->length-sizeof(mbuffer_st);
-+	client_hello_len = extdata->length-sizeof(mbuffer_st);
- 
- 	next_idx = 0;
- 
-@@ -440,6 +439,11 @@ client_send_params(gnutls_session_t session,
- 	}
- 
- 	if (prf_res && rkey.size > 0) {
-+		gnutls_datum_t client_hello;
-+
-+		client_hello.data = extdata->data+sizeof(mbuffer_st);
-+		client_hello.size = client_hello_len;
-+
- 		ret = compute_psk_binder(session, prf_res,
- 					 binders_len, binders_pos,
- 					 ext_offset, &rkey, &client_hello, 1,
-@@ -474,6 +478,11 @@ client_send_params(gnutls_session_t session,
- 	}
- 
- 	if (prf_psk && user_key.size > 0 && info) {
-+		gnutls_datum_t client_hello;
-+
-+		client_hello.data = extdata->data+sizeof(mbuffer_st);
-+		client_hello.size = client_hello_len;
-+
- 		ret = compute_psk_binder(session, prf_psk,
- 					 binders_len, binders_pos,
- 					 ext_offset, &user_key, &client_hello, 0,
--- 
-2.30.2
-
diff --git a/gnu/packages/patches/gnutls-guile-eintr-eagain.patch b/gnu/packages/patches/gnutls-guile-eintr-eagain.patch
new file mode 100644
index 0000000000..e04c945158
--- /dev/null
+++ b/gnu/packages/patches/gnutls-guile-eintr-eagain.patch
@@ -0,0 +1,56 @@
+Fixes <https://issues.guix.gnu.org/47867>.
+
+This fix was merged upstream
+in <https://gitlab.com/gnutls/gnutls/-/merge_requests/1417> and will
+be in GnuTLS 3.7.3.  Upstream commit:
+
+commit 110e2172dbef1fbdf7399dab1e80780847b61c0c
+Author: Ludovic Courtès <ludo@gnu.org>
+Date:   Sat Apr 24 22:02:14 2021 +0200
+
+    guile: Writes to record ports handle EAGAIN/EINTR transparently.
+
+diff --git a/guile/src/core.c b/guile/src/core.c
+index a13670fc7b..0926dc8a97 100644
+--- a/guile/src/core.c
++++ b/guile/src/core.c
+@@ -985,7 +985,10 @@ write_to_session_record_port (SCM port, const void *data, size_t size)
+       c_result = gnutls_record_send (c_session, (char *) data + c_sent,
+                                      size - c_sent);
+       if (EXPECT_FALSE (c_result < 0))
+-        scm_gnutls_error (c_result, FUNC_NAME);
++	{
++	  if (c_result != GNUTLS_E_AGAIN && c_result != GNUTLS_E_INTERRUPTED)
++	    scm_gnutls_error (c_result, FUNC_NAME);
++	}
+       else
+         c_sent += c_result;
+     }
+@@ -1069,7 +1072,8 @@ read_from_session_record_port (SCM port, SCM dst, size_t start, size_t count)
+ #undef FUNC_NAME
+ 
+ /* Return the file descriptor that backs PORT.  This function is called upon a
+-   blocking read--i.e., 'read_from_session_record_port' returned -1.  */
++   blocking read--i.e., 'read_from_session_record_port' or
++   'write_to_session_record_port' returned -1.  */
+ static int
+ session_record_port_fd (SCM port)
+ {
+@@ -1097,7 +1101,16 @@ write_to_session_record_port (SCM port, SCM src, size_t start, size_t count)
+   c_session = scm_to_gnutls_session (session, 1, FUNC_NAME);
+   data = (char *) SCM_BYTEVECTOR_CONTENTS (src) + start;
+ 
+-  result = gnutls_record_send (c_session, data, count);
++  do
++    result = gnutls_record_send (c_session, data, count);
++  while (result == GNUTLS_E_INTERRUPTED
++	 || (result == GNUTLS_E_AGAIN
++	     && !SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session)));
++
++  if (result == GNUTLS_E_AGAIN
++      && SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session))
++    /* Tell Guile that reading would block.  */
++    return (size_t) -1;
+ 
+   if (EXPECT_FALSE (result < 0))
+     scm_gnutls_error (result, FUNC_NAME);
diff --git a/gnu/packages/patches/graphviz-CVE-2020-18032.patch b/gnu/packages/patches/graphviz-CVE-2020-18032.patch
deleted file mode 100644
index 4cf94a9a36..0000000000
--- a/gnu/packages/patches/graphviz-CVE-2020-18032.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Fix CVE-2020-18032:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=2020-18032
-https://gitlab.com/graphviz/graphviz/-/issues/1700
-
-Patch copied from upstream source repository:
-
-https://gitlab.com/graphviz/graphviz/-/commit/784411ca3655c80da0f6025ab20634b2a6ff696b
-
-From 784411ca3655c80da0f6025ab20634b2a6ff696b Mon Sep 17 00:00:00 2001
-From: Matthew Fernandez <matthew.fernandez@gmail.com>
-Date: Sat, 25 Jul 2020 19:31:01 -0700
-Subject: [PATCH] fix: out-of-bounds write on invalid label
-
-When the label for a node cannot be parsed (due to it being malformed), it falls
-back on the symbol name of the node itself. I.e. the default label the node
-would have had if it had no label attribute at all. However, this is applied by
-dynamically altering the node's label to "\N", a shortcut for the symbol name of
-the node. All of this is fine, however if the hand written label itself is
-shorter than the literal string "\N", not enough memory would have been
-allocated to write "\N" into the label text.
-
-Here we account for the possibility of error during label parsing, and assume
-that the label text may need to be overwritten with "\N" after the fact. Fixes
-issue #1700.
----
- lib/common/shapes.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/lib/common/shapes.c b/lib/common/shapes.c
-index 0a0635fc3..9dca9ba6e 100644
---- a/lib/common/shapes.c
-+++ b/lib/common/shapes.c
-@@ -3546,9 +3546,10 @@ static void record_init(node_t * n)
-     reclblp = ND_label(n)->text;
-     len = strlen(reclblp);
-     /* For some forgotten reason, an empty label is parsed into a space, so
--     * we need at least two bytes in textbuf.
-+     * we need at least two bytes in textbuf, as well as accounting for the
-+     * error path involving "\\N" below.
-      */
--    len = MAX(len, 1);
-+    len = MAX(MAX(len, 1), (int)strlen("\\N"));
-     textbuf = N_NEW(len + 1, char);
-     if (!(info = parse_reclbl(n, flip, TRUE, textbuf))) {
- 	agerr(AGERR, "bad label format %s\n", ND_label(n)->text);
--- 
-2.31.1
-
diff --git a/gnu/packages/patches/gtk-doc-respect-xml-catalog.patch b/gnu/packages/patches/gtk-doc-respect-xml-catalog.patch
new file mode 100644
index 0000000000..710f208285
--- /dev/null
+++ b/gnu/packages/patches/gtk-doc-respect-xml-catalog.patch
@@ -0,0 +1,16 @@
+Taken from here:
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/documentation/gtk-doc/respect-xml-catalog-files-var.patch.
+
+--- a/m4/gtkdoc_jh_check_xml_catalog.m4
++++ b/m4/gtkdoc_jh_check_xml_catalog.m4
+@@ -5,8 +5,8 @@
+ [
+ 	AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
+ 	AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
+-	if $jh_found_xmlcatalog && \
+-		AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
++	# empty argument forces libxml to use XML_CATALOG_FILES variable
++	if AC_RUN_LOG([$XMLCATALOG --noout "" "$1" >&2]); then
+ 		AC_MSG_RESULT([found])
+ 		ifelse([$3],,,[$3])
+ 	else
diff --git a/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch
new file mode 100644
index 0000000000..4a60023bf7
--- /dev/null
+++ b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch
@@ -0,0 +1,51 @@
+From 889294a93fc6464c2c2919bc47f6fd85ec823363 Mon Sep 17 00:00:00 2001
+From: Raghav Gururajan <rg@raghavgururajan.name>
+Date: Tue, 18 May 2021 19:57:00 -0400
+Subject: [PATCH] [PATCH]: Honor GUIX_GTK4_PATH.
+
+This patch makes GTK look for additional modules in a list of directories
+specified by the environment variable "GUIX_GTK4_PATH". This can be used
+instead of "GTK_PATH" to make GTK find modules that are incompatible with
+other major versions of GTK.
+---
+ gtk/gtkmodules.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
+index aace5dcbc9..193b6a02e9 100644
+--- a/gtk/gtkmodules.c
++++ b/gtk/gtkmodules.c
+@@ -105,6 +105,7 @@ static char **
+ get_module_path (void)
+ {
+   const char *module_path_env;
++  const gchar *module_guix_gtk4_path_env;
+   const char *exe_prefix;
+   char *module_path;
+   char *default_dir;
+@@ -114,6 +115,7 @@ get_module_path (void)
+     return result;
+ 
+   module_path_env = g_getenv ("GTK_PATH");
++  module_guix_gtk4_path_env = g_getenv ("GUIX_GTK4_PATH");
+   exe_prefix = g_getenv ("GTK_EXE_PREFIX");
+ 
+   if (exe_prefix)
+@@ -121,7 +123,13 @@ get_module_path (void)
+   else
+     default_dir = g_build_filename (_gtk_get_libdir (), "gtk-4.0", NULL);
+ 
+-  if (module_path_env)
++  if (module_guix_gtk4_path_env && module_path_env)
++    module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
++				module_guix_gtk4_path_env, module_path_env, default_dir, NULL);
++  else if (module_guix_gtk4_path_env)
++    module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
++				module_guix_gtk4_path_env, default_dir, NULL);
++  else if (module_path_env)
+     module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
+ 				module_path_env, default_dir, NULL);
+   else
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/guile-email-fix-tests.patch b/gnu/packages/patches/guile-email-fix-tests.patch
new file mode 100644
index 0000000000..8621aaea02
--- /dev/null
+++ b/gnu/packages/patches/guile-email-fix-tests.patch
@@ -0,0 +1,35 @@
+This patch has been proposed upstream:
+https://lists.systemreboot.net/guile-email/87mtnv1r2p.fsf@gnu.org/T/#u.
+
+From c21fe0f0e28b80b606973d3e372e2bc8528c9766 Mon Sep 17 00:00:00 2001
+From: Mathieu Othacehe <othacehe@gnu.org>
+Date: Wed, 29 Sep 2021 12:47:35 +0000
+Subject: [PATCH 1/1] email: Do not use an empty bytevector to test the
+ charset.
+
+Using an empty bytevector no longer throws an exception since this Guile
+commit: 5ea8c69e9153a970952bf6f0b32c4fad6a28e839.
+
+* email/email.scm (post-process-content-transfer-encoding): Use a bytevector
+containg the 'e' character to test the charset validity.
+---
+ email/email.scm | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/email/email.scm b/email/email.scm
+index 3f4e194..ac70463 100644
+--- a/email/email.scm
++++ b/email/email.scm
+@@ -832,7 +832,8 @@ values. The returned headers is a string and body is a bytevector."
+   (define (valid-charset? charset)
+     (catch #t
+       (lambda ()
+-        (bytevector->string (make-bytevector 0 0) charset)
++        ;; Try to convert a bytevector containg the 'e' character.
++        (bytevector->string (make-bytevector 1 48) charset)
+         #t)
+       (const #f)))
+ 
+-- 
+2.33.0
+
diff --git a/gnu/packages/patches/guile-ssh-fix-test-suite.patch b/gnu/packages/patches/guile-ssh-fix-test-suite.patch
new file mode 100644
index 0000000000..dc10e08b0f
--- /dev/null
+++ b/gnu/packages/patches/guile-ssh-fix-test-suite.patch
@@ -0,0 +1,217 @@
+From f7942cded8b65341916a555186e2219efe174cd0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Thu, 4 Feb 2021 14:38:25 -0500
+Subject: [PATCH] tests: Fix test suite for Guile 3.0.5.
+
+The test-runner object is now reset to #f when calling the 'test-end'
+procedure.  See the commit de5d1a7f99b8e952b115237ebc29633062f99bb9 in
+Guile (srfi-64: Reset test-runner-current if done) which introduced this
+change.
+
+* tests/client-server.scm (exit-status): New variable.  Use it when calling
+exit.
+* tests/dist.scm: Likewise.
+* tests/key.scm: Likewise.
+* tests/log.scm: Likewise.
+* tests/popen.scm: Likewise.
+* tests/server-client.scm: Likewise.
+* tests/server.scm: Likewise.
+* tests/session.scm: Likewise.
+* tests/shell.scm: Likewise.
+* tests/sssh-ssshd.scm: Likewise.
+* tests/tunnel.scm: Likewise.
+---
+ tests/client-server.scm | 4 +++-
+ tests/dist.scm          | 4 +++-
+ tests/key.scm           | 3 ++-
+ tests/log.scm           | 5 ++++-
+ tests/popen.scm         | 4 +++-
+ tests/server-client.scm | 4 +++-
+ tests/server.scm        | 4 +++-
+ tests/session.scm       | 4 +++-
+ tests/shell.scm         | 3 ++-
+ tests/sssh-ssshd.scm    | 4 +++-
+ tests/tunnel.scm        | 4 +++-
+ 11 files changed, 32 insertions(+), 11 deletions(-)
+
+diff --git a/tests/client-server.scm b/tests/client-server.scm
+index 432a48c..fc46140 100644
+--- a/tests/client-server.scm
++++ b/tests/client-server.scm
+@@ -743,8 +743,10 @@
+ 
+ ;;;
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "client-server")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; client-server.scm ends here.
+diff --git a/tests/dist.scm b/tests/dist.scm
+index 2a3a75f..79f9e23 100644
+--- a/tests/dist.scm
++++ b/tests/dist.scm
+@@ -269,8 +269,10 @@ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
+ ;;;
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "dist")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; dist.scm ends here.
+diff --git a/tests/key.scm b/tests/key.scm
+index be31378..e1678f4 100644
+--- a/tests/key.scm
++++ b/tests/key.scm
+@@ -170,9 +170,10 @@
+                    (eq? (get-key-type key) 'ecdsa-p256)))))))
+ 
+ ;;;
++(define exit-status (test-runner-fail-count (test-runner-current)))
+ 
+ (test-end "key")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; key.scm ends here.
+diff --git a/tests/log.scm b/tests/log.scm
+index f547202..d528251 100644
+--- a/tests/log.scm
++++ b/tests/log.scm
+@@ -64,8 +64,11 @@
+   (get-log-verbosity))
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "log")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
++
+ 
+ ;;; log.scm ends here
+diff --git a/tests/popen.scm b/tests/popen.scm
+index e063e0b..fe77108 100644
+--- a/tests/popen.scm
++++ b/tests/popen.scm
+@@ -129,8 +129,10 @@
+           (format-log/scm 'nolog "open-remote-output-pipe"  "channel: ~A" channel)
+           (output-only? channel)))))))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "popen")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; popen.scm ends here.
+diff --git a/tests/server-client.scm b/tests/server-client.scm
+index 920aa22..b6ed3eb 100644
+--- a/tests/server-client.scm
++++ b/tests/server-client.scm
+@@ -148,8 +148,10 @@
+          (equal? x session))))))
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "server-client")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; server-client.scm ends here.
+diff --git a/tests/server.scm b/tests/server.scm
+index c7f8b6c..1a6daea 100644
+--- a/tests/server.scm
++++ b/tests/server.scm
+@@ -157,9 +157,11 @@
+     (server-listen server)
+     #t))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "server")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; server.scm ends here.
+ 
+diff --git a/tests/session.scm b/tests/session.scm
+index 8caa039..7310647 100644
+--- a/tests/session.scm
++++ b/tests/session.scm
+@@ -210,8 +210,10 @@
+   (let ((session (%make-session)))
+     (not (connected? session))))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "session")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; session.scm ends here.
+diff --git a/tests/shell.scm b/tests/shell.scm
+index 7d613fb..e36e661 100644
+--- a/tests/shell.scm
++++ b/tests/shell.scm
+@@ -113,9 +113,10 @@
+ 
+ 
+ ;;;
++(define exit-status (test-runner-fail-count (test-runner-current)))
+ 
+ (test-end "shell")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; shell.scm ends here.
+diff --git a/tests/sssh-ssshd.scm b/tests/sssh-ssshd.scm
+index 2fe23db..edb53fc 100644
+--- a/tests/sssh-ssshd.scm
++++ b/tests/sssh-ssshd.scm
+@@ -118,8 +118,10 @@
+       result)))
+ 
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "sssh-ssshd")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; sssh-ssshd.scm ends here.
+diff --git a/tests/tunnel.scm b/tests/tunnel.scm
+index ef5a568..d6453b7 100644
+--- a/tests/tunnel.scm
++++ b/tests/tunnel.scm
+@@ -191,8 +191,10 @@
+                   (= pnum portnum)))
+            (eq? (channel-cancel-forward session "localhost" portnum) 'ok))))))))
+ 
++(define exit-status (test-runner-fail-count (test-runner-current)))
++
+ (test-end "tunnel")
+ 
+-(exit (= (test-runner-fail-count (test-runner-current)) 0))
++(exit (= 0 exit-status))
+ 
+ ;;; tunnel.scm ends here.
+-- 
+2.30.0
+
diff --git a/gnu/packages/patches/guile-ssh-read-error.patch b/gnu/packages/patches/guile-ssh-read-error.patch
new file mode 100644
index 0000000000..9cc6b048a0
--- /dev/null
+++ b/gnu/packages/patches/guile-ssh-read-error.patch
@@ -0,0 +1,18 @@
+This patch adjusts to slightly different 'read-error' in Guile 3.0.6
+compared to earlier versions:
+
+  https://github.com/artyom-poptsov/guile-ssh/issues/28
+
+--- a/tests/dist.scm
++++ b/tests/dist.scm
+@@ -183,8 +183,8 @@ Unbound variable: e"
+    rrepl-get-result))
+ 
+ (test-error-with-log/= "rrepl-get-result, unknown # object error"
+-  'node-repl-error "Reader error: scm_lreadr: #<unknown port>:1:3: \
+-Unknown # object: (#\\<): scheme@(guile-user)> \
++  'node-repl-error "Reader error: #f: #<unknown port>:1:3: \
++Unknown # object: (\"#<\"): scheme@(guile-user)> \
+ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
+   (call-with-input-string
+    (string-append  "scheme@(guile-user)> $4 = "
diff --git a/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch b/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch
deleted file mode 100644
index 250eef2c8b..0000000000
--- a/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Source: https://gitlab.gnome.org/GNOME/gvfs/-/commit/13551f3f40d41f1357126ac5a26d0fa012cd8123
-
-Note: This change should be incorporated into stable version 1.46.x of gvfs.
-
-From 13551f3f40d41f1357126ac5a26d0fa012cd8123 Mon Sep 17 00:00:00 2001
-From: Bastien Nocera <hadess@hadess.net>
-Date: Tue, 16 Jun 2020 13:28:35 +0200
-Subject: [PATCH] afc: Add support for libplist-2.2
-
-Which changed name from libplist to libplist-2.0 to embed its API
-version number in the library name.
----
- meson.build | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 1750f65ca..187bfd55f 100644
---- a/meson.build
-+++ b/meson.build
-@@ -357,7 +357,10 @@ config_h.set('HAVE_LOGIND', enable_logind)
- enable_afc = get_option('afc')
- if enable_afc
-   libimobiledevice_dep = dependency('libimobiledevice-1.0', version: '>= 1.2')
--  libplist_dep = dependency('libplist', version: '>= 0.15')
-+  libplist_dep = dependency('libplist-2.0', required: false)
-+  if not libplist_dep.found()
-+    libplist_dep = dependency('libplist', version: '>= 0.15')
-+  endif
- endif
- 
- # *** Check if we should build with GOA volume monitor ***
--- 
-GitLab
-
diff --git a/gnu/packages/patches/icu4c-CVE-2020-10531.patch b/gnu/packages/patches/icu4c-CVE-2020-10531.patch
deleted file mode 100644
index c2ab923bdc..0000000000
--- a/gnu/packages/patches/icu4c-CVE-2020-10531.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-Fix CVE-2020-10531:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10531
-
-Patch copied from upstream source repository (changes to the test suite
-are commented out):
-
-https://github.com/unicode-org/icu/commit/b7d08bc04a4296982fcef8b6b8a354a9e4e7afca
-
-From b7d08bc04a4296982fcef8b6b8a354a9e4e7afca Mon Sep 17 00:00:00 2001
-From: Frank Tang <ftang@chromium.org>
-Date: Sat, 1 Feb 2020 02:39:04 +0000
-Subject: [PATCH] ICU-20958 Prevent SEGV_MAPERR in append
-
-See #971
----
- icu4c/source/common/unistr.cpp          |  6 ++-
- icu4c/source/test/intltest/ustrtest.cpp | 62 +++++++++++++++++++++++++
- icu4c/source/test/intltest/ustrtest.h   |  1 +
- 3 files changed, 68 insertions(+), 1 deletion(-)
-
-diff --git a/icu4c/source/common/unistr.cpp b/icu4c/source/common/unistr.cpp
-index 901bb3358ba..077b4d6ef20 100644
---- a/icu4c/source/common/unistr.cpp
-+++ b/icu4c/source/common/unistr.cpp
-@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
-   }
- 
-   int32_t oldLength = length();
--  int32_t newLength = oldLength + srcLength;
-+  int32_t newLength;
-+  if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {
-+    setToBogus();
-+    return *this;
-+  }
- 
-   // Check for append onto ourself
-   const UChar* oldArray = getArrayStart();
-#diff --git a/icu4c/source/test/intltest/ustrtest.cpp b/icu4c/source/test/intltest/ustrtest.cpp
-#index b6515ea813c..ad38bdf53a3 100644
-#--- a/icu4c/source/test/intltest/ustrtest.cpp
-#+++ b/icu4c/source/test/intltest/ustrtest.cpp
-#@@ -67,6 +67,7 @@ void UnicodeStringTest::runIndexedTest( int32_t index, UBool exec, const char* &
-#     TESTCASE_AUTO(TestWCharPointers);
-#     TESTCASE_AUTO(TestNullPointers);
-#     TESTCASE_AUTO(TestUnicodeStringInsertAppendToSelf);
-#+    TESTCASE_AUTO(TestLargeAppend);
-#     TESTCASE_AUTO_END;
-# }
-# 
-#@@ -2310,3 +2311,64 @@ void UnicodeStringTest::TestUnicodeStringInsertAppendToSelf() {
-#     str.insert(2, sub);
-#     assertEquals("", u"abbcdcde", str);
-# }
-#+
-#+void UnicodeStringTest::TestLargeAppend() {
-#+    if(quick) return;
-#+
-#+    IcuTestErrorCode status(*this, "TestLargeAppend");
-#+    // Make a large UnicodeString
-#+    int32_t len = 0xAFFFFFF;
-#+    UnicodeString str;
-#+    char16_t *buf = str.getBuffer(len);
-#+    // A fast way to set buffer to valid Unicode.
-#+    // 4E4E is a valid unicode character
-#+    uprv_memset(buf, 0x4e, len * 2);
-#+    str.releaseBuffer(len);
-#+    UnicodeString dest;
-#+    // Append it 16 times
-#+    // 0xAFFFFFF times 16 is 0xA4FFFFF1,
-#+    // which is greater than INT32_MAX, which is 0x7FFFFFFF.
-#+    int64_t total = 0;
-#+    for (int32_t i = 0; i < 16; i++) {
-#+        dest.append(str);
-#+        total += len;
-#+        if (total <= INT32_MAX) {
-#+            assertFalse("dest is not bogus", dest.isBogus());
-#+        } else {
-#+            assertTrue("dest should be bogus", dest.isBogus());
-#+        }
-#+    }
-#+    dest.remove();
-#+    total = 0;
-#+    for (int32_t i = 0; i < 16; i++) {
-#+        dest.append(str);
-#+        total += len;
-#+        if (total + len <= INT32_MAX) {
-#+            assertFalse("dest is not bogus", dest.isBogus());
-#+        } else if (total <= INT32_MAX) {
-#+            // Check that a string of exactly the maximum size works
-#+            UnicodeString str2;
-#+            int32_t remain = INT32_MAX - total;
-#+            char16_t *buf2 = str2.getBuffer(remain);
-#+            if (buf2 == nullptr) {
-#+                // if somehow memory allocation fail, return the test
-#+                return;
-#+            }
-#+            uprv_memset(buf2, 0x4e, remain * 2);
-#+            str2.releaseBuffer(remain);
-#+            dest.append(str2);
-#+            total += remain;
-#+            assertEquals("When a string of exactly the maximum size works", (int64_t)INT32_MAX, total);
-#+            assertEquals("When a string of exactly the maximum size works", INT32_MAX, dest.length());
-#+            assertFalse("dest is not bogus", dest.isBogus());
-#+
-#+            // Check that a string size+1 goes bogus
-#+            str2.truncate(1);
-#+            dest.append(str2);
-#+            total++;
-#+            assertTrue("dest should be bogus", dest.isBogus());
-#+        } else {
-#+            assertTrue("dest should be bogus", dest.isBogus());
-#+        }
-#+    }
-#+}
-#diff --git a/icu4c/source/test/intltest/ustrtest.h b/icu4c/source/test/intltest/ustrtest.h
-#index 218befdcc68..4a356a92c7a 100644
-#--- a/icu4c/source/test/intltest/ustrtest.h
-#+++ b/icu4c/source/test/intltest/ustrtest.h
-#@@ -97,6 +97,7 @@ class UnicodeStringTest: public IntlTest {
-#     void TestWCharPointers();
-#     void TestNullPointers();
-#     void TestUnicodeStringInsertAppendToSelf();
-#+    void TestLargeAppend();
-# };
-# 
-# #endif
diff --git a/gnu/packages/patches/inetutils-hurd.patch b/gnu/packages/patches/inetutils-hurd.patch
deleted file mode 100644
index bd65c4feb1..0000000000
--- a/gnu/packages/patches/inetutils-hurd.patch
+++ /dev/null
@@ -1,583 +0,0 @@
-Support compiling on the Hurd.
-
-Taken from https://git.hadrons.org/cgit/debian/pkgs/inetutils.git/tree/debian/patches/0002-ifconfig-Improve-the-support-for-GNU-Hurd.patch
-
-From 9a90d9b9119906df23cb2db1503cb0f099942dd9 Mon Sep 17 00:00:00 2001
-From: Mats Erik Andersson <gnu@gisladisker.se>
-Date: Sat, 18 Jul 2015 01:12:41 +0200
-Subject: [PATCH 02/35] ifconfig: Improve the support for GNU/Hurd.
-
-Use system specific code instead of generic code.
-This provides abilities similar to other systems.
----
- ChangeLog                   |  17 +++
- ifconfig/system.c           |  10 +-
- ifconfig/system.h           |   2 +
- ifconfig/system/Makefile.am |   4 +-
- ifconfig/system/generic.c   |  14 +-
- ifconfig/system/hurd.c      | 292 ++++++++++++++++++++++++++++++++++++
- ifconfig/system/hurd.h      |  50 ++++++
- 7 files changed, 381 insertions(+), 8 deletions(-)
- create mode 100644 ifconfig/system/hurd.c
- create mode 100644 ifconfig/system/hurd.h
-
-diff --git a/ifconfig/system.c b/ifconfig/system.c
-index 30677e41..e108dc2e 100644
---- a/ifconfig/system.c
-+++ b/ifconfig/system.c
-@@ -25,10 +25,12 @@
- # include "system/solaris.c"
- #elif defined __QNX__
- # include "system/qnx.c"
--# elif defined __DragonFly__ || defined __FreeBSD__ || \
--       defined __FreeBSD_kernel__ || \
--       defined __NetBSD__ || defined __OpenBSD__
--#  include "system/bsd.c"
-+#elif defined __DragonFly__ || defined __FreeBSD__ || \
-+      defined __FreeBSD_kernel__ || \
-+      defined __NetBSD__ || defined __OpenBSD__
-+# include "system/bsd.c"
-+#elif defined __GNU__
-+# include "system/hurd.c"
- #else
- # include "system/generic.c"
- #endif
-diff --git a/ifconfig/system.h b/ifconfig/system.h
-index 8521ad95..66878d3a 100644
---- a/ifconfig/system.h
-+++ b/ifconfig/system.h
-@@ -97,6 +97,8 @@ extern struct if_nameindex* (*system_if_nameindex) (void);
-        defined __FreeBSD_kernel__ || \
-        defined __NetBSD__ || defined __OpenBSD__
- #  include "system/bsd.h"
-+# elif defined __GNU__
-+#  include "system/hurd.h"
- # else
- #  include "system/generic.h"
- # endif
-diff --git a/ifconfig/system/Makefile.am b/ifconfig/system/Makefile.am
-index 954c6774..62a9f1c4 100644
---- a/ifconfig/system/Makefile.am
-+++ b/ifconfig/system/Makefile.am
-@@ -26,8 +26,10 @@ noinst_HEADERS = \
- 	linux.h \
- 	solaris.h \
- 	qnx.h \
-+	hurd.h \
- 	bsd.c \
- 	generic.c \
- 	linux.c \
- 	solaris.c \
--	qnx.c
-+	qnx.c \
-+	hurd.c
-diff --git a/ifconfig/system/generic.c b/ifconfig/system/generic.c
-index 9a2bda55..20a78bde 100644
---- a/ifconfig/system/generic.c
-+++ b/ifconfig/system/generic.c
-@@ -22,6 +22,8 @@
- #include <config.h>
- 
- #include "../ifconfig.h"
-+
-+#include <unused-parameter.h>
- 
- 
- /* Output format stuff.  */
-@@ -36,19 +38,25 @@ const char *system_help;
- struct argp_child system_argp_child;
- 
- int
--system_parse_opt (struct ifconfig **ifp, char option, char *optarg)
-+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+		  char option _GL_UNUSED_PARAMETER,
-+		  char *optarg _GL_UNUSED_PARAMETER)
- {
-   return 0;
- }
- 
- int
--system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
-+system_parse_opt_rest (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+		       int argc _GL_UNUSED_PARAMETER,
-+		       char *argv[] _GL_UNUSED_PARAMETER)
- {
-   return 0;
- }
- 
- int
--system_configure (int sfd, struct ifreq *ifr, struct system_ifconfig *ifs)
-+system_configure (int sfd _GL_UNUSED_PARAMETER,
-+		  struct ifreq *ifr _GL_UNUSED_PARAMETER,
-+		  struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
- {
-   return 0;
- }
-diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
-new file mode 100644
-index 00000000..3bd19775
---- /dev/null
-+++ b/ifconfig/system/hurd.c
-@@ -0,0 +1,292 @@
-+/* hurd.c -- Code for ifconfig specific to GNU/Hurd.
-+  Copyright (C) 2015 Free Software Foundation, Inc.
-+
-+  This file is part of GNU Inetutils.
-+
-+  GNU Inetutils 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 3 of the License, or (at
-+  your option) any later version.
-+
-+  GNU Inetutils 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.
-+
-+  You should have received a copy of the GNU General Public License
-+  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
-+
-+/* Mostly written by Marcus Brinkmann.
-+   Adaptions to GNU/Hurd by Mats Erik Andersson.  */
-+
-+#include <config.h>
-+
-+#include <stdlib.h>
-+#include <sys/ioctl.h>
-+#include <net/if_arp.h>
-+#include "../ifconfig.h"
-+
-+#include <unused-parameter.h>
-+
-+
-+/* Output format stuff.  */
-+
-+const char *system_default_format = "gnu";
-+
-+
-+/* Argument parsing stuff.  */
-+
-+const char *system_help = "NAME [ADDR]\
-+ [broadcast BRDADDR] [netmask MASK]\
-+ [mtu N] [up|down] [FLAGS]";
-+
-+struct argp_child system_argp_child;
-+
-+int
-+system_parse_opt (struct ifconfig **ifp _GL_UNUSED_PARAMETER,
-+		  char option _GL_UNUSED_PARAMETER,
-+		  char *optarg _GL_UNUSED_PARAMETER)
-+{
-+  return 0;
-+}
-+
-+int
-+system_parse_opt_rest (struct ifconfig **ifp, int argc, char *argv[])
-+{
-+  int i = 0, mask, rev;
-+  enum {
-+    EXPECT_NOTHING,
-+    EXPECT_AF,
-+    EXPECT_BROADCAST,
-+    EXPECT_NETMASK,
-+    EXPECT_METRIC,
-+    EXPECT_MTU
-+  } expect = EXPECT_AF;
-+
-+  *ifp = parse_opt_new_ifs (argv[0]);
-+
-+  while (++i < argc)
-+    {
-+      switch (expect)
-+	{
-+	case EXPECT_BROADCAST:
-+	  parse_opt_set_brdaddr (*ifp, argv[i]);
-+	  break;
-+
-+	case EXPECT_NETMASK:
-+	  parse_opt_set_netmask (*ifp, argv[i]);
-+	  break;
-+
-+	case EXPECT_MTU:
-+	  parse_opt_set_mtu (*ifp, argv[i]);
-+	  break;
-+
-+	/* XXX: 2015-07-18, GNU/Hurd does not yet support
-+		ioctl(SIOCSIFMETRIC), but we let the code
-+		handle this standard ability anyway!
-+	 */
-+	case EXPECT_METRIC:
-+	  parse_opt_set_metric (*ifp, argv[i]);
-+	  break;
-+
-+	case EXPECT_AF:
-+	  expect = EXPECT_NOTHING;
-+	  if (!strcmp (argv[i], "inet"))
-+	    continue;
-+	  else if (!strcmp (argv[i], "inet6"))
-+	    {
-+	      error (0, 0, "%s is not a supported address family", argv[i]);
-+	      return 0;
-+	    }
-+	  break;
-+
-+	case EXPECT_NOTHING:
-+	  break;
-+	}
-+
-+      if (expect != EXPECT_NOTHING)
-+	expect = EXPECT_NOTHING;
-+      else if (!strcmp (argv[i], "broadcast"))
-+	expect = EXPECT_BROADCAST;
-+      else if (!strcmp (argv[i], "netmask"))
-+	expect = EXPECT_NETMASK;
-+      else if (!strcmp (argv[i], "metric"))
-+	expect = EXPECT_METRIC;
-+      else if (!strcmp (argv[i], "mtu"))
-+	expect = EXPECT_MTU;
-+      else if (!strcmp (argv[i], "up"))
-+	parse_opt_set_flag (*ifp, IFF_UP | IFF_RUNNING, 0);
-+      else if (!strcmp (argv[i], "down"))
-+	parse_opt_set_flag (*ifp, IFF_UP, 1);
-+      else if (((mask = if_nameztoflag (argv[i], &rev))
-+		& ~IU_IFF_CANTCHANGE) != 0)
-+	parse_opt_set_flag (*ifp, mask, rev);
-+      else
-+	{
-+	  if (!((*ifp)->valid & IF_VALID_ADDR))
-+	    parse_opt_set_address (*ifp, argv[i]);
-+	  else if (!((*ifp)->valid & IF_VALID_DSTADDR))
-+	    parse_opt_set_dstaddr (*ifp, argv[i]);
-+	}
-+    }
-+
-+  switch (expect)
-+    {
-+    case EXPECT_BROADCAST:
-+      error (0, 0, "option `broadcast' requires an argument");
-+      break;
-+
-+    case EXPECT_NETMASK:
-+      error (0, 0, "option `netmask' requires an argument");
-+      break;
-+
-+    case EXPECT_METRIC:
-+      error (0, 0, "option `metric' requires an argument");
-+      break;
-+
-+    case EXPECT_MTU:
-+      error (0, 0, "option `mtu' requires an argument");
-+      break;
-+
-+    case EXPECT_AF:
-+    case EXPECT_NOTHING:
-+      return 1;
-+    }
-+
-+  return 0;
-+}
-+
-+int
-+system_configure (int sfd _GL_UNUSED_PARAMETER,
-+		  struct ifreq *ifr _GL_UNUSED_PARAMETER,
-+		  struct system_ifconfig *ifs _GL_UNUSED_PARAMETER)
-+{
-+  return 0;
-+}
-+
-+struct if_nameindex* (*system_if_nameindex) (void) = if_nameindex;
-+
-+static void
-+print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
-+		    unsigned char *data)
-+{
-+  *column += printf ("%02X:%02X:%02X:%02X:%02X:%02X",
-+		     data[0], data[1], data[2], data[3], data[4], data[5]);
-+  had_output = 1;
-+}
-+
-+struct arphrd_symbol
-+{
-+  const char *name;
-+  const char *title;
-+  int value;
-+  void (*print_hwaddr) (format_data_t form, unsigned char *data);
-+} arphrd_symbols[] =
-+  {
-+#ifdef ARPHRD_ETHER		/* Ethernet 10/100Mbps.  */
-+    { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
-+#endif
-+#ifdef ARPHRD_LOOPBACK		/* Loopback device.  */
-+    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
-+#endif
-+    /* XXX: The image debian-hurd-20150424 returns the value 4
-+	    instead of expected ARPHRD_LOOPBACK.  This has been
-+	    discussed in the list debian-hurd, where I was asked
-+	    to resist the temptation of a work around!
-+     */
-+    { NULL, NULL, 0, NULL}
-+  };
-+
-+struct arphrd_symbol *
-+arphrd_findvalue (int value)
-+{
-+  struct arphrd_symbol *arp = arphrd_symbols;
-+  while (arp->name != NULL)
-+    {
-+      if (arp->value == value)
-+	break;
-+      arp++;
-+    }
-+  if (arp->name)
-+    return arp;
-+  else
-+    return NULL;
-+}
-+
-+void
-+system_fh_hwaddr_query (format_data_t form, int argc, char *argv[])
-+{
-+#ifdef SIOCGIFHWADDR
-+  struct arphrd_symbol *arp;
-+
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+    select_arg (form, argc, argv, 1);
-+
-+  arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+  select_arg (form, argc, argv, (arp && arp->print_hwaddr) ? 0 : 1);
-+#else
-+  select_arg (form, argc, argv, 1);
-+#endif
-+}
-+
-+void
-+system_fh_hwaddr (format_data_t form, int argc _GL_UNUSED_PARAMETER,
-+		  char *argv[] _GL_UNUSED_PARAMETER)
-+{
-+#ifdef SIOCGIFHWADDR
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+    error (EXIT_FAILURE, errno,
-+	   "SIOCGIFHWADDR failed for interface `%s'",
-+	   form->ifr->ifr_name);
-+  else
-+    {
-+      struct arphrd_symbol *arp;
-+
-+      arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+      if (arp && arp->print_hwaddr)
-+	arp->print_hwaddr (form,
-+			   (unsigned char *) form->ifr->ifr_hwaddr.sa_data);
-+      else
-+	put_string (form, "(hwaddr unknown)");
-+    }
-+#else
-+  *column += printf ("(not available)");
-+  had_output = 1;
-+#endif
-+}
-+
-+void
-+system_fh_hwtype_query (format_data_t form, int argc, char *argv[])
-+{
-+#ifdef SIOCGIFHWADDR
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) >= 0)
-+    select_arg (form, argc, argv, 0);
-+  else
-+#endif
-+    select_arg (form, argc, argv, 1);
-+}
-+
-+void
-+system_fh_hwtype (format_data_t form, int argc _GL_UNUSED_PARAMETER,
-+		  char *argv[] _GL_UNUSED_PARAMETER)
-+{
-+#ifdef SIOCGIFHWADDR
-+  if (ioctl (form->sfd, SIOCGIFHWADDR, form->ifr) < 0)
-+    error (EXIT_FAILURE, errno,
-+	   "SIOCGIFHWADDR failed for interface `%s'",
-+	   form->ifr->ifr_name);
-+  else
-+    {
-+      struct arphrd_symbol *arp;
-+
-+      arp = arphrd_findvalue (form->ifr->ifr_hwaddr.sa_family);
-+      if (arp)
-+	put_string (form, arp->title);
-+      else
-+	put_string (form, "(hwtype unknown)");
-+    }
-+#else
-+  *column += printf ("(not available)");
-+  had_output = 1;
-+#endif
-+}
-diff --git a/ifconfig/system/hurd.h b/ifconfig/system/hurd.h
-new file mode 100644
-index 00000000..bab14565
---- /dev/null
-+++ b/ifconfig/system/hurd.h
-@@ -0,0 +1,50 @@
-+/*
-+  Copyright (C) 2015 Free Software Foundation, Inc.
-+
-+  This file is part of GNU Inetutils.
-+
-+  GNU Inetutils 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 3 of the License, or (at
-+  your option) any later version.
-+
-+  GNU Inetutils 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.
-+
-+  You should have received a copy of the GNU General Public License
-+  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
-+
-+/* Written by Mats Erik Andersson.  */
-+
-+#ifndef IFCONFIG_SYSTEM_HURD_H
-+# define IFCONFIG_SYSTEM_HURD_H
-+
-+# include "../printif.h"
-+# include "../options.h"
-+
-+
-+/* Option support.  */
-+
-+struct system_ifconfig
-+{
-+  int valid;
-+};
-+
-+
-+/* Output format support.  */
-+
-+# define SYSTEM_FORMAT_HANDLER \
-+  { "hurd", fh_nothing}, \
-+  { "hwaddr?", system_fh_hwaddr_query}, \
-+  { "hwaddr", system_fh_hwaddr}, \
-+  { "hwtype?", system_fh_hwtype_query}, \
-+  { "hwtype", system_fh_hwtype},
-+
-+void system_fh_hwaddr_query (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwaddr (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwtype_query (format_data_t form, int argc, char *argv[]);
-+void system_fh_hwtype (format_data_t form, int argc, char *argv[]);
-+
-+#endif /* !IFCONFIG_SYSTEM_HURD_H */
--- 
-2.23.0.rc1.170.gbd704faa3e
-
-From 589dab9c7d3119da82837dabae34c8a3d16cbe49 Mon Sep 17 00:00:00 2001
-From: Mats Erik Andersson <gnu@gisladisker.se>
-Date: Thu, 30 Jul 2015 01:06:42 +0200
-Subject: [PATCH 07/35] ifconfig: Hardware detection in GNU/Hurd.
-
-A work-around needed to distinguish hardware type.
----
- ChangeLog              | 10 ++++++++++
- ifconfig/system/hurd.c | 19 ++++++++++++-------
- 2 files changed, 22 insertions(+), 7 deletions(-)
-
-diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
-index 3bd19775..b6261a00 100644
---- a/ifconfig/system/hurd.c
-+++ b/ifconfig/system/hurd.c
-@@ -175,6 +175,16 @@ print_hwaddr_ether (format_data_t form _GL_UNUSED_PARAMETER,
-   had_output = 1;
- }
- 
-+/* GNU/Hurd and Mach are using a mixture of BSD definitions
-+ * and GNU/Linux interface headers, which in this situation
-+ * means that sa_family_t is an unsigned char, from BSD, while
-+ * all ARPHRD_* come from GNU/Linux and are thus 16 bits wide.
-+ * We must account for this.  The following bitmask will
-+ * adapt to any future change!
-+ */
-+
-+#define _ARP_MASK ((sizeof (sa_family_t) == 1) ? 0xff : 0xffff)
-+
- struct arphrd_symbol
- {
-   const char *name;
-@@ -184,16 +194,11 @@ struct arphrd_symbol
- } arphrd_symbols[] =
-   {
- #ifdef ARPHRD_ETHER		/* Ethernet 10/100Mbps.  */
--    { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
-+    { "ETHER", "Ethernet", ARPHRD_ETHER & _ARP_MASK, print_hwaddr_ether},
- #endif
- #ifdef ARPHRD_LOOPBACK		/* Loopback device.  */
--    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
-+    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK & _ARP_MASK, NULL},
- #endif
--    /* XXX: The image debian-hurd-20150424 returns the value 4
--	    instead of expected ARPHRD_LOOPBACK.  This has been
--	    discussed in the list debian-hurd, where I was asked
--	    to resist the temptation of a work around!
--     */
-     { NULL, NULL, 0, NULL}
-   };
- 
--- 
-2.23.0.rc1.170.gbd704faa3e
-
-From d379784b4461d17b2536effd1b52bae21cd28a32 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Fri, 16 Aug 2019 00:34:03 +0200
-Subject: [PATCH 35/35] telnet: Several ioctls have been disabled in the Hurd's
- glibc
-
-But not the related option macros. inetutils uses those macros to decide
-whether the ioctls are available, so it is FTBFS now. The Hurd's glibc
-is being fixed, but we'll use this for now to get the builds going.
----
- telnet/sys_bsd.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/telnet/sys_bsd.c b/telnet/sys_bsd.c
-index 662536ab..5eb35cb5 100644
---- a/telnet/sys_bsd.c
-+++ b/telnet/sys_bsd.c
-@@ -63,6 +63,7 @@
- #include <errno.h>
- #include <arpa/telnet.h>
- #include <sys/select.h>
-+#include <sys/ioctl.h>
- #include <unused-parameter.h>
- 
- #include "ring.h"
-@@ -157,7 +158,7 @@ TerminalRead (char *buf, int n)
- int
- TerminalAutoFlush (void)
- {
--#if defined LNOFLSH
-+#if defined TIOCLGET && defined LNOFLSH
-   int flush;
- 
-   ioctl (0, TIOCLGET, (char *) &flush);
-@@ -260,7 +261,9 @@ TerminalSaveState (void)
-   ioctl (0, TIOCGETP, (char *) &ottyb);
-   ioctl (0, TIOCGETC, (char *) &otc);
-   ioctl (0, TIOCGLTC, (char *) &oltc);
-+#ifdef TIOCLGET
-   ioctl (0, TIOCLGET, (char *) &olmode);
-+#endif
- 
-   ntc = otc;
-   nltc = oltc;
-@@ -755,7 +758,9 @@ TerminalNewMode (register int f)
- #endif
-     }
- #ifndef USE_TERMIO
-+#ifdef TIOCLSET
-   ioctl (tin, TIOCLSET, (char *) &lmode);
-+#endif
-   ioctl (tin, TIOCSLTC, (char *) &ltc);
-   ioctl (tin, TIOCSETC, (char *) &tc);
-   ioctl (tin, TIOCSETN, (char *) &sb);
--- 
-2.23.0.rc1.170.gbd704faa3e
-
diff --git a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch b/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
deleted file mode 100644
index e4897de1b8..0000000000
--- a/gnu/packages/patches/jsoncpp-fix-inverted-case.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-This patch fixes a bug and related test failure on platforms where 'char'
-is unsigned.
-
-Taken from upstream:
-https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb
-
-diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
-index 8e06cca2..56195dc1 100644
---- a/src/lib_json/json_writer.cpp
-+++ b/src/lib_json/json_writer.cpp
-@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) {
- 
-   char const* const end = s + n;
-   for (char const* cur = s; cur < end; ++cur) {
--    if (*cur == '\\' || *cur == '\"' || *cur < ' ' ||
--        static_cast<unsigned char>(*cur) < 0x80)
-+    if (*cur == '\\' || *cur == '\"' ||
-+        static_cast<unsigned char>(*cur) < ' ' ||
-+        static_cast<unsigned char>(*cur) >= 0x80)
-       return true;
-   }
-   return false;
diff --git a/gnu/packages/patches/jsoncpp-pkg-config-version.patch b/gnu/packages/patches/jsoncpp-pkg-config-version.patch
new file mode 100644
index 0000000000..3983cc300c
--- /dev/null
+++ b/gnu/packages/patches/jsoncpp-pkg-config-version.patch
@@ -0,0 +1,24 @@
+Taken from upstream: https://github.com/open-source-parsers/jsoncpp/issues/1235.
+
+From ac2870298ed5b5a96a688d9df07461b31f83e906 Mon Sep 17 00:00:00 2001
+From: Derick Vigne <derickvigne@me.com>
+Date: Tue, 26 Jan 2021 14:59:12 -0500
+Subject: [PATCH] Fixed pkg-config Version
+
+---
+ pkg-config/jsoncpp.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg-config/jsoncpp.pc.in b/pkg-config/jsoncpp.pc.in
+index 632a377f5..2a2221069 100644
+--- a/pkg-config/jsoncpp.pc.in
++++ b/pkg-config/jsoncpp.pc.in
+@@ -5,7 +5,7 @@ includedir=@includedir_for_pc_file@
+ 
+ Name: jsoncpp
+ Description: A C++ library for interacting with JSON
+-Version: @JSONCPP_VERSION@
++Version: @PROJECT_VERSION@
+ URL: https://github.com/open-source-parsers/jsoncpp
+ Libs: -L${libdir} -ljsoncpp
+ Cflags: -I${includedir}
diff --git a/gnu/packages/patches/lcms-CVE-2018-16435.patch b/gnu/packages/patches/lcms-CVE-2018-16435.patch
deleted file mode 100644
index 60228e73af..0000000000
--- a/gnu/packages/patches/lcms-CVE-2018-16435.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-https://github.com/mm2/Little-CMS/commit/768f70ca405cd3159d990e962d54456773bb8cf8.patch
-
-From 768f70ca405cd3159d990e962d54456773bb8cf8 Mon Sep 17 00:00:00 2001
-From: Marti Maria <info@littlecms.com>
-Date: Wed, 15 Aug 2018 20:07:56 +0200
-Subject: [PATCH] Upgrade Visual studio 2017 15.8
-
-- Upgrade to 15.8
-- Add check on CGATS memory allocation (thanks to Quang Nguyen for
-pointing out this)
----
- Projects/VC2017/jpegicc/jpegicc.vcxproj           |  1 +
- Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj       |  2 +-
- Projects/VC2017/lcms2_static/lcms2_static.vcxproj |  2 +-
- Projects/VC2017/linkicc/linkicc.vcxproj           |  2 +-
- Projects/VC2017/psicc/psicc.vcxproj               |  2 +-
- Projects/VC2017/testbed/testbed.vcxproj           |  2 +-
- Projects/VC2017/tiffdiff/tiffdiff.vcxproj         |  2 +-
- Projects/VC2017/tifficc/tifficc.vcxproj           |  2 +-
- Projects/VC2017/transicc/transicc.vcxproj         |  1 +
- src/cmscgats.c                                    | 14 ++++++++++----
- 10 files changed, 19 insertions(+), 11 deletions(-)
-
-diff --git a/Projects/VC2017/jpegicc/jpegicc.vcxproj b/Projects/VC2017/jpegicc/jpegicc.vcxproj
-index ab26a53..39cfd00 100644
---- a/Projects/VC2017/jpegicc/jpegicc.vcxproj
-+++ b/Projects/VC2017/jpegicc/jpegicc.vcxproj
-@@ -22,6 +22,7 @@
-     <ProjectGuid>{62812507-F926-4968-96A9-17678460AD90}</ProjectGuid>
-     <RootNamespace>jpegicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-index 4c8aa3f..d1bf3eb 100644
---- a/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-+++ b/Projects/VC2017/lcms2_DLL/lcms2_DLL.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{8C51BE48-ADB8-4089-A9EC-F6BF993A0548}</ProjectGuid>
-     <RootNamespace>lcms2_DLL</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-index 2a9988a..9fc05ce 100644
---- a/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-+++ b/Projects/VC2017/lcms2_static/lcms2_static.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{71DEDE59-3F1E-486B-A899-4283000F76B5}</ProjectGuid>
-     <RootNamespace>lcms2_static</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/linkicc/linkicc.vcxproj b/Projects/VC2017/linkicc/linkicc.vcxproj
-index 30c2b4e..51586dd 100644
---- a/Projects/VC2017/linkicc/linkicc.vcxproj
-+++ b/Projects/VC2017/linkicc/linkicc.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{FBFBE1DC-DB84-4BA1-9552-B4780F457849}</ProjectGuid>
-     <RootNamespace>linkicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/psicc/psicc.vcxproj b/Projects/VC2017/psicc/psicc.vcxproj
-index 9dcf89a..8f26e12 100644
---- a/Projects/VC2017/psicc/psicc.vcxproj
-+++ b/Projects/VC2017/psicc/psicc.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{EF6A8851-65FE-46F5-B9EF-14F0B671F693}</ProjectGuid>
-     <RootNamespace>psicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/testbed/testbed.vcxproj b/Projects/VC2017/testbed/testbed.vcxproj
-index 0af3762..3f6aea3 100644
---- a/Projects/VC2017/testbed/testbed.vcxproj
-+++ b/Projects/VC2017/testbed/testbed.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{928A3A2B-46EF-4279-959C-513B3652FF0E}</ProjectGuid>
-     <RootNamespace>testbed</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-index 7edfe28..3a6d837 100644
---- a/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-+++ b/Projects/VC2017/tiffdiff/tiffdiff.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{75B91835-CCD7-48BE-A606-A9C997D5DBEE}</ProjectGuid>
-     <RootNamespace>tiffdiff</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/tifficc/tifficc.vcxproj b/Projects/VC2017/tifficc/tifficc.vcxproj
-index cd9f04c..5ef954f 100644
---- a/Projects/VC2017/tifficc/tifficc.vcxproj
-+++ b/Projects/VC2017/tifficc/tifficc.vcxproj
-@@ -22,7 +22,7 @@
-     <ProjectGuid>{2256DE16-ED92-4A6F-9C54-F65BB61E64A2}</ProjectGuid>
-     <RootNamespace>tifficc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
--    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/Projects/VC2017/transicc/transicc.vcxproj b/Projects/VC2017/transicc/transicc.vcxproj
-index d9b77c6..b3173d8 100644
---- a/Projects/VC2017/transicc/transicc.vcxproj
-+++ b/Projects/VC2017/transicc/transicc.vcxproj
-@@ -22,6 +22,7 @@
-     <ProjectGuid>{9EE22D66-C849-474C-9ED5-C3E141DAB160}</ProjectGuid>
-     <RootNamespace>transicc</RootNamespace>
-     <Keyword>Win32Proj</Keyword>
-+    <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
-   </PropertyGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-diff --git a/src/cmscgats.c b/src/cmscgats.c
-index 1a87613..8c3e96d 100644
---- a/src/cmscgats.c
-+++ b/src/cmscgats.c
-@@ -1,7 +1,7 @@
- //---------------------------------------------------------------------------------
- //
- //  Little Color Management System
--//  Copyright (c) 1998-2017 Marti Maria Saguer
-+//  Copyright (c) 1998-2018 Marti Maria Saguer
- //
- // Permission is hereby granted, free of charge, to any person obtaining
- // a copy of this software and associated documentation files (the "Software"),
-@@ -1506,10 +1506,16 @@ void AllocateDataSet(cmsIT8* it8)
-     t-> nSamples   = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_FIELDS"));
-     t-> nPatches   = atoi(cmsIT8GetProperty(it8, "NUMBER_OF_SETS"));
- 
--    t-> Data = (char**)AllocChunk (it8, ((cmsUInt32Number) t->nSamples + 1) * ((cmsUInt32Number) t->nPatches + 1) *sizeof (char*));
--    if (t->Data == NULL) {
-+    if (t -> nSamples < 0 || t->nSamples > 0x7ffe || t->nPatches < 0 || t->nPatches > 0x7ffe)
-+    {
-+        SynError(it8, "AllocateDataSet: too much data");
-+    }
-+    else {
-+        t->Data = (char**)AllocChunk(it8, ((cmsUInt32Number)t->nSamples + 1) * ((cmsUInt32Number)t->nPatches + 1) * sizeof(char*));
-+        if (t->Data == NULL) {
- 
--        SynError(it8, "AllocateDataSet: Unable to allocate data array");
-+            SynError(it8, "AllocateDataSet: Unable to allocate data array");
-+        }
-     }
- 
- }
diff --git a/gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch b/gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch
new file mode 100644
index 0000000000..e8d5dce0ed
--- /dev/null
+++ b/gnu/packages/patches/libmicrohttpd-0.9.73-test-ssl3.patch
@@ -0,0 +1,35 @@
+ Disable usage of SSLv3 in testing
+
+ Integrated uptream version 0.9.74
+
+
+diff --git a/src/testcurl/https/test_tls_options.c b/src/testcurl/https/test_tls_options.c
+
+--- a/src/testcurl/https/test_tls_options.c
++++ b/src/testcurl/https/test_tls_options.c
+@@ -119,11 +119,6 @@ main (int argc, char *const *argv)
+     fprintf (stderr, "Curl does not support SSL.  Cannot run the test.\n");
+     return 77;
+   }
+-  if (0 != strncmp (ssl_version, "GnuTLS", 6))
+-  {
+-    fprintf (stderr, "This test can be run only with libcurl-gnutls.\n");
+-    return 77;
+-  }
+ 
+   if (! testsuite_curl_global_init ())
+     return 99;
+@@ -152,10 +147,10 @@ main (int argc, char *const *argv)
+   fprintf (stderr,
+            "The following handshake should fail (and print an error message)...\n");
+   if (0 !=
+-      test_wrap ("TLS1.0 vs SSL3",
++      test_wrap ("TLS1.1 vs TLS1.0",
+                  &test_unmatching_ssl_version, NULL, port, daemon_flags,
+                  aes256_sha,
+-                 CURL_SSLVERSION_SSLv3,
++                 CURL_SSLVERSION_TLSv1_1,
+                  MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
+                  MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
+                  MHD_OPTION_HTTPS_PRIORITIES,
+
diff --git a/gnu/packages/patches/librime-fix-build-with-gcc10.patch b/gnu/packages/patches/librime-fix-build-with-gcc10.patch
new file mode 100644
index 0000000000..49ad011b57
--- /dev/null
+++ b/gnu/packages/patches/librime-fix-build-with-gcc10.patch
@@ -0,0 +1,41 @@
+From: Felix Gruber <felgru@posteo.net>
+Date: Mon, 6 Sep 2021 19:38:17 +0200
+Subject: [PATCH] Add missing <cmath> includes
+
+Fix a build failure with GCC 10 that manifests like this:
+
+------
+/tmp/guix-build-librime-1.7.3.drv-0/source/src/rime/gear/script_translator.cc: In member function ‘void rime::ScriptTranslation::PrepareCandidate()’:
+/tmp/guix-build-librime-1.7.3.drv-0/source/src/rime/gear/script_translator.cc:490:23: error: ‘exp’ was not declared in this scope
+  490 |     cand->set_quality(exp(entry->weight) +
+      |                       ^~~
+/tmp/guix-build-librime-1.7.3.drv-0/source/src/rime/gear/script_translator.cc:504:23: error: ‘exp’ was not declared in this scope
+  504 |     cand->set_quality(exp(entry->weight) +
+      |                       ^~~
+make[2]: *** [src/CMakeFiles/rime.dir/build.make:1241: src/CMakeFiles/rime.dir/rime/gear/script_translator.cc.o] Error 1
+------
+
+diff --git a/src/rime/gear/script_translator.cc b/src/rime/gear/script_translator.cc
+index 4a45f05..515c8db 100644
+--- a/src/rime/gear/script_translator.cc
++++ b/src/rime/gear/script_translator.cc
+@@ -7,6 +7,7 @@
+ // 2011-07-10 GONG Chen <chen.sst@gmail.com>
+ //
+ #include <algorithm>
++#include <cmath>
+ #include <stack>
+ #include <boost/algorithm/string/join.hpp>
+ #include <boost/range/adaptor/reversed.hpp>
+diff --git a/src/rime/gear/table_translator.cc b/src/rime/gear/table_translator.cc
+index 162ac02..dbea76a 100644
+--- a/src/rime/gear/table_translator.cc
++++ b/src/rime/gear/table_translator.cc
+@@ -4,6 +4,7 @@
+ //
+ // 2011-07-10 GONG Chen <chen.sst@gmail.com>
+ //
++#include <cmath>
+ #include <boost/algorithm/string.hpp>
+ #include <boost/range/adaptor/reversed.hpp>
+ #include <utf8.h>
diff --git a/gnu/packages/patches/libtirpc-hurd-client.patch b/gnu/packages/patches/libtirpc-hurd-client.patch
deleted file mode 100644
index 526ad262d2..0000000000
--- a/gnu/packages/patches/libtirpc-hurd-client.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Taken from https://salsa.debian.org/debian/libtirpc/-/raw/master/debian/patches/06-hurd-client-port.diff
-
-Description: Fix client code for hurd, avoiding malloc overflow
- When trying to setup a inet connection, it happens the following:
- - in libtirp, src/clnt_vc.c, clnt_vc_create gets called
- - when trying to allocate vc_fd_locks, __rpc_dtbsize() is used as size
-   for that array of fd locks
- - __rpc_dtbsize(), in src/rpc_generic.c, queries using rlimit the
-   maximum (rlim_max) number of file descriptors (RLIMIT_NOFILE):
-   - on Linux, the default is { rlim_cur = 1024, rlim_max = 4096 }
-   - on kFreeBSD, the default is { rlim_cur = 1024, rlim_max = 1024 }
-   - on Hurd, the default is { rlim_cur = 1024, rlim_max = RLIM_INFINITY }
-  meaning that on Hurd the memory allocation fails (as
-  __rpc_dtbsize() * sizeof(int) overflows and is negative)
-
- Change libtiprc so __rpc_dtbsize falls back on rlim_cur if rlim_max
- is unlimited.
-
- This patch fixes the client connection using inet sockets; local unix
- sockets are not working, for two reasons so far:
- - getpeername on them gives EOPNOTSUPP
- - SO_REUSEADDR is not implemented for them
-Author: Pino Toscano <pino@debian.org>
-
-Bug-Debian: http://bugs.debian.org/739674
-Forwarded: no
-Reviewed-By: Petter Reinholdtsen
-Last-Update: 2014-03-03
-
---- a/src/rpc_generic.c
-+++ b/src/rpc_generic.c
-@@ -107,12 +107,17 @@
- {
- 	static int tbsize;
- 	struct rlimit rl;
-+	rlim_t lim;
- 
- 	if (tbsize) {
- 		return (tbsize);
- 	}
- 	if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
--		return (tbsize = (int)rl.rlim_max);
-+		lim = rl.rlim_max;
-+		if (lim == RLIM_INFINITY) {
-+			lim = rl.rlim_cur;
-+		}
-+		return (tbsize = (int)lim);
- 	}
- 	/*
- 	 * Something wrong.  I'll try to save face by returning a
diff --git a/gnu/packages/patches/libxml2-parent-pointers.patch b/gnu/packages/patches/libxml2-parent-pointers.patch
new file mode 100644
index 0000000000..1f0615c512
--- /dev/null
+++ b/gnu/packages/patches/libxml2-parent-pointers.patch
@@ -0,0 +1,228 @@
+Fix a regression in 2.9.12 where some corrupt XML structures were handled
+incorrectly:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/issues/255
+
+This is an amalgamation of these upstream commits:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/85b1792e37b131e7a51af98a37f92472e8de5f3f
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/13ad8736d294536da4cbcd70a96b0a2fbf47070c
+
+diff --git a/HTMLtree.c b/HTMLtree.c
+--- a/HTMLtree.c
++++ b/HTMLtree.c
+@@ -744,7 +744,7 @@ void
+ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+ 	                 xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
+                          int format) {
+-    xmlNodePtr root;
++    xmlNodePtr root, parent;
+     xmlAttrPtr attr;
+     const htmlElemDesc * info;
+ 
+@@ -755,6 +755,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+     }
+ 
+     root = cur;
++    parent = cur->parent;
+     while (1) {
+         switch (cur->type) {
+         case XML_HTML_DOCUMENT_NODE:
+@@ -762,13 +763,25 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+             if (((xmlDocPtr) cur)->intSubset != NULL) {
+                 htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+             }
+-            if (cur->children != NULL) {
++            /* Always validate cur->parent when descending. */
++            if ((cur->parent == parent) && (cur->children != NULL)) {
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+             break;
+ 
+         case XML_ELEMENT_NODE:
++            /*
++             * Some users like lxml are known to pass nodes with a corrupted
++             * tree structure. Fall back to a recursive call to handle this
++             * case.
++             */
++            if ((cur->parent != parent) && (cur->children != NULL)) {
++                htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
++                break;
++            }
++
+             /*
+              * Get specific HTML info for that node.
+              */
+@@ -817,6 +830,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                     (cur->name != NULL) &&
+                     (cur->name[0] != 'p')) /* p, pre, param */
+                     xmlOutputBufferWriteString(buf, "\n");
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -825,9 +839,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 (info != NULL) && (!info->isinline)) {
+                 if ((cur->next->type != HTML_TEXT_NODE) &&
+                     (cur->next->type != HTML_ENTITY_REF_NODE) &&
+-                    (cur->parent != NULL) &&
+-                    (cur->parent->name != NULL) &&
+-                    (cur->parent->name[0] != 'p')) /* p, pre, param */
++                    (parent != NULL) &&
++                    (parent->name != NULL) &&
++                    (parent->name[0] != 'p')) /* p, pre, param */
+                     xmlOutputBufferWriteString(buf, "\n");
+             }
+ 
+@@ -842,9 +856,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 break;
+             if (((cur->name == (const xmlChar *)xmlStringText) ||
+                  (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
+-                ((cur->parent == NULL) ||
+-                 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
+-                  (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
++                ((parent == NULL) ||
++                 ((xmlStrcasecmp(parent->name, BAD_CAST "script")) &&
++                  (xmlStrcasecmp(parent->name, BAD_CAST "style"))))) {
+                 xmlChar *buffer;
+ 
+                 buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+@@ -902,13 +916,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 break;
+             }
+ 
+-            /*
+-             * The parent should never be NULL here but we want to handle
+-             * corrupted documents gracefully.
+-             */
+-            if (cur->parent == NULL)
+-                return;
+-            cur = cur->parent;
++            cur = parent;
++            /* cur->parent was validated when descending. */
++            parent = cur->parent;
+ 
+             if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
+                 (cur->type == XML_DOCUMENT_NODE)) {
+@@ -939,9 +949,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                     (cur->next != NULL)) {
+                     if ((cur->next->type != HTML_TEXT_NODE) &&
+                         (cur->next->type != HTML_ENTITY_REF_NODE) &&
+-                        (cur->parent != NULL) &&
+-                        (cur->parent->name != NULL) &&
+-                        (cur->parent->name[0] != 'p')) /* p, pre, param */
++                        (parent != NULL) &&
++                        (parent->name != NULL) &&
++                        (parent->name[0] != 'p')) /* p, pre, param */
+                         xmlOutputBufferWriteString(buf, "\n");
+                 }
+             }
+diff --git a/xmlsave.c b/xmlsave.c
+--- a/xmlsave.c
++++ b/xmlsave.c
+@@ -847,7 +847,7 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+ static void
+ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+     int format = ctxt->format;
+-    xmlNodePtr tmp, root, unformattedNode = NULL;
++    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
+     xmlAttrPtr attr;
+     xmlChar *start, *end;
+     xmlOutputBufferPtr buf;
+@@ -856,6 +856,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+     buf = ctxt->buf;
+ 
+     root = cur;
++    parent = cur->parent;
+     while (1) {
+         switch (cur->type) {
+         case XML_DOCUMENT_NODE:
+@@ -868,7 +869,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_DOCUMENT_FRAG_NODE:
+-            if (cur->children != NULL) {
++            /* Always validate cur->parent when descending. */
++            if ((cur->parent == parent) && (cur->children != NULL)) {
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -887,7 +890,18 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_ELEMENT_NODE:
+-	    if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
++            /*
++             * Some users like lxml are known to pass nodes with a corrupted
++             * tree structure. Fall back to a recursive call to handle this
++             * case.
++             */
++            if ((cur->parent != parent) && (cur->children != NULL)) {
++                xmlNodeDumpOutputInternal(ctxt, cur);
++                break;
++            }
++
++	    if ((ctxt->level > 0) && (ctxt->format == 1) &&
++                (xmlIndentTreeOutput))
+ 		xmlOutputBufferWrite(buf, ctxt->indent_size *
+ 				     (ctxt->level > ctxt->indent_nr ?
+ 				      ctxt->indent_nr : ctxt->level),
+@@ -942,6 +956,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 xmlOutputBufferWrite(buf, 1, ">");
+                 if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
+                 if (ctxt->level >= 0) ctxt->level++;
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -1058,13 +1073,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 break;
+             }
+ 
+-            /*
+-             * The parent should never be NULL here but we want to handle
+-             * corrupted documents gracefully.
+-             */
+-            if (cur->parent == NULL)
+-                return;
+-            cur = cur->parent;
++            cur = parent;
++            /* cur->parent was validated when descending. */
++            parent = cur->parent;
+ 
+             if (cur->type == XML_ELEMENT_NODE) {
+                 if (ctxt->level > 0) ctxt->level--;
+diff --git a/xmlsave.c b/xmlsave.c
+--- a/xmlsave.c
++++ b/xmlsave.c
+@@ -890,6 +890,13 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_ELEMENT_NODE:
++	    if ((cur != root) && (ctxt->format == 1) &&
++                (xmlIndentTreeOutput))
++		xmlOutputBufferWrite(buf, ctxt->indent_size *
++				     (ctxt->level > ctxt->indent_nr ?
++				      ctxt->indent_nr : ctxt->level),
++				     ctxt->indent);
++
+             /*
+              * Some users like lxml are known to pass nodes with a corrupted
+              * tree structure. Fall back to a recursive call to handle this
+@@ -900,13 +907,6 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 break;
+             }
+ 
+-	    if ((ctxt->level > 0) && (ctxt->format == 1) &&
+-                (xmlIndentTreeOutput))
+-		xmlOutputBufferWrite(buf, ctxt->indent_size *
+-				     (ctxt->level > ctxt->indent_nr ?
+-				      ctxt->indent_nr : ctxt->level),
+-				     ctxt->indent);
+-
+             xmlOutputBufferWrite(buf, 1, "<");
+             if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
diff --git a/gnu/packages/patches/libxml2-terminating-newline.patch b/gnu/packages/patches/libxml2-terminating-newline.patch
new file mode 100644
index 0000000000..3f5c88dd4e
--- /dev/null
+++ b/gnu/packages/patches/libxml2-terminating-newline.patch
@@ -0,0 +1,33 @@
+Fix a regression in 2.9.12 where serializing empty HTML documents would
+not add a terminating newline.
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/issues/266
+
+Taken from upstream:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/92d9ab4c28842a09ca2b76d3ff2f933e01b6cd6f
+
+diff --git a/HTMLtree.c b/HTMLtree.c
+--- a/HTMLtree.c
++++ b/HTMLtree.c
+@@ -763,11 +763,15 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+             if (((xmlDocPtr) cur)->intSubset != NULL) {
+                 htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+             }
+-            /* Always validate cur->parent when descending. */
+-            if ((cur->parent == parent) && (cur->children != NULL)) {
+-                parent = cur;
+-                cur = cur->children;
+-                continue;
++            if (cur->children != NULL) {
++                /* Always validate cur->parent when descending. */
++                if (cur->parent == parent) {
++                    parent = cur;
++                    cur = cur->children;
++                    continue;
++                }
++            } else {
++                xmlOutputBufferWriteString(buf, "\n");
+             }
+             break;
+ 
diff --git a/gnu/packages/patches/libxml2-xpath-recursion-limit.patch b/gnu/packages/patches/libxml2-xpath-recursion-limit.patch
new file mode 100644
index 0000000000..051196c635
--- /dev/null
+++ b/gnu/packages/patches/libxml2-xpath-recursion-limit.patch
@@ -0,0 +1,20 @@
+Fix recursion accounting in XPath expressions:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/issues/264
+
+Taken from upstream:
+
+  https://gitlab.gnome.org/GNOME/libxml2/-/commit/3e1aad4fe584747fd7d17cc7b2863a78e2d21a77
+
+diff --git a/xpath.c b/xpath.c
+--- a/xpath.c
++++ b/xpath.c
+@@ -10983,7 +10983,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
+     }
+ 
+     if (xpctxt != NULL)
+-        xpctxt->depth -= 1;
++        xpctxt->depth -= 10;
+ }
+ 
+ /**
diff --git a/gnu/packages/patches/libxt-guix-search-paths.patch b/gnu/packages/patches/libxt-guix-search-paths.patch
index 5419edd1bd..61022d232a 100644
--- a/gnu/packages/patches/libxt-guix-search-paths.patch
+++ b/gnu/packages/patches/libxt-guix-search-paths.patch
@@ -1,13 +1,9 @@
 diff --git a/src/Intrinsic.c b/src/Intrinsic.c
-index c9624ec..addcdba 100644
 --- a/src/Intrinsic.c
 +++ b/src/Intrinsic.c
-@@ -1312,21 +1312,101 @@ static void FillInLangSubs(
-     } else (void) strcpy(*rest, string);
+@@ -1345,21 +1345,99 @@ FillInLangSubs(Substitution subs, XtPerDisplay pd)
  }
  
-+
-+
  /*
 - * default path used if environment variable XFILESEARCHPATH
 - * is not defined.  Also substitued for %D.
@@ -24,8 +20,9 @@ index c9624ec..addcdba 100644
 +   These values provide the default paths where Guix/GuixSD can expect
 +   to find resources for installed packages.
   */
--static const char *implementation_default_path(void)
-+static const char *guix_default_path(void)
+ static const char *
+-implementation_default_path(void)
++guix_default_path(void)
  {
 -#if defined(WIN32)
 -    static char xfilesearchpath[] = "";
@@ -115,7 +112,7 @@ index c9624ec..addcdba 100644
  }
  
  
-@@ -1354,7 +1434,7 @@ _XtString XtResolvePathname(
+@@ -1388,7 +1466,7 @@ XtResolvePathname(Display *dpy,
  {
      XtPerDisplay pd;
      static const char *defaultPath = NULL;
diff --git a/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch b/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch
new file mode 100644
index 0000000000..4982587d15
--- /dev/null
+++ b/gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch
@@ -0,0 +1,13 @@
+Adapted from https://github.com/digego/extempore/pull/322/files
+
+--- a/include/llvm/IR/ValueMap.h	2015-08-04 00:30:24.000000000 +0200
++++ b/include/llvm/IR/ValueMap.h	2018-07-14 21:09:09.769502736 +0200
+@@ -99,7 +99,7 @@
+   explicit ValueMap(const ExtraData &Data, unsigned NumInitBuckets = 64)
+       : Map(NumInitBuckets), Data(Data) {}
+
+-  bool hasMD() const { return MDMap; }
++  bool hasMD() const { return static_cast<bool>(MDMap); }
+   MDMapT &MD() {
+     if (!MDMap)
+       MDMap.reset(new MDMapT);
diff --git a/gnu/packages/patches/mariadb-CVE-2021-27928.patch b/gnu/packages/patches/mariadb-CVE-2021-27928.patch
deleted file mode 100644
index 39a023c159..0000000000
--- a/gnu/packages/patches/mariadb-CVE-2021-27928.patch
+++ /dev/null
@@ -1,642 +0,0 @@
-From 7580701e6279900fec40822952a3b874732289cf Mon Sep 17 00:00:00 2001
-From: Sergei Golubchik <serg@mariadb.org>
-Date: Thu, 18 Feb 2021 14:20:48 +0100
-Subject: [PATCH] make @@wsrep_provider and @@wsrep_notify_cmd read-only
-
-this should simplify run-time cluster management
----
- mysql-test/suite/galera/disabled.def          |  2 +
- .../galera/include/galera_load_provider.inc   | 19 --------
- .../galera/include/galera_unload_provider.inc |  3 +-
- .../suite/galera/r/galera_ist_rsync.result    |  2 +-
- .../galera/r/galera_sst_mysqldump.result      |  2 +-
- .../suite/galera/r/mysql-wsrep#33.result      |  2 +-
- .../suite/sys_vars/r/sysvars_wsrep.result     |  4 +-
- .../sys_vars/r/wsrep_notify_cmd_basic.result  | 47 -------------------
- .../sys_vars/r/wsrep_provider_basic.result    | 40 ----------------
- .../r/wsrep_provider_options_basic.result     | 46 ------------------
- .../sys_vars/t/wsrep_notify_cmd_basic.test    | 43 -----------------
- .../sys_vars/t/wsrep_provider_basic.test      | 39 ---------------
- .../t/wsrep_provider_options_basic.test       | 41 ----------------
- mysql-test/suite/wsrep/disabled.def           |  2 +
- mysql-test/suite/wsrep/r/variables.result     | 12 ++---
- mysql-test/suite/wsrep/t/variables.test       | 32 +++----------
- sql/sys_vars.cc                               |  8 ++--
- 17 files changed, 25 insertions(+), 319 deletions(-)
- delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
- delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
- delete mode 100644 mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
- delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
- delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
- delete mode 100644 mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
-
-diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
-index d940c702d54..83f26e81636 100644
---- a/mysql-test/suite/galera/disabled.def
-+++ b/mysql-test/suite/galera/disabled.def
-@@ -49,3 +49,5 @@ partition : MDEV-19958 Galera test failure on galera.partition
- query_cache: MDEV-15805 Test failure on galera.query_cache
- sql_log_bin : MDEV-21491 galera.sql_log_bin
- versioning_trx_id : MDEV-18590 galera.versioning_trx_id
-+galera_wsrep_provider_unset_set: wsrep_provider is read-only for security reasons
-+pxc-421: wsrep_provider is read-only for security reasons
-diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc
-index 0f843597d9c..28010cc5b71 100644
---- a/mysql-test/suite/galera/include/galera_load_provider.inc
-+++ b/mysql-test/suite/galera/include/galera_load_provider.inc
-@@ -1,25 +1,6 @@
- --echo Loading wsrep provider ...
- 
- --disable_query_log
----eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
--
--#
--# count occurences of successful node starts in error log
--#
--perl;
--  use strict;
--   my $test_log=$ENV{'LOG_FILE'} or die "LOG_FILE not set";
--   my $test_log_copy=$test_log . '.copy';
--   if (-e $test_log_copy) {
--      unlink $test_log_copy;
--   }
--
--EOF
----copy_file $LOG_FILE $LOG_FILE.copy
--
--#
--#  now join to the cluster
--#
- --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
- 
- --enable_query_log
-diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_unload_provider.inc
-index cd841f51fbc..ed7e9bc41f0 100644
---- a/mysql-test/suite/galera/include/galera_unload_provider.inc
-+++ b/mysql-test/suite/galera/include/galera_unload_provider.inc
-@@ -1,7 +1,6 @@
- --echo Unloading wsrep provider ...
- 
- --let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
----let $wsrep_provider_orig = `SELECT @@wsrep_provider`
- --let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
- --let $wsrep_error_log_orig = `SELECT @@log_error`
- if(!$wsrep_log_error_orig)
-@@ -12,4 +11,4 @@ if(!$wsrep_log_error_orig)
- }
- --let LOG_FILE= $wsrep_log_error_orig
- 
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
-diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result
-index 13f7d898a59..70a87c73df7 100644
---- a/mysql-test/suite/galera/r/galera_ist_rsync.result
-+++ b/mysql-test/suite/galera/r/galera_ist_rsync.result
-@@ -23,7 +23,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
- INSERT INTO t1 VALUES ('node2_committed_before');
- COMMIT;
- Unloading wsrep provider ...
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
- connection node_1;
- SET AUTOCOMMIT=OFF;
- START TRANSACTION;
-diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result
-index 4ed679ba477..145b3a94775 100644
---- a/mysql-test/suite/galera/r/galera_sst_mysqldump.result
-+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result
-@@ -30,7 +30,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
- INSERT INTO t1 VALUES ('node2_committed_before');
- COMMIT;
- Unloading wsrep provider ...
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
- connection node_1;
- SET AUTOCOMMIT=OFF;
- START TRANSACTION;
-diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result
-index fb0b593cc96..45c6a3f660a 100644
---- a/mysql-test/suite/galera/r/mysql-wsrep#33.result
-+++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result
-@@ -32,7 +32,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
- INSERT INTO t1 VALUES ('node2_committed_before');
- COMMIT;
- Unloading wsrep provider ...
--SET GLOBAL wsrep_provider = 'none';
-+SET GLOBAL wsrep_cluster_address = '';
- connection node_1;
- SET AUTOCOMMIT=OFF;
- START TRANSACTION;
-diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
-index 4b6abf85434..f73bfbd13e7 100644
---- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
-+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
-@@ -403,7 +403,7 @@ NUMERIC_MIN_VALUE	NULL
- NUMERIC_MAX_VALUE	NULL
- NUMERIC_BLOCK_SIZE	NULL
- ENUM_VALUE_LIST	NULL
--READ_ONLY	NO
-+READ_ONLY	YES
- COMMAND_LINE_ARGUMENT	REQUIRED
- GLOBAL_VALUE_PATH	NULL
- VARIABLE_NAME	WSREP_ON
-@@ -463,7 +463,7 @@ NUMERIC_MIN_VALUE	NULL
- NUMERIC_MAX_VALUE	NULL
- NUMERIC_BLOCK_SIZE	NULL
- ENUM_VALUE_LIST	NULL
--READ_ONLY	NO
-+READ_ONLY	YES
- COMMAND_LINE_ARGUMENT	REQUIRED
- GLOBAL_VALUE_PATH	NULL
- VARIABLE_NAME	WSREP_PROVIDER_OPTIONS
-diff --git a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result b/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
-deleted file mode 100644
-index 056ff8c817b..00000000000
---- a/mysql-test/suite/sys_vars/r/wsrep_notify_cmd_basic.result
-+++ /dev/null
-@@ -1,47 +0,0 @@
--#
--# wsrep_notify_cmd
--#
--call mtr.add_suppression("WSREP: Failed to get provider options");
--# save the initial value
--SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
--# default
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--
--
--# scope
--SELECT @@session.wsrep_notify_cmd;
--ERROR HY000: Variable 'wsrep_notify_cmd' is a GLOBAL variable
--SET @@global.wsrep_notify_cmd='notify_cmd';
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--notify_cmd
--
--# valid values
--SET @@global.wsrep_notify_cmd='command';
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--command
--SET @@global.wsrep_notify_cmd='hyphenated-command';
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--hyphenated-command
--SET @@global.wsrep_notify_cmd=default;
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--
--SET @@global.wsrep_notify_cmd=NULL;
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--NULL
--
--# invalid values
--SET @@global.wsrep_notify_cmd=1;
--ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd'
--SELECT @@global.wsrep_notify_cmd;
--@@global.wsrep_notify_cmd
--NULL
--
--# restore the initial value
--SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
--# End of test
-diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
-deleted file mode 100644
-index 3e4ac8ca883..00000000000
---- a/mysql-test/suite/sys_vars/r/wsrep_provider_basic.result
-+++ /dev/null
-@@ -1,40 +0,0 @@
--#
--# wsrep_provider
--#
--# save the initial value
--SET @wsrep_provider_global_saved = @@global.wsrep_provider;
--# default
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# scope
--SELECT @@session.wsrep_provider;
--ERROR HY000: Variable 'wsrep_provider' is a GLOBAL variable
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# valid values
--SET @@global.wsrep_provider=default;
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# invalid values
--SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
--ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/invalid/libgalera_smm.so'
--SET @@global.wsrep_provider=NULL;
--ERROR 42000: Variable 'wsrep_provider' can't be set to the value of 'NULL'
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--SET @@global.wsrep_provider=1;
--ERROR 42000: Incorrect argument type to variable 'wsrep_provider'
--SELECT @@global.wsrep_provider;
--@@global.wsrep_provider
--none
--
--# restore the initial value
--SET @@global.wsrep_provider = @wsrep_provider_global_saved;
--# End of test
-diff --git a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
-deleted file mode 100644
-index 15949a14e39..00000000000
---- a/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
-+++ /dev/null
-@@ -1,46 +0,0 @@
--#
--# wsrep_provider_options
--#
--call mtr.add_suppression("WSREP: Failed to get provider options");
--# default
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--
--# scope
--SELECT @@session.wsrep_provider_options;
--ERROR HY000: Variable 'wsrep_provider_options' is a GLOBAL variable
--SET @@global.wsrep_provider_options='option1';
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--
--# valid values
--SET @@global.wsrep_provider_options='name1=value1;name2=value2';
--ERROR HY000: WSREP (galera) not started
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--SET @@global.wsrep_provider_options='hyphenated-name:value';
--ERROR HY000: WSREP (galera) not started
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--SET @@global.wsrep_provider_options=default;
--ERROR HY000: WSREP (galera) not started
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--
--# invalid values
--SET @@global.wsrep_provider_options=1;
--ERROR 42000: Incorrect argument type to variable 'wsrep_provider_options'
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--SET @@global.wsrep_provider_options=NULL;
--Got one of the listed errors
--SELECT @@global.wsrep_provider_options;
--@@global.wsrep_provider_options
--
--# End of test
-diff --git a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test b/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
-deleted file mode 100644
-index 6d1535ba148..00000000000
---- a/mysql-test/suite/sys_vars/t/wsrep_notify_cmd_basic.test
-+++ /dev/null
-@@ -1,43 +0,0 @@
----source include/have_wsrep.inc
--
----echo #
----echo # wsrep_notify_cmd
----echo #
--
--call mtr.add_suppression("WSREP: Failed to get provider options");
--
----echo # save the initial value
--SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
--
----echo # default
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # scope
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SELECT @@session.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd='notify_cmd';
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # valid values
--SET @@global.wsrep_notify_cmd='command';
--SELECT @@global.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd='hyphenated-command';
--SELECT @@global.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd=default;
--SELECT @@global.wsrep_notify_cmd;
--SET @@global.wsrep_notify_cmd=NULL;
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # invalid values
----error ER_WRONG_TYPE_FOR_VAR
--SET @@global.wsrep_notify_cmd=1;
--SELECT @@global.wsrep_notify_cmd;
--
----echo
----echo # restore the initial value
--SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
--
----echo # End of test
-diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
-deleted file mode 100644
-index 1190ab41bb0..00000000000
---- a/mysql-test/suite/sys_vars/t/wsrep_provider_basic.test
-+++ /dev/null
-@@ -1,39 +0,0 @@
----source include/have_wsrep.inc
--
----echo #
----echo # wsrep_provider
----echo #
--
----echo # save the initial value
--SET @wsrep_provider_global_saved = @@global.wsrep_provider;
--
----echo # default
--SELECT @@global.wsrep_provider;
--
----echo
----echo # scope
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SELECT @@session.wsrep_provider;
--SELECT @@global.wsrep_provider;
--
----echo
----echo # valid values
--SET @@global.wsrep_provider=default;
--SELECT @@global.wsrep_provider;
--
----echo
----echo # invalid values
----error ER_WRONG_VALUE_FOR_VAR
--SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
----error ER_WRONG_VALUE_FOR_VAR
--SET @@global.wsrep_provider=NULL;
--SELECT @@global.wsrep_provider;
----error ER_WRONG_TYPE_FOR_VAR
--SET @@global.wsrep_provider=1;
--SELECT @@global.wsrep_provider;
--
----echo
----echo # restore the initial value
--SET @@global.wsrep_provider = @wsrep_provider_global_saved;
--
----echo # End of test
-diff --git a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
-deleted file mode 100644
-index 6eb3a94b6a4..00000000000
---- a/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
-+++ /dev/null
-@@ -1,41 +0,0 @@
----source include/have_wsrep.inc
--
----echo #
----echo # wsrep_provider_options
----echo #
--
--call mtr.add_suppression("WSREP: Failed to get provider options");
--
----echo # default
--SELECT @@global.wsrep_provider_options;
--
----echo
----echo # scope
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SELECT @@session.wsrep_provider_options;
----error 0,ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options='option1';
--SELECT @@global.wsrep_provider_options;
--
----echo
----echo # valid values
----error ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options='name1=value1;name2=value2';
--SELECT @@global.wsrep_provider_options;
----error ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options='hyphenated-name:value';
--SELECT @@global.wsrep_provider_options;
----error ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options=default;
--SELECT @@global.wsrep_provider_options;
--
----echo
----echo # invalid values
----error ER_WRONG_TYPE_FOR_VAR
--SET @@global.wsrep_provider_options=1;
--SELECT @@global.wsrep_provider_options;
----error ER_WRONG_ARGUMENTS,ER_WRONG_ARGUMENTS
--SET @@global.wsrep_provider_options=NULL;
--SELECT @@global.wsrep_provider_options;
--
----echo # End of test
-diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def
-index 11577bfe8b0..3d204db6945 100644
---- a/mysql-test/suite/wsrep/disabled.def
-+++ b/mysql-test/suite/wsrep/disabled.def
-@@ -10,3 +10,5 @@
- #
- ##############################################################################
- 
-+
-+mdev_6832: wsrep_provider is read-only for security reasons
-diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
-index a9988fd1628..e57440125ee 100644
---- a/mysql-test/suite/wsrep/r/variables.result
-+++ b/mysql-test/suite/wsrep/r/variables.result
-@@ -14,7 +14,6 @@ SET SESSION wsrep_replicate_myisam= ON;
- ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable and should be set with SET GLOBAL
- SET GLOBAL wsrep_replicate_myisam= ON;
- SET GLOBAL wsrep_replicate_myisam= OFF;
--SET GLOBAL wsrep_provider=none;
- #
- # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
- # variables when using "_"
-@@ -151,7 +150,6 @@ wsrep_local_state_comment	#
- # Should show nothing.
- SHOW STATUS LIKE 'x';
- Variable_name	Value
--SET GLOBAL wsrep_provider=none;
- 
- SHOW STATUS LIKE 'wsrep_local_state_uuid';
- Variable_name	Value
-@@ -160,7 +158,6 @@ wsrep_local_state_uuid	#
- SHOW STATUS LIKE 'wsrep_last_committed';
- Variable_name	Value
- wsrep_last_committed	#
--SET GLOBAL wsrep_provider=none;
- 
- #
- # MDEV#6206: wsrep_slave_threads subtracts from max_connections
-@@ -174,7 +171,7 @@ SELECT @@global.wsrep_slave_threads;
- 1
- SELECT @@global.wsrep_cluster_address;
- @@global.wsrep_cluster_address
--
-+gcomm://
- SELECT @@global.wsrep_on;
- @@global.wsrep_on
- 1
-@@ -183,14 +180,14 @@ Variable_name	Value
- Threads_connected	1
- SHOW STATUS LIKE 'wsrep_thread_count';
- Variable_name	Value
--wsrep_thread_count	0
-+wsrep_thread_count	2
- 
- SELECT @@global.wsrep_provider;
- @@global.wsrep_provider
- libgalera_smm.so
- SELECT @@global.wsrep_cluster_address;
- @@global.wsrep_cluster_address
--
-+gcomm://
- SELECT @@global.wsrep_on;
- @@global.wsrep_on
- 1
-@@ -199,11 +196,10 @@ Variable_name	Value
- Threads_connected	1
- SHOW STATUS LIKE 'wsrep_thread_count';
- Variable_name	Value
--wsrep_thread_count	0
-+wsrep_thread_count	2
- 
- # Setting wsrep_cluster_address triggers the creation of
- # applier/rollbacker threads.
--SET GLOBAL wsrep_cluster_address= 'gcomm://';
- # Wait for applier thread to get created 1.
- # Wait for applier thread to get created 2.
- SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
-index f2c3a0a3b78..fd352b61a3a 100644
---- a/mysql-test/suite/wsrep/t/variables.test
-+++ b/mysql-test/suite/wsrep/t/variables.test
-@@ -23,7 +23,7 @@ SET GLOBAL wsrep_replicate_myisam= ON;
- 
- # Reset it back.
- SET GLOBAL wsrep_replicate_myisam= OFF;
--SET GLOBAL wsrep_provider=none;
-+#SET GLOBAL wsrep_provider=none;
- 
- --echo #
- --echo # MDEV#5790: SHOW GLOBAL STATUS LIKE does not show the correct list of
-@@ -32,9 +32,6 @@ SET GLOBAL wsrep_provider=none;
- 
- CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
- 
- --replace_column 2 #
- SHOW GLOBAL STATUS LIKE 'wsrep%';
-@@ -50,11 +47,9 @@ SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
- SHOW STATUS LIKE 'x';
- 
- # Reset it back.
--SET GLOBAL wsrep_provider=none;
-+#SET GLOBAL wsrep_provider=none;
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
-+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
- 
- # The following 2 variables are used by mariabackup
- # SST.
-@@ -66,7 +61,7 @@ SHOW STATUS LIKE 'wsrep_local_state_uuid';
- SHOW STATUS LIKE 'wsrep_last_committed';
- 
- # Reset it back.
--SET GLOBAL wsrep_provider=none;
-+#SET GLOBAL wsrep_provider=none;
- 
- --echo
- --echo #
-@@ -74,9 +69,7 @@ SET GLOBAL wsrep_provider=none;
- --echo #
- call mtr.add_suppression("WSREP: Failed to get provider options");
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
-+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
- 
- --replace_regex /.*libgalera_smm.*/libgalera_smm.so/
- SELECT @@global.wsrep_provider;
-@@ -87,9 +80,7 @@ SHOW STATUS LIKE 'threads_connected';
- SHOW STATUS LIKE 'wsrep_thread_count';
- --echo
- 
----disable_query_log
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
----enable_query_log
-+#evalp SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
- 
- --replace_regex /.*libgalera_smm.*/libgalera_smm.so/
- SELECT @@global.wsrep_provider;
-@@ -101,7 +92,7 @@ SHOW STATUS LIKE 'wsrep_thread_count';
- 
- --echo # Setting wsrep_cluster_address triggers the creation of
- --echo # applier/rollbacker threads.
--SET GLOBAL wsrep_cluster_address= 'gcomm://';
-+#SET GLOBAL wsrep_cluster_address= 'gcomm://';
- 
- --echo # Wait for applier thread to get created 1.
- --let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
-@@ -162,15 +153,6 @@ SET @@global.wsrep_sst_auth= NULL;
- SELECT @@global.wsrep_sst_auth;
- SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
- 
--# Reset (for mtr internal checks)
--
----disable_query_log
--SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
--eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved;
--SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
----enable_query_log
--
- --source include/galera_wait_ready.inc
- 
- --echo # End of test.
-diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
-index 64040243df0..8c67a4d432a 100644
---- a/sql/sys_vars.cc
-+++ b/sql/sys_vars.cc
-@@ -5669,8 +5669,8 @@ static Sys_var_tz Sys_time_zone(
- 
- static Sys_var_charptr_fscs Sys_wsrep_provider(
-        "wsrep_provider", "Path to replication provider library",
--       PREALLOCATED GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG),
--       DEFAULT(WSREP_NONE),
-+       PREALLOCATED READ_ONLY GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG),
-+       DEFAULT(WSREP_NONE),
-        NO_MUTEX_GUARD, NOT_IN_BINLOG,
-        ON_CHECK(wsrep_provider_check), ON_UPDATE(wsrep_provider_update));
- 
-@@ -5886,8 +5886,8 @@ static Sys_var_ulong Sys_wsrep_max_ws_rows (
- 
- static Sys_var_charptr Sys_wsrep_notify_cmd(
-        "wsrep_notify_cmd", "",
--       GLOBAL_VAR(wsrep_notify_cmd),CMD_LINE(REQUIRED_ARG),
--       DEFAULT(""));
-+       READ_ONLY GLOBAL_VAR(wsrep_notify_cmd), CMD_LINE(REQUIRED_ARG),
-+       DEFAULT(""));
- 
- static Sys_var_mybool Sys_wsrep_certify_nonPK(
-        "wsrep_certify_nonPK", "Certify tables with no primary key",
--- 
-2.31.0
-
diff --git a/gnu/packages/patches/mesa-opencl-all-targets.patch b/gnu/packages/patches/mesa-opencl-all-targets.patch
new file mode 100644
index 0000000000..99d4abcea4
--- /dev/null
+++ b/gnu/packages/patches/mesa-opencl-all-targets.patch
@@ -0,0 +1,25 @@
+This patch restores LLVM targets needed for OpenCL, *reverting* this
+upstream commit:
+
+  From 80817b6e344258ac9b955f824ebf9019a0fc1610 Mon Sep 17 00:00:00 2001
+  From: Jesse Natalie <jenatali@microsoft.com>
+  Date: Wed, 18 Nov 2020 18:30:30 -0800
+  Subject: [PATCH] meson: Adjust Clover's required LLVM modules
+
+diff --git a/meson.build b/meson.build
+index 6d1607c35a3..f828eb80faa 100644
+--- b/meson.build
++++ a/meson.build
+@@ -1479,10 +1479,9 @@
+ endif
+ if with_gallium_opencl
+   llvm_modules += [
+-    'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
+-    'lto', 'option', 'objcarcopts', 'profiledata'
++    'all-targets', 'linker', 'coverage', 'instrumentation', 'ipo', 'irreader',
++    'lto', 'option', 'objcarcopts', 'profiledata',
+   ]
+-  llvm_optional_modules += ['frontendopenmp']
+ endif
+ if with_microsoft_clc
+   llvm_modules += ['target', 'linker', 'irreader', 'option', 'libdriver']
diff --git a/gnu/packages/patches/mesa-skip-tests.patch b/gnu/packages/patches/mesa-skip-tests.patch
index 2622d5d312..8f587ea7ef 100644
--- a/gnu/packages/patches/mesa-skip-tests.patch
+++ b/gnu/packages/patches/mesa-skip-tests.patch
@@ -1,23 +1,3 @@
-disk_cache_create() here looks up the users home directory from <pwd.h>
-which resolves to "/" in the build environment. I could not find an easy
-way to set the home directory to something else, so we disable this test
-for now.
-
---- a/src/compiler/glsl/tests/cache_test.c
-+++ b/src/compiler/glsl/tests/cache_test.c
-@@ -170,11 +170,6 @@
-    unsetenv("MESA_GLSL_CACHE_DIR");
-    unsetenv("XDG_CACHE_HOME");
- 
--   cache = disk_cache_create("test", "make_check", 0);
--   expect_non_null(cache, "disk_cache_create with no environment variables");
--
--   disk_cache_destroy(cache);
--
-    /* Test with XDG_CACHE_HOME set */
-    setenv("XDG_CACHE_HOME", CACHE_TEST_TMP "/xdg-cache-home", 1);
-    cache = disk_cache_create("test", "make_check", 0);
-
 This test fails on i686-linux. I couldn't come up with a regex that
 could be used to disable it just on i686-linux, so we disable it
 completely with this patch:
diff --git a/gnu/packages/patches/meson-for-build-rpath.patch b/gnu/packages/patches/meson-for-build-rpath.patch
deleted file mode 100644
index ef9a73f07c..0000000000
--- a/gnu/packages/patches/meson-for-build-rpath.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-This patch removes a part of meson that clears the rpath upon installation.
-This will only be applied to a special version of meson, used for the
-meson-build-system.
-
-Original patch for Meson 0.42.0 by Peter Mikkelsen <petermikkelsen10@gmail.com>
-
---- meson-0.47.1/mesonbuild/minstall.py.old	2018-08-10 11:01:27.812327013 +0200
-+++ meson-0.47.1/mesonbuild/minstall.py	2018-08-10 11:01:51.940368505 +0200
-@@ -436,15 +436,6 @@
-                         print("Symlink creation does not work on this platform. "
-                               "Skipping all symlinking.")
-                         printed_symlink_error = True
--            if os.path.isfile(outname):
--                try:
--                    depfixer.fix_rpath(outname, install_rpath, final_path,
--                                       install_name_mappings, verbose=False)
--                except SystemExit as e:
--                    if isinstance(e.code, int) and e.code == 0:
--                        pass
--                    else:
--                        raise
- 
- def run(args):
-     parser = buildparser()
diff --git a/gnu/packages/patches/mit-krb5-hurd.patch b/gnu/packages/patches/mit-krb5-hurd.patch
index d4962b1e60..449320cea4 100644
--- a/gnu/packages/patches/mit-krb5-hurd.patch
+++ b/gnu/packages/patches/mit-krb5-hurd.patch
@@ -148,18 +148,3 @@ index 7e981d4..d83b3b6 100644
 +# define MAXPATHLEN 4096
 +#endif
  #endif /* _DB_INT_H_ */
-diff --git a/src/tests/resolve/resolve.c b/src/tests/resolve/resolve.c
-index 7339d21..38f7253 100644
---- a/src/tests/resolve/resolve.c
-+++ b/src/tests/resolve/resolve.c
-@@ -73,6 +73,10 @@ char *strchr();
- #include <netinet/in.h>
- #include <netdb.h>
- 
-+#ifndef MAXHOSTNAMELEN
-+# define MAXHOSTNAMELEN 256
-+#endif
-+
- int
- main(argc, argv)
-     int argc;
diff --git a/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch b/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
deleted file mode 100644
index 491a358731..0000000000
--- a/gnu/packages/patches/mit-krb5-qualify-short-hostnames.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Fix a null pointer dereference when no DNS search path is configured.
-This showed up as a segfault while running the gsasl test suite.
-
-Taken from upstream:
-https://github.com/krb5/krb5/commit/cd82bf377e7fad2409c76bf8b241920692f34fda
-
-diff --git a/src/lib/krb5/os/dnsglue.c b/src/lib/krb5/os/dnsglue.c
-index e35ca9d76c..0cd213fdd7 100644
---- a/src/lib/krb5/os/dnsglue.c
-+++ b/src/lib/krb5/os/dnsglue.c
-@@ -91,7 +91,7 @@ static int initparse(struct krb5int_dns_state *);
- #define DECLARE_HANDLE(h) struct __res_state h
- #define INIT_HANDLE(h) (memset(&h, 0, sizeof(h)), res_ninit(&h) == 0)
- #define SEARCH(h, n, c, t, a, l) res_nsearch(&h, n, c, t, a, l)
--#define PRIMARY_DOMAIN(h) strdup(h.dnsrch[0])
-+#define PRIMARY_DOMAIN(h) ((h.dnsrch[0] == NULL) ? NULL : strdup(h.dnsrch[0]))
- #if HAVE_RES_NDESTROY
- #define DESTROY_HANDLE(h) res_ndestroy(&h)
- #else
-@@ -104,7 +104,8 @@ static int initparse(struct krb5int_dns_state *);
- #define DECLARE_HANDLE(h)
- #define INIT_HANDLE(h) (res_init() == 0)
- #define SEARCH(h, n, c, t, a, l) res_search(n, c, t, a, l)
--#define PRIMARY_DOMAIN(h) strdup(_res.defdname)
-+#define PRIMARY_DOMAIN(h) \
-+    ((_res.defdname == NULL) ? NULL : strdup(_res.defdname))
- #define DESTROY_HANDLE(h)
- 
- #endif
diff --git a/gnu/packages/patches/mpg321-gcc-10.patch b/gnu/packages/patches/mpg321-gcc-10.patch
new file mode 100644
index 0000000000..8966d9f7c8
--- /dev/null
+++ b/gnu/packages/patches/mpg321-gcc-10.patch
@@ -0,0 +1,83 @@
+From f930c3b81bdf9c05152fb005562b3869f6e36f34 Mon Sep 17 00:00:00 2001
+From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
+Date: Thu, 4 Jun 2020 20:41:25 +0300
+Subject: [PATCH] Fix GCC10 compilation
+
+---
+ mpg321.c |  8 ++++++++
+ mpg321.h | 16 ++++++++--------
+ 2 files changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/mpg321.c b/mpg321.c
+index 19282bb..663882e 100644
+--- a/mpg321.c
++++ b/mpg321.c
+@@ -63,6 +63,14 @@
+ #include <pthread.h>
+ #include <semaphore.h>
+ 
++output_frame *Output_Queue;
++decoded_frames *Decoded_Frames;
++int semarray;
++int mad_decoder_position;
++int output_buffer_position;
++double real[FFT_BUFFER_SIZE];
++double imag[FFT_BUFFER_SIZE];
++int loop_remaining;
+ 
+ int pflag = 0;
+ int volume = 0;
+diff --git a/mpg321.h b/mpg321.h
+index 798bff0..235cf4a 100644
+--- a/mpg321.h
++++ b/mpg321.h
+@@ -116,7 +116,7 @@ extern char *playlist_file;
+ extern int quit_now;
+ extern char remote_input_buf[PATH_MAX + 5];
+ extern int file_change;
+-int loop_remaining;
++extern int loop_remaining;
+ 
+ extern int status;
+ extern int scrobbler_time;
+@@ -233,8 +233,8 @@ RETSIGTYPE handle_sigchld(int sig);
+ #define FFT_BUFFER_SIZE_LOG 9
+ #define FFT_BUFFER_SIZE (1 << FFT_BUFFER_SIZE_LOG) /* 512 */
+ /*Temporary data stores to perform FFT in */
+-double real[FFT_BUFFER_SIZE];
+-double imag[FFT_BUFFER_SIZE];
++extern double real[FFT_BUFFER_SIZE];
++extern double imag[FFT_BUFFER_SIZE];
+ 
+ typedef struct {
+ 	double real[FFT_BUFFER_SIZE];
+@@ -258,10 +258,10 @@ fft_state *fft_init(void);
+ /* Output buffer process */
+ void frame_buffer_p();
+ /* Semaphore array */
+-int semarray;
++extern int semarray;
+ /* Input/Output buffer position */
+-int mad_decoder_position;
+-int output_buffer_position;
++extern int mad_decoder_position;
++extern int output_buffer_position;
+ /* Output Frame including needed information */
+ typedef struct {
+ 	unsigned char data[4*1152];
+@@ -285,10 +285,10 @@ typedef struct {
+ } decoded_frames;
+ 
+ /* Output frame queue pointer */
+-output_frame *Output_Queue;
++extern output_frame *Output_Queue;
+ 
+ /* Shared total decoded frames */
+-decoded_frames *Decoded_Frames;
++extern decoded_frames *Decoded_Frames;
+ 
+ #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+ /* */
+-- 
+2.26.2
+
diff --git a/gnu/packages/patches/nss-getcwd-nonnull.patch b/gnu/packages/patches/nss-getcwd-nonnull.patch
new file mode 100644
index 0000000000..37c1b1c539
--- /dev/null
+++ b/gnu/packages/patches/nss-getcwd-nonnull.patch
@@ -0,0 +1,30 @@
+Disable -Werror=nonnull on getcwd(0, 4096) because GCC incorrectly warns that
+the second argument should be NULL with recent glibc.  See:
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96832
+https://sourceware.org/bugzilla/show_bug.cgi?id=26545
+
+diff --git a/nss/coreconf/nsinstall/nsinstall.c b/nss/coreconf/nsinstall/nsinstall.c
+--- a/nss/coreconf/nsinstall/nsinstall.c
++++ b/nss/coreconf/nsinstall/nsinstall.c
+@@ -236,14 +236,20 @@ main(int argc, char **argv)
+ 	return 0;
+ 
+     if (!cwd) {
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+ 	cwd = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+ 	if (!cwd)
+ 	    fail("could not get CWD");
+     }
+ 
+     /* make sure we can get into todir. */
+     xchdir(todir);
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+     todir = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+     if (!todir)
+ 	fail("could not get CWD in todir");
+     tdlen = strlen(todir);
diff --git a/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch b/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch
new file mode 100644
index 0000000000..b2661f822c
--- /dev/null
+++ b/gnu/packages/patches/ocaml-4.09-multiple-definitions.patch
@@ -0,0 +1,41 @@
+Avoid multiply-defined symbols that lead to link errors such as:
+
+  ld: libcamlrund.a(backtrace_bd.o):/tmp/guix-build-ocaml-4.09.0.drv-0/ocaml-4.09.0/runtime/backtrace.c:31: multiple definition of `caml_debug_info'; libcamlrund.a(backtrace_byt_bd.o):/tmp/guix-build-ocaml-4.09.0.drv-0/ocaml-4.09.0/runtime/backtrace_byt.c:47: first defined here
+
+diff --git a/runtime/backtrace.c b/runtime/backtrace.c
+index a3c2c08..f57c81c 100644
+--- a/runtime/backtrace.c
++++ b/runtime/backtrace.c
+@@ -28,7 +28,7 @@
+ #include "caml/fail.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+diff --git a/runtime/backtrace_byt.c b/runtime/backtrace_byt.c
+index b913dac..b5ec926 100644
+--- a/runtime/backtrace_byt.c
++++ b/runtime/backtrace_byt.c
+@@ -44,7 +44,7 @@
+ #include "caml/backtrace_prim.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport char_os * caml_cds_file = NULL;
+ 
+diff --git a/runtime/startup_nat.c b/runtime/startup_nat.c
+index b4e6bc4..7eca5fa 100644
+--- a/runtime/startup_nat.c
++++ b/runtime/startup_nat.c
+@@ -44,6 +44,5 @@
+ #endif
+ 
+ extern int caml_parser_trace;
+-CAMLexport header_t caml_atom_table[256];
+ char * caml_code_area_start, * caml_code_area_end;
+ struct ext_table caml_code_fragments_table;
diff --git a/gnu/packages/patches/ocaml-multiple-definitions.patch b/gnu/packages/patches/ocaml-multiple-definitions.patch
new file mode 100644
index 0000000000..e8678f4f64
--- /dev/null
+++ b/gnu/packages/patches/ocaml-multiple-definitions.patch
@@ -0,0 +1,43 @@
+Avoid multiply-defined symbols that lead to link errors such as:
+
+  gcc -O2 -fno-strict-aliasing -fwrapv -Wall -fno-tree-vrp  -g -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DCAML_NAME_SPACE  -Wl,-E -o ocamlruni prims.o libcamlruni.a -lm  -ldl -lpthread 
+  ld: libcamlruni.a(backtrace.i.o):/tmp/guix-build-ocaml-4.07.1.drv-0/ocaml-4.07.1/byterun/backtrace.c:31: multiple definition of `caml_debug_info'; libcamlruni.a(backtrace_prim.i.o):/tmp/guix-build-ocaml-4.07.1.drv-0/ocaml-4.07.1/byterun/backtrace_prim.c:47: first defined here
+
+diff --git a/asmrun/startup.c b/asmrun/startup.c
+index 070f0c6..cf8a56f 100644
+--- a/asmrun/startup.c
++++ b/asmrun/startup.c
+@@ -44,7 +44,6 @@
+ #endif
+ 
+ extern int caml_parser_trace;
+-CAMLexport header_t caml_atom_table[256];
+ char * caml_code_area_start, * caml_code_area_end;
+ struct ext_table caml_code_fragments_table;
+ 
+diff --git a/byterun/backtrace.c b/byterun/backtrace.c
+index 8dfe9b7..9cc9e72 100644
+--- a/byterun/backtrace.c
++++ b/byterun/backtrace.c
+@@ -28,7 +28,7 @@
+ #include "caml/fail.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport int32_t caml_backtrace_active = 0;
+ CAMLexport int32_t caml_backtrace_pos = 0;
+diff --git a/byterun/backtrace_prim.c b/byterun/backtrace_prim.c
+index e69b256..d794f73 100644
+--- a/byterun/backtrace_prim.c
++++ b/byterun/backtrace_prim.c
+@@ -44,7 +44,7 @@
+ #include "caml/backtrace_prim.h"
+ 
+ /* The table of debug information fragments */
+-struct ext_table caml_debug_info;
++static struct ext_table caml_debug_info;
+ 
+ CAMLexport char_os * caml_cds_file = NULL;
+ 
diff --git a/gnu/packages/patches/p11-kit-hurd.patch b/gnu/packages/patches/p11-kit-hurd.patch
new file mode 100644
index 0000000000..01699882c4
--- /dev/null
+++ b/gnu/packages/patches/p11-kit-hurd.patch
@@ -0,0 +1,46 @@
+Taken from: https://groups.google.com/g/linux.debian.bugs.dist/c/mX4GpUJih4k.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -132,6 +132,16 @@ if test "$os_unix" = "yes"; then
+ 	AC_CHECK_FUNCS([getpeereid])
+ 	AC_CHECK_FUNCS([getpeerucred])
+ 	AC_CHECK_FUNCS([issetugid])
++	case "$host_os" in
++	kfreebsd*-gnu | gnu*)
++		have_getpeereid=no
++		AC_CHECK_LIB(bsd, getpeereid, have_getpeereid=yes)
++		if test "x$have_getpeereid" = "xyes"; then
++			AC_DEFINE([HAVE_GETPEEREID], [1], [have getpeereid])
++			AC_SEARCH_LIBS([getpeereid], [bsd])
++		fi
++	;;
++	esac
+ 
+ 	AC_CACHE_CHECK([for thread-local storage class],
+ 		[ac_cv_tls_keyword],
+
+--- a/common/unix-peer.c
++++ b/common/unix-peer.c
+@@ -47,6 +47,11 @@
+ #  include <ucred.h>
+ #endif
+ 
++#ifdef HAVE_GETPEEREID
++/* Declare getpeereid from /usr/include/bsd/unistd.h */
++extern int getpeereid(int s, uid_t *euid, gid_t *egid);
++#endif
++
+ /* Returns the unix domain socket peer information.
+  * Returns zero on success.
+  */
+@@ -73,7 +78,8 @@ p11_get_upeer_id (int cfd, uid_t *uid, u
+ 		*pid = cr.pid;
+ 
+ #elif defined(HAVE_GETPEEREID)
+-	/* *BSD/MacOSX */
++	/* *BSD/MacOSX/kFreeBSD/Hurd */
++
+ 	uid_t euid;
+ 	gid_t egid;
+ 
\ No newline at end of file
diff --git a/gnu/packages/patches/perl-cross.patch b/gnu/packages/patches/perl-cross.patch
deleted file mode 100644
index a7d10b4e1f..0000000000
--- a/gnu/packages/patches/perl-cross.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Submitted upstream.
-
-From 4c3eb19a11dfe5c88c902481a8294c4f675fcd03 Mon Sep 17 00:00:00 2001
-From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
-Date: Sun, 19 Apr 2020 23:33:28 +0200
-Subject: [PATCH] Support cross-compiling to the Hurd.
-
-* cnf/hints/gnu: New file.
-* cnf/configure_tool.sh: Guess it.
----
- cnf/configure_tool.sh |  4 ++++
- cnf/hints/gnu         | 21 +++++++++++++++++++++
- 2 files changed, 25 insertions(+)
- create mode 100644 cnf/hints/gnu
-
-diff --git a/cnf/configure_tool.sh b/cnf/configure_tool.sh
-index 32201c0..7b0baa4 100644
---- a/cnf/configure_tool.sh
-+++ b/cnf/configure_tool.sh
-@@ -266,6 +266,10 @@ if not hinted 'osname'; then
- 			define osname "bsd"
- 			result "BSD"
- 			;;
-+		*-gnu*)
-+			define osname "gnu"
-+			result "GNU"
-+			;;
- 		*)
- 			result "no"
- 			;;
-diff --git a/cnf/hints/gnu b/cnf/hints/gnu
-new file mode 100644
-index 0000000..a0583a2
---- /dev/null
-+++ b/cnf/hints/gnu
-@@ -0,0 +1,21 @@
-+# Hurd syscalls
-+d_voidsig='define'
-+d_nanosleep='undef'
-+d_clock_gettime='define'
-+d_clock_getres='define'
-+d_clock_nanosleep='define'
-+d_clock='define'
-+
-+# From the original linux.sh
-+usemallocwrap='define'
-+
-+# libraries to test
-+libswanted='m crypt pthread nm ndbm gdbm dbm db dl gdbm_compat'
-+
-+d_procselfexe='undef'
-+procselfexe='"undef"'
-+
-+st_ino_sign=1
-+st_ino_size=8
-+
-+d_fcntl_can_lock='define'
--- 
-2.26.0
-
diff --git a/gnu/packages/patches/perl-deterministic-ordering.patch b/gnu/packages/patches/perl-deterministic-ordering.patch
deleted file mode 100644
index be63d5cde3..0000000000
--- a/gnu/packages/patches/perl-deterministic-ordering.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From <https://bugs.debian.org/801523>.
-
-From c01f602d1926b0671fd2c8d91f7e52c4e4c9fb24 Mon Sep 17 00:00:00 2001
-From: Niko Tyni <ntyni@debian.org>
-Date: Sun, 11 Oct 2015 19:27:56 +0300
-Subject: [PATCH] Sort the list of XS code files when generating RealPPPort.xs
-
-all_files_in_dir() uses readdir() ordering to make the list of
-input files. This can vary between build systems, breaking build
-reproducibility.
----
- cpan/Devel-PPPort/PPPort_xs.PL | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dist/Devel-PPPort/PPPort_xs.PL b/dist/Devel-PPPort/PPPort_xs.PL
-index 5f18940..149f2fe 100644
---- a/dist/Devel-PPPort/PPPort_xs.PL
-+++ b/dist/Devel-PPPort/PPPort_xs.PL
-@@ -38,7 +38,7 @@ END
- my $file;
- my $sec;
- 
--for $file (all_files_in_dir('parts/inc')) {
-+for $file (sort(all_files_in_dir('parts/inc'))) {
-   my $spec = parse_partspec($file);
- 
-   my $msg = 0;
--- 
-2.5.1
diff --git a/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch b/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch
deleted file mode 100644
index f2166aebfd..0000000000
--- a/gnu/packages/patches/perl-io-socket-ssl-openssl-1.0.2f-fix.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Work around a problem arising from the update to OpenSSL 1.0.2f, based on the
-following upstream commit:
-
-  https://github.com/noxxi/p5-io-socket-ssl/commit/6e23ee4a433f83f1065bd2467255eba5ee9b1ddd
-
-Attempting to update to IO-Socket-SSL-2.023, which includes this commit,
-caused other test failures.  See:
-
-  https://lists.gnu.org/archive/html/guix-devel/2016-01/msg01032.html
-
-Description from the upstream commit:
-
-  OpenSSL 1.0.2f changed the behavior of SSL shutdown in case the TLS connection
-  was not fully established (commit: f73c737c7ac908c5d6407c419769123392a3b0a9).
-  This somehow resulted in Net::SSLeay::shutdown returning 0 (i.e. keep trying)
-  which caused an endless loop. It will now ignore this result in case the TLS
-  connection was not yet established and consider the TLS connection closed
-  instead.
-
---- IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm.orig	2014-10-21 16:51:16.000000000 -0400
-+++ IO-Socket-SSL-2.002/lib/IO/Socket/SSL.pm	2016-01-31 15:07:14.971099894 -0500
-@@ -1213,6 +1213,11 @@
- 		    # shutdown complete
- 		    last;
- 		}
-+		if ((${*$self}{'_SSL_opened'}||0) <= 0) {
-+		    # not really open, thus don't expect shutdown to return
-+		    # something meaningful
-+		    last;
-+		}
- 
- 		# initiate or complete shutdown
- 		local $SIG{PIPE} = 'IGNORE';
diff --git a/gnu/packages/patches/perl-no-sys-dirs.patch b/gnu/packages/patches/perl-no-sys-dirs.patch
index 2269d715c7..14d634cac9 100644
--- a/gnu/packages/patches/perl-no-sys-dirs.patch
+++ b/gnu/packages/patches/perl-no-sys-dirs.patch
@@ -6,7 +6,7 @@ Patch adapted from Nixpkgs, originally by Eelco Dolstra
 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
 --- perl-5.20.0-orig/Configure	2014-05-26 15:34:18.000000000 +0200
 +++ perl-5.20.0/Configure	2014-06-25 10:43:35.368285986 +0200
-@@ -106,15 +106,7 @@
+@@ -108,15 +108,7 @@
  fi
  
  : Proper PATH setting
@@ -23,8 +23,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  
  for p in $paths
  do
-@@ -1337,8 +1329,7 @@
- archname=''
+@@ -1435,8 +1427,7 @@
+ i_whoami=''
  : Possible local include directories to search.
  : Set locincpth to "" in a hint file to defeat local include searches.
 -locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
@@ -33,8 +33,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  :
  : no include file wanted by default
  inclwanted=''
-@@ -1349,17 +1340,12 @@
- 
+@@ -1450,17 +1441,12 @@
+ archobjs=''
  libnames=''
  : change the next line if compiling for Xenix/286 on Xenix/386
 -xlibpth='/usr/lib/386 /lib/386'
@@ -54,8 +54,8 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  
  : Private path used by Configure to find libraries.  Its value
  : is prepended to libpth. This variable takes care of special
-@@ -1391,8 +1377,6 @@
- libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
+@@ -1495,8 +1481,6 @@
+ libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
  : We probably want to search /usr/shlib before most other libraries.
  : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
 -glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
@@ -63,7 +63,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  : Do not use vfork unless overridden by a hint file.
  usevfork=false
  
-@@ -2446,7 +2430,6 @@
+@@ -2553,7 +2537,6 @@
  zip
  "
  pth=`echo $PATH | sed -e "s/$p_/ /g"`
@@ -71,7 +71,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  for file in $loclist; do
  	eval xxx=\$$file
  	case "$xxx" in
-@@ -4936,7 +4919,7 @@
+@@ -5049,7 +5033,7 @@
  : Set private lib path
  case "$plibpth" in
  '') if ./mips; then
@@ -80,7 +80,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
      fi;;
  esac
  case "$libpth" in
-@@ -8600,13 +8583,8 @@
+@@ -8877,13 +8861,8 @@
  echo " "
  case "$sysman" in
  '')
@@ -96,7 +96,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/Configure perl-5.20.0/Configure
  	;;
  esac
  if $test -d "$sysman"; then
-@@ -19900,9 +19878,10 @@
+@@ -21027,9 +21006,10 @@
  case "$full_ar" in
  '') full_ar=$ar ;;
  esac
@@ -169,7 +169,7 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/freebsd.sh perl-5.20.0/hints/
 diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/linux.sh
 --- perl-5.20.0-orig/hints/linux.sh	2014-05-26 15:34:20.000000000 +0200
 +++ perl-5.20.0/hints/linux.sh	2014-06-25 10:33:47.354883843 +0200
-@@ -150,25 +150,6 @@
+@@ -150,28 +150,6 @@
      ;;
  esac
  
@@ -188,6 +188,9 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
 -# plibpth to bypass this check.
 -if [ -x /usr/bin/gcc ] ; then
 -    gcc=/usr/bin/gcc
+-# clang also provides -print-search-dirs
+-elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
+-    gcc=${cc:-cc}
 -else
 -    gcc=gcc
 -fi
@@ -195,7 +198,40 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
  case "$plibpth" in
  '') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries |
  	cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
-@@ -367,33 +322,6 @@
+@@ -208,32 +186,6 @@
+   ;;
+ esac
+ 
+-case "$libc" in
+-'')
+-# If you have glibc, then report the version for ./myconfig bug reporting.
+-# (Configure doesn't need to know the specific version since it just uses
+-# gcc to load the library for all tests.)
+-# We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
+-# are insufficiently precise to distinguish things like
+-# libc-2.0.6 and libc-2.0.7.
+-    for p in $plibpth
+-    do
+-        for trylib in libc.so.6 libc.so
+-        do
+-            if $test -e $p/$trylib; then
+-                libc=`ls -l $p/$trylib | awk '{print $NF}'`
+-                if $test "X$libc" != X; then
+-                    break
+-                fi
+-            fi
+-        done
+-        if $test "X$libc" != X; then
+-            break
+-        fi
+-    done
+-    ;;
+-esac
+-
+ if ${sh:-/bin/sh} -c exit; then
+   echo ''
+   echo 'You appear to have a working bash.  Good.'
+@@ -311,33 +263,6 @@
  	;;
  esac
  
@@ -229,40 +265,3 @@ diff -ru -x '*~' -x '*.rej' perl-5.20.0-orig/hints/linux.sh perl-5.20.0/hints/li
  # Linux on Synology.
  if [ -f /etc/synoinfo.conf -a -d /usr/syno ]; then
      # Tested on Synology DS213 and DS413
-diff --git a/hints/linux.sh b/hints/linux.sh
-index 3f38ea0..97aed11 100644
---- a/hints/linux.sh
-+++ b/hints/linux.sh
-@@ -195,32 +195,6 @@ case "$usequadmath" in
-   ;;
- esac
- 
--case "$libc" in
--'')
--# If you have glibc, then report the version for ./myconfig bug reporting.
--# (Configure doesn't need to know the specific version since it just uses
--# gcc to load the library for all tests.)
--# We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
--# are insufficiently precise to distinguish things like
--# libc-2.0.6 and libc-2.0.7.
--    for p in $plibpth
--    do
--        for trylib in libc.so.6 libc.so
--        do
--            if $test -e $p/$trylib; then
--                libc=`ls -l $p/$trylib | awk '{print $NF}'`
--                if $test "X$libc" != X; then
--                    break
--                fi
--            fi
--        done
--        if $test "X$libc" != X; then
--            break
--        fi
--    done
--    ;;
--esac
--
- if ${sh:-/bin/sh} -c exit; then
-   echo ''
-   echo 'You appear to have a working bash.  Good.'
diff --git a/gnu/packages/patches/pipewire-0.2.7-fno-common.patch b/gnu/packages/patches/pipewire-0.2.7-fno-common.patch
new file mode 100644
index 0000000000..f7d9b25932
--- /dev/null
+++ b/gnu/packages/patches/pipewire-0.2.7-fno-common.patch
@@ -0,0 +1,51 @@
+Fixes 'multiple definition errors' when building with GCC 10+
+
+From: https://bugs.gentoo.org/710796
+Originally from: https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/a62e41e
+and https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/7a976c7
+
+--- a/spa/plugins/bluez5/a2dp-codecs.h
++++ b/spa/plugins/bluez5/a2dp-codecs.h
+@@ -284,15 +284,15 @@
+         }
+ }
+ 
+-const a2dp_sbc_t bluez_a2dp_sbc;
++extern const a2dp_sbc_t bluez_a2dp_sbc;
+ #if ENABLE_MP3
+-const a2dp_mpeg_t bluez_a2dp_mpeg;
++extern const a2dp_mpeg_t bluez_a2dp_mpeg;
+ #endif
+ #if ENABLE_AAC
+-const a2dp_aac_t bluez_a2dp_aac;
++extern const a2dp_aac_t bluez_a2dp_aac;
+ #endif
+ #if ENABLE_APTX
+-const a2dp_aptx_t bluez_a2dp_aptx;
++extern const a2dp_aptx_t bluez_a2dp_aptx;
+ #endif
+ 
+ #endif
+--- a/spa/plugins/bluez5/bluez5-monitor.c
++++ b/spa/plugins/bluez5/bluez5-monitor.c
+@@ -75,7 +75,7 @@
+ 	struct spa_list transport_list;
+ };
+ 
+-struct spa_handle_factory spa_a2dp_sink_factory;
++extern struct spa_handle_factory spa_a2dp_sink_factory;
+ 
+ static void fill_item(struct spa_bt_monitor *this, struct spa_bt_transport *transport,
+ 		struct spa_pod **result, struct spa_pod_builder *builder)
+--- a/spa/plugins/bluez5/meson.build
++++ b/spa/plugins/bluez5/meson.build
+@@ -1,7 +1,8 @@
+ 
+ bluez5_sources = ['plugin.c',
+ 		  'a2dp-sink.c',
+-                  'bluez5-monitor.c']
++		  'a2dp-codecs.c',
++		  'bluez5-monitor.c']
+ 
+ bluez5lib = shared_library('spa-bluez5',
+ 	bluez5_sources,
diff --git a/gnu/packages/patches/python-2.7-no-static-lib.patch b/gnu/packages/patches/python-2.7-no-static-lib.patch
new file mode 100644
index 0000000000..02529989be
--- /dev/null
+++ b/gnu/packages/patches/python-2.7-no-static-lib.patch
@@ -0,0 +1,70 @@
+From 92e2dcace7a3c02289b314238c5f18caec659ff1 Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sat, 5 Jun 2021 12:41:47 +0200
+Subject: [PATCH] No static lib.
+
+This patch is adapted from Fedora. The original patch did not apply
+because of whitespace changes.
+
+00111 #
+Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
+a libpythonMAJOR.MINOR.a (bug 550692):
+Downstream only: not appropriate for upstream
+---
+ Makefile.pre.in | 26 +-------------------------
+ 1 file changed, 1 insertion(+), 25 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 6239fc3..948f196 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -486,7 +486,7 @@ coverage-report: regen-grammar
+ 
+ 
+ # Build the interpreter
+-$(BUILDPYTHON):	Modules/python.o $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON):	Modules/python.o $(LDLIBRARY)
+ 		$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ 			Modules/python.o \
+ 			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+@@ -527,18 +527,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ 		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ 		$(PY_BUILD_ENVIRON) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+ 
+-# Build static library
+-# avoid long command lines, same as LIBRARY_OBJS
+-$(LIBRARY): $(LIBRARY_OBJS)
+-	-rm -f $@
+-	$(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
+-	$(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
+-	$(AR) $(ARFLAGS) $@ $(MODOBJS)
+-	$(RANLIB) $@
+-
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ 	if test $(INSTSONAME) != $(LDLIBRARY); then \
+ 		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1216,18 +1204,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config
+ 		else	true; \
+ 		fi; \
+ 	done
+-	@if test -d $(LIBRARY); then :; else \
+-		if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+-			if test "$(SO)" = .dll; then \
+-				$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+-			else \
+-				$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-				$(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-			fi; \
+-		else \
+-			echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+-		fi; \
+-	fi
+ 	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ 	$(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+ 	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
+-- 
+2.31.1
+
diff --git a/gnu/packages/patches/python-3-fix-tests.patch b/gnu/packages/patches/python-3-fix-tests.patch
index e13790bd41..b44e743c71 100644
--- a/gnu/packages/patches/python-3-fix-tests.patch
+++ b/gnu/packages/patches/python-3-fix-tests.patch
@@ -1,10 +1,39 @@
-See the discussion about the issues fixed here at:
-http://bugs.python.org/issue20868 .
+From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 28 Oct 2020 22:55:05 -0400
+Subject: [PATCH] Skip problematic Python 3 tests in Guix.
+
+A subset of the hunks in this patch is tracked upstream at
+https://bugs.python.org/issue38845, which was contributed by Tanguy Le
+Carrour <tanguy@bioneland.org>.
+---
+ Lib/ctypes/test/test_callbacks.py         | 3 +++
+ Lib/ctypes/test/test_find.py              | 1 +
+ Lib/ctypes/test/test_libc.py              | 3 +++
+ Lib/distutils/tests/test_archive_util.py  | 2 ++
+ Lib/distutils/tests/test_sdist.py         | 1 +
+ Lib/test/_test_multiprocessing.py         | 2 ++
+ Lib/test/test_asyncio/test_base_events.py | 2 ++
+ Lib/test/test_generators.py               | 1 +
+ Lib/test/test_pathlib.py                  | 3 +--
+ Lib/test/test_pdb.py                      | 4 ++--
+ Lib/test/test_regrtest.py                 | 2 ++
+ Lib/test/test_resource.py                 | 1 +
+ Lib/test/test_shutil.py                   | 2 ++
+ Lib/test/test_signal.py                   | 4 ++++
+ Lib/test/test_socket.py                   | 8 ++++++++
+ Lib/test/test_spwd.py                     | 6 ++----
+ Lib/test/test_tarfile.py                  | 9 ++++++---
+ Lib/test/test_threading.py                | 3 +++
+ Lib/test/test_unicodedata.py              | 1 +
+ Tools/scripts/run_tests.py                | 2 +-
+ 20 files changed, 48 insertions(+), 12 deletions(-)
 
 diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
+index d8e9c5a760..94fc5929c9 100644
 --- a/Lib/ctypes/test/test_callbacks.py
 +++ b/Lib/ctypes/test/test_callbacks.py
-@@ -3,6 +3,7 @@ import unittest
+@@ -5,6 +5,7 @@ from test import support
  from ctypes import *
  from ctypes.test import need_symbol
  import _ctypes_test
@@ -12,7 +41,7 @@ diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.
  
  class Callbacks(unittest.TestCase):
      functype = CFUNCTYPE
-@@ -176,6 +177,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
+@@ -178,6 +179,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
  
          self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
  
@@ -21,7 +50,20 @@ diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.
      def test_issue_8959_a(self):
          from ctypes.util import find_library
          libc_path = find_library("c")
+diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
+index 92ac1840ad..c8eb75dedd 100644
+--- a/Lib/ctypes/test/test_find.py
++++ b/Lib/ctypes/test/test_find.py
+@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+             self.assertNotEqual(find_library('c'), None)
+ 
++    @unittest.skipIf(True, "ldconfig is not used on Guix")
+     def test_find_library_with_ld(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
 diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
+index 56285b5ff8..c088ab3db8 100644
 --- a/Lib/ctypes/test/test_libc.py
 +++ b/Lib/ctypes/test/test_libc.py
 @@ -2,6 +2,7 @@ import unittest
@@ -42,6 +84,7 @@ diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
          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
+index e9aad0e40f..8bbaa51ee5 100644
 --- a/Lib/distutils/tests/test_archive_util.py
 +++ b/Lib/distutils/tests/test_archive_util.py
 @@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
@@ -61,6 +104,7 @@ diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test
          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
+index 23db126959..6e2329df7d 100644
 --- a/Lib/distutils/tests/test_sdist.py
 +++ b/Lib/distutils/tests/test_sdist.py
 @@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
@@ -72,9 +116,10 @@ diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.
          # now building a sdist
          dist, cmd = self.get_cmd()
 diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+index e47905c863..31a5a9c308 100644
 --- a/Lib/test/_test_multiprocessing.py
 +++ b/Lib/test/_test_multiprocessing.py
-@@ -1473,6 +1473,7 @@ class _TestCondition(BaseTestCase):
+@@ -1577,6 +1577,7 @@ class _TestCondition(BaseTestCase):
          if pid is not None:
              os.kill(pid, signal.SIGINT)
  
@@ -82,10 +127,19 @@ diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.
      def test_wait_result(self):
          if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
              pid = os.getpid()
+@@ -3905,6 +3906,7 @@ class _TestSharedMemory(BaseTestCase):
+         sms.close()
+ 
+     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
+         # bpo-36368: protect SharedMemoryManager server process from
+         # KeyboardInterrupt signals.
 diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+index 533d5cc7f5..c4f860cc3b 100644
 --- a/Lib/test/test_asyncio/test_base_events.py
 +++ b/Lib/test/test_asyncio/test_base_events.py
-@@ -1323,6 +1323,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
+@@ -1341,6 +1341,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
          self._test_create_connection_ip_addr(m_socket, False)
  
      @patch_socket
@@ -95,9 +149,10 @@ diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/t
          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
+index 3bf1522808..04bac8a7db 100644
 --- a/Lib/test/test_generators.py
 +++ b/Lib/test/test_generators.py
-@@ -34,6 +34,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
+@@ -33,6 +33,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
          else:
              return "FAILED"
  
@@ -105,30 +160,11 @@ diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
      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
+index 3da35710b9..5404f9193d 100644
 --- a/Lib/test/test_pathlib.py
 +++ b/Lib/test/test_pathlib.py
-@@ -2134,8 +2134,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
+@@ -2408,8 +2408,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
          self.assertEqual(given, expect)
          self.assertEqual(set(p.rglob("FILEd*")), set())
  
@@ -139,9 +175,10 @@ diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
          P = self.cls
          support.import_module('pwd')
 diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+index 8016f81e5a..10190486b4 100644
 --- a/Lib/test/test_pdb.py
 +++ b/Lib/test/test_pdb.py
-@@ -1150,11 +1150,11 @@ def test_pdb_issue_20766():
+@@ -1219,11 +1219,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
@@ -156,9 +193,10 @@ diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
  
  
 diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index a77638b10a..2069b349a8 100644
 --- a/Lib/test/test_regrtest.py
 +++ b/Lib/test/test_regrtest.py
-@@ -762,6 +762,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -811,6 +811,7 @@ class ArgsTestCase(BaseTestCase):
          output = self.run_tests('--fromfile', filename)
          self.check_executed_tests(output, tests)
  
@@ -166,7 +204,7 @@ diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
      def test_interrupted(self):
          code = TEST_INTERRUPTED
          test = self.create_test('sigint', code=code)
-@@ -779,6 +780,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -828,6 +829,7 @@ class ArgsTestCase(BaseTestCase):
                   % (self.TESTNAME_REGEX, len(tests)))
          self.check_line(output, regex)
  
@@ -175,9 +213,10 @@ diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
          # 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
+index e5ece5284c..5299e54507 100644
 --- a/Lib/test/test_resource.py
 +++ b/Lib/test/test_resource.py
-@@ -145,6 +145,7 @@ class ResourceTest(unittest.TestCase):
+@@ -148,6 +148,7 @@ class ResourceTest(unittest.TestCase):
  
      @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
      @support.requires_linux_version(2, 6, 36)
@@ -186,37 +225,75 @@ diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
          self.assertRaises(TypeError, resource.prlimit)
          self.assertRaises(ProcessLookupError, resource.prlimit,
 diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index e19af64be0..1b893df6fa 100644
 --- a/Lib/test/test_shutil.py
 +++ b/Lib/test/test_shutil.py
-@@ -1143,6 +1143,7 @@ class TestShutil(unittest.TestCase):
+@@ -1427,6 +1427,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+         base_name = os.path.join(tmpdir, 'archive')
          self.assertRaises(ValueError, make_archive, base_name, 'xxx')
  
-     @support.requires_zlib
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
      def test_make_archive_owner_group(self):
          # testing make_archive with owner and group, with various combinations
-         # this works even if there's not gid/uid support
-@@ -1171,6 +1172,7 @@ class TestShutil(unittest.TestCase):
+@@ -1455,6 +1456,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+         self.assertTrue(os.path.isfile(res))
  
  
-     @support.requires_zlib
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
      @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_signal.py b/Lib/test/test_signal.py
+index 45553a6a42..55623f01a3 100644
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
+         self.assertLess(len(s), signal.NSIG)
+ 
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers exit via SIGINT."""
+         process = subprocess.run(
+@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
+             signal.signal(7, handler)
+ 
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
+         # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
+@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
+ 
+ class RaiseSignalTest(unittest.TestCase):
+ 
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_sigint(self):
+         with self.assertRaises(KeyboardInterrupt):
+             signal.raise_signal(signal.SIGINT)
+@@ -1275,6 +1278,7 @@ class RaiseSignalTest(unittest.TestCase):
+ 
+ class PidfdSignalTest(unittest.TestCase):
+ 
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @unittest.skipUnless(
+         hasattr(signal, "pidfd_send_signal"),
+         "pidfd support not built in",
 diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index aefba4f397..6c89f558d5 100755
 --- a/Lib/test/test_socket.py
 +++ b/Lib/test/test_socket.py
-@@ -875,6 +875,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1009,6 +1009,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.HOSTv4, '10.0.0.1', '255.255.255.255']:
+         for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
              self.assertEqual(socket.gethostbyname(addr), addr)
-@@ -1004,6 +1006,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1140,6 +1142,8 @@ class GeneralModuleTests(unittest.TestCase):
              self.assertWarns(DeprecationWarning, socket.ntohs, k)
              self.assertWarns(DeprecationWarning, socket.htons, k)
  
@@ -225,7 +302,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
      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):
+@@ -1489,6 +1493,8 @@ class GeneralModuleTests(unittest.TestCase):
              raise
          self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
  
@@ -234,7 +311,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
      def testGetaddrinfo(self):
          try:
              socket.getaddrinfo('localhost', 80)
-@@ -1440,6 +1446,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1571,6 +1577,8 @@ class GeneralModuleTests(unittest.TestCase):
          # only IP addresses are allowed
          self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
  
@@ -244,6 +321,7 @@ diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
                           'network is not enabled')
      def test_idna(self):
 diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index 07793c84c8..fec672bcbe 100644
 --- a/Lib/test/test_spwd.py
 +++ b/Lib/test/test_spwd.py
 @@ -5,8 +5,7 @@ from test import support
@@ -267,9 +345,10 @@ diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
  
      def test_getspnam_exception(self):
 diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+index 29cde91bf7..8d0f20e8bf 100644
 --- a/Lib/test/test_tarfile.py
 +++ b/Lib/test/test_tarfile.py
-@@ -2509,9 +2509,12 @@ def root_is_uid_gid_0():
+@@ -2607,9 +2607,12 @@ def root_is_uid_gid_0():
          import pwd, grp
      except ImportError:
          return False
@@ -286,9 +365,10 @@ diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
      return True
  
 diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+index c21cdf8eb7..6c9d575032 100644
 --- a/Lib/test/test_threading.py
 +++ b/Lib/test/test_threading.py
-@@ -1249,6 +1249,7 @@ class MiscTestCase(unittest.TestCase):
+@@ -1398,6 +1398,7 @@ class MiscTestCase(unittest.TestCase):
  
  
  class InterruptMainTests(unittest.TestCase):
@@ -296,7 +376,7 @@ diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
      def test_interrupt_main_subthread(self):
          # Calling start_new_thread with a function that executes interrupt_main
          # should raise KeyboardInterrupt upon completion.
-@@ -1260,6 +1261,8 @@ class InterruptMainTests(unittest.TestCase):
+@@ -1409,6 +1410,8 @@ class InterruptMainTests(unittest.TestCase):
              t.join()
          t.join()
  
@@ -305,10 +385,23 @@ diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
      def test_interrupt_main_mainthread(self):
          # Make sure that if interrupt_main is called in main thread that
          # KeyboardInterrupt is raised instantly.
+diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
+index b552d2bd17..28b1144e15 100644
+--- a/Lib/test/test_unicodedata.py
++++ b/Lib/test/test_unicodedata.py
+@@ -309,6 +309,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
+                 self.assertEqual(len(lines), 1,
+                                  r"\u%.4x should not be a linebreak" % i)
+ 
++@requires_resource('network')
+ class NormalizationTest(unittest.TestCase):
+     @staticmethod
+     def check_version(testfile):
 diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index bcfa5e943b..1f2484971b 100644
 --- a/Tools/scripts/run_tests.py
 +++ b/Tools/scripts/run_tests.py
-@@ -39,7 +39,7 @@ def main(regrtest_args):
+@@ -41,7 +41,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):
@@ -317,3 +410,6 @@ diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
      args.extend(regrtest_args)
      print(' '.join(args))
      if sys.platform == 'win32':
+-- 
+2.29.2
+
diff --git a/gnu/packages/patches/python-3-hurd-configure.patch b/gnu/packages/patches/python-3-hurd-configure.patch
new file mode 100644
index 0000000000..aa25a401c5
--- /dev/null
+++ b/gnu/packages/patches/python-3-hurd-configure.patch
@@ -0,0 +1,27 @@
+Upstream status: Not upstreamed.
+
+The build system refuses to cross-compile for unknown targets
+even though it works fine.  Add GNU/Hurd target.
+
+--- Python-3.8.5/configure.orig	2020-10-26 14:06:09.665423525 +0100
++++ Python-3.8.5/configure	2020-10-26 14:08:30.987765738 +0100
+@@ -3278,6 +3278,9 @@
+ 	*-*-vxworks*)
+ 	    ac_sys_system=VxWorks
+ 	    ;;
++	*-*-gnu)
++	    ac_sys_system=GNU
++	    ;;
+ 	*)
+ 		# for now, limit cross builds to known configurations
+ 		MACHDEP="unknown"
+@@ -3328,6 +3331,9 @@
+ 	*-*-vxworks*)
+ 		_host_cpu=$host_cpu
+ 		;;
++	*-*-gnu)
++		_host_cpu=$host_cpu
++	    ;;
+ 	*)
+ 		# for now, limit cross builds to known configurations
+ 		MACHDEP="unknown"
diff --git a/gnu/packages/patches/python-3-no-static-lib.patch b/gnu/packages/patches/python-3-no-static-lib.patch
new file mode 100644
index 0000000000..b44dbc976c
--- /dev/null
+++ b/gnu/packages/patches/python-3-no-static-lib.patch
@@ -0,0 +1,75 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: David Malcolm <dmalcolm@redhat.com>
+Date: Mon, 18 Jan 2010 17:59:07 +0000
+Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Downstream only: not appropriate for upstream.
+
+See https://bugzilla.redhat.com/show_bug.cgi?id=556092
+
+Co-authored-by: David Malcolm <dmalcolm@redhat.com>
+Co-authored-by: Bohuslav Kabrda <bkabrda@redhat.com>
+Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
+Co-authored-by: Robert Kuska <rkuska@redhat.com>
+Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
+Co-authored-by: Miro Hrončok <miro@hroncok.cz>
+---
+ Makefile.pre.in | 21 ++-------------------
+ 1 file changed, 2 insertions(+), 19 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 0c3981c132..5587422ec7 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -589,7 +589,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
+ 	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
+ 
+ # Build the interpreter
+-$(BUILDPYTHON):	Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
++$(BUILDPYTHON):	Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
+ 	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
+ 
+ platform: $(BUILDPYTHON) pybuilddir.txt
+@@ -637,12 +637,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ 		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ 		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+ 
+-
+-# Build static library
+-$(LIBRARY): $(LIBRARY_OBJS)
+-	-rm -f $@
+-	$(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
+-
+ libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
+ 	if test $(INSTSONAME) != $(LDLIBRARY); then \
+ 		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
+@@ -724,7 +718,7 @@ Makefile Modules/config.c: Makefile.pre \
+ 	@echo "The Makefile was updated, you may need to re-run make."
+ 
+ 
+-Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
++Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
+ 	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
+ 
+ ############################################################################
+@@ -1652,17 +1646,6 @@ libainstall:	@DEF_MAKE_RULE@ python-config
+ 		else	true; \
+ 		fi; \
+ 	done
+-	@if test -d $(LIBRARY); then :; else \
+-		if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+-			if test "$(SHLIB_SUFFIX)" = .dll; then \
+-				$(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+-			else \
+-				$(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+-			fi; \
+-		else \
+-			echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+-		fi; \
+-	fi
+ 	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ 	$(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
+ 	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/gnu/packages/patches/python-3.8-CVE-2021-3177.patch b/gnu/packages/patches/python-3.8-CVE-2021-3177.patch
deleted file mode 100644
index 01f6b52865..0000000000
--- a/gnu/packages/patches/python-3.8-CVE-2021-3177.patch
+++ /dev/null
@@ -1,194 +0,0 @@
-Fix CVE-2021-3177 for Python 3.8:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177
-
-Patch copied from upstream source repository:
-
-https://github.com/python/cpython/commit/ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f
-
-From ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f Mon Sep 17 00:00:00 2001
-From: "Miss Islington (bot)"
- <31488909+miss-islington@users.noreply.github.com>
-Date: Mon, 18 Jan 2021 13:28:52 -0800
-Subject: [PATCH] closes bpo-42938: Replace snprintf with Python unicode
- formatting in ctypes param reprs. (GH-24248)
-
-(cherry picked from commit 916610ef90a0d0761f08747f7b0905541f0977c7)
-
-Co-authored-by: Benjamin Peterson <benjamin@python.org>
-
-Co-authored-by: Benjamin Peterson <benjamin@python.org>
----
- Lib/ctypes/test/test_parameters.py            | 43 ++++++++++++++++
- .../2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst  |  2 +
- Modules/_ctypes/callproc.c                    | 51 +++++++------------
- 3 files changed, 64 insertions(+), 32 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-
-diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
-index e4c25fd880cef..531894fdec838 100644
---- a/Lib/ctypes/test/test_parameters.py
-+++ b/Lib/ctypes/test/test_parameters.py
-@@ -201,6 +201,49 @@ def __dict__(self):
-         with self.assertRaises(ZeroDivisionError):
-             WorseStruct().__setstate__({}, b'foo')
- 
-+    def test_parameter_repr(self):
-+        from ctypes import (
-+            c_bool,
-+            c_char,
-+            c_wchar,
-+            c_byte,
-+            c_ubyte,
-+            c_short,
-+            c_ushort,
-+            c_int,
-+            c_uint,
-+            c_long,
-+            c_ulong,
-+            c_longlong,
-+            c_ulonglong,
-+            c_float,
-+            c_double,
-+            c_longdouble,
-+            c_char_p,
-+            c_wchar_p,
-+            c_void_p,
-+        )
-+        self.assertRegex(repr(c_bool.from_param(True)), r"^<cparam '\?' at 0x[A-Fa-f0-9]+>$")
-+        self.assertEqual(repr(c_char.from_param(97)), "<cparam 'c' ('a')>")
-+        self.assertRegex(repr(c_wchar.from_param('a')), r"^<cparam 'u' at 0x[A-Fa-f0-9]+>$")
-+        self.assertEqual(repr(c_byte.from_param(98)), "<cparam 'b' (98)>")
-+        self.assertEqual(repr(c_ubyte.from_param(98)), "<cparam 'B' (98)>")
-+        self.assertEqual(repr(c_short.from_param(511)), "<cparam 'h' (511)>")
-+        self.assertEqual(repr(c_ushort.from_param(511)), "<cparam 'H' (511)>")
-+        self.assertRegex(repr(c_int.from_param(20000)), r"^<cparam '[li]' \(20000\)>$")
-+        self.assertRegex(repr(c_uint.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$")
-+        self.assertRegex(repr(c_long.from_param(20000)), r"^<cparam '[li]' \(20000\)>$")
-+        self.assertRegex(repr(c_ulong.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$")
-+        self.assertRegex(repr(c_longlong.from_param(20000)), r"^<cparam '[liq]' \(20000\)>$")
-+        self.assertRegex(repr(c_ulonglong.from_param(20000)), r"^<cparam '[LIQ]' \(20000\)>$")
-+        self.assertEqual(repr(c_float.from_param(1.5)), "<cparam 'f' (1.5)>")
-+        self.assertEqual(repr(c_double.from_param(1.5)), "<cparam 'd' (1.5)>")
-+        self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>")
-+        self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^<cparam ('d' \(1.5\)|'g' at 0x[A-Fa-f0-9]+)>$")
-+        self.assertRegex(repr(c_char_p.from_param(b'hihi')), "^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$")
-+        self.assertRegex(repr(c_wchar_p.from_param('hihi')), "^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$")
-+        self.assertRegex(repr(c_void_p.from_param(0x12)), r"^<cparam 'P' \(0x0*12\)>$")
-+
- ################################################################
- 
- if __name__ == '__main__':
-#diff --git a/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-#new file mode 100644
-#index 0000000000000..7df65a156feab
-#--- /dev/null
-#+++ b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst
-#@@ -0,0 +1,2 @@
-#+Avoid static buffers when computing the repr of :class:`ctypes.c_double` and
-#+:class:`ctypes.c_longdouble` values.
-diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
-index a9b8675cd951b..de75918d49f37 100644
---- a/Modules/_ctypes/callproc.c
-+++ b/Modules/_ctypes/callproc.c
-@@ -484,58 +484,47 @@ is_literal_char(unsigned char c)
- static PyObject *
- PyCArg_repr(PyCArgObject *self)
- {
--    char buffer[256];
-     switch(self->tag) {
-     case 'b':
-     case 'B':
--        sprintf(buffer, "<cparam '%c' (%d)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%d)>",
-             self->tag, self->value.b);
--        break;
-     case 'h':
-     case 'H':
--        sprintf(buffer, "<cparam '%c' (%d)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%d)>",
-             self->tag, self->value.h);
--        break;
-     case 'i':
-     case 'I':
--        sprintf(buffer, "<cparam '%c' (%d)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%d)>",
-             self->tag, self->value.i);
--        break;
-     case 'l':
-     case 'L':
--        sprintf(buffer, "<cparam '%c' (%ld)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%ld)>",
-             self->tag, self->value.l);
--        break;
- 
-     case 'q':
-     case 'Q':
--        sprintf(buffer,
--#ifdef MS_WIN32
--            "<cparam '%c' (%I64d)>",
--#else
--            "<cparam '%c' (%lld)>",
--#endif
-+        return PyUnicode_FromFormat("<cparam '%c' (%lld)>",
-             self->tag, self->value.q);
--        break;
-     case 'd':
--        sprintf(buffer, "<cparam '%c' (%f)>",
--            self->tag, self->value.d);
--        break;
--    case 'f':
--        sprintf(buffer, "<cparam '%c' (%f)>",
--            self->tag, self->value.f);
--        break;
--
-+    case 'f': {
-+        PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d);
-+        if (f == NULL) {
-+            return NULL;
-+        }
-+        PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f);
-+        Py_DECREF(f);
-+        return result;
-+    }
-     case 'c':
-         if (is_literal_char((unsigned char)self->value.c)) {
--            sprintf(buffer, "<cparam '%c' ('%c')>",
-+            return PyUnicode_FromFormat("<cparam '%c' ('%c')>",
-                 self->tag, self->value.c);
-         }
-         else {
--            sprintf(buffer, "<cparam '%c' ('\\x%02x')>",
-+            return PyUnicode_FromFormat("<cparam '%c' ('\\x%02x')>",
-                 self->tag, (unsigned char)self->value.c);
-         }
--        break;
- 
- /* Hm, are these 'z' and 'Z' codes useful at all?
-    Shouldn't they be replaced by the functionality of c_string
-@@ -544,22 +533,20 @@ PyCArg_repr(PyCArgObject *self)
-     case 'z':
-     case 'Z':
-     case 'P':
--        sprintf(buffer, "<cparam '%c' (%p)>",
-+        return PyUnicode_FromFormat("<cparam '%c' (%p)>",
-             self->tag, self->value.p);
-         break;
- 
-     default:
-         if (is_literal_char((unsigned char)self->tag)) {
--            sprintf(buffer, "<cparam '%c' at %p>",
-+            return PyUnicode_FromFormat("<cparam '%c' at %p>",
-                 (unsigned char)self->tag, (void *)self);
-         }
-         else {
--            sprintf(buffer, "<cparam 0x%02x at %p>",
-+            return PyUnicode_FromFormat("<cparam 0x%02x at %p>",
-                 (unsigned char)self->tag, (void *)self);
-         }
--        break;
-     }
--    return PyUnicode_FromString(buffer);
- }
- 
- static PyMemberDef PyCArgType_members[] = {
diff --git a/gnu/packages/patches/python-3.8-fix-tests.patch b/gnu/packages/patches/python-3.8-fix-tests.patch
deleted file mode 100644
index 4fbdd444c7..0000000000
--- a/gnu/packages/patches/python-3.8-fix-tests.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
-index 1474624..887f8ee 100644
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -3801,6 +3801,7 @@ class _TestSharedMemory(BaseTestCase):
-         sms.close()
-
-     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
-         # bpo-36368: protect SharedMemoryManager server process from
-         # KeyboardInterrupt signals.
-diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
-index d41e94b..a1c15e7 100644
---- a/Lib/test/test_signal.py
-+++ b/Lib/test/test_signal.py
-@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
-         self.assertLess(len(s), signal.NSIG)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers exit via SIGINT."""
-         process = subprocess.run(
-@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
-             signal.signal(7, handler)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
-         # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
-@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
-
- class RaiseSignalTest(unittest.TestCase):
-
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_sigint(self):
-         with self.assertRaises(KeyboardInterrupt):
-             signal.raise_signal(signal.SIGINT)
---
-2.23.0
diff --git a/gnu/packages/patches/python-3.9-fix-tests.patch b/gnu/packages/patches/python-3.9-fix-tests.patch
deleted file mode 100644
index dc6b8c4cc8..0000000000
--- a/gnu/packages/patches/python-3.9-fix-tests.patch
+++ /dev/null
@@ -1,370 +0,0 @@
-See the discussion about the issues fixed here at:
-http://bugs.python.org/issue20868 .
-
-diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
---- a/Lib/ctypes/test/test_callbacks.py
-+++ b/Lib/ctypes/test/test_callbacks.py
-@@ -3,6 +3,7 @@ import unittest
- from ctypes import *
- from ctypes.test import need_symbol
- import _ctypes_test
-+import platform
-
- class Callbacks(unittest.TestCase):
-     functype = CFUNCTYPE
-@@ -176,6 +177,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
-
-         self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
-
-+    @unittest.skipIf(platform.machine() in ['mips64'],
-+                     "This test fails on this platform")
-     def test_issue_8959_a(self):
-         from ctypes.util import find_library
-         libc_path = find_library("c")
-diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
---- a/Lib/ctypes/test/test_libc.py
-+++ b/Lib/ctypes/test/test_libc.py
-@@ -2,6 +2,7 @@ import unittest
-
- from ctypes import *
- import _ctypes_test
-+import platform
-
- lib = CDLL(_ctypes_test.__file__)
-
-@@ -17,6 +18,8 @@ class LibTest(unittest.TestCase):
-         import math
-         self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))
-
-+    @unittest.skipIf(platform.machine() in ['mips64'],
-+                     "This test fails on this platform")
-     def test_qsort(self):
-         comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
-         lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
-diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
---- a/Lib/distutils/tests/test_archive_util.py
-+++ b/Lib/distutils/tests/test_archive_util.py
-@@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
-         self.assertEqual(os.path.basename(res), 'archive.tar.xz')
-         self.assertEqual(self._tarinfo(res), self._created_files)
-
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_archive_owner_group(self):
-         # testing make_archive with owner and group, with various combinations
-         # this works even if there's not gid/uid support
-@@ -362,6 +363,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
-
-     @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
-     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_tarfile_root_owner(self):
-         tmpdir =  self._create_files()
-         base_name = os.path.join(self.mkdtemp(), 'archive')
-diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
---- a/Lib/distutils/tests/test_sdist.py
-+++ b/Lib/distutils/tests/test_sdist.py
-@@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
-                      "The tar command is not found")
-     @unittest.skipIf(find_executable('gzip') is None,
-                      "The gzip command is not found")
-+    @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix")
-     def test_make_distribution_owner_group(self):
-         # now building a sdist
-         dist, cmd = self.get_cmd()
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -1473,6 +1473,7 @@ class _TestCondition(BaseTestCase):
-         if pid is not None:
-             os.kill(pid, signal.SIGINT)
-
-+    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
-     def test_wait_result(self):
-         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
-             pid = os.getpid()
-diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
---- a/Lib/test/test_asyncio/test_base_events.py
-+++ b/Lib/test/test_asyncio/test_base_events.py
-@@ -1323,6 +1323,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
-         self._test_create_connection_ip_addr(m_socket, False)
-
-     @patch_socket
-+    @unittest.skipUnless(support.is_resource_enabled('network'),
-+                         'network is not enabled')
-     def test_create_connection_service_name(self, m_socket):
-         m_socket.getaddrinfo = socket.getaddrinfo
-         sock = m_socket.socket.return_value
-diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
---- a/Lib/test/test_generators.py
-+++ b/Lib/test/test_generators.py
-@@ -34,6 +34,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
-         else:
-             return "FAILED"
-
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
-     def test_raise_and_yield_from(self):
-         gen = self.generator1()
-         gen.send(None)
-diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
---- a/Lib/test/test_pathlib.py
-+++ b/Lib/test/test_pathlib.py
-@@ -2134,8 +2134,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
-         self.assertEqual(given, expect)
-         self.assertEqual(set(p.rglob("FILEd*")), set())
-
--    @unittest.skipUnless(hasattr(pwd, 'getpwall'),
--                         'pwd module does not expose getpwall()')
-+    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
-     def test_expanduser(self):
-         P = self.cls
-         support.import_module('pwd')
-diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
---- a/Lib/test/test_pdb.py
-+++ b/Lib/test/test_pdb.py
-@@ -1150,11 +1150,11 @@ def test_pdb_issue_20766():
-     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
-     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
-     (Pdb) continue
--    pdb 1: <built-in function default_int_handler>
-+    pdb 1: Handlers.SIG_IGN
-     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(5)test_function()
-     -> sess.set_trace(sys._getframe())
-     (Pdb) continue
--    pdb 2: <built-in function default_int_handler>
-+    pdb 2: Handlers.SIG_IGN
-     """
-
-
-diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
---- a/Lib/test/test_regrtest.py
-+++ b/Lib/test/test_regrtest.py
-@@ -762,6 +762,7 @@ class ArgsTestCase(BaseTestCase):
-         output = self.run_tests('--fromfile', filename)
-         self.check_executed_tests(output, tests)
-
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
-     def test_interrupted(self):
-         code = TEST_INTERRUPTED
-         test = self.create_test('sigint', code=code)
-@@ -779,6 +780,7 @@ class ArgsTestCase(BaseTestCase):
-                  % (self.TESTNAME_REGEX, len(tests)))
-         self.check_line(output, regex)
-
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
-     def test_slowest_interrupted(self):
-         # Issue #25373: test --slowest with an interrupted test
-         code = TEST_INTERRUPTED
-diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
---- a/Lib/test/test_resource.py
-+++ b/Lib/test/test_resource.py
-@@ -145,6 +145,7 @@ class ResourceTest(unittest.TestCase):
-
-     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
-     @support.requires_linux_version(2, 6, 36)
-+    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
-     def test_prlimit(self):
-         self.assertRaises(TypeError, resource.prlimit)
-         self.assertRaises(ProcessLookupError, resource.prlimit,
-diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
---- a/Lib/test/test_shutil.py
-+++ b/Lib/test/test_shutil.py
-@@ -1428,6 +1428,7 @@ class TestArchives(BaseTest, 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
-@@ -1456,6 +1457,7 @@ class TestArchives(BaseTest, 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_unicodedata.py b/Lib/test/test_unicodedata.py
---- a/Lib/test/test_unicodedata.py
-+++ b/Lib/test/test_unicodedata.py
-@@ -320,6 +320,7 @@ class NormalizationTest(unittest.TestCase):
-         data = [int(x, 16) for x in data.split(" ")]
-         return "".join([chr(x) for x in data])
-
-+    @unittest.skipIf(True, 'Network is not available in the Guix build environment')
-     def test_normalization(self):
-         TESTDATAFILE = "NormalizationTest.txt"
-         TESTDATAURL = f"http://www.pythontest.net/unicode/{unicodedata.unidata_version}/{TESTDATAFILE}"
-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.HOSTv4, '10.0.0.1', '255.255.255.255']:
-             self.assertEqual(socket.gethostbyname(addr), addr)
-@@ -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')
-
-
--@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
--                     'root privileges required')
-+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
- class TestSpwdRoot(unittest.TestCase):
-
-     def test_getspall(self):
-@@ -56,8 +55,7 @@ class TestSpwdRoot(unittest.TestCase):
-             self.assertRaises(TypeError, spwd.getspnam, bytes_name)
-
-
--@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
--                     'non-root user required')
-+@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
- class TestSpwdNonRoot(unittest.TestCase):
-
-     def test_getspnam_exception(self):
-diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
---- a/Lib/test/test_tarfile.py
-+++ b/Lib/test/test_tarfile.py
-@@ -2509,9 +2509,12 @@ def root_is_uid_gid_0():
-         import pwd, grp
-     except ImportError:
-         return False
--    if pwd.getpwuid(0)[0] != 'root':
--        return False
--    if grp.getgrgid(0)[0] != 'root':
-+    try:
-+        if pwd.getpwuid(0)[0] != 'root':
-+            return False
-+        if grp.getgrgid(0)[0] != 'root':
-+            return False
-+    except KeyError:
-         return False
-     return True
-
-diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
---- a/Lib/test/test_threading.py
-+++ b/Lib/test/test_threading.py
-@@ -1249,6 +1249,7 @@ class MiscTestCase(unittest.TestCase):
-
-
- class InterruptMainTests(unittest.TestCase):
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
-     def test_interrupt_main_subthread(self):
-         # Calling start_new_thread with a function that executes interrupt_main
-         # should raise KeyboardInterrupt upon completion.
-@@ -1260,6 +1261,8 @@ class InterruptMainTests(unittest.TestCase):
-             t.join()
-         t.join()
-
-+
-+    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
-     def test_interrupt_main_mainthread(self):
-         # Make sure that if interrupt_main is called in main thread that
-         # KeyboardInterrupt is raised instantly.
-diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
---- a/Tools/scripts/run_tests.py
-+++ b/Tools/scripts/run_tests.py
-@@ -39,7 +39,7 @@ def main(regrtest_args):
-     if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
-         args.extend(['-j', '0'])  # Use all CPU cores
-     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
--        args.extend(['-u', 'all,-largefile,-audio,-gui'])
-+        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
-     args.extend(regrtest_args)
-     print(' '.join(args))
-     if sys.platform == 'win32':
-diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
-index 1474624..887f8ee 100644
---- a/Lib/test/_test_multiprocessing.py
-+++ b/Lib/test/_test_multiprocessing.py
-@@ -3801,6 +3801,7 @@ class _TestSharedMemory(BaseTestCase):
-         sms.close()
-
-     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
-         # bpo-36368: protect SharedMemoryManager server process from
-         # KeyboardInterrupt signals.
-diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
-index d41e94b..a1c15e7 100644
---- a/Lib/test/test_signal.py
-+++ b/Lib/test/test_signal.py
-@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
-         self.assertLess(len(s), signal.NSIG)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers exit via SIGINT."""
-         process = subprocess.run(
-@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
-             signal.signal(7, handler)
-
-     @unittest.skipUnless(sys.executable, "sys.executable required.")
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_keyboard_interrupt_exit_code(self):
-         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
-         # We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
-@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
-
- class RaiseSignalTest(unittest.TestCase):
-
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_sigint(self):
-         with self.assertRaises(KeyboardInterrupt):
-             signal.raise_signal(signal.SIGINT)
-@@ -1279,6 +1279,7 @@ class PidfdSignalTest(unittest.TestCase):
-         hasattr(signal, "pidfd_send_signal"),
-         "pidfd support not built in",
-     )
-+    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
-     def test_pidfd_send_signal(self):
-         with self.assertRaises(OSError) as cm:
-             signal.pidfd_send_signal(0, signal.SIGINT)
-diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
-index 92ac184..49eec2c 100644
---- a/Lib/ctypes/test/test_find.py
-+++ b/Lib/ctypes/test/test_find.py
-@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase):
-         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
-             self.assertNotEqual(find_library('c'), None)
-
-+    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
-     def test_find_library_with_ld(self):
-         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
-              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
diff --git a/gnu/packages/patches/python-babel-fix-parse-future-test.patch b/gnu/packages/patches/python-babel-fix-parse-future-test.patch
new file mode 100644
index 0000000000..8a90166ec5
--- /dev/null
+++ b/gnu/packages/patches/python-babel-fix-parse-future-test.patch
@@ -0,0 +1,68 @@
+From 7bdaa28a55e8d8228d5434effa4b1473ab7b3669 Mon Sep 17 00:00:00 2001
+From: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
+Date: Tue, 5 May 2020 08:05:56 +0000
+Subject: [PATCH] fix tests when using Python 3.9a6
+
+In Python 3.9a6 integer values for future flags were changed to prevent
+collision with compiler flags. We need to retrieve these at runtime so
+the test suite works with Python <= 3.8 as well as Python 3.9.
+---
+ tests/test_util.py | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_util.py b/tests/test_util.py
+index a6a4450c..b9343aaa 100644
+--- a/tests/test_util.py
++++ b/tests/test_util.py
+@@ -11,6 +11,7 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://babel.edgewall.org/log/.
+ 
++import __future__
+ import unittest
+ 
+ import pytest
+@@ -20,6 +21,12 @@
+ from babel.util import parse_future_flags
+ 
+ 
++class _FF:
++    division         = __future__.division.compiler_flag
++    print_function   = __future__.print_function.compiler_flag
++    with_statement   = __future__.with_statement.compiler_flag
++    unicode_literals = __future__.unicode_literals.compiler_flag
++
+ def test_distinct():
+     assert list(util.distinct([1, 2, 1, 3, 4, 4])) == [1, 2, 3, 4]
+     assert list(util.distinct('foobar')) == ['f', 'o', 'b', 'a', 'r']
+@@ -70,25 +77,25 @@ def test_parse_encoding_non_ascii():
+ from __future__ import print_function,
+     division, with_statement,
+     unicode_literals
+-''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
++''', _FF.print_function | _FF.division | _FF.with_statement | _FF.unicode_literals),
+     ('''
+ from __future__ import print_function, division
+ print('hello')
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+     ('''
+ from __future__ import print_function, division, unknown,,,,,
+ print 'hello'
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+     ('''
+ from __future__ import (
+     print_function,
+     division)
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+     ('''
+ from __future__ import \\
+     print_function, \\
+     division
+-''', 0x10000 | 0x2000),
++''', _FF.print_function | _FF.division),
+ ])
+ def test_parse_future(source, result):
+     fp = BytesIO(source.encode('latin-1'))
diff --git a/gnu/packages/patches/python-chai-drop-python2.patch b/gnu/packages/patches/python-chai-drop-python2.patch
new file mode 100644
index 0000000000..0eb980e5db
--- /dev/null
+++ b/gnu/packages/patches/python-chai-drop-python2.patch
@@ -0,0 +1,32 @@
+Patch copied from Gentoo removing obsolete Python2 code.
+
+--- a/chai/chai.py
++++ b/chai/chai.py
+@@ -62,11 +62,6 @@
+             try:
+                 func(self, *args, **kwargs)
+             except UnexpectedCall as e:
+-                # if this is not python3, use python2 syntax
+-                if not hasattr(e, '__traceback__'):
+-                    from .python2 import reraise
+-                    reraise(
+-                        AssertionError, '\n\n' + str(e), sys.exc_info()[-1])
+                 exc = AssertionError('\n\n' + str(e))
+                 setattr(exc, '__traceback__', sys.exc_info()[-1])
+                 raise exc
+--- a/chai/python2.py
++++ b/chai/python2.py
+@@ -1,3 +0,0 @@
+-
+-def reraise(exc, msg, traceback):
+-    raise exc, msg, traceback
+--- a/chai.egg-info/SOURCES.txt
++++ b/chai.egg-info/SOURCES.txt
+@@ -10,7 +10,6 @@
+ chai/exception.py
+ chai/expectation.py
+ chai/mock.py
+-chai/python2.py
+ chai/spy.py
+ chai/stub.py
+ chai.egg-info/PKG-INFO
diff --git a/gnu/packages/patches/python-docopt-pytest6-compat.patch b/gnu/packages/patches/python-docopt-pytest6-compat.patch
new file mode 100644
index 0000000000..acd4955778
--- /dev/null
+++ b/gnu/packages/patches/python-docopt-pytest6-compat.patch
@@ -0,0 +1,29 @@
+https://sources.debian.org/data/main/d/docopt/0.6.2-3/debian/patches/pytest6
+
+From: Michael R. Crusoe <crusoe@debian.org>
+Subject: fix for pytest 6.x comptability
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979285
+
+--- docopt.orig/conftest.py
++++ docopt/conftest.py
+@@ -11,6 +11,8 @@
+ 
+ def pytest_collect_file(path, parent):
+     if path.ext == ".docopt" and path.basename.startswith("test"):
++        if hasattr(DocoptTestFile, "from_parent"):
++            return DocoptTestFile.from_parent(parent, fspath=path)
+         return DocoptTestFile(path, parent)
+ 
+ 
+@@ -41,7 +43,10 @@
+         for name, doc, cases in parse_test(raw):
+             name = self.fspath.purebasename
+             for case in cases:
+-                yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
++                if hasattr(DocoptTestItem, "from_parent"):
++                    yield DocoptTestItem.from_parent(self, name="%s(%d)" % (name, index), doc=doc, case=case)
++                else:
++                    yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
+                 index += 1
+ 
+ 
diff --git a/gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch b/gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch
new file mode 100644
index 0000000000..4ffe9b373d
--- /dev/null
+++ b/gnu/packages/patches/python-fixtures-remove-monkeypatch-test.patch
@@ -0,0 +1,59 @@
+https://sources.debian.org/data/main/p/python-fixtures/3.0.0-4/debian/patches/remove-broken-monkey-patch-test.patch
+
+The last release was May 2016. This can be removed when the next release happens.
+
+Description: Remove broken monkey patch tests
+Author: Thomas Goirand <zigo@debian.org>
+Bug-Debian: https://bugs.debian.org/973239
+Forwarded: no
+Last-Update: 2020-11-12
+
+--- python-fixtures-3.0.0.orig/fixtures/tests/_fixtures/test_monkeypatch.py
++++ python-fixtures-3.0.0/fixtures/tests/_fixtures/test_monkeypatch.py
+@@ -181,22 +181,6 @@ class TestMonkeyPatch(testtools.TestCase
+         self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+                 C, 'foo_cls')
+ 
+-    def test_patch_classmethod_with_classmethod(self):
+-        oldmethod = C.foo_cls
+-        oldmethod_inst = C().foo_cls
+-        fixture = MonkeyPatch(
+-            'fixtures.tests._fixtures.test_monkeypatch.C.foo_cls',
+-            D.bar_cls_args)
+-        with fixture:
+-            cls, target_class = C.foo_cls()
+-            self.expectThat(cls, Is(D))
+-            self.expectThat(target_class, Is(C))
+-            cls, target_class = C().foo_cls()
+-            self.expectThat(cls, Is(D))
+-            self.expectThat(target_class, Is(C))
+-        self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+-                C, 'foo_cls')
+-
+     def test_patch_classmethod_with_function(self):
+         oldmethod = C.foo_cls
+         oldmethod_inst = C().foo_cls
+@@ -212,23 +196,6 @@ class TestMonkeyPatch(testtools.TestCase
+         self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+                 C, 'foo_cls')
+ 
+-    def test_patch_classmethod_with_boundmethod(self):
+-        oldmethod = C.foo_cls
+-        oldmethod_inst = C().foo_cls
+-        d = D()
+-        fixture = MonkeyPatch(
+-            'fixtures.tests._fixtures.test_monkeypatch.C.foo_cls',
+-            d.bar_two_args)
+-        with fixture:
+-            slf, cls = C.foo_cls()
+-            self.expectThat(slf, Is(d))
+-            self.expectThat(cls, Is(C))
+-            slf, cls = C().foo_cls()
+-            self.expectThat(slf, Is(d))
+-            self.expectThat(cls, Is(C))
+-        self._check_restored_static_or_class_method(oldmethod, oldmethod_inst,
+-                C, 'foo_cls')
+-
+     def test_patch_function_with_staticmethod(self):
+         oldmethod = fake_no_args
+         fixture = MonkeyPatch(
diff --git a/gnu/packages/patches/python-random2-getrandbits-test.patch b/gnu/packages/patches/python-random2-getrandbits-test.patch
new file mode 100644
index 0000000000..4f6c56027a
--- /dev/null
+++ b/gnu/packages/patches/python-random2-getrandbits-test.patch
@@ -0,0 +1,23 @@
+From 1bac6355d9c65de847cc445d782c466778b94fbd Mon Sep 17 00:00:00 2001
+From: "Robert T. McGibbon" <rmcgibbo@gmail.com>
+Date: Sun, 9 May 2021 11:18:23 -0400
+Subject: [PATCH] Update tests for python3.9
+
+---
+ src/tests.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/tests.py b/src/tests.py
+index d918891..4f2c3de 100644
+--- a/src/tests.py
++++ b/src/tests.py
+@@ -448,7 +448,8 @@ def test_genrandbits(self):
+         self.assertRaises(TypeError, self.gen.getrandbits)
+         self.assertRaises(TypeError, self.gen.getrandbits, 'a')
+         self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+-        self.assertRaises(ValueError, self.gen.getrandbits, 0)
++        if sys.version_info < (3, 9):
++            self.assertRaises(ValueError, self.gen.getrandbits, 0)
+         self.assertRaises(ValueError, self.gen.getrandbits, -1)
+ 
+     def test_randbelow_logic(self, _log=log, int=int):
diff --git a/gnu/packages/patches/python-testtools.patch b/gnu/packages/patches/python-testtools.patch
deleted file mode 100644
index 42536e50f9..0000000000
--- a/gnu/packages/patches/python-testtools.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-https://github.com/testing-cabal/testtools/commit/29004731f9c480b7c44a9c2605513d50d372898f.patch
-Should be fixed in the next release
-
-From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
-Date: Thu, 17 May 2018 17:52:26 +0200
-Subject: [PATCH] Fix the tests on Python 3.7
-
-Exception's repr got changed not to include trailing comma
-
-Fixes https://github.com/testing-cabal/testtools/issues/270
----
- .travis.yml                                |  1 +
- testtools/tests/matchers/test_exception.py | 11 +++++++++--
- 2 files changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/.travis.yml b/.travis.yml
-index 7f1f4db7..784608e0 100644
---- a/.travis.yml
-+++ b/.travis.yml
-@@ -5,6 +5,7 @@ python:
-   - "3.4"
-   - "3.5"
-   - "3.6"
-+  - "3.7-dev"
-   - "pypy"
- 
- install:
-diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py
-index 6cd80af1..acd39252 100644
---- a/testtools/tests/matchers/test_exception.py
-+++ b/testtools/tests/matchers/test_exception.py
-@@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface):
-     matches_matches = [error_foo]
-     matches_mismatches = [error_bar, error_base_foo]
- 
-+    if sys.version_info >= (3, 7):
-+        # exception's repr has changed
-+        _e = ''
-+    else:
-+        _e = ','
-+
-     str_examples = [
--        ("MatchesException(Exception('foo',))",
-+        ("MatchesException(Exception('foo'%s))" % _e,
-          MatchesException(Exception('foo')))
-         ]
-     describe_examples = [
-         ("%r is not a %r" % (Exception, ValueError),
-          error_base_foo,
-          MatchesException(ValueError("foo"))),
--        ("ValueError('bar',) has different arguments to ValueError('foo',).",
-+        ("ValueError('bar'%s) has different arguments to ValueError('foo'%s)."
-+         % (_e, _e),
-          error_bar,
-          MatchesException(ValueError("foo"))),
-         ]
diff --git a/gnu/packages/patches/python-typing-inspect-fix.patch b/gnu/packages/patches/python-typing-inspect-fix.patch
new file mode 100644
index 0000000000..e6e28981b7
--- /dev/null
+++ b/gnu/packages/patches/python-typing-inspect-fix.patch
@@ -0,0 +1,38 @@
+From 16919e21936179e53df2f376c8b59b5fc44bd2dd Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Fri, 15 Jan 2021 09:22:52 -0500
+Subject: [PATCH] Fix for Python 3.9+.
+
+Fixes <https://github.com/ilevkivskyi/typing_inspect/issues/60>.
+
+Based on an idea in
+https://github.com/ilevkivskyi/typing_inspect/issues/60#issuecomment-683187584.
+---
+ typing_inspect.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/typing_inspect.py b/typing_inspect.py
+index 1ca68ed..31d05ee 100644
+--- a/typing_inspect.py
++++ b/typing_inspect.py
+@@ -21,7 +21,7 @@ LEGACY_TYPING = False
+ 
+ if NEW_TYPING:
+     from typing import (
+-        Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, ForwardRef
++        Generic, Callable, Union, TypeVar, ClassVar, Tuple, _GenericAlias, _SpecialGenericAlias, ForwardRef
+     )
+     from typing_extensions import Literal
+ else:
+@@ -75,7 +75,7 @@ def is_generic_type(tp):
+     """
+     if NEW_TYPING:
+         return (isinstance(tp, type) and issubclass(tp, Generic) or
+-                isinstance(tp, _GenericAlias) and
++                (isinstance(tp, _GenericAlias) or isinstance(tp, _SpecialGenericAlias)) and
+                 tp.__origin__ not in (Union, tuple, ClassVar, collections.abc.Callable))
+     return (isinstance(tp, GenericMeta) and not
+             isinstance(tp, (CallableMeta, TupleMeta)))
+-- 
+2.29.2
+
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch b/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch
new file mode 100644
index 0000000000..ddaf8e2849
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch
@@ -0,0 +1,54 @@
+Fix build with Bison 3.7
+
+https://bugs.gentoo.org/736499
+
+Patch copied from upstream source repository:
+
+https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31
+
+From d92b11fea65364fefa700249bd3340e0cd4c5b31 Mon Sep 17 00:00:00 2001
+From: Dmitry Shachnev <mitya57@gmail.com>
+Date: Tue, 4 Aug 2020 21:04:06 +0300
+Subject: [PATCH] Let Bison generate the header directly, to fix build with
+ Bison 3.7
+
+Starting with Bison 3.7, the generated C++ file #include's the header
+by default, instead of duplicating it. So we should not delete it.
+
+Remove the code to add #ifdef guards to the header, since Bison adds
+them itself since version 2.6.3.
+---
+ Source/WebCore/css/makegrammar.pl | 21 +--------------------
+ 1 file changed, 1 insertion(+), 20 deletions(-)
+
+diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl
+index 5d63b08102eb5..9435701c70612 100644
+--- a/Source/WebCore/css/makegrammar.pl
++++ b/Source/WebCore/css/makegrammar.pl
+@@ -73,25 +73,6 @@
+ }
+ 
+ my $fileBase = File::Spec->join($outputDir, $filename);
+-my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
++my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
+ push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives.
+ system(@bisonCommand) == 0 or die;
+-
+-open HEADER, ">$fileBase.h" or die;
+-print HEADER << "EOF";
+-#ifndef CSSGRAMMAR_H
+-#define CSSGRAMMAR_H
+-EOF
+-
+-open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die;
+-while (<HPP>) {
+-    print HEADER;
+-}
+-close HPP;
+-
+-print HEADER "#endif\n";
+-close HEADER;
+-
+-unlink("$fileBase.cpp.h");
+-unlink("$fileBase.hpp");
+-
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch b/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch
new file mode 100644
index 0000000000..63840f4bbc
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch
@@ -0,0 +1,21 @@
+Fix building with glib 2.68:
+
+https://github.com/qtwebkit/qtwebkit/issues/1057
+
+Patch copied from upstream pull request:
+
+https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b
+
+diff -aurN qtwebkit-5.212.0-alpha4/Source/WTF/wtf/glib/GRefPtr.h qtwebkit-5.212.0-alpha4-mod/Source/WTF/wtf/glib/GRefPtr.h
+--- qtwebkit-5.212.0-alpha4/Source/WTF/wtf/glib/GRefPtr.h	2020-03-04 18:16:37.000000000 +0100
++++ qtwebkit-5.212.0-alpha4-mod/Source/WTF/wtf/glib/GRefPtr.h	2021-04-05 06:58:44.763328636 +0200
+@@ -29,9 +29,6 @@
+ #include <wtf/RefPtr.h>
+ #include <algorithm>
+ 
+-extern "C" void g_object_unref(gpointer);
+-extern "C" gpointer g_object_ref_sink(gpointer);
+-
+ namespace WTF {
+ 
+ enum GRefPtrAdoptType { GRefPtrAdopt };
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch b/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch
new file mode 100644
index 0000000000..acbfc4c4c8
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch
@@ -0,0 +1,152 @@
+Fix building with ICU > 68.
+
+https://bugs.gentoo.org/753260
+
+Patch adapted from Gentoo:
+
+https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=335f29d266c5b169ff1e781f9851a3a203f3198c
+
+From 335f29d266c5b169ff1e781f9851a3a203f3198c Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Fri, 6 Nov 2020 09:22:15 +0100
+Subject: dev-qt/qtwebkit: Fix build with ICU-68
+
+Thanks-to: Lars Wendler <polynomial-c@gentoo.org>
+Closes: https://bugs.gentoo.org/753260
+Package-Manager: Portage-3.0.9, Repoman-3.0.2
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ .../qtwebkit-5.212.0_pre20200309-icu-68.patch      | 120 +++++++++++++++++++++
+ 1 file changed, 120 insertions(+)
+ create mode 100644 dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-icu-68.patch
+
+(limited to 'dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-icu-68.patch')
+
+diff --git a/Source/WebCore/platform/text/TextCodecICU.cpp b/Source/WebCore/platform/text/TextCodecICU.cpp
+index dd6ff06..e0f4bd7 100644
+--- a/Source/WebCore/platform/text/TextCodecICU.cpp
++++ b/Source/WebCore/platform/text/TextCodecICU.cpp
+@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
+     m_converterICU = ucnv_open(m_canonicalConverterName, &err);
+     ASSERT(U_SUCCESS(err));
+     if (m_converterICU)
+-        ucnv_setFallback(m_converterICU, TRUE);
++        ucnv_setFallback(m_converterICU, true);
+ }
+ 
+ int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
+diff --git a/Source/WebCore/platform/text/icu/UTextProvider.h b/Source/WebCore/platform/text/icu/UTextProvider.h
+index c254fc4..6d1e1cb 100644
+--- a/Source/WebCore/platform/text/icu/UTextProvider.h
++++ b/Source/WebCore/platform/text/icu/UTextProvider.h
+@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+             text->chunkOffset = text->chunkLength;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     } else {
+@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex <= 0 && !text->chunkNativeStart) {
+             text->chunkOffset = 0;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     }
+diff --git a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+index cd6852c..6a864b1 100644
+--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+         if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (index >= length && uText->chunkNativeLimit == length) {
+             // Off the end of the buffer, but we can't get it.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return FALSE;
++            return false;
+         }
+     } else {
+         if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (!index && !uText->chunkNativeStart) {
+             // Already at the beginning; can't go any farther.
+             uText->chunkOffset = 0;
+-            return FALSE;
++            return false;
+         }
+     }
+     
+@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+ 
+     uText->nativeIndexingLimit = uText->chunkLength;
+ 
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UText* text)
+ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBo
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+diff --git a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+index 7aaac48..9ae0d36 100644
+--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLength(UText* text)
+ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBoo
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch b/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch
new file mode 100644
index 0000000000..9f9674de33
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch
@@ -0,0 +1,35 @@
+Fix building with Python 3.9:
+
+https://github.com/qtwebkit/qtwebkit/issues/993
+
+Patch copied from upstream source repository:
+
+https://github.com/qtwebkit/qtwebkit/commit/78360c01c796b6260bf828bc9c8a0ef73c5132fd
+
+From 78360c01c796b6260bf828bc9c8a0ef73c5132fd Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <annulen@yandex.ru>
+Date: Wed, 3 Jun 2020 15:01:42 +0300
+Subject: [PATCH] Fix compilation with Python 3.9: avoid passing encoding to
+ json.load()
+
+In Python 2.7 UTF-8 is assumed by default, while in Python 3 this argument
+is not supported.
+
+Change-Id: Ic459d60a6b20bc1838d8771bc36ac41614fe61a9
+---
+ Source/JavaScriptCore/generate-bytecode-files | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/JavaScriptCore/generate-bytecode-files b/Source/JavaScriptCore/generate-bytecode-files
+index c5dab429c7b0f..af3431275ecf9 100644
+--- a/Source/JavaScriptCore/generate-bytecode-files
++++ b/Source/JavaScriptCore/generate-bytecode-files
+@@ -163,7 +163,7 @@ if __name__ == "__main__":
+         initBytecodesFile = openOrExit(initASMFileName, "w")
+ 
+     try:
+-        bytecodeSections = json.load(bytecodeFile, encoding = "utf-8")
++        bytecodeSections = json.load(bytecodeFile)
+     except:
+         print("Unexpected error parsing {0}: {1}".format(bytecodeJSONFile, sys.exc_info()))
+ 
diff --git a/gnu/packages/patches/range-v3-build-with-gcc10.patch b/gnu/packages/patches/range-v3-build-with-gcc10.patch
new file mode 100644
index 0000000000..a5d5b33523
--- /dev/null
+++ b/gnu/packages/patches/range-v3-build-with-gcc10.patch
@@ -0,0 +1,122 @@
+From 0487cca29e352e8f16bbd91fda38e76e39a0ed28 Mon Sep 17 00:00:00 2001
+From: Louis Dionne <ldionne.2@gmail.com>
+Date: Tue, 15 Jun 2021 14:40:01 -0400
+Subject: [PATCH] Work around broken integration with latest libc++. (#1635)
+
+* Work around broken integration with latest libc++.
+
+In newer versions of libc++, the base template of std::iterator_traits
+provides a member typedef called __primary_template which is an alias
+to the std::iterator_traits specialization itself. This fix works with
+both the old version of libc++ and the new one.
+
+Fixes issue #1633.
+
+* Fix is_std_iterator_traits_specialized_v on MSVC
+
+It used to pretend that std::iterator_traits<T*> is a user-defined
+specialization, which isn't the case. This is due to MSVC's
+iterator_traits<T*> specialization not posing as the base template.
+---
+ include/std/detail/associated_types.hpp | 22 +++++++++++-----
+ test/CMakeLists.txt                     |  1 +
+ test/bug1633.cpp                        | 34 +++++++++++++++++++++++++
+ 3 files changed, 51 insertions(+), 6 deletions(-)
+ create mode 100644 test/bug1633.cpp
+
+diff --git a/include/std/detail/associated_types.hpp b/include/std/detail/associated_types.hpp
+index b642166d4..449a3f91c 100644
+--- a/include/std/detail/associated_types.hpp
++++ b/include/std/detail/associated_types.hpp
+@@ -265,11 +265,22 @@ namespace ranges
+         template<typename I>
+         char is_std_iterator_traits_specialized_impl_(void *);
+ #elif defined(_LIBCPP_VERSION)
+-        template<typename I, bool B>
+-        char (
+-            &is_std_iterator_traits_specialized_impl_(std::__iterator_traits<I, B> *))[2];
++        // In older versions of libc++, the base template inherits from std::__iterator_traits<typename, bool>.
++        template<template<typename, bool> class IteratorTraitsBase, typename I, bool B>
++        char (&libcpp_iterator_traits_base_impl(IteratorTraitsBase<I, B> *))[2];
++        template<template<typename, bool> class IteratorTraitsBase, typename I>
++        char libcpp_iterator_traits_base_impl(void *);
++
++        // In newer versions, the base template has only one template parameter and provides the
++        // __primary_template typedef which aliases the iterator_traits specialization.
++        template<template<typename> class, typename I>
++        char (&libcpp_iterator_traits_base_impl(typename std::iterator_traits<I>::__primary_template *))[2];
++        template<template<typename> class, typename I>
++        char libcpp_iterator_traits_base_impl(void *);
++
+         template<typename I>
+-        char is_std_iterator_traits_specialized_impl_(void *);
++        auto is_std_iterator_traits_specialized_impl_(std::iterator_traits<I>* traits)
++            -> decltype(libcpp_iterator_traits_base_impl<std::__iterator_traits, I>(traits));
+ #elif defined(_MSVC_STL_VERSION)
+         template<typename I>
+         char (&is_std_iterator_traits_specialized_impl_(
+@@ -287,14 +298,13 @@ namespace ranges
+         RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v =
+             1 == sizeof(is_std_iterator_traits_specialized_impl_<I>(
+                      static_cast<std::iterator_traits<I> *>(nullptr)));
+-
++#endif
+         // The standard iterator_traits<T *> specialization(s) do not count
+         // as user-specialized. This will no longer be necessary in C++20.
+         // This helps with `T volatile*` and `void *`.
+         template<typename T>
+         RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v<T *> =
+             false;
+-#endif
+     } // namespace detail
+     /// \endcond
+ } // namespace ranges
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 889f314af..2c2b7c09c 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -19,3 +19,4 @@ rv3_add_test(test.bug474 bug474 bug474.cpp)
+ rv3_add_test(test.bug566 bug566 bug566.cpp)
+ rv3_add_test(test.bug1322 bug1322 bug1322.cpp)
+ rv3_add_test(test.bug1335 bug1335 bug1335.cpp)
++rv3_add_test(test.bug1633 bug1633 bug1633.cpp)
+diff --git a/test/bug1633.cpp b/test/bug1633.cpp
+new file mode 100644
+index 000000000..be52420ad
+--- /dev/null
++++ b/test/bug1633.cpp
+@@ -0,0 +1,34 @@
++// Range v3 library
++//
++//  Use, modification and distribution is subject to the
++//  Boost Software License, Version 1.0. (See accompanying
++//  file LICENSE_1_0.txt or copy at
++//  http://www.boost.org/LICENSE_1_0.txt)
++//
++// Project home: https://github.com/ericniebler/range-v3
++
++#include <cstddef>
++#include <iterator>
++#include <range/v3/iterator.hpp>
++
++struct X { };
++
++namespace std {
++    template<> struct iterator_traits<X> { };
++}
++
++struct Y {
++    using difference_type = std::ptrdiff_t;
++    using value_type = int;
++    using pointer = int*;
++    using reference = int&;
++    using iterator_category = std::forward_iterator_tag;
++};
++
++static_assert(ranges::detail::is_std_iterator_traits_specialized_v<X>, "");
++static_assert(!ranges::detail::is_std_iterator_traits_specialized_v<Y>, "");
++static_assert(!ranges::detail::is_std_iterator_traits_specialized_v<int*>, "");
++
++int main()
++{
++}
diff --git a/gnu/packages/patches/rust-1.19-mrustc.patch b/gnu/packages/patches/rust-1.19-mrustc.patch
deleted file mode 100644
index 261162172e..0000000000
--- a/gnu/packages/patches/rust-1.19-mrustc.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-See https://github.com/thepowersgang/mrustc/archive/v0.8.0.tar.gz
-
---- rustc-1.19.0-src-orig/src/libcore/intrinsics.rs
-+++ rustc-1.19.0-src/src/libcore/intrinsics.rs
-@@ -678,5 +678,9 @@
-     pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
- 
-+    /// Obtain the length of a slice pointer
-+    #[cfg(rust_compiler="mrustc")]
-+    pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize;
-+
-     /// Gets a static string slice containing the name of a type.
-     pub fn type_name<T: ?Sized>() -> &'static str;
-
---- rustc-1.19.0-src-orig/src/libcore/slice/mod.rs
-+++ rustc-1.19.0-src/src/libcore/slice/mod.rs
-@@ -413,6 +413,8 @@
-     #[inline]
-     fn len(&self) -> usize {
--        unsafe {
--            mem::transmute::<&[T], Repr<T>>(self).len
--        }
-+        #[cfg(not(rust_compiler="mrustc"))]
-+        let rv = unsafe { mem::transmute::<&[T], Repr<T>>(self).len };
-+        #[cfg(rust_compiler="mrustc")]
-+        let rv = unsafe { ::intrinsics::mrustc_slice_len(self) };
-+        rv
-     }
diff --git a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch b/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch
deleted file mode 100644
index a2bad55117..0000000000
--- a/gnu/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-GDB responds with some overly detailed lines - which makes the tests fail.
-Patch rust to accept those instead.
-See <https://github.com/rust-lang/rust/issues/54178>.
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs	2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-enum-with-different-disr-sizes.rs	2018-09-13 10:25:56.322513658 +0200
-@@ -19,36 +19,36 @@
- 
- // gdb-command:print eight_bytes1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Variant1, __0 = 100}, {RUST$ENUM$DISR = Variant1, __0 = 100}}
--// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum::Variant1(100)
-+// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100)
- 
- // gdb-command:print four_bytes1
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Variant1, __0 = 101}, {RUST$ENUM$DISR = Variant1, __0 = 101}}
--// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum::Variant1(101)
-+// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101)
- 
- // gdb-command:print two_bytes1
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Variant1, __0 = 102}, {RUST$ENUM$DISR = Variant1, __0 = 102}}
--// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum::Variant1(102)
-+// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102)
- 
- // gdb-command:print one_byte1
- // gdbg-check:$4 = {{RUST$ENUM$DISR = Variant1, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant1, __0 = 65 'A'}}
--// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum::Variant1(65)
-+// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65)
- 
- 
- // gdb-command:print eight_bytes2
- // gdbg-check:$5 = {{RUST$ENUM$DISR = Variant2, __0 = 100}, {RUST$ENUM$DISR = Variant2, __0 = 100}}
--// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum::Variant2(100)
-+// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100)
- 
- // gdb-command:print four_bytes2
- // gdbg-check:$6 = {{RUST$ENUM$DISR = Variant2, __0 = 101}, {RUST$ENUM$DISR = Variant2, __0 = 101}}
--// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum::Variant2(101)
-+// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101)
- 
- // gdb-command:print two_bytes2
- // gdbg-check:$7 = {{RUST$ENUM$DISR = Variant2, __0 = 102}, {RUST$ENUM$DISR = Variant2, __0 = 102}}
--// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum::Variant2(102)
-+// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102)
- 
- // gdb-command:print one_byte2
- // gdbg-check:$8 = {{RUST$ENUM$DISR = Variant2, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant2, __0 = 65 'A'}}
--// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum::Variant2(65)
-+// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65)
- 
- // gdb-command:continue
- 
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs	2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-struct-style-enum.rs	2018-09-13 10:27:43.353108111 +0200
-@@ -19,15 +19,15 @@
- 
- // gdb-command:print case1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}}
--// gdbr-check:$1 = generic_struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
-+// gdbr-check:$1 = generic_struct_style_enum::Regular<u16, u32, i64>::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
- 
- // gdb-command:print case2
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, [...]}}
--// gdbr-check:$2 = generic_struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153}
-+// gdbr-check:$2 = generic_struct_style_enum::Regular<i16, u32, i64>::Case2{a: 0, b: 286331153, c: 286331153}
- 
- // gdb-command:print case3
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}}
--// gdbr-check:$3 = generic_struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897}
-+// gdbr-check:$3 = generic_struct_style_enum::Regular<u16, i32, u64>::Case3{a: 0, b: 6438275382588823897}
- 
- // gdb-command:print univariant
- // gdbg-check:$4 = {{a = -1}}
-diff -ur orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs
---- orig/rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs	2018-09-13 10:24:33.775565159 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/generic-tuple-style-enum.rs	2018-09-13 10:28:26.328546298 +0200
-@@ -21,15 +21,15 @@
- 
- // gdb-command:print case1
- // gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, [...]}, {RUST$ENUM$DISR = Case1, [...]}}
--// gdbr-check:$1 = generic_tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868)
-+// gdbr-check:$1 = generic_tuple_style_enum::Regular<u16, u32, u64>::Case1(0, 31868, 31868, 31868, 31868)
- 
- // gdb-command:print case2
- // gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, [...]}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, [...]}}
--// gdbr-check:$2 = generic_tuple_style_enum::Regular::Case2(0, 286331153, 286331153)
-+// gdbr-check:$2 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case2(0, 286331153, 286331153)
- 
- // gdb-command:print case3
- // gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, [...]}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}}
--// gdbr-check:$3 = generic_tuple_style_enum::Regular::Case3(0, 6438275382588823897)
-+// gdbr-check:$3 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case3(0, 6438275382588823897)
- 
- // gdb-command:print univariant
- // gdbg-check:$4 = {{__0 = -1}}
---- orig/rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs	2018-09-13 10:24:33.783565071 +0200
-+++ rustc-1.25.0-src/src/test/debuginfo/nil-enum.rs	2018-10-26 18:19:20.404564587 +0200
-@@ -17,11 +17,11 @@
- 
- // gdb-command:print first
- // gdbg-check:$1 = {<No data fields>}
--// gdbr-check:$1 = <error reading variable>
-+// gdbr-check:$1 = nil_enum::ANilEnum
- 
- // gdb-command:print second
- // gdbg-check:$2 = {<No data fields>}
--// gdbr-check:$2 = <error reading variable>
-+// gdbr-check:$2 = nil_enum::AnotherNilEnum
- 
- #![allow(unused_variables)]
- #![feature(omit_gdb_pretty_printer_section)]
diff --git a/gnu/packages/patches/rust-1.30-gdb-llvm.patch b/gnu/packages/patches/rust-1.30-gdb-llvm.patch
deleted file mode 100644
index e8f0acc8b4..0000000000
--- a/gnu/packages/patches/rust-1.30-gdb-llvm.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-Tweak some gdb tests which were broken during LLVM upgrades.
-This has been subsequently fixed upstream in later rustc versions,
-but still needed to bootstrap some earlier versions of the compiler.
-
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/borrowed-c-style-enum.rs rustc-1.30.1-src/src/test/debuginfo/borrowed-c-style-enum.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/borrowed-c-style-enum.rs	2019-02-04 12:49:34.055483896 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/borrowed-c-style-enum.rs	2019-02-04 13:01:10.915950356 -0800
-@@ -18,15 +18,15 @@
- 
- // gdb-command:print *the_a_ref
- // gdbg-check:$1 = TheA
--// gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA
-+// gdbr-check:$1 = borrowed_c_style_enum::TheA
- 
- // gdb-command:print *the_b_ref
- // gdbg-check:$2 = TheB
--// gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB
-+// gdbr-check:$2 = borrowed_c_style_enum::TheB
- 
- // gdb-command:print *the_c_ref
- // gdbg-check:$3 = TheC
--// gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC
-+// gdbr-check:$3 = borrowed_c_style_enum::TheC
- 
- 
- // === LLDB TESTS ==================================================================================
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/c-style-enum-in-composite.rs rustc-1.30.1-src/src/test/debuginfo/c-style-enum-in-composite.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/c-style-enum-in-composite.rs	2019-02-04 12:49:34.051483727 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/c-style-enum-in-composite.rs	2019-02-04 13:02:00.981997525 -0800
-@@ -19,31 +19,31 @@
- 
- // gdb-command:print tuple_interior_padding
- // gdbg-check:$1 = {__0 = 0, __1 = OneHundred}
--// gdbr-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred)
-+// gdbr-check:$1 = (0, c_style_enum_in_composite::OneHundred)
- 
- // gdb-command:print tuple_padding_at_end
- // gdbg-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
--// gdbr-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2)
-+// gdbr-check:$2 = ((1, c_style_enum_in_composite::OneThousand), 2)
- 
- // gdb-command:print tuple_different_enums
- // gdbg-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna}
--// gdbr-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna)
-+// gdbr-check:$3 = (c_style_enum_in_composite::OneThousand, c_style_enum_in_composite::MountainView, c_style_enum_in_composite::OneMillion, c_style_enum_in_composite::Vienna)
- 
- // gdb-command:print padded_struct
- // gdbg-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5}
--// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5}
-+// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::OneMillion, c: 4, d: c_style_enum_in_composite::Toronto, e: 5}
- 
- // gdb-command:print packed_struct
- // gdbg-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8}
--// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8}
-+// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::OneHundred, c: 7, d: c_style_enum_in_composite::Vienna, e: 8}
- 
- // gdb-command:print non_padded_struct
- // gdbg-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto}
--// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto}
-+// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::OneMillion, b: c_style_enum_in_composite::MountainView, c: c_style_enum_in_composite::OneThousand, d: c_style_enum_in_composite::Toronto}
- 
- // gdb-command:print struct_with_drop
- // gdbg-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9}
--// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9)
-+// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::OneHundred, b: c_style_enum_in_composite::Vienna}, 9)
- 
- // === LLDB TESTS ==================================================================================
- 
-diff -r -u rustc-1.30.1-src-orig/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs rustc-1.30.1-src/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs
---- rustc-1.30.1-src-orig/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs	2019-02-04 12:49:34.043483393 -0800
-+++ rustc-1.30.1-src/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs	2019-02-04 13:02:17.954691634 -0800
-@@ -27,15 +27,15 @@
- 
- // gdb-command: print c_style_enum1
- // gdbg-check:$3 = CStyleEnumVar1
--// gdbr-check:$3 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar1
-+// gdbr-check:$3 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar1
- 
- // gdb-command: print c_style_enum2
- // gdbg-check:$4 = CStyleEnumVar2
--// gdbr-check:$4 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar2
-+// gdbr-check:$4 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar2
- 
- // gdb-command: print c_style_enum3
- // gdbg-check:$5 = CStyleEnumVar3
--// gdbr-check:$5 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar3
-+// gdbr-check:$5 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnumVar3
- 
- #![allow(dead_code, unused_variables)]
diff --git a/gnu/packages/patches/rust-1.45-linker-locale.patch b/gnu/packages/patches/rust-1.45-linker-locale.patch
deleted file mode 100644
index 40220e8e77..0000000000
--- a/gnu/packages/patches/rust-1.45-linker-locale.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Patch will be included upstream in 1.47: https://github.com/rust-lang/rust/pull/74416
-diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs
-index e64aafa599f..12575ac4358 100644
---- a/src/librustc_codegen_ssa/back/linker.rs
-+++ b/src/librustc_codegen_ssa/back/linker.rs
-@@ -28,7 +28,7 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor};
- pub fn disable_localization(linker: &mut Command) {
-     // No harm in setting both env vars simultaneously.
-     // Unix-style linkers.
--    linker.env("LC_ALL", "C");
-+    linker.env("LC_ALL", "en_US.UTF-8");
-     // MSVC's `link.exe`.
-     linker.env("VSLANG", "1033");
- }
diff --git a/gnu/packages/patches/rust-1.48-linker-locale.patch b/gnu/packages/patches/rust-1.48-linker-locale.patch
deleted file mode 100644
index d06dcbe682..0000000000
--- a/gnu/packages/patches/rust-1.48-linker-locale.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://github.com/rust-lang/rust/pull/74416
-diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
-index 3df956c465e..f45fee45be4 100644
---- a/compiler/rustc_codegen_ssa/src/back/linker.rs
-+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
-@@ -28,7 +28,7 @@
- pub fn disable_localization(linker: &mut Command) {
-     // No harm in setting both env vars simultaneously.
-     // Unix-style linkers.
--    linker.env("LC_ALL", "C");
-+    linker.env("LC_ALL", "en_US.UTF-8");
-     // MSVC's `link.exe`.
-     linker.env("VSLANG", "1033");
- }
diff --git a/gnu/packages/patches/rust-bootstrap-stage0-test.patch b/gnu/packages/patches/rust-bootstrap-stage0-test.patch
deleted file mode 100644
index e8484903e5..0000000000
--- a/gnu/packages/patches/rust-bootstrap-stage0-test.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Bootstrap tests failed with local stage0 cargo and rustc
-Backported changes from https://github.com/rust-lang/rust/pull/51977
-
-From 0834d9d771e912f51deca6c25699e44734624546 Mon Sep 17 00:00:00 2001
-From: Nikolai Merinov <nikolai.merinov@member.fsf.org>
-Date: Mon, 2 Jul 2018 01:45:35 +0500
-Subject: [PATCH] bootstrap: tests should use rustc from config.toml
-
-Tests should always use "rustc" and "cargo" from config.toml instead
-of assuming that stage0 binaries was downloaded to build directory.
----
- src/bootstrap/bootstrap.py | 2 ++
- src/bootstrap/config.rs    | 6 ++----
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
-index 487440becf..1701f7b83a 100644
---- a/src/bootstrap/bootstrap.py
-+++ b/src/bootstrap/bootstrap.py
-@@ -788,6 +788,8 @@ def bootstrap(help_triggered):
-     env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
-     env["BOOTSTRAP_PYTHON"] = sys.executable
-     env["BUILD_DIR"] = build.build_dir
-+    env["CARGO"] = build.cargo()
-+    env["RUSTC"] = build.rustc()
-     run(args, env=env, verbose=build.verbose)
- 
- 
-diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
-index 6dd6291be2..d1a0deb583 100644
---- a/src/bootstrap/config.rs
-+++ b/src/bootstrap/config.rs
-@@ -23,7 +23,6 @@ use std::cmp;
- 
- use num_cpus;
- use toml;
--use util::exe;
- use cache::{INTERNER, Interned};
- use flags::Flags;
- pub use flags::Subcommand;
-@@ -362,9 +361,8 @@ impl Config {
-         config.src = Config::path_from_python("SRC");
-         config.out = Config::path_from_python("BUILD_DIR");
- 
--        let stage0_root = config.out.join(&config.build).join("stage0/bin");
--        config.initial_rustc = stage0_root.join(exe("rustc", &config.build));
--        config.initial_cargo = stage0_root.join(exe("cargo", &config.build));
-+        config.initial_rustc = Config::path_from_python("RUSTC");
-+        config.initial_cargo = Config::path_from_python("CARGO");
- 
-         config
-     }
--- 
-2.17.1
-
diff --git a/gnu/packages/patches/syslinux-gcc10.patch b/gnu/packages/patches/syslinux-gcc10.patch
new file mode 100644
index 0000000000..8d3750b36e
--- /dev/null
+++ b/gnu/packages/patches/syslinux-gcc10.patch
@@ -0,0 +1,87 @@
+Taken from Gentoo and adapted to fix the build using GCC 10. See:
+https://bugs.gentoo.org/705730.
+
+--- a/mk/com32.mk
++++ b/mk/com32.mk
+@@ -47,6 +47,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+ 
+ ifeq ($(FWCLASS),EFI)
+ GCCOPT += -mno-red-zone
+--- a/mk/elf.mk
++++ b/mk/elf.mk
+@@ -42,6 +42,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+ 
+ com32 = $(topdir)/com32
+ core = $(topdir)/core
+--- a/mk/embedded.mk
++++ b/mk/embedded.mk
+@@ -51,6 +51,7 @@ GCCOPT    += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT    += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT    += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
+ GCCOPT    += $(call gcc_ok,-fvisibility=hidden)
++GCCOPT    += $(call gcc_ok,-fcommon)
+ 
+ LIBGCC    := $(shell $(CC) $(GCCOPT) --print-libgcc)
+ 
+--- a/mk/lib.mk
++++ b/mk/lib.mk
+@@ -28,6 +28,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+ 
+ INCLUDE	= -I$(SRC)
+ STRIP	= strip --strip-all -R .comment -R .note
+--- a/mk/efi.mk
++++ b/mk/efi.mk
+@@ -7,7 +7,7 @@ core = $(topdir)/core
+ # Set up architecture specifics; for cross compilation, set ARCH as apt
+ # gnuefi sets up architecture specifics in ia32 or x86_64 sub directories
+ # set up the LIBDIR and EFIINC for building for the appropriate architecture
+-GCCOPT := $(call gcc_ok,-fno-stack-protector,)
++GCCOPT := $(call gcc_ok,-fno-stack-protector,) $(call gcc_ok,-fcommon)
+ EFIINC = $(objdir)/include/efi
+ LIBDIR  = $(objdir)/lib
+ 
+diff --git a/dos/string.h b/dos/string.h
+index f648de2..a502132 100644
+--- a/dos/string.h
++++ b/dos/string.h
+@@ -5,12 +5,13 @@
+ #ifndef _STRING_H
+ #define _STRING_H
+ 
++#include <stddef.h>
++
+ /* Standard routines */
+ #define memcpy(a,b,c)	__builtin_memcpy(a,b,c)
+ #define memmove(a,b,c)	__builtin_memmove(a,b,c)
+ #define memset(a,b,c)	__builtin_memset(a,b,c)
+ #define strcpy(a,b)	__builtin_strcpy(a,b)
+-#define strlen(a)	__builtin_strlen(a)
+ 
+ /* This only returns true or false */
+ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
+@@ -21,6 +22,13 @@ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
+     return rv;
+ }
+ 
++static inline size_t strlen(const char *s)
++{
++    size_t len = 0;
++    while (*s++) len++;
++    return len;
++}
++
+ extern char *strchr(const char *s, int c);
+ 
+ #endif /* _STRING_H */
\ No newline at end of file
diff --git a/gnu/packages/patches/syslinux-strip-gnu-property.patch b/gnu/packages/patches/syslinux-strip-gnu-property.patch
new file mode 100644
index 0000000000..c656bbeedd
--- /dev/null
+++ b/gnu/packages/patches/syslinux-strip-gnu-property.patch
@@ -0,0 +1,31 @@
+Taken from: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=906414.
+
+Author: Lukas Schwaighofer <lukas@schwaighofer.name>
+Description: Strip the .note.gnu.property section for the mbr. This section is
+ added since binutils Debian version 2.31.1-2 and causes mbr.bin to grow in
+ size beyond what can fit into the master boot record.
+---
+ mbr/i386/mbr.ld   | 1 +
+ mbr/x86_64/mbr.ld | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
+index d14ba80..5368346 100644
+--- a/mbr/i386/mbr.ld
++++ b/mbr/i386/mbr.ld
+@@ -70,4 +70,5 @@ SECTIONS
+   .debug_typenames 0 : { *(.debug_typenames) }
+   .debug_varnames  0 : { *(.debug_varnames) }
+   /DISCARD/ : { *(.note.GNU-stack) }
++  /DISCARD/ : { *(.note.gnu.property) }
+ }
+diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
+index ae27d49..b8c0d89 100644
+--- a/mbr/x86_64/mbr.ld
++++ b/mbr/x86_64/mbr.ld
+@@ -69,4 +69,5 @@ SECTIONS
+   .debug_typenames 0 : { *(.debug_typenames) }
+   .debug_varnames  0 : { *(.debug_varnames) }
+   /DISCARD/ : { *(.note.GNU-stack) }
++  /DISCARD/ : { *(.note.gnu.property) }
+ }
diff --git a/gnu/packages/patches/tcl-fix-cross-compilation.patch b/gnu/packages/patches/tcl-fix-cross-compilation.patch
deleted file mode 100644
index 00c36b8f27..0000000000
--- a/gnu/packages/patches/tcl-fix-cross-compilation.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From f7fa48c4c75a1e748dc5071e709c0b62ff739eaa Mon Sep 17 00:00:00 2001
-From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
-Date: Mon, 9 Dec 2019 10:02:20 +0000
-Subject: [PATCH] Fix [abd4abedd2]: Failed to build tk 8.6.10 with cross
- compile
-
-Patch taken from upstream to fix cross-compilation. To be removed on next Tcl release.
-
----
- compat/strtol.c  | 2 +-
- compat/strtoul.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/compat/strtol.c b/compat/strtol.c
-index b7f69196ce2..811006a64c3 100644
---- a/compat/strtol.c
-+++ b/compat/strtol.c
-@@ -53,7 +53,7 @@ strtol(
-      */
- 
-     p = string;
--    while (TclIsSpaceProc(*p)) {
-+    while (isspace(UCHAR(*p))) {
- 	p += 1;
-     }
- 
-diff --git a/compat/strtoul.c b/compat/strtoul.c
-index e37eb05f823..15587f1da1a 100644
---- a/compat/strtoul.c
-+++ b/compat/strtoul.c
-@@ -74,7 +74,7 @@ strtoul(
-      */
- 
-     p = string;
--    while (TclIsSpaceProc(*p)) {
-+    while (isspace(UCHAR(*p))) {
- 	p += 1;
-     }
-     if (*p == '-') {
diff --git a/gnu/packages/patches/tcsh-fix-autotest.patch b/gnu/packages/patches/tcsh-fix-autotest.patch
index 200867cb9b..9f5790641b 100644
--- a/gnu/packages/patches/tcsh-fix-autotest.patch
+++ b/gnu/packages/patches/tcsh-fix-autotest.patch
@@ -63,17 +63,6 @@
  
  AT_DATA([comment2.csh],
  [[echo testing...@%:@\
---- tests/subst.at
-+++ tests/subst.at
-@@ -54,7 +54,7 @@ AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
- , [1
- ])
- 
--AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo "echo ~$(id -un)/foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
-+AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo "echo ~$(id -un)//foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
- 	  | wc -l | tr -d ' \t'], , [1
- ])
- 
 --- tests/variables.at
 +++ tests/variables.at
 @@ -666,7 +666,8 @@ set listflags=(-xA $cwd/args.sh)
diff --git a/gnu/packages/patches/texlive-bin-poppler-0.83.patch b/gnu/packages/patches/texlive-bin-poppler-0.83.patch
deleted file mode 100644
index 5e57e3efac..0000000000
--- a/gnu/packages/patches/texlive-bin-poppler-0.83.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-Fix build with Poppler 0.83 and later.
-
-Taken from Arch Linux, but adjusted to patch the versioned Poppler
-files, as upstream applies it after copying them in place.
-https://git.archlinux.org/svntogit/packages.git/tree/trunk/texlive-poppler-0.83.patch?h=packages/texlive-bin
-
-diff -ru texlive-source-orig/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc texlive-source/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
---- texlive-source-orig/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
-+++ texlive-source/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc
-@@ -723,7 +723,7 @@
- #endif
-     // initialize
-     if (!isInit) {
--        globalParams = new GlobalParams();
-+        globalParams.reset(new GlobalParams());
-         globalParams->setErrQuiet(false);
-         isInit = true;
-     }
-@@ -1108,6 +1108,5 @@
-             delete_document(p);
-         }
-         // see above for globalParams
--        delete globalParams;
-     }
- }
-diff -ru texlive-source-orig/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc texlive-source/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
---- texlive-source-orig/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
-+++ texlive-source/texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc
-@@ -79,7 +79,7 @@
-         exit(1);
-     }
-     fileName = new GString(argv[1]);
--    globalParams = new GlobalParams();
-+    globalParams.reset(new GlobalParams());
-     doc = new PDFDoc(fileName);
-     if (!doc->isOk()) {
-         fprintf(stderr, "Invalid PDF file\n");
-@@ -100,7 +100,7 @@
-     if (objnum == 0) {
-         srcStream = catalogDict.dictLookup("SourceObject");
-         static char const_SourceFile[] = "SourceFile";
--        if (!srcStream.isStream(const_SourceFile)) {
-+        if (!srcStream.isDict(const_SourceFile)) {
-             fprintf(stderr, "No SourceObject found\n");
-             exit(1);
-         }
-@@ -202,5 +202,4 @@
-         fprintf(stderr, "Cross-reference table extracted to %s\n", outname);
-     fclose(outfile);
-     delete doc;
--    delete globalParams;
- }
diff --git a/gnu/packages/patches/texlive-bin-poppler-0.86.patch b/gnu/packages/patches/texlive-bin-poppler-0.86.patch
deleted file mode 100644
index b1adca657b..0000000000
--- a/gnu/packages/patches/texlive-bin-poppler-0.86.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Fix build with Poppler 0.86 and later.
-
-Taken from Arch Linux, but adjusted to patch the versioned Poppler
-files, as upstream applies it after copying them in place.
-https://git.archlinux.org/svntogit/packages.git/tree/trunk/texlive-poppler-0.86.patch?h=packages/texlive-bin
-
---- a/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc	2020-03-03 21:11:35.102711802 +0000
-+++ b/texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc	2020-03-03 21:13:13.057420111 +0000
-@@ -757,7 +757,7 @@
-     if (page_name) {
-         // get page by name
-         GString name(page_name);
--        LinkDest *link = pdf_doc->doc->findDest(&name);
-+        LinkDest *link = pdf_doc->doc->findDest(&name).get();
-         if (link == 0 || !link->isOk())
-             pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
-         Ref ref = link->getPageRef();
diff --git a/gnu/packages/patches/vigra-python-compat.patch b/gnu/packages/patches/vigra-python-compat.patch
deleted file mode 100644
index 63c6abb326..0000000000
--- a/gnu/packages/patches/vigra-python-compat.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Fix build with Boost + Python 3.7.
-
-Taken from upstream:
-https://github.com/ukoethe/vigra/commit/a6fa62663c6a6b752ed0707e95f643e25867a0f9
-
-diff --git a/vigranumpy/src/core/vigranumpycore.cxx b/vigranumpy/src/core/vigranumpycore.cxx
-index ec38d3636..c81c6ae52 100644
---- a/vigranumpy/src/core/vigranumpycore.cxx
-+++ b/vigranumpy/src/core/vigranumpycore.cxx
-@@ -61,7 +61,7 @@ UInt32 pychecksum(python::str const & s)
- 	return checksum(data, size);
- #else
- 	Py_ssize_t size = 0;
--	char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
-+	const char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
- 	return checksum(data, size);
- #endif
- }
diff --git a/gnu/packages/patches/xygrib-fix-finding-data.patch b/gnu/packages/patches/xygrib-fix-finding-data.patch
new file mode 100644
index 0000000000..0b718b0eff
--- /dev/null
+++ b/gnu/packages/patches/xygrib-fix-finding-data.patch
@@ -0,0 +1,131 @@
+This is a backport of the commits in PR 235 (“Fixes for packaging on
+linux-like systems”), which was merged upstream:
+
+https://github.com/opengribs/XyGrib/pull/235
+
+It fixes finding resources such as icons, maps and translations installed in
+the data directory.  This patch has been merged upstream and can be removed
+with the next release.
+
+Sightly adapted to find openjpg-2.4.
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 64059ab65dae..00cc5d6aea6f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,6 +7,9 @@ set(VERSION_PATCH 6)
+ set(XYGRIB_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+ set(XYGRIB_VERSION_DATE "2019-07-05")
+ 
++option(GNU_PACKAGE "Install into GNU standard directories" OFF)
++option(GEN_TRANSLATIONS "Generate translations" ON)
++
+ set(CMAKE_VERBOSE_MAKEFILE ON)
+ 
+ # Find includes in corresponding build directories
+@@ -25,7 +28,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ set(CMAKE_CXX_STANDARD 11)
+ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ if(UNIX AND NOT APPLE)
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC")
++add_compile_options(-Wall -fPIC)
+ endif()
+ 
+ # Add support for address etc sanitizers, part 1/2 (other half after ADD_EXECUTABLE)
+@@ -108,17 +111,12 @@ find_path(OPENJPEG_INCLUDE_DIR
+      ~/Library/Frameworks/include
+      /Library/Frameworks/include
+      /usr/local/include
+-     /usr/local/include/openjpeg-2.3
+-     /usr/include/openjpeg-2.3
+-     /usr/local/include/openjpeg-2.1
+-     /usr/include/openjpeg-2.1
+-     /usr/local/include/openjpeg-2.2
+-     /usr/include/openjpeg-2.2
+      /usr/include
+      /sw/include # Fink
+      /opt/local/include # DarwinPorts
+      /opt/csw/include # Blastwave
+      /opt/include
++     PATH_SUFFIXES openjpeg-2.4 openjpeg-2.3 openjpeg-2.2 openjpeg-2.1
+      REQUIRED
+  )
+ include_directories(${OPENJPEG_INCLUDE_DIR})
+@@ -212,22 +210,24 @@ include_directories(${PNG_INCLUDE_DIR})
+ configure_file(cmake/Version.h.in ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/Version.h)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include)
+ 
+-if(APPLE)
+-set(PREFIX_BIN ${PROJECT_NAME})
+-set(PREFIX_PKGDATA ${PROJECT_NAME})
+-endif()
+-if(WIN32)
+-set(PREFIX_BIN ".")
+-set(PREFIX_PKGDATA ".")
+-endif()
+-if(UNIX AND NOT APPLE)
+-# This is not exactly a good idea on linux - the code should be changed so that the executable would go to /usr/local/bin and the data to /usr/local/share/XyGrib
+-set(PREFIX_BIN ${PROJECT_NAME})
+-set(PREFIX_PKGDATA ${PROJECT_NAME})
++if(GNU_PACKAGE)
++    include(GNUInstallDirs)
++    set(PREFIX_BIN ${CMAKE_INSTALL_FULL_BINDIR})
++    set(PREFIX_PKGDATA ${CMAKE_INSTALL_FULL_DATADIR}/openGribs/${PROJECT_NAME})
++else()
++    if(WIN32)
++        set(PREFIX_BIN ".")
++        set(PREFIX_PKGDATA ".")
++    else()
++        set(PREFIX_BIN ${PROJECT_NAME})
++        set(PREFIX_PKGDATA ${PROJECT_NAME})
++    endif()
+ endif()
+ 
+ add_subdirectory(src)
+-add_subdirectory(data/tr)
++if(GEN_TRANSLATIONS)
++    add_subdirectory(data/tr)
++endif()
+ 
+ # Installation
+ # macOS bundle parameters
+@@ -241,4 +241,14 @@ set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STR
+ set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${XYGRIB_VERSION}")
+ set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_COPYRIGHT "${PROJECT_NAME} Authors")
+ # Install data
+-install(DIRECTORY data DESTINATION ${PREFIX_PKGDATA})
++install(DIRECTORY data DESTINATION ${PREFIX_PKGDATA}
++        PATTERN "CMakeFiles" EXCLUDE
++        PATTERN "CMakeLists.txt" EXCLUDE
++        PATTERN "Makefile" EXCLUDE
++        PATTERN "cmake_install.cmake" EXCLUDE)
++if(GNU_PACKAGE)
++    install(FILES debian/xygrib.desktop
++            DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/applications)
++    install(FILES debian/xygrib.png
++            DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/pixmaps)
++endif()
+diff --git a/INSTALL.md b/INSTALL.md
+index 2c9d3ab4da03..1190cc780182 100644
+--- a/INSTALL.md
++++ b/INSTALL.md
+@@ -22,7 +22,19 @@ https://gihub.com/opengribs/XyGrib/releases or on https://opengribs.org in the d
+   - openSUSE Tumbleweed: `sudo zypper install gcc git cmake libqt5-qtbase-devel libpng-devel openjpeg2-devel libnova-devel libproj-devel zlib-devel libbz2-devel
+ 
+ ## Build and package
++### Options
+ 
++XyGrib has two CMake options
++- GNU_PACKAGE (DEFAULT: OFF)
++```
++Files will be installed in GNU standard installation directories such as prefix/bin and prefix/share.
++Packagers are recommended to test this option.
++```
++- GEN_TRANSLATION (DEFAULT: ON)
++```
++Create targets to generate translation files.
++Turning this off removes the need for qt-linguist, part of qttools qt5 submodule, during build.
++```
+ ### macOS
+ 
+ - Get the source
diff --git a/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch b/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch
deleted file mode 100644
index 48b5eb18eb..0000000000
--- a/gnu/packages/patches/zstd-CVE-2021-24031_CVE-2021-24032.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-Description: fix race condition allowing attackers to access destination file
- This commit addresses https://github.com/facebook/zstd/issues/2491.
- .
- Note that a downside of this solution is that it is global: `umask()` affects
- all file creation calls in the process. I believe this is safe since
- `fileio.c` functions should only ever be used in the zstd binary, and these
- are (almost) the only files ever created by zstd, and AIUI they're only
- created in a single thread. So we can get away with messing with global state.
- .
- Note that this doesn't change the permissions of files created by `dibio.c`.
- I'm not sure what those should be...
-Author: W. Felix Handte <w@felixhandte.com>
-Origin: upstream
-Bug: https://github.com/facebook/zstd/issues/2491
-Bug-Debian: https://github.com/facebook/zstd/issues/2491
-Applied-Upstream: commit:a774c5797399040af62db21d8a9b9769e005430e
-Reviewed-by: Étienne Mollier <etienne.mollier@mailoo.org>
-Last-Update: 2021-03-03
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/programs/fileio.c
-+++ b/programs/fileio.c
-@@ -606,11 +606,11 @@ FIO_openDstFile(FIO_prefs_t* const prefs
-             FIO_remove(dstFileName);
-     }   }
- 
--    {   FILE* const f = fopen( dstFileName, "wb" );
-+    {   const int old_umask = UTIL_umask(0177); /* u-x,go-rwx */
-+        FILE* const f = fopen( dstFileName, "wb" );
-+        UTIL_umask(old_umask);
-         if (f == NULL) {
-             DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
--        } else if(srcFileName != NULL && strcmp (srcFileName, stdinmark)) {
--            chmod(dstFileName, 00600);
-         }
-         return f;
-     }
---- a/programs/util.c
-+++ b/programs/util.c
-@@ -54,6 +54,15 @@ int UTIL_getFileStat(const char* infilen
-     return 1;
- }
- 
-+int UTIL_umask(int mode) {
-+#if PLATFORM_POSIX_VERSION > 0
-+    return umask(mode);
-+#else
-+    /* do nothing, fake return value */
-+    return mode;
-+#endif
-+}
-+
- int UTIL_setFileStat(const char *filename, stat_t *statbuf)
- {
-     int res = 0;
---- a/programs/util.h
-+++ b/programs/util.h
-@@ -136,6 +136,10 @@ int UTIL_isSameFile(const char* file1, c
- int UTIL_compareStr(const void *p1, const void *p2);
- int UTIL_isCompressedFile(const char* infilename, const char *extensionList[]);
- const char* UTIL_getFileExtension(const char* infilename);
-+/**
-+ * Wraps umask(). Does nothing when the platform doesn't have that concept.
-+ */
-+int UTIL_umask(int mode);
- 
- #ifndef _MSC_VER
- U32 UTIL_isFIFO(const char* infilename);
diff --git a/gnu/packages/patches/zziplib-CVE-2018-16548.patch b/gnu/packages/patches/zziplib-CVE-2018-16548.patch
deleted file mode 100644
index a17c6a9768..0000000000
--- a/gnu/packages/patches/zziplib-CVE-2018-16548.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-The following 3 patches applied to 0.13.69 in this order, combined:
-https://github.com/gdraheim/zziplib/commit/9411bde3e4a70a81ff3ffd256b71927b2d90dcbb.patch
-https://github.com/gdraheim/zziplib/commit/d2e5d5c53212e54a97ad64b793a4389193fec687.patch
-https://github.com/gdraheim/zziplib/commit/0e1dadb05c1473b9df2d7b8f298dab801778ef99.patch
-
-diff --git a/test/test.zip b/test/test.zip
-index 2c992ea..952d475 100644
-Binary files a/test/test.zip and b/test/test.zip differ
-diff --git a/zzip/zip.c b/zzip/zip.c
-index 14e2e06..f97a40a 100644
---- a/zzip/zip.c
-+++ b/zzip/zip.c
-@@ -472,9 +472,15 @@ __zzip_parse_root_directory(int fd,
-         } else
-         {
-             if (io->fd.seeks(fd, zz_rootseek + zz_offset, SEEK_SET) < 0)
-+	    {
-+	    	free(hdr0);
-                 return ZZIP_DIR_SEEK;
-+	    }
-             if (io->fd.read(fd, &dirent, sizeof(dirent)) < __sizeof(dirent))
-+	    {
-+	    	free(hdr0);
-                 return ZZIP_DIR_READ;
-+	    }
-             d = &dirent;
-         }
- 
-@@ -574,11 +580,18 @@ __zzip_parse_root_directory(int fd,
- 
-         if (hdr_return)
-             *hdr_return = hdr0;
-+	else
-+	{
-+	    /* If it is not assigned to *hdr_return, it will never be free()'d */
-+	    free(hdr0);
-+	}
-     }                           /* else zero (sane) entries */
-+    else
-+        free(hdr0);
- #  ifndef ZZIP_ALLOW_MODULO_ENTRIES
--    return (entries != zz_entries ? ZZIP_CORRUPTED : 0);
-+    return (entries != zz_entries) ? ZZIP_CORRUPTED : 0;
- #  else
--    return ((entries & (unsigned)0xFFFF) != zz_entries ? ZZIP_CORRUPTED : 0);
-+    return ((entries & (unsigned)0xFFFF) != zz_entries) ? ZZIP_CORRUPTED : 0;
- #  endif
- }
-