summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/clang-runtime-13-glibc-2.36-compat.patch50
-rw-r--r--gnu/packages/patches/clang-runtime-14-glibc-2.36-compat.patch50
-rw-r--r--gnu/packages/patches/clang-runtime-9-glibc-2.36-compat.patch50
-rw-r--r--gnu/packages/patches/dblatex-inkscape-1.0.patch39
-rw-r--r--gnu/packages/patches/diffutils-fix-signal-processing.patch58
-rw-r--r--gnu/packages/patches/docbook-utils-documentation-edits.patch102
-rw-r--r--gnu/packages/patches/docbook-utils-escape-characters.patch36
-rw-r--r--gnu/packages/patches/docbook-utils-remove-jade-sp.patch216
-rw-r--r--gnu/packages/patches/docbook-utils-respect-refentry-for-name.patch36
-rw-r--r--gnu/packages/patches/docbook-utils-source-date-epoch.patch31
-rw-r--r--gnu/packages/patches/docbook-utils-use-date-element.patch63
-rw-r--r--gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch40
-rw-r--r--gnu/packages/patches/docbook-xsl-support-old-url.patch17
-rw-r--r--gnu/packages/patches/docbook2x-filename-handling.patch44
-rw-r--r--gnu/packages/patches/docbook2x-fix-synopsis.patch26
-rw-r--r--gnu/packages/patches/docbook2x-manpage-typo.patch26
-rw-r--r--gnu/packages/patches/docbook2x-preprocessor-declaration.patch91
-rw-r--r--gnu/packages/patches/docbook2x-static-datadir-evaluation.patch21
-rw-r--r--gnu/packages/patches/eudev-rules-directory.patch13
-rw-r--r--gnu/packages/patches/ffmpeg-4-binutils-2.41.patch76
-rw-r--r--gnu/packages/patches/ffmpeg-remove-compressed_ten_bit_format.patch43
-rw-r--r--gnu/packages/patches/file-32bit-time.patch40
-rw-r--r--gnu/packages/patches/gcc-10-libsanitizer-no-crypt.patch134
-rw-r--r--gnu/packages/patches/gcc-12-libsanitizer-no-crypt.patch134
-rw-r--r--gnu/packages/patches/gcc-13-libsanitizer-no-crypt.patch140
-rw-r--r--gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch50
-rw-r--r--gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch70
-rw-r--r--gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch402
-rw-r--r--gnu/packages/patches/gcc-7-libsanitizer-fsconfig-command.patch32
-rw-r--r--gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch33
-rw-r--r--gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch35
-rw-r--r--gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch10
-rw-r--r--gnu/packages/patches/glib-gerror-null-format.patch137
-rw-r--r--gnu/packages/patches/glib-networking-disable-connection-tls1.2-test.patch18
-rw-r--r--gnu/packages/patches/glibc-2.37-versioned-locpath.patch57
-rw-r--r--gnu/packages/patches/glibc-2.38-ldd-x86_64.patch8
-rw-r--r--gnu/packages/patches/glibc-2.39-bootstrap-system.patch69
-rw-r--r--gnu/packages/patches/glibc-bootstrap-system.patch27
-rw-r--r--gnu/packages/patches/gnumach-support-noide.patch25
-rw-r--r--gnu/packages/patches/gnutls-cross.patch82
-rw-r--r--gnu/packages/patches/hurd-add-without-rump-configure-option.patch82
-rw-r--r--gnu/packages/patches/hurd-fix-rumpdisk-build.patch41
-rw-r--r--gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods-2.patch155
-rw-r--r--gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods.patch891
-rw-r--r--gnu/packages/patches/imagemagick-CVE-2020-27829.patch27
-rw-r--r--gnu/packages/patches/imagemagick-ReadDCMImage-fix.patch26
-rw-r--r--gnu/packages/patches/imagemagick-ReadDCMPixels-fix.patch35
-rw-r--r--gnu/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch25
-rw-r--r--gnu/packages/patches/libsepol-versioned-docbook.patch56
-rw-r--r--gnu/packages/patches/openjdk-10-char-reproducibility.patch12
-rw-r--r--gnu/packages/patches/openjdk-10-classlist-reproducibility.patch27
-rw-r--r--gnu/packages/patches/openjdk-10-corba-reproducibility.patch12
-rw-r--r--gnu/packages/patches/openjdk-10-jar-reproducibility.patch103
-rw-r--r--gnu/packages/patches/openjdk-10-jtask-reproducibility.patch53
-rw-r--r--gnu/packages/patches/openjdk-10-module-reproducibility.patch305
-rw-r--r--gnu/packages/patches/openjdk-10-module3-reproducibility.patch34
-rw-r--r--gnu/packages/patches/openjdk-10-module4-reproducibility.patch14
-rw-r--r--gnu/packages/patches/openjdk-11-classlist-reproducibility.patch11
-rw-r--r--gnu/packages/patches/openjdk-13-classlist-reproducibility.patch11
-rw-r--r--gnu/packages/patches/openjdk-15-jtask-reproducibility.patch40
-rw-r--r--gnu/packages/patches/openjdk-9-classlist-reproducibility.patch31
-rw-r--r--gnu/packages/patches/openjdk-9-idlj-reproducibility.patch37
-rw-r--r--gnu/packages/patches/openjdk-9-jar-reproducibility.patch107
-rw-r--r--gnu/packages/patches/openjdk-9-module-reproducibility.patch297
-rw-r--r--gnu/packages/patches/openjdk-9-module2-reproducibility.patch125
-rw-r--r--gnu/packages/patches/openjdk-9-module3-reproducibility.patch36
-rw-r--r--gnu/packages/patches/python-3-reproducible-build.patch30
-rw-r--r--gnu/packages/patches/python-matplotlib-fix-legend-loc-best-test.patch84
-rw-r--r--gnu/packages/patches/python-pillow-use-zlib-1.3.patch21
-rw-r--r--gnu/packages/patches/sway-add-libinput-config-accel.patch49
-rw-r--r--gnu/packages/patches/webrtc-audio-processing-big-endian.patch93
-rw-r--r--gnu/packages/patches/zig-do-not-link-against-librt.patch10
72 files changed, 3821 insertions, 1690 deletions
diff --git a/gnu/packages/patches/clang-runtime-13-glibc-2.36-compat.patch b/gnu/packages/patches/clang-runtime-13-glibc-2.36-compat.patch
new file mode 100644
index 0000000000..e457713d16
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-13-glibc-2.36-compat.patch
@@ -0,0 +1,50 @@
+This commit is from upstream and is included in the llvm-15 release
+
+commit b379129c4beb3f26223288627a1291739f33af02
+Author: Fangrui Song <i@maskray.me>
+Date: Mon Jul 11 11:38:28 2022 -0700
+
+ [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+
+ It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+ headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+ since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+ defines `fsconfig_command` which conflicts with linux/mount.h:
+
+ .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+
+ Fix https://github.com/llvm/llvm-project/issues/56421
+
+ Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+ Differential Revision: https://reviews.llvm.org/D129471
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56..81740bf4ab39 100644
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,6 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
+-#include <linux/fs.h>
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +875,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+ unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+ unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+ unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+ unsigned IOCTL_GIO_FONT = GIO_FONT;
+ unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/gnu/packages/patches/clang-runtime-14-glibc-2.36-compat.patch b/gnu/packages/patches/clang-runtime-14-glibc-2.36-compat.patch
new file mode 100644
index 0000000000..79b36f1383
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-14-glibc-2.36-compat.patch
@@ -0,0 +1,50 @@
+This commit is from upstream and is included in the llvm-15 release
+
+commit b379129c4beb3f26223288627a1291739f33af02
+Author: Fangrui Song <i@maskray.me>
+Date: Mon Jul 11 11:38:28 2022 -0700
+
+ [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+
+ It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+ headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+ since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+ defines `fsconfig_command` which conflicts with linux/mount.h:
+
+ .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+
+ Fix https://github.com/llvm/llvm-project/issues/56421
+
+ Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+ Differential Revision: https://reviews.llvm.org/D129471
+
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 4bd425435d56..81740bf4ab39 100644
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -73,7 +73,6 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
+-#include <linux/fs.h>
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +875,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+ unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+ unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+ unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+ unsigned IOCTL_GIO_FONT = GIO_FONT;
+ unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/gnu/packages/patches/clang-runtime-9-glibc-2.36-compat.patch b/gnu/packages/patches/clang-runtime-9-glibc-2.36-compat.patch
new file mode 100644
index 0000000000..9d0ab94222
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-9-glibc-2.36-compat.patch
@@ -0,0 +1,50 @@
+This commit is from upstream and is included in the llvm-15 release
+
+commit b379129c4beb3f26223288627a1291739f33af02
+Author: Fangrui Song <i@maskray.me>
+Date: Mon Jul 11 11:38:28 2022 -0700
+
+ [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36
+
+ It is generally not a good idea to mix usage of glibc headers and Linux UAPI
+ headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc
+ since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h
+ defines `fsconfig_command` which conflicts with linux/mount.h:
+
+ .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’
+
+ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually.
+
+ Fix https://github.com/llvm/llvm-project/issues/56421
+
+ Reviewed By: #sanitizers, vitalybuka, zatrazz
+
+ Differential Revision: https://reviews.llvm.org/D129471
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+index 4bd425435d56..81740bf4ab39 100644
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -73,7 +73,6 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
+-#include <linux/fs.h>
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +875,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+ unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+ unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+ unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+ unsigned IOCTL_GIO_FONT = GIO_FONT;
+ unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/gnu/packages/patches/dblatex-inkscape-1.0.patch b/gnu/packages/patches/dblatex-inkscape-1.0.patch
new file mode 100644
index 0000000000..634c99481a
--- /dev/null
+++ b/gnu/packages/patches/dblatex-inkscape-1.0.patch
@@ -0,0 +1,39 @@
+# Imported from <https://sourceforge.net/p/dblatex/dblatex/merge-requests/4/>
+
+# HG changeset patch
+# User Jan Tojnar <jtojnar@gmail.com>
+# Date 1588714251 -7200
+# Tue May 05 23:30:51 2020 +0200
+# Branch inkscape1
+# Node ID 611cc4a4a878d57f5877f2d418864560f68d25cf
+# Parent 3ddf5d6cedcbc9c8b98c4da77fd545b2478d90a3
+Port to Inkscape 1.0
+
+Inkscape revamped the CLI flags:
+
+https://gitlab.com/inkscape/inbox/issues/2416
+
+diff -r 3ddf5d6cedcb -r 611cc4a4a878 docs/custom/dblatex.xconf
+--- a/docs/custom/dblatex.xconf Tue Sep 10 00:40:26 2019 +0200
++++ b/docs/custom/dblatex.xconf Tue May 05 23:30:51 2020 +0200
+@@ -18,7 +18,7 @@
+ <imagedata>
+ <converter src="svg" dst="*" docformat="pdf">
+ <command>
+- inkscape -z -D --export-dpi=600 --export-%(dst)s=%(output)s %(input)s
++ inkscape -D --export-dpi=600 --export-type=%(dst)s --export-filename=%(output)s %(input)s
+ </command>
+ </converter>
+ </imagedata>
+diff -r 3ddf5d6cedcb -r 611cc4a4a878 lib/dbtexmf/core/imagedata.py
+--- a/lib/dbtexmf/core/imagedata.py Tue Sep 10 00:40:26 2019 +0200
++++ b/lib/dbtexmf/core/imagedata.py Tue May 05 23:30:51 2020 +0200
+@@ -178,7 +178,7 @@
+ class SvgConverter(ImageConverter):
+ def __init__(self, imgsrc, imgdst="", docformat="", backend=""):
+ ImageConverter.__init__(self, imgsrc="svg", imgdst=imgdst)
+- self.add_command(["inkscape", "-z", "-D", "--export-%(dst)s=%(output)s",
++ self.add_command(["inkscape", "-D", "--export-type=%(dst)s", "--export-filename=%(output)s",
+ "%(input)s"])
+
+
diff --git a/gnu/packages/patches/diffutils-fix-signal-processing.patch b/gnu/packages/patches/diffutils-fix-signal-processing.patch
deleted file mode 100644
index 134dd3f718..0000000000
--- a/gnu/packages/patches/diffutils-fix-signal-processing.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Author: Frédéric Bonnard <frediz@debian.org>
-
-Obtained from:
-
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922552#19
-
-Fixes bug reported upstream at:
-
-https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34519
-
-diff --git a/src/diff.c b/src/diff.c
-index e2eb32437353..b574e8282dc9 100644
---- a/src/diff.c
-+++ b/src/diff.c
-@@ -1451,6 +1451,8 @@ compare_files (struct comparison const *parent,
- }
- }
-
-+ final_process_signals ();
-+
- /* Now the comparison has been done, if no error prevented it,
- and STATUS is the value this function will return. */
-
-diff --git a/src/diff.h b/src/diff.h
-index 03daaa4a0530..e177fe600a25 100644
---- a/src/diff.h
-+++ b/src/diff.h
-@@ -390,6 +390,7 @@ extern enum changes analyze_hunk (struct change *, lin *, lin *, lin *, lin *);
- extern void begin_output (void);
- extern void debug_script (struct change *);
- extern void fatal (char const *) __attribute__((noreturn));
-+extern void final_process_signals (void);
- extern void finish_output (void);
- extern void message (char const *, char const *, char const *);
- extern void message5 (char const *, char const *, char const *,
-diff --git a/src/util.c b/src/util.c
-index 4f4d9bb285eb..56d292de2927 100644
---- a/src/util.c
-+++ b/src/util.c
-@@ -237,6 +237,18 @@ process_signals (void)
- }
- }
-
-+/* Process remaining signals once before exit */
-+void
-+final_process_signals (void)
-+{
-+ static int last = 1;
-+
-+ if (last) {
-+ process_signals ();
-+ last = 0;
-+ }
-+}
-+
- static void
- install_signal_handlers (void)
- {
diff --git a/gnu/packages/patches/docbook-utils-documentation-edits.patch b/gnu/packages/patches/docbook-utils-documentation-edits.patch
new file mode 100644
index 0000000000..7258d12675
--- /dev/null
+++ b/gnu/packages/patches/docbook-utils-documentation-edits.patch
@@ -0,0 +1,102 @@
+# Source: <https://sources.debian.org/patches/docbook-utils/0.6.14-4/spellingtypo.patch/>
+
+Description: Fix some typos in man pages
+Author: Mathieu Malaterre <malat@debian.org>
+
+Index: docbook-utils-0.6.14/doc/man/docbook2man-spec.pl.1
+===================================================================
+--- docbook-utils-0.6.14.orig/doc/man/docbook2man-spec.pl.1 2012-05-09 18:39:17.932819095 +0200
++++ docbook-utils-0.6.14/doc/man/docbook2man-spec.pl.1 2012-05-09 18:39:24.780818845 +0200
+@@ -17,7 +17,7 @@
+ .SH "DESCRIPTION"
+ .PP
+ \fBdocbook2man\fR is a sgmlspl spec file that produced man
+-pages (using the -man macros) from DocBook RefEntry markup.
++pages (using the \-man macros) from DocBook RefEntry markup.
+ .PP
+ The program reads ESIS produced by nsgmls (or other SGML parsers) from
+ standard input. Markup not found in RefEntry is discarded.
+Index: docbook-utils-0.6.14/doc/man/frontend-spec.7
+===================================================================
+--- docbook-utils-0.6.14.orig/doc/man/frontend-spec.7 2012-05-09 18:41:45.172813778 +0200
++++ docbook-utils-0.6.14/doc/man/frontend-spec.7 2012-05-09 18:42:03.176813129 +0200
+@@ -10,7 +10,7 @@
+ .SH "DESCRIPTION"
+ .PP
+ \fBjw\fR(1) calls frontends like
+-\fIfrontends/docbook\fR to get the informations
++\fIfrontends/docbook\fR to get the information
+ specific to a given input format. The frontend knows which information
+ to return from the first command line parameter. It gets all necessary
+ data via environment variables ready to use.
+Index: docbook-utils-0.6.14/doc/man/jw.1
+===================================================================
+--- docbook-utils-0.6.14.orig/doc/man/jw.1 2012-05-09 18:39:35.612818456 +0200
++++ docbook-utils-0.6.14/doc/man/jw.1 2012-05-09 18:40:51.736815708 +0200
+@@ -142,7 +142,7 @@
+ The following options apply to the conversion script:
+ .TP
+ \fB -f \fIfrontend\fB | --frontend \fIfrontend\fB \fR
+-Allows to specify another frontend than default \fIdocbook\fR\&.
++Allows one to specify another frontend than default \fIdocbook\fR\&.
+ The list of currently available frontends is:
+ .RS
+ .TP
+@@ -156,13 +156,13 @@
+ .RE
+ .TP
+ \fB -b \fIbackend\fB | --backend \fIbackend\fB \fR
+-Allows to specify another backend than default
++Allows one to specify another backend than default
+ \fIHTML\fR\&. The list of currently available
+ backends is:
+ .RS
+ .TP
+ \fB\fIdvi\fB\fR
+-Converts to DVI (DeVice Independant
++Converts to DVI (DeVice Independent
+ files) by calling \fBJade\fR or
+ \fBOpenJade\fR\&.
+ .TP
+@@ -210,7 +210,7 @@
+ .RE
+ .TP
+ \fB -c \fIfile\fB | --cat \fIfile\fB \fR
+-Allows to use an extra SGML Open Catalog that will list
++Allows one to use an extra SGML Open Catalog that will list
+ other files like customization style sheets, adaptations to the
+ DocBook Document Type Definition, special character entities,
+ etc. This catalog is added to the list of catalogs determined
+@@ -241,7 +241,7 @@
+ are specified on the command line.
+ .TP
+ \fB -d \fIfile\fB|default|none | --dsl \fIfile\fB|default|none \fR
+-Allows to use a customized style sheet instead
++Allows one to use a customized style sheet instead
+ of the default one.
+
+ A "target" starting with a hash mark "#" can be appended
+Index: docbook-utils-0.6.14/doc/man/sgmldiff.1
+===================================================================
+--- docbook-utils-0.6.14.orig/doc/man/sgmldiff.1 2012-05-09 18:41:13.316814927 +0200
++++ docbook-utils-0.6.14/doc/man/sgmldiff.1 2012-05-09 18:41:38.032814038 +0200
+@@ -17,7 +17,7 @@
+
+ .SH "DESCRIPTION"
+ .PP
+-This perl script allows to determine the structural differences
++This perl script allows one to determine the structural differences
+ between two SGML files. It compares the files, regardless of what
+ is in between the tags, to only focus on the markup. Its output
+ is similar to \fBdiff\fR(1)\&.
+@@ -62,8 +62,8 @@
+ Lines 5 to 7 of the first file have been changed
+ into lines 8 to 10 of the second line.
+ In addition to those summaries, the lines of the first file are
+-shown preceeded by '<' and the lines of the second file are
+-shown preceeded by '>".
++shown preceded by '<' and the lines of the second file are
++shown preceded by '>".
+ .SH "OPTIONS"
+ .PP
+ Here is the list of actions that can be requested to
diff --git a/gnu/packages/patches/docbook-utils-escape-characters.patch b/gnu/packages/patches/docbook-utils-escape-characters.patch
new file mode 100644
index 0000000000..3845ee6238
--- /dev/null
+++ b/gnu/packages/patches/docbook-utils-escape-characters.patch
@@ -0,0 +1,36 @@
+# Source: <https://sources.debian.org/patches/docbook-utils/0.6.14-4/bug_528334.patch/>
+
+Description: incorrectly strips whitespace (patch included)
+ In the previous upload, docbook2man was patched to escape the special
+ characters . and ' at the beginning of a line (see #399947).
+ Unfortunately that patch was incorrect -- as well as escaping the special
+ characters, it also removes all whitespace from the beginning of
+ affected lines. As a result, if you are in a block where whitespace
+ matters (such as <screen>...</screen>) then the output is now incorrect.
+
+ This is very easy to fix -- just match the whitespace and preserve it,
+ instead of tossing it away. The full patch (just two lines) is included
+ below.
+Author: Ben Burton <bab@debian.org>
+Forwarded: not-needed
+Bug-Debian: http://bugs.debian.org/528334
+
+Edit by Bruno Victal <mirai@makinata.eu>:
+ Patch was edited so that it could be applied against the original
+ docbook-utils-0.6.14 sources.
+
+Index: docbook-utils-0.6.14/helpers/docbook2man-spec.pl
+===================================================================
+--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl 2012-05-09 18:59:42.584774885 +0200
++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl 2012-05-09 19:00:34.788773002 +0200
+@@ -1212,8 +1212,8 @@
+ $_[0] =~ s/\\/\\\\/g;
+
+ # Escape dots and single quotes in column 1
+- $_[0] =~ s/^\./\\\&\./;
+- $_[0] =~ s/^\'/\\\&\'/;
++ $_[0] =~ s/^([ \t]*)\./$1\\\&\./;
++ $_[0] =~ s/^([ \t]*)\'/$1\\\&\'/;
+
+ # In non-'pre'-type elements:
+ if(!$nocollapse_whitespace) {
diff --git a/gnu/packages/patches/docbook-utils-remove-jade-sp.patch b/gnu/packages/patches/docbook-utils-remove-jade-sp.patch
new file mode 100644
index 0000000000..99751b4de3
--- /dev/null
+++ b/gnu/packages/patches/docbook-utils-remove-jade-sp.patch
@@ -0,0 +1,216 @@
+# Source: <https://sources.debian.org/patches/docbook-utils/0.6.14-4/remove-jade-sp.patch/>
+Description: Change dependencies on jade and sp to openjade and opensp
+Author: Neil Roeth <neil@debian.org>
+Last-Update: 2016-07-24
+
+Edit by Bruno Victal <mirai@makinata.eu>:
+ Patch was edited so that it could be applied against the original
+ docbook-utils-0.6.14 sources.
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/doc/HTML/Makefile.am
++++ b/doc/HTML/Makefile.am
+@@ -1,4 +1,4 @@
+-htmldir = $(docdir)/html/docbook-utils-@VERSION@
++htmldir = $(docdir)/html
+ html_DATA = api.html \
+ backend-spec.html \
+ docbook2man.html \
+@@ -25,6 +25,6 @@
+ $(top_srcdir)/doc/refentry/sgmldiff.sgml
+ SGML_CATALOG_FILES=/etc/sgml/catalog \
+ SGML_SEARCH_PATH=$(top_srcdir):$(top_srcdir)/doc:.. \
+- jade -t sgml -i html -d $(top_srcdir)/docbook-utils.dsl\#html \
++ openjade -t sgml -i html -d $(top_srcdir)/docbook-utils.dsl\#html \
+ -V '%use-id-as-filename%' $<
+
+--- a/doc/man/Makefile.am
++++ b/doc/man/Makefile.am
+@@ -12,5 +12,5 @@
+ $(top_srcdir)/helpers/docbook2man-spec.pl
+ SGML_CATALOG_FILES=/etc/sgml/catalog \
+ SGML_SEARCH_PATH=$(top_srcdir)/doc:.. \
+- nsgmls $< | \
++ onsgmls $< | \
+ sgmlspl $(top_srcdir)/helpers/docbook2man-spec.pl
+--- a/backends/man.in
++++ b/backends/man.in
+@@ -7,8 +7,8 @@
+ TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \
+ { echo >&2 "man backend: could not create secure temporary directory"; exit 1;}
+ trap 'rm -rf "${TMPDIR}"' EXIT
+-nsgmls $SGML_FILE > "${TMPDIR}/nsgmls.tmp"
+-sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs"
++onsgmls $SGML_FILE > "${TMPDIR}/onsgmls.tmp"
++sgmlspl $HELPER <"${TMPDIR}/onsgmls.tmp" 2>"${TMPDIR}/errs"
+ if [ $? -ne 0 ]
+ then
+ cat "${TMPDIR}/errs"
+@@ -18,7 +18,7 @@
+ if grep unresolved "${TMPDIR}/errs" >/dev/null 2>&1
+ then
+ echo "Resolving references.."
+- sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp"
++ sgmlspl $HELPER <"${TMPDIR}/onsgmls.tmp"
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+--- a/backends/texi.in
++++ b/backends/texi.in
+@@ -3,7 +3,7 @@
+ # This program is under GPL license. See LICENSE file for details.
+
+ # Convert to texinfo
+-nsgmls $SGML_FILE | sgmlspl $SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2texi-spec.pl >$SGML_FILE_NAME.texi
++onsgmls $SGML_FILE | sgmlspl docbook2texi-spec.pl >$SGML_FILE_NAME.texi
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+--- a/bin/sgmldiff.in
++++ b/bin/sgmldiff.in
+@@ -22,13 +22,13 @@
+
+ use strict;
+ use integer;
+-use vars qw($nsgmls $errors $errorlog $VERSION);
++use vars qw($onsgmls $errors $errorlog $VERSION);
+ use Getopt::Long 2.01;
+
+ $VERSION = 1.03;
+
+-my $nsgmls;
+-$nsgmls = "@jade_bindir@/nsgmls";
++my $onsgmls;
++$onsgmls = "@jade_bindir@/onsgmls";
+
+ #----------------------------------------------------------------------
+ # TODO:
+@@ -37,7 +37,7 @@
+ # - Wait for suggestions ;-)
+ #
+ # Note: the input file need not be valid, nor is it necessary to have
+-# the DTDs. nsgmls always returns a structure.
++# the DTDs. onsgmls always returns a structure.
+ #----------------------------------------------------------------------
+
+ # Get file name
+@@ -141,11 +141,11 @@
+ unlink $diff2;
+
+ #---------------------------------------------------------------------
+-# Process nsgmls output: keep all stuff that is important for the
++# Process onsgmls output: keep all stuff that is important for the
+ # structure comparison. Make two structures: one that is diffed
+ # (without text) (DIFF) and one that is used to present the
+ # differences to the user (@full). For more info: see SP
+-# documentation, nsgmls output format.
++# documentation, onsgmls output format.
+
+ sub prepare {
+ my($filename,$todiffname) = @_;
+@@ -161,7 +161,7 @@
+ my @line_numbered = ();
+ my $line = 0;
+
+- open(ESIS, "$nsgmls -l $errors $errorlog -onotation-sysid -oid -oempty $filename | "); #-oentity generates strange output; ? -ononsgml
++ open(ESIS, "$onsgmls -l $errors $errorlog -onotation-sysid -oid -oempty $filename | "); #-oentity generates strange output; ? -ononsgml
+ open(DIFF, "> $todiffname");
+ while (<ESIS>) {
+ chomp $_;
+@@ -375,7 +375,7 @@
+ };
+
+ #----------------------------------------------------------------------
+-# Normalise data text from nsgmls (i.e. don't print the escaped text).
++# Normalise data text from onsgmls (i.e. don't print the escaped text).
+ sub normalise_text {
+ my($string,$prefix) = @_;
+ my $result = "$prefix";
+--- a/configure.in
++++ b/configure.in
+@@ -21,7 +21,7 @@
+
+ dnl Checks for programs.
+ jade_bindirs="/usr/bin /usr/local/bin"
+-AC_FIND_PROGRAM(nsgmls, $jade_bindirs, jade_bindir)
++AC_FIND_PROGRAM(onsgmls, $jade_bindirs, jade_bindir)
+ AC_SUBST(jade_bindir)
+
+ perl_bindirs="/usr/bin /usr/local/bin"
+--- a/doc/refentry/docbook2man-spec.pl.sgml
++++ b/doc/refentry/docbook2man-spec.pl.sgml
+@@ -19,7 +19,7 @@
+ <!-- docbook2man-spec.pl BREAKAGE HERE! -->
+
+ <CmdSynopsis>
+-<Command>nsgmls</command>
++<Command>onsgmls</command>
+ <Arg><Replaceable>sgml document</replaceable></Arg>
+ <Command>| sgmlspl</command>
+ <Arg choice=req>docbook2man-spec.pl</arg>
+@@ -35,7 +35,7 @@
+ </Para>
+
+ <Para>
+-The program reads ESIS produced by nsgmls (or other SGML parsers) from
++The program reads ESIS produced by onsgmls (or other SGML parsers) from
+ standard input. Markup not found in RefEntry is discarded.
+ </Para>
+
+--- a/doc/refentry/docbook2texi-spec.pl.sgml
++++ b/doc/refentry/docbook2texi-spec.pl.sgml
+@@ -20,7 +20,7 @@
+ <!-- docbook2man-spec.pl BREAKAGE HERE! -->
+
+ <CmdSynopsis>
+-<Command>nsgmls</command>
++<Command>onsgmls</command>
+ <Arg><Replaceable>sgml document</replaceable></Arg>
+ <Command>| sgmlspl</command>
+ <Arg choice=req>docbook2texi-spec.pl</arg>
+@@ -37,7 +37,7 @@
+ </Para>
+
+ <Para>
+-The program reads ESIS produced by nsgmls (or other SGML parsers) from
++The program reads ESIS produced by onsgmls (or other SGML parsers) from
+ standard input. Currently the document element must be <SGMLTag>Book</sgmltag>,
+ otherwise the results are undefined.
+ </Para>
+--- a/doc/refentry/jw.sgml
++++ b/doc/refentry/jw.sgml
+@@ -630,7 +630,7 @@
+ <manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>install-catalog</refentrytitle>
+ <manvolnum>8</manvolnum></citerefentry>,
+- <citerefentry><refentrytitle>nsgmls</refentrytitle>
++ <citerefentry><refentrytitle>onsgmls</refentrytitle>
+ <manvolnum>1</manvolnum></citerefentry>, <ulink
+ url="http://sources.redhat.com/docbook-tools/">docbook-utils
+ homepage</ulink>.</para>
+--- a/doc/refentry/sgmldiff.sgml
++++ b/doc/refentry/sgmldiff.sgml
+@@ -238,10 +238,10 @@
+ <glossterm>
+ <!-- Next line is a hack to force a paragraph break in the man-page. -->
+ <cmdsynopsis> <command></command> </cmdsynopsis>
+- <citerefentry> <refentrytitle>nsgmls</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
++ <citerefentry> <refentrytitle>onsgmls</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
+ </glossterm>
+ <glossdef>
+- <para>a base component of <application>Jade</application> DSSSL engine</para>
++ <para>a base component of <application>OpenJade</application> DSSSL engine</para>
+ </glossdef>
+ </glossentry>
+
+--- a/helpers/docbook2man-spec.pl
++++ b/helpers/docbook2man-spec.pl
+@@ -7,7 +7,7 @@
+ The SGMLSpm package from CPAN. This contains the sgmlspl script which
+ is used to grok this file. Use it like this:
+
+-nsgmls some-docbook-document.sgml | sgmlspl docbook2man-spec.pl
++onsgmls some-docbook-document.sgml | sgmlspl docbook2man-spec.pl
+
+ =head1 DESCRIPTION
+
diff --git a/gnu/packages/patches/docbook-utils-respect-refentry-for-name.patch b/gnu/packages/patches/docbook-utils-respect-refentry-for-name.patch
new file mode 100644
index 0000000000..1b8ce7a0de
--- /dev/null
+++ b/gnu/packages/patches/docbook-utils-respect-refentry-for-name.patch
@@ -0,0 +1,36 @@
+# Source: <https://sources.debian.org/patches/docbook-utils/0.6.14-4/bug_394511.patch/>
+
+Description: docbook2man should translate the NAME section according to the REFENTRY's lang attribute
+ Currently, docbook2man translates the NAME section according to the lang
+ attribute provided to the REFNAMEDIV tag.
+ When a lang attribute is specified in the REFENTRY tag and no lang
+ attribute is specified with the REFNAMEDIV, the lang attribute of the
+ REFENTRY should be used.
+Author: Nicolas François <nicolas.francois@centraliens.net>
+Forwarded: not-needed
+Bug-Debian: http://bugs.debian.org/394511
+
+Index: docbook-utils-0.6.14/helpers/docbook2man-spec.pl
+===================================================================
+--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl 2012-05-09 18:55:53.276783163 +0200
++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl 2012-05-09 18:58:04.792778418 +0200
+@@ -359,11 +359,14 @@
+ # NAME section
+ man_sgml('<REFNAMEDIV>', sub {
+ my %words = qw( fr NOM es NOMBRE de NAME );
+- if (defined($_[0]->attribute('LANG')->value)) {
+- my $id = $_[0]->attribute('LANG')->value;
+- my $ad = $words{$id};
+- output("\n.SH $ad\n");}
+- else {output("\n.SH NAME\n");}
++ # Use the REFNAMEDIV's lang attribute, and default to the
++ # REFENTRY's lang attribute.
++ my $lang = $_[0]->attribute('LANG')->value;
++ $lang = $manpage_lang unless defined $lang;
++ if (defined($lang) and defined $words{lc($lang)}) {
++ my $ad = $words{lc($lang)};
++ output("\n.SH $ad\n");}
++ else { output("\n.SH NAME\n");}
+ });
+
+ sgml('<REFNAME>', \&save_cdata);
diff --git a/gnu/packages/patches/docbook-utils-source-date-epoch.patch b/gnu/packages/patches/docbook-utils-source-date-epoch.patch
new file mode 100644
index 0000000000..15c025a726
--- /dev/null
+++ b/gnu/packages/patches/docbook-utils-source-date-epoch.patch
@@ -0,0 +1,31 @@
+# Source: <https://sources.debian.org/patches/docbook-utils/0.6.14-4/support_source_date_epoch.patch/>
+
+Author: Reiner Herrmann <reiner@reiner-h.de>
+Description: Support SOURCE_DATE_EPOCH for timestamps
+ To allow generating documents in a reproducible way,
+ allow overriding the timestamp through the environment.
+ .
+ See also: https://reproducible-builds.org/specs/source-date-epoch/
+Bug-Debian: https://bugs.debian.org/800797
+
+--- a/helpers/docbook2man-spec.pl
++++ b/helpers/docbook2man-spec.pl
+@@ -57,6 +57,7 @@
+ use SGMLS; # Use the SGMLS package.
+ use SGMLS::Output; # Use stack-based output.
+ use SGMLS::Refs;
++use POSIX qw(strftime setlocale LC_TIME);
+
+ ########################################################################
+ # SGMLSPL script produced automatically by the script sgmlspl.pl
+@@ -279,6 +280,10 @@
+ _END_BANNER
+
+ my $date = `date "+%d %B %Y"`;
++ if ($ENV{SOURCE_DATE_EPOCH}) {
++ setlocale(LC_TIME, "C");
++ $date = strftime("%d %B %Y", gmtime($ENV{SOURCE_DATE_EPOCH} || time));
++ }
+ my $manpage_date = $manpage_date || $date ;
+
+ output '.TH "';
diff --git a/gnu/packages/patches/docbook-utils-use-date-element.patch b/gnu/packages/patches/docbook-utils-use-date-element.patch
new file mode 100644
index 0000000000..106707f7d4
--- /dev/null
+++ b/gnu/packages/patches/docbook-utils-use-date-element.patch
@@ -0,0 +1,63 @@
+# Source: <https://sources.debian.org/patches/docbook-utils/0.6.14-4/bug_214982.patch/>
+
+Description: patch to get the <date> from the sgml file
+ For the moment, docbook2man doesn't use the tag date in <date> </date>
+ to but `date "+%d %B %Y"`, and thus depend on the current locale.
+
+ <refentry>
+ <docinfo>
+ <date>06 September 2003</>
+ </docinfo>
+ </refentry>
+
+ A patch against /usr/share/perl5/sgmlspl-specs/docbook2man-spec.pl
+ allows to use the date written in the source SGML file (which can be
+ localized) instead of the current date.
+
+ However, if no correct date tag is present in the SGML file, the date
+ written in the manpage will depend on the current locale.
+Author: Simon Paillard <simon.paillard@resel.enst-bretagne.fr>
+Forwarded: not-needed
+Bug-Debian: http://bugs.debian.org/214982
+
+Index: docbook-utils-0.6.14/helpers/docbook2man-spec.pl
+===================================================================
+--- docbook-utils-0.6.14.orig/helpers/docbook2man-spec.pl 2012-05-09 18:27:28.000000000 +0200
++++ docbook-utils-0.6.14/helpers/docbook2man-spec.pl 2012-05-09 18:55:53.276783163 +0200
+@@ -278,8 +278,9 @@
+ .\\" etc. to Steve Cheng <steve\@ggi-project.org>.
+ _END_BANNER
+
+- my $manpage_date = `date "+%d %B %Y"`;
+-
++ my $date = `date "+%d %B %Y"`;
++ my $manpage_date = $manpage_date || $date ;
++
+ output '.TH "';
+
+ # If the title is not mixed-case, convention says to
+@@ -292,7 +293,7 @@
+ }
+
+ output '" "', fold_string($manpage_sect),
+- '" "', fold_string(`date "+%d %B %Y"`),
++ '" "', fold_string($manpage_date),
+ '" "', $manpage_misc,
+ '" "', $manpage_manual,
+ "\"\n";
+@@ -568,6 +569,15 @@
+ sgml('</ATTRIBUTION>', sub { $_[0]->parent->ext->{'attribution'} = pop_output(); });
+
+
++sgml('<DATE>', sub {
++ save_cdata();
++});
++sgml('</DATE>', sub {
++ $manpage_date = fold_string(pop_output());
++ $raw_cdata--;
++});
++
++
+ # IGNORE.
+ sgml('<DOCINFO>', sub { push_output('nul'); });
+ sgml('</DOCINFO>', sub { pop_output(); });
diff --git a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch b/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
deleted file mode 100644
index fed4b76429..0000000000
--- a/gnu/packages/patches/docbook-xsl-nonrecursive-string-subst.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Use a non-recursive replace function when the parser supports it.
-
-https://bugs.gnu.org/29782
-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://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,
- long strings with many matches will cause stack overflows.
-Author: Peter De Wachter <pdewacht@gmail.com>
-Bug-Debian: https://bugs.debian.org/750593
-
---- a/lib/lib.xsl
-+++ b/lib/lib.xsl
-@@ -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"
-+ xmlns:str="http://exslt.org/strings"
-+ exclude-result-prefixes="str"
-+ version="1.0">
-
- <xsl:template name="dot.count">
- <!-- Returns the number of "." characters in a string -->
-@@ -52,6 +56,9 @@
- <xsl:param name="replacement"/>
-
- <xsl:choose>
-+ <xsl:when test="function-available('str:replace')">
-+ <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>
-+ </xsl:when>
- <xsl:when test="contains($string, $target)">
- <xsl:variable name="rest">
- <xsl:call-template name="string.subst">
diff --git a/gnu/packages/patches/docbook-xsl-support-old-url.patch b/gnu/packages/patches/docbook-xsl-support-old-url.patch
deleted file mode 100644
index 5b7dda458f..0000000000
--- a/gnu/packages/patches/docbook-xsl-support-old-url.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-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/docbook2x-filename-handling.patch b/gnu/packages/patches/docbook2x-filename-handling.patch
new file mode 100644
index 0000000000..ebffd7b7ae
--- /dev/null
+++ b/gnu/packages/patches/docbook2x-filename-handling.patch
@@ -0,0 +1,44 @@
+# Source: <https://sources.debian.org/patches/docbook2x/0.8.8-18/03_fix_420153_filename_whitespace_handling.patch/>
+
+## 03_fix_420153_filename_whitespace_handling.dpatch by
+## Daniel Leidert (dale) <daniel.leidert@wgdd.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Peter Eisentraut reported a regression in the whitespace handling of
+## DP: refentrytitle content during filename creation:
+## DP: http://bugs.debian.org/420153. The problem is, that upstream first
+## DP: replaces all spaces (but not linebreaks btw) with underlines and then
+## DP: it tries to normalize the result. This means, that a linebreak with
+## DP: additional whitespaces results in manpage names like 'foo_ ____bar.9'.
+## DP: So what we basically do in this patch is, that we first normalize the
+## DP: refentrytitle and then replace any spaces left with underlines.
+
+Edit by Bruno Victal <mirai@makinata.eu>:
+ Removed dpatch lines.
+
+--- docbook2x-0.8.8~/xslt/man/manpage.xsl 2006-04-20 15:45:55.000000000 +0200
++++ docbook2x-0.8.8/xslt/man/manpage.xsl 2007-04-20 16:19:28.000000000 +0200
+@@ -30,7 +30,7 @@
+
+ <xsl:template name="manpage-filename">
+ <xsl:param name="filename" />
+- <xsl:value-of select="normalize-space(translate($filename, &quot; /&quot;, &quot;__&quot;))" />
++ <xsl:value-of select="translate(normalize-space($filename), ' /', '__')" />
+ </xsl:template>
+
+
+--- docbook2x-0.8.8~/xslt/man/refentry.xsl 2006-04-21 04:39:55.000000000 +0200
++++ docbook2x-0.8.8/xslt/man/refentry.xsl 2007-04-20 16:21:53.000000000 +0200
+@@ -38,7 +38,11 @@
+ <xsl:template name="refentry-filename">
+ <xsl:param name="title" />
+
+- <xsl:variable name="title2" select="translate($title, &quot; /&quot;, &quot;__&quot;)" />
++ <xsl:variable name="title2">
++ <xsl:call-template name="manpage-filename">
++ <xsl:with-param name="filename" select="$title" />
++ </xsl:call-template>
++ </xsl:variable>
+
+ <!-- not using gentext here since man page names tend not to have
+ accented chars / non-Latin chars ...
diff --git a/gnu/packages/patches/docbook2x-fix-synopsis.patch b/gnu/packages/patches/docbook2x-fix-synopsis.patch
new file mode 100644
index 0000000000..315c93029b
--- /dev/null
+++ b/gnu/packages/patches/docbook2x-fix-synopsis.patch
@@ -0,0 +1,26 @@
+# Source: <https://sources.debian.org/patches/docbook2x/0.8.8-18/07_Fix-hyphens-in-commands-and-options-in-synopsis.patch/>
+
+From 06944d2bf8aa761ec6c145c964e59c3b1f41d7a5 Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <sthibault@debian.org>
+Date: Wed, 6 Sep 2023 21:48:59 +0200
+Subject: man: Fix hyphens in commands and options in synopsis
+
+diff --git a/xslt/man/synop.xsl b/xslt/man/synop.xsl
+index 9713a1b..e535b75 100644
+--- a/xslt/man/synop.xsl
++++ b/xslt/man/synop.xsl
+@@ -107,9 +107,9 @@
+ <xsl:call-template name="cmdsynopsis-gentext-sepchar" />
+ </xsl:if>
+
+- <b>
++ <xsl:call-template name="inline-bold-monospace">
+ <xsl:apply-templates mode="cmdsynopsis" />
+- </b>
++ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template match="replaceable" mode="cmdsynopsis">
+--
+2.34.1
+
diff --git a/gnu/packages/patches/docbook2x-manpage-typo.patch b/gnu/packages/patches/docbook2x-manpage-typo.patch
new file mode 100644
index 0000000000..5b64ca837b
--- /dev/null
+++ b/gnu/packages/patches/docbook2x-manpage-typo.patch
@@ -0,0 +1,26 @@
+# Source: <https://sources.debian.org/patches/docbook2x/0.8.8-18/06_fix_man_typo.patch/>
+
+Author: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
+
+--- docbook2x-0.8.8.orig/doc/docbook2man.1
++++ docbook2x-0.8.8/doc/docbook2man.1
+@@ -187,7 +187,7 @@ parameter instead.
+
+ However, inside a custom stylesheet
+ (\fInot on the command-line\fR)
+-this paramter can be set to the XPath expression
++this parameter can be set to the XPath expression
+ \*(T<document('')\*(T>,
+ which will cause the custom translations
+ directly embedded inside the custom stylesheet to be read.
+--- docbook2x-0.8.8.orig/doc/docbook2texi.1
++++ docbook2x-0.8.8/doc/docbook2texi.1
+@@ -230,7 +230,7 @@ parameter instead.
+
+ However, inside a custom stylesheet
+ (\fInot on the command-line\fR)
+-this paramter can be set to the XPath expression
++this parameter can be set to the XPath expression
+ \*(T<document('')\*(T>,
+ which will cause the custom translations
+ directly embedded inside the custom stylesheet to be read.
diff --git a/gnu/packages/patches/docbook2x-preprocessor-declaration.patch b/gnu/packages/patches/docbook2x-preprocessor-declaration.patch
new file mode 100644
index 0000000000..34fb64c059
--- /dev/null
+++ b/gnu/packages/patches/docbook2x-preprocessor-declaration.patch
@@ -0,0 +1,91 @@
+# Source: <https://sources.debian.org/patches/docbook2x/0.8.8-18/04_fix_442782_preprocessor_declaration_syntax.patch/>
+
+## 04_fix_442782_preprocessor_declaration_syntax.dpatch by Colin Watson <cjwatson@debian.org>.
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Conventionally, preprocessor declarations should start with
+## DP: '\"
+## DP: rather than
+## DP: .\"
+## DP: Current man-db only supports the first (and recommended) syntax. So
+## DP: Colin Watson provided this patch to fix docbook2x.
+## DP:
+## DP: <URL:http://bugs.debian.org/442782>
+## DP: <URL:http://lists.gnu.org/archive/html/groff/2007-11/msg00023.html>
+
+Edit by Bruno Victal <mirai@makinata.eu>:
+ Removed dpatch lines.
+
+--- trunk~/perl/db2x_manxml.pl 2006-04-22 17:21:32.000000000 +0200
++++ trunk/perl/db2x_manxml.pl 2007-11-24 01:27:37.000000000 +0100
+@@ -342,6 +342,25 @@
+ $self->{line_start} = 1;
+ }
+
++#
++# Print a comment in the output, without causing a break.
++# Params: comment - the comment text.
++# May use any characters; they need not be escaped.
++#
++sub comment_nobreak
++{
++ my ($self, $comment) = @_;
++ $self->write("\n") unless $self->{line_start};
++
++ foreach my $line (split(/\n/, $comment)) {
++ $self->write('\'\" ');
++ $self->write($line);
++ $self->write("\n");
++ }
++
++ $self->{line_start} = 1;
++}
++
+
+ #
+ # Use a roff "escape" i.e. commands embedded in text starting with \
+@@ -510,16 +529,20 @@
+
+ $self->{'adjust-stack'} = [ 'b' ];
+
+- $self->{rw}->comment($elem->attr('preprocessors'))
+- if($elem->attr('preprocessors') ne '');
+-
++ my $preprocessors = $elem->attr('preprocessors');
+ # I've dug through the Internet to see if there was any
+ # standard way to specify encoding with man pages.
+ # The following seems to be a reasonable proposal:
+ # <URL:http://mail.nl.linux.org/linux-utf8/2001-04/msg00168.html>
+ my $encoding = $self->{options}->{'encoding'};
+ $encoding =~ s#//TRANSLIT$##i;
+- $self->{rw}->comment("-*- coding: $encoding -*-");
++ $encoding = "-*- coding: $encoding -*-";
++ if ($preprocessors eq '') {
++ $preprocessors = $encoding;
++ } else {
++ $preprocessors = "$preprocessors $encoding";
++ }
++ $self->{rw}->comment_nobreak($preprocessors);
+
+ # Define escapes for switching to and from monospace fonts (groff only)
+ $self->{rw}->request(qw{ .if \n(.g .ds T< \\\\FC});
+--- trunk~/xslt/backend/db2x_manxml.xsl 2006-04-23 16:44:52.000000000 +0200
++++ trunk/xslt/backend/db2x_manxml.xsl 2007-11-24 01:27:37.000000000 +0100
+@@ -528,7 +528,7 @@
+ <exslt:document method="text"
+ encoding="{$encoding}"
+ href="{$path}">
+- <xsl:text>.\" -*- coding: </xsl:text>
++ <xsl:text>'\" -*- coding: </xsl:text>
+ <xsl:value-of select="$encoding" />
+ <xsl:text> -*-&#10;</xsl:text>
+ <xsl:copy-of select="$content" />
+@@ -538,7 +538,7 @@
+ <saxon:output method="text"
+ encoding="{$encoding}"
+ href="{$path}">
+- <xsl:text>.\" -*- coding: </xsl:text>
++ <xsl:text>'\" -*- coding: </xsl:text>
+ <xsl:value-of select="$encoding" />
+ <xsl:text> -*-&#10;</xsl:text>
+ <xsl:copy-of select="$content" />
diff --git a/gnu/packages/patches/docbook2x-static-datadir-evaluation.patch b/gnu/packages/patches/docbook2x-static-datadir-evaluation.patch
new file mode 100644
index 0000000000..eb8844d379
--- /dev/null
+++ b/gnu/packages/patches/docbook2x-static-datadir-evaluation.patch
@@ -0,0 +1,21 @@
+# Source: <https://sources.debian.org/patches/docbook2x/0.8.8-18/01_fix_static_datadir_evaluation.patch/>
+
+Description:
+ 01_fix_static_datadir_evaluation.dpatch by Daniel Leidert (dale) <daniel.leidert@wgdd.de>
+ All lines beginning with `## DP:' are a description of the patch.
+ The evaluation of datadir results in "${prefix}/share" without
+ evaluation of the ${prefix} variable with autoconf 2.60.
+
+Index: docbook2X-0.8.8/configure.ac
+===================================================================
+--- docbook2X-0.8.8.orig/configure.ac
++++ docbook2X-0.8.8/configure.ac
+@@ -148,7 +148,7 @@
+ dnl they will reside and should use these static_* values.
+ dnl Ensure that all static_* are fully expanded.
+
+-eval static_datadir="$datadir"
++eval eval static_datadir="$datadir"
+
+ eval static_bindir="$bindir"
+ old_val=""
diff --git a/gnu/packages/patches/eudev-rules-directory.patch b/gnu/packages/patches/eudev-rules-directory.patch
index 54fc01c6d5..4a9bc33826 100644
--- a/gnu/packages/patches/eudev-rules-directory.patch
+++ b/gnu/packages/patches/eudev-rules-directory.patch
@@ -4,9 +4,11 @@ The old udev 182 supported $UDEV_CONFIG_FILE, which in turn allowed
the search path to be customized, but eudev no longer has this, hence
this hack.
---- eudev-3.1.5/src/udev/udev-rules.c 2015-10-13 06:22:14.000000000 +0800
-+++ eudev-3.1.5/src/udev/udev-rules.c 2015-10-16 20:45:38.491934336 +0800
-@@ -47,15 +47,11 @@
+diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
+index 3856686c8..0362abb04 100644
+--- a/src/udev/udev-rules.c
++++ b/src/udev/udev-rules.c
+@@ -48,16 +48,11 @@ struct uid_gid {
};
};
@@ -20,11 +22,12 @@ this hack.
- "/lib/udev/rules.d",
- "/usr/lib/udev/rules.d",
-#endif
-+ NULL, /* placeholder for $EUDEV_RULES_DIRECTORY */
+- "/usr/local/lib/udev/rules.d",
++ NULL, /* placeholder for $EUDEV_RULES_DIRECTORY */
NULL};
struct udev_rules {
-@@ -1704,6 +1700,9 @@
+@@ -1718,6 +1713,9 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) {
udev_rules_check_timestamp(rules);
diff --git a/gnu/packages/patches/ffmpeg-4-binutils-2.41.patch b/gnu/packages/patches/ffmpeg-4-binutils-2.41.patch
new file mode 100644
index 0000000000..52a9310029
--- /dev/null
+++ b/gnu/packages/patches/ffmpeg-4-binutils-2.41.patch
@@ -0,0 +1,76 @@
+From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001
+From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
+Date: Sun, 16 Jul 2023 18:18:02 +0300
+Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift
+ instructions within inline assembly
+
+Fixes assembling with binutil as >= 2.41
+
+Signed-off-by: James Almer <jamrial@gmail.com>
+---
+ libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++---
+ 1 file changed, 23 insertions(+), 3 deletions(-)
+
+diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
+index 6298f5ed19..ca7e2dffc1 100644
+--- a/libavcodec/x86/mathops.h
++++ b/libavcodec/x86/mathops.h
+@@ -35,12 +35,20 @@
+ static av_always_inline av_const int MULL(int a, int b, unsigned shift)
+ {
+ int rt, dummy;
++ if (__builtin_constant_p(shift))
+ __asm__ (
+ "imull %3 \n\t"
+ "shrdl %4, %%edx, %%eax \n\t"
+ :"=a"(rt), "=d"(dummy)
+- :"a"(a), "rm"(b), "ci"((uint8_t)shift)
++ :"a"(a), "rm"(b), "i"(shift & 0x1F)
+ );
++ else
++ __asm__ (
++ "imull %3 \n\t"
++ "shrdl %4, %%edx, %%eax \n\t"
++ :"=a"(rt), "=d"(dummy)
++ :"a"(a), "rm"(b), "c"((uint8_t)shift)
++ );
+ return rt;
+ }
+
+@@ -113,19 +121,31 @@ __asm__ volatile(\
+ // avoid +32 for shift optimization (gcc should do that ...)
+ #define NEG_SSR32 NEG_SSR32
+ static inline int32_t NEG_SSR32( int32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("sarl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("sarl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+ #define NEG_USR32 NEG_USR32
+ static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("shrl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("shrl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+--
+2.25.1
+
diff --git a/gnu/packages/patches/ffmpeg-remove-compressed_ten_bit_format.patch b/gnu/packages/patches/ffmpeg-remove-compressed_ten_bit_format.patch
new file mode 100644
index 0000000000..3eac98d1f9
--- /dev/null
+++ b/gnu/packages/patches/ffmpeg-remove-compressed_ten_bit_format.patch
@@ -0,0 +1,43 @@
+From 031f1561cd286596cdb374da32f8aa816ce3b135 Mon Sep 17 00:00:00 2001
+From: Christopher Degawa <christopher.degawa@intel.com>
+Date: Thu, 20 Oct 2022 22:55:27 -0500
+Subject: [PATCH] avcodec/libsvtav1: remove compressed_ten_bit_format and
+ simplify alloc_buffer
+
+compressed_ten_bit_format has been deprecated upstream and has no effect
+and can be removed. Plus, technically it was never used in the first place
+since it would require the app (ffmpeg) to set it and do additional
+processing of the input frames.
+
+Also simplify alloc_buffer by removing calculations relating to the
+non-existant processing.
+
+Signed-off-by: Christopher Degawa <christopher.degawa@intel.com>
+---
+ libavcodec/libsvtav1.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
+index 2f5634cee0241..28da206cf8512 100644
+--- a/libavcodec/libsvtav1.c
++++ b/libavcodec/libsvtav1.c
+@@ -124,16 +124,12 @@ static int svt_print_error(void *log_ctx, EbErrorType err,
+
+ static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc)
+ {
+- const int pack_mode_10bit =
+- (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0;
+- const size_t luma_size_8bit =
+- config->source_width * config->source_height * (1 << pack_mode_10bit);
+- const size_t luma_size_10bit =
+- (config->encoder_bit_depth > 8 && pack_mode_10bit == 0) ? luma_size_8bit : 0;
++ const size_t luma_size = config->source_width * config->source_height *
++ (config->encoder_bit_depth > 8 ? 2 : 1);
+
+ EbSvtIOFormat *in_data;
+
+- svt_enc->raw_size = (luma_size_8bit + luma_size_10bit) * 3 / 2;
++ svt_enc->raw_size = luma_size * 3 / 2;
+
+ // allocate buffer for in and out
+ svt_enc->in_buf = av_mallocz(sizeof(*svt_enc->in_buf));
diff --git a/gnu/packages/patches/file-32bit-time.patch b/gnu/packages/patches/file-32bit-time.patch
new file mode 100644
index 0000000000..671bcfdf66
--- /dev/null
+++ b/gnu/packages/patches/file-32bit-time.patch
@@ -0,0 +1,40 @@
+Upstream uses CVS, this is taken from the Github mirror
+https://github.com/file/file/commit/218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1.patch
+https://sources.debian.org/src/file/1%3A5.45-2/debian/patches/1690555105.FILE5_45-1-g218fdf81.deal-with-32-bit-time-t.patch/
+
+From 218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1 Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Fri, 28 Jul 2023 14:38:25 +0000
+Subject: [PATCH] deal with 32 bit time_t
+
+---
+ src/file.h | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/file.h b/src/file.h
+index 2e0494d2f..78f574ea1 100644
+--- a/src/file.h
++++ b/src/file.h
+@@ -27,7 +27,7 @@
+ */
+ /*
+ * file.h - definitions for file(1) program
+- * @(#)$File: file.h,v 1.247 2023/07/27 19:40:22 christos Exp $
++ * @(#)$File: file.h,v 1.248 2023/07/28 14:38:25 christos Exp $
+ */
+
+ #ifndef __file_h__
+@@ -159,9 +159,11 @@
+ /*
+ * Dec 31, 23:59:59 9999
+ * we need to make sure that we don't exceed 9999 because some libc
+- * implementations like muslc crash otherwise
++ * implementations like muslc crash otherwise. If you are unlucky
++ * to be running on a system with a 32 bit time_t, then it is even less.
+ */
+-#define MAX_CTIME CAST(time_t, 0x3afff487cfULL)
++#define MAX_CTIME \
++ CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
+
+ #define FILE_BADSIZE CAST(size_t, ~0ul)
+ #define MAXDESC 64 /* max len of text description/MIME type */
diff --git a/gnu/packages/patches/gcc-10-libsanitizer-no-crypt.patch b/gnu/packages/patches/gcc-10-libsanitizer-no-crypt.patch
new file mode 100644
index 0000000000..72707ea982
--- /dev/null
+++ b/gnu/packages/patches/gcc-10-libsanitizer-no-crypt.patch
@@ -0,0 +1,134 @@
+Adapted from LLVM's patch, removed LLVM-specific test stuff. Original commit
+message follows.
+
+From d7bead833631486e337e541e692d9b4a1ca14edd Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Fri, 28 Apr 2023 09:59:17 -0700
+Subject: [PATCH] [sanitizer] Remove crypt and crypt_r interceptors
+
+From Florian Weimer's D144073
+
+> On GNU/Linux (glibc), the crypt and crypt_r functions are not part of the main shared object (libc.so.6), but libcrypt (with multiple possible sonames). The sanitizer libraries do not depend on libcrypt, so it can happen that during sanitizer library initialization, no real implementation will be found because the crypt, crypt_r functions are not present in the process image (yet). If its interceptors are called nevertheless, this results in a call through a null pointer when the sanitizer library attempts to forward the call to the real implementation.
+>
+> Many distributions have already switched to libxcrypt, a library that is separate from glibc and that can be build with sanitizers directly (avoiding the need for interceptors). This patch disables building the interceptor for glibc targets.
+
+Let's remove crypt and crypt_r interceptors (D68431) to fix issues with
+newer glibc.
+
+For older glibc, msan will not know that an uninstrumented crypt_r call
+initializes `data`, so there is a risk for false positives. However, with some
+codebase survey, I think crypt_r uses are very few and the call sites typically
+have a `memset(&data, 0, sizeof(data));` anyway.
+
+Fix https://github.com/google/sanitizers/issues/1365
+Related: https://bugzilla.redhat.com/show_bug.cgi?id=2169432
+
+Reviewed By: #sanitizers, fweimer, thesamesam, vitalybuka
+
+Differential Revision: https://reviews.llvm.org/D149403
+---
+ .../sanitizer_common_interceptors.inc | 37 -------------------
+ .../sanitizer_platform_interceptors.h | 2 -
+ .../sanitizer_platform_limits_posix.cpp | 8 ----
+ .../sanitizer_platform_limits_posix.h | 1 -
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
+index b30c91f06cfeb..490a8b12d8b17 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
++++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
+@@ -10086,41 +10086,6 @@ INTERCEPTOR(SSIZE_T, getrandom, void *buf, SIZE_T buflen, unsigned int flags) {
+ #define INIT_GETRANDOM
+ #endif
+
+-#if SANITIZER_INTERCEPT_CRYPT
+-INTERCEPTOR(char *, crypt, char *key, char *salt) {
+- void *ctx;
+- COMMON_INTERCEPTOR_ENTER(ctx, crypt, key, salt);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1);
+- char *res = REAL(crypt)(key, salt);
+- if (res != nullptr)
+- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1);
+- return res;
+-}
+-#define INIT_CRYPT COMMON_INTERCEPT_FUNCTION(crypt);
+-#else
+-#define INIT_CRYPT
+-#endif
+-
+-#if SANITIZER_INTERCEPT_CRYPT_R
+-INTERCEPTOR(char *, crypt_r, char *key, char *salt, void *data) {
+- void *ctx;
+- COMMON_INTERCEPTOR_ENTER(ctx, crypt_r, key, salt, data);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1);
+- char *res = REAL(crypt_r)(key, salt, data);
+- if (res != nullptr) {
+- COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data,
+- __sanitizer::struct_crypt_data_sz);
+- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1);
+- }
+- return res;
+-}
+-#define INIT_CRYPT_R COMMON_INTERCEPT_FUNCTION(crypt_r);
+-#else
+-#define INIT_CRYPT_R
+-#endif
+-
+ #if SANITIZER_INTERCEPT_GETENTROPY
+ INTERCEPTOR(int, getentropy, void *buf, SIZE_T buflen) {
+ void *ctx;
+@@ -10698,8 +10663,6 @@ static void InitializeCommonInterceptors() {
+ INIT_GETUSERSHELL;
+ INIT_SL_INIT;
+ INIT_GETRANDOM;
+- INIT_CRYPT;
+- INIT_CRYPT_R;
+ INIT_GETENTROPY;
+ INIT_QSORT;
+ INIT_QSORT_R;
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h b/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
+index eb39fabfd5983..c82ab5c210562 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
+@@ -569,8 +569,6 @@
+ #define SANITIZER_INTERCEPT_FDEVNAME SI_FREEBSD
+ #define SANITIZER_INTERCEPT_GETUSERSHELL (SI_POSIX && !SI_ANDROID)
+ #define SANITIZER_INTERCEPT_SL_INIT (SI_FREEBSD || SI_NETBSD)
+-#define SANITIZER_INTERCEPT_CRYPT (SI_POSIX && !SI_ANDROID)
+-#define SANITIZER_INTERCEPT_CRYPT_R (SI_LINUX && !SI_ANDROID)
+
+ #define SANITIZER_INTERCEPT_GETRANDOM \
+ ((SI_LINUX && __GLIBC_PREREQ(2, 25)) || SI_FREEBSD)
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index a04eed7aa5a6e..6d61d276d77e3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -142,7 +142,6 @@
+ #include <linux/serial.h>
+ #include <sys/msg.h>
+ #include <sys/ipc.h>
+-#include <crypt.h>
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+ #if SANITIZER_ANDROID
+@@ -243,7 +244,6 @@
+ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
+ unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
+ unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
+- unsigned struct_crypt_data_sz = sizeof(struct crypt_data);
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index e6f298c26e1fb..58244c9944a03 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -309,7 +309,6 @@ extern unsigned struct_msqid_ds_sz;
+ extern unsigned struct_mq_attr_sz;
+ extern unsigned struct_timex_sz;
+ extern unsigned struct_statvfs_sz;
+-extern unsigned struct_crypt_data_sz;
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+ struct __sanitizer_iovec {
diff --git a/gnu/packages/patches/gcc-12-libsanitizer-no-crypt.patch b/gnu/packages/patches/gcc-12-libsanitizer-no-crypt.patch
new file mode 100644
index 0000000000..d9c0a2557a
--- /dev/null
+++ b/gnu/packages/patches/gcc-12-libsanitizer-no-crypt.patch
@@ -0,0 +1,134 @@
+Adapted from LLVM's patch, removed LLVM-specific test stuff. Original commit
+message follows.
+
+From d7bead833631486e337e541e692d9b4a1ca14edd Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Fri, 28 Apr 2023 09:59:17 -0700
+Subject: [PATCH] [sanitizer] Remove crypt and crypt_r interceptors
+
+From Florian Weimer's D144073
+
+> On GNU/Linux (glibc), the crypt and crypt_r functions are not part of the main shared object (libc.so.6), but libcrypt (with multiple possible sonames). The sanitizer libraries do not depend on libcrypt, so it can happen that during sanitizer library initialization, no real implementation will be found because the crypt, crypt_r functions are not present in the process image (yet). If its interceptors are called nevertheless, this results in a call through a null pointer when the sanitizer library attempts to forward the call to the real implementation.
+>
+> Many distributions have already switched to libxcrypt, a library that is separate from glibc and that can be build with sanitizers directly (avoiding the need for interceptors). This patch disables building the interceptor for glibc targets.
+
+Let's remove crypt and crypt_r interceptors (D68431) to fix issues with
+newer glibc.
+
+For older glibc, msan will not know that an uninstrumented crypt_r call
+initializes `data`, so there is a risk for false positives. However, with some
+codebase survey, I think crypt_r uses are very few and the call sites typically
+have a `memset(&data, 0, sizeof(data));` anyway.
+
+Fix https://github.com/google/sanitizers/issues/1365
+Related: https://bugzilla.redhat.com/show_bug.cgi?id=2169432
+
+Reviewed By: #sanitizers, fweimer, thesamesam, vitalybuka
+
+Differential Revision: https://reviews.llvm.org/D149403
+---
+ .../sanitizer_common_interceptors.inc | 37 -------------------
+ .../sanitizer_platform_interceptors.h | 2 -
+ .../sanitizer_platform_limits_posix.cpp | 8 ----
+ .../sanitizer_platform_limits_posix.h | 1 -
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
+index b30c91f06cfeb..490a8b12d8b17 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
++++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
+@@ -10086,41 +10086,6 @@ INTERCEPTOR(SSIZE_T, getrandom, void *buf, SIZE_T buflen, unsigned int flags) {
+ #define INIT_GETRANDOM
+ #endif
+
+-#if SANITIZER_INTERCEPT_CRYPT
+-INTERCEPTOR(char *, crypt, char *key, char *salt) {
+- void *ctx;
+- COMMON_INTERCEPTOR_ENTER(ctx, crypt, key, salt);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1);
+- char *res = REAL(crypt)(key, salt);
+- if (res != nullptr)
+- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1);
+- return res;
+-}
+-#define INIT_CRYPT COMMON_INTERCEPT_FUNCTION(crypt);
+-#else
+-#define INIT_CRYPT
+-#endif
+-
+-#if SANITIZER_INTERCEPT_CRYPT_R
+-INTERCEPTOR(char *, crypt_r, char *key, char *salt, void *data) {
+- void *ctx;
+- COMMON_INTERCEPTOR_ENTER(ctx, crypt_r, key, salt, data);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1);
+- char *res = REAL(crypt_r)(key, salt, data);
+- if (res != nullptr) {
+- COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data,
+- __sanitizer::struct_crypt_data_sz);
+- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1);
+- }
+- return res;
+-}
+-#define INIT_CRYPT_R COMMON_INTERCEPT_FUNCTION(crypt_r);
+-#else
+-#define INIT_CRYPT_R
+-#endif
+-
+ #if SANITIZER_INTERCEPT_GETENTROPY
+ INTERCEPTOR(int, getentropy, void *buf, SIZE_T buflen) {
+ void *ctx;
+@@ -10698,8 +10663,6 @@ static void InitializeCommonInterceptors() {
+ INIT_GETUSERSHELL;
+ INIT_SL_INIT;
+ INIT_GETRANDOM;
+- INIT_CRYPT;
+- INIT_CRYPT_R;
+ INIT_GETENTROPY;
+ INIT_QSORT;
+ INIT_QSORT_R;
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h b/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
+index eb39fabfd5983..c82ab5c210562 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
+@@ -569,8 +569,6 @@
+ #define SANITIZER_INTERCEPT_FDEVNAME SI_FREEBSD
+ #define SANITIZER_INTERCEPT_GETUSERSHELL (SI_POSIX && !SI_ANDROID)
+ #define SANITIZER_INTERCEPT_SL_INIT (SI_FREEBSD || SI_NETBSD)
+-#define SANITIZER_INTERCEPT_CRYPT (SI_POSIX && !SI_ANDROID)
+-#define SANITIZER_INTERCEPT_CRYPT_R (SI_LINUX && !SI_ANDROID)
+
+ #define SANITIZER_INTERCEPT_GETRANDOM \
+ ((SI_LINUX && __GLIBC_PREREQ(2, 25)) || SI_FREEBSD)
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index a04eed7aa5a6e..6d61d276d77e3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -142,7 +142,6 @@
+ #include <linux/serial.h>
+ #include <sys/msg.h>
+ #include <sys/ipc.h>
+-#include <crypt.h>
+ #endif // SANITIZER_ANDROID
+
+ #include <link.h>
+@@ -243,7 +244,6 @@
+ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
+ unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
+ unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
+- unsigned struct_crypt_data_sz = sizeof(struct crypt_data);
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index e6f298c26e1fb..58244c9944a03 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -309,7 +309,6 @@ extern unsigned struct_msqid_ds_sz;
+ extern unsigned struct_mq_attr_sz;
+ extern unsigned struct_timex_sz;
+ extern unsigned struct_statvfs_sz;
+-extern unsigned struct_crypt_data_sz;
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+ struct __sanitizer_iovec {
diff --git a/gnu/packages/patches/gcc-13-libsanitizer-no-crypt.patch b/gnu/packages/patches/gcc-13-libsanitizer-no-crypt.patch
new file mode 100644
index 0000000000..0785830c36
--- /dev/null
+++ b/gnu/packages/patches/gcc-13-libsanitizer-no-crypt.patch
@@ -0,0 +1,140 @@
+Adapted from LLVM's patch, removed LLVM-specific test stuff. Original commit
+message follows.
+
+From d7bead833631486e337e541e692d9b4a1ca14edd Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i@maskray.me>
+Date: Fri, 28 Apr 2023 09:59:17 -0700
+Subject: [PATCH] [sanitizer] Remove crypt and crypt_r interceptors
+
+From Florian Weimer's D144073
+
+> On GNU/Linux (glibc), the crypt and crypt_r functions are not part of the main shared object (libc.so.6), but libcrypt (with multiple possible sonames). The sanitizer libraries do not depend on libcrypt, so it can happen that during sanitizer library initialization, no real implementation will be found because the crypt, crypt_r functions are not present in the process image (yet). If its interceptors are called nevertheless, this results in a call through a null pointer when the sanitizer library attempts to forward the call to the real implementation.
+>
+> Many distributions have already switched to libxcrypt, a library that is separate from glibc and that can be build with sanitizers directly (avoiding the need for interceptors). This patch disables building the interceptor for glibc targets.
+
+Let's remove crypt and crypt_r interceptors (D68431) to fix issues with
+newer glibc.
+
+For older glibc, msan will not know that an uninstrumented crypt_r call
+initializes `data`, so there is a risk for false positives. However, with some
+codebase survey, I think crypt_r uses are very few and the call sites typically
+have a `memset(&data, 0, sizeof(data));` anyway.
+
+Fix https://github.com/google/sanitizers/issues/1365
+Related: https://bugzilla.redhat.com/show_bug.cgi?id=2169432
+
+Reviewed By: #sanitizers, fweimer, thesamesam, vitalybuka
+
+Differential Revision: https://reviews.llvm.org/D149403
+---
+ .../sanitizer_common_interceptors.inc | 37 -------------------
+ .../sanitizer_platform_interceptors.h | 2 -
+ .../sanitizer_platform_limits_posix.cpp | 8 ----
+ .../sanitizer_platform_limits_posix.h | 1 -
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
+index b30c91f06cfeb..490a8b12d8b17 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
++++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc
+@@ -10086,41 +10086,6 @@ INTERCEPTOR(SSIZE_T, getrandom, void *buf, SIZE_T buflen, unsigned int flags) {
+ #define INIT_GETRANDOM
+ #endif
+
+-#if SANITIZER_INTERCEPT_CRYPT
+-INTERCEPTOR(char *, crypt, char *key, char *salt) {
+- void *ctx;
+- COMMON_INTERCEPTOR_ENTER(ctx, crypt, key, salt);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1);
+- char *res = REAL(crypt)(key, salt);
+- if (res != nullptr)
+- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1);
+- return res;
+-}
+-#define INIT_CRYPT COMMON_INTERCEPT_FUNCTION(crypt);
+-#else
+-#define INIT_CRYPT
+-#endif
+-
+-#if SANITIZER_INTERCEPT_CRYPT_R
+-INTERCEPTOR(char *, crypt_r, char *key, char *salt, void *data) {
+- void *ctx;
+- COMMON_INTERCEPTOR_ENTER(ctx, crypt_r, key, salt, data);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1);
+- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1);
+- char *res = REAL(crypt_r)(key, salt, data);
+- if (res != nullptr) {
+- COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data,
+- __sanitizer::struct_crypt_data_sz);
+- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1);
+- }
+- return res;
+-}
+-#define INIT_CRYPT_R COMMON_INTERCEPT_FUNCTION(crypt_r);
+-#else
+-#define INIT_CRYPT_R
+-#endif
+-
+ #if SANITIZER_INTERCEPT_GETENTROPY
+ INTERCEPTOR(int, getentropy, void *buf, SIZE_T buflen) {
+ void *ctx;
+@@ -10698,8 +10663,6 @@ static void InitializeCommonInterceptors() {
+ INIT_GETUSERSHELL;
+ INIT_SL_INIT;
+ INIT_GETRANDOM;
+- INIT_CRYPT;
+- INIT_CRYPT_R;
+ INIT_GETENTROPY;
+ INIT_QSORT;
+ INIT_QSORT_R;
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h b/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
+index eb39fabfd5983..c82ab5c210562 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_interceptors.h
+@@ -569,8 +569,6 @@
+ #define SANITIZER_INTERCEPT_FDEVNAME SI_FREEBSD
+ #define SANITIZER_INTERCEPT_GETUSERSHELL (SI_POSIX && !SI_ANDROID)
+ #define SANITIZER_INTERCEPT_SL_INIT (SI_FREEBSD || SI_NETBSD)
+-#define SANITIZER_INTERCEPT_CRYPT (SI_POSIX && !SI_ANDROID)
+-#define SANITIZER_INTERCEPT_CRYPT_R (SI_LINUX && !SI_ANDROID)
+
+ #define SANITIZER_INTERCEPT_GETRANDOM \
+ ((SI_LINUX && __GLIBC_PREREQ(2, 25)) || SI_FREEBSD)
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index a04eed7aa5a6e..6d61d276d77e3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -177,10 +177,6 @@ typedef struct user_fpregs elf_fpregset_t;
+ # include "sanitizer_platform_interceptors.h"
+ # include "sanitizer_platform_limits_posix.h"
+
+-#if SANITIZER_INTERCEPT_CRYPT_R
+-#include <crypt.h>
+-#endif
+-
+ namespace __sanitizer {
+ unsigned struct_utsname_sz = sizeof(struct utsname);
+ unsigned struct_stat_sz = sizeof(struct stat);
+@@ -300,10 +296,6 @@ namespace __sanitizer {
+ unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
+ #endif // SANITIZER_GLIBC
+
+-#if SANITIZER_INTERCEPT_CRYPT_R
+- unsigned struct_crypt_data_sz = sizeof(struct crypt_data);
+-#endif
+-
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ unsigned struct_timex_sz = sizeof(struct timex);
+ unsigned struct_msqid_ds_sz = sizeof(struct msqid_ds);
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index e6f298c26e1fb..58244c9944a03 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -309,7 +309,6 @@ extern unsigned struct_msqid_ds_sz;
+ extern unsigned struct_mq_attr_sz;
+ extern unsigned struct_timex_sz;
+ extern unsigned struct_statvfs_sz;
+-extern unsigned struct_crypt_data_sz;
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
+
+ struct __sanitizer_iovec {
diff --git a/gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch b/gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch
new file mode 100644
index 0000000000..9252b6920a
--- /dev/null
+++ b/gnu/packages/patches/gcc-13.2.0-libstdc++-docbook-xsl-uri.patch
@@ -0,0 +1,50 @@
+# Upstreamed <https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628047.html>
+
+From 2748b8df7a241c5fd6a7c2de6621c5cc56bb6ae1 Mon Sep 17 00:00:00 2001
+Message-Id: <2748b8df7a241c5fd6a7c2de6621c5cc56bb6ae1.1692808412.git.mirai@makinata.eu>
+In-Reply-To: <2db0606adfdb800f3fcc95f2cb6c13ff76246e5f.1692808412.git.mirai@makinata.eu>
+References: <2db0606adfdb800f3fcc95f2cb6c13ff76246e5f.1692808412.git.mirai@makinata.eu>
+From: Bruno Victal <mirai@makinata.eu>
+Date: Mon, 21 Aug 2023 20:58:43 +0100
+Subject: [PATCH 2/2] libstdc++: Update docbook xsl URI.
+
+The URI for namespaced docbook-xsl was updated to reflect the current
+DocBook upstream at <https://cdn.docbook.org/>.
+
+libstdc++-v3/Changelog:
+ * acinclude.m4: Update docbook xsl URI.
+ * configure: Regenerate.
+---
+ libstdc++-v3/acinclude.m4 | 2 +-
+ libstdc++-v3/configure | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index b25378eaace..152811fd00d 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -604,7 +604,7 @@ dnl XSL_STYLE_DIR
+ dnl
+ AC_DEFUN([GLIBCXX_CONFIGURE_DOCBOOK], [
+
+-glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
++glibcxx_docbook_url=http://cdn.docbook.org/release/xsl/current/
+
+ AC_MSG_CHECKING([for local stylesheet directory])
+ glibcxx_local_stylesheets=no
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index c4da56c3042..d967b137ea1 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -73923,7 +73923,7 @@ fi
+
+
+
+-glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
++glibcxx_docbook_url=http://cdn.docbook.org/release/xsl/current/
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local stylesheet directory" >&5
+ $as_echo_n "checking for local stylesheet directory... " >&6; }
+--
+2.40.1
+
diff --git a/gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch b/gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch
new file mode 100644
index 0000000000..abc4cc877f
--- /dev/null
+++ b/gnu/packages/patches/gcc-13.2.0-libstdc++-info-install-fix.patch
@@ -0,0 +1,70 @@
+# Upstreamed <https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628047.html>
+
+From 2db0606adfdb800f3fcc95f2cb6c13ff76246e5f Mon Sep 17 00:00:00 2001
+Message-Id: <2db0606adfdb800f3fcc95f2cb6c13ff76246e5f.1692808412.git.mirai@makinata.eu>
+From: Bruno Victal <mirai@makinata.eu>
+Date: Mon, 21 Aug 2023 20:58:22 +0100
+Subject: [PATCH 1/2] libstdc++: Fix 'doc-install-info' rule.
+
+The info manual isn't moved to the expected location after
+generation which causes the install rule for it to fail.
+
+libstdc++-v3/Changelog:
+
+ * doc/Makefile.in: Regenerate.
+ * doc/Makefile.am: Fix 'doc-install-info' rule.
+ Fix typo in commment.
+---
+ libstdc++-v3/doc/Makefile.am | 4 ++--
+ libstdc++-v3/doc/Makefile.in | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libstdc++-v3/doc/Makefile.am b/libstdc++-v3/doc/Makefile.am
+index 8371441c62e..373522d593d 100644
+--- a/libstdc++-v3/doc/Makefile.am
++++ b/libstdc++-v3/doc/Makefile.am
+@@ -598,7 +598,7 @@ stamp-pdf-docbook: doc-pdf-docbook-pre doc-xml-single-docbook
+ doc-pdf-docbook: stamp-pdf-docbook
+
+ # TEXINFO, via docbook2X
+-# NB: Both experimental and tempermental
++# NB: Both experimental and temperamental
+ manual_texi = ${docbook_outdir}/texinfo/libstdc++-manual.texi
+ manual_info = ${docbook_outdir}/texinfo/libstdc++-manual.info
+ DB2TEXI_FLAGS = \
+@@ -615,7 +615,7 @@ stamp-texinfo-docbook: stamp-xml-single-docbook ${docbook_outdir}/texinfo
+
+ stamp-info-docbook: stamp-texinfo-docbook
+ @echo "Generating info files..."
+- $(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi}
++ $(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi} -o ${manual_info}
+ $(STAMP) stamp-info-docbook
+
+ doc-texinfo-docbook: stamp-texinfo-docbook
+diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
+index 21ad8557f7a..c19e3e3044c 100644
+--- a/libstdc++-v3/doc/Makefile.in
++++ b/libstdc++-v3/doc/Makefile.in
+@@ -645,7 +645,7 @@ manual_pdf = ${docbook_outdir}/pdf/libstdc++-manual.pdf
+ DBLATEX_FLAGS = --verbose --pdf --dump --debug --tmpdir=${docbook_outdir}/latex
+
+ # TEXINFO, via docbook2X
+-# NB: Both experimental and tempermental
++# NB: Both experimental and temperamental
+ manual_texi = ${docbook_outdir}/texinfo/libstdc++-manual.texi
+ manual_info = ${docbook_outdir}/texinfo/libstdc++-manual.info
+ DB2TEXI_FLAGS = \
+@@ -1096,7 +1096,7 @@ stamp-texinfo-docbook: stamp-xml-single-docbook ${docbook_outdir}/texinfo
+
+ stamp-info-docbook: stamp-texinfo-docbook
+ @echo "Generating info files..."
+- $(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi}
++ $(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi} -o ${manual_info}
+ $(STAMP) stamp-info-docbook
+
+ doc-texinfo-docbook: stamp-texinfo-docbook
+
+base-commit: f9ff6fa58217294d63f255dd02abfcc8a074f509
+--
+2.40.1
+
diff --git a/gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch b/gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch
new file mode 100644
index 0000000000..473e08e240
--- /dev/null
+++ b/gnu/packages/patches/gcc-5.5.0-libstdc++-xmlcatalog.patch
@@ -0,0 +1,402 @@
+From 7f792d2acc0d3eeb95c6f8e0acd72ae304cec9be Mon Sep 17 00:00:00 2001
+Message-Id: <7f792d2acc0d3eeb95c6f8e0acd72ae304cec9be.1692813549.git.mirai@makinata.eu>
+From: Jonathan Wakely <jwakely@redhat.com>
+Date: Wed, 27 Feb 2019 11:25:44 +0000
+Subject: [PATCH] PR libstdc++/89466 avoid slow xsltproc command in configure
+
+Note: Backported from a4395a846a9343960714568e7cf8af4425e63a50.
+
+Certain broken versions of xsltproc ignore the --nonet option and will
+attempt to fetch the docbook stylesheet from the WWW when it isn't in
+the local XML catalog.
+
+This patch checks for the local stylesheet directory first, and doesn't
+use xsltproc if no local stylesheets are found. Checking for the local
+directory is done using xmlcatalog if available, only checking the
+hardcoded list of directories if xmlcatalog fails. The right directory
+for Suse is added to the hardcoded list.
+
+This should avoid doing an xsltproc check that would need to download
+the stylesheet, so no network connection is made even if a broken
+xsltproc is present.
+
+ PR libstdc++/89466
+ * acinclude.m4 (GLIBCXX_CONFIGURE_DOCBOOK): Reorder check for local
+ stylesheet directories before check for xsltproc. Try to use
+ xmlcatalog to find local stylesheet directory before trying hardcoded
+ paths. Add path used by suse to hardcoded paths. Adjust xsltproc
+ check to look for the same stylesheet as doc/Makefile.am uses. Don't
+ use xsltproc if xmlcatalog fails to find a local stylesheet.
+ * configure.ac: Check for xmlcatalog.
+ * Makefile.in: Regenerate.
+ * configure: Likewise.
+ * doc/Makefile.in: Likewise.
+ * include/Makefile.in: Likewise.
+ * libsupc++/Makefile.in: Likewise.
+ * po/Makefile.in: Likewise.
+ * python/Makefile.in: Likewise.
+ * src/Makefile.in: Likewise.
+ * src/c++11/Makefile.in: Likewise.
+ * src/c++98/Makefile.in: Likewise.
+ * src/filesystem/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+
+From-SVN: r269249
+Modified-by: Bruno Victal <mirai@makinata.eu>
+---
+ libstdc++-v3/Makefile.in | 1 +
+ libstdc++-v3/acinclude.m4 | 47 +++++++------
+ libstdc++-v3/configure | 90 +++++++++++++++++++------
+ libstdc++-v3/configure.ac | 1 +
+ libstdc++-v3/doc/Makefile.in | 1 +
+ libstdc++-v3/include/Makefile.in | 1 +
+ libstdc++-v3/libsupc++/Makefile.in | 1 +
+ libstdc++-v3/po/Makefile.in | 1 +
+ libstdc++-v3/python/Makefile.in | 1 +
+ libstdc++-v3/src/Makefile.in | 1 +
+ libstdc++-v3/src/c++11/Makefile.in | 1 +
+ libstdc++-v3/src/c++98/Makefile.in | 1 +
+ libstdc++-v3/src/filesystem/Makefile.in | 1 +
+ libstdc++-v3/testsuite/Makefile.in | 1 +
+ 14 files changed, 109 insertions(+), 40 deletions(-)
+
+diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
+index a9451e19a96..6aee8281f77 100644
+--- a/libstdc++-v3/Makefile.in
++++ b/libstdc++-v3/Makefile.in
+@@ -230,6 +230,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 18b7b6638ec..fde3fb6da6e 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -674,34 +674,43 @@ dnl XSL_STYLE_DIR
+ dnl
+ AC_DEFUN([GLIBCXX_CONFIGURE_DOCBOOK], [
+
+-AC_MSG_CHECKING([for docbook stylesheets for documentation creation])
+-glibcxx_stylesheets=no
+-if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude http://docbook.sourceforge.net/release/xsl-ns/current/xhtml-1_1/docbook.xsl - 2>/dev/null; then
+- glibcxx_stylesheets=yes
+-fi
+-AC_MSG_RESULT($glibcxx_stylesheets)
++glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
+
+ AC_MSG_CHECKING([for local stylesheet directory])
+ glibcxx_local_stylesheets=no
+-if test x"$glibcxx_stylesheets" = x"yes"; then
+- if test -d /usr/share/sgml/docbook/xsl-ns-stylesheets; then
+- glibcxx_local_stylesheets=yes
+- XSL_STYLE_DIR=/usr/share/sgml/docbook/xsl-ns-stylesheets
+- fi
+- if test -d /usr/share/xml/docbook/stylesheet/docbook-xsl-ns; then
+- glibcxx_local_stylesheets=yes
+- XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl-ns
+- fi
+- if test -d /usr/share/xml/docbook/stylesheet/nwalsh5/current; then
+- glibcxx_local_stylesheets=yes
+- XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/nwalsh5/current
+- fi
++if test x${XMLCATALOG} = xyes && xsl_style_dir=`xmlcatalog "" $glibcxx_docbook_url 2>/dev/null`
++then
++ XSL_STYLE_DIR=`echo $xsl_style_dir | sed -n 's;^file://;;p'`
++ glibcxx_local_stylesheets=yes
++else
++ for dir in \
++ /usr/share/sgml/docbook/xsl-ns-stylesheets \
++ /usr/share/xml/docbook/stylesheet/docbook-xsl-ns \
++ /usr/share/xml/docbook/stylesheet/nwalsh5/current \
++ /usr/share/xml/docbook/stylesheet/nwalsh/current
++ do
++ if test -d $dir; then
++ glibcxx_local_stylesheets=yes
++ XSL_STYLE_DIR=$dir
++ break
++ fi
++ done
+ fi
+ AC_MSG_RESULT($glibcxx_local_stylesheets)
+
+ if test x"$glibcxx_local_stylesheets" = x"yes"; then
+ AC_SUBST(XSL_STYLE_DIR)
+ AC_MSG_NOTICE($XSL_STYLE_DIR)
++
++ AC_MSG_CHECKING([for docbook stylesheets for documentation creation])
++ glibcxx_stylesheets=no
++ if test x${XMLCATALOG} = xno || xmlcatalog "" $glibcxx_docbook_url/xhtml/docbook.xsl >/dev/null 2>&1; then
++ if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude $glibcxx_docbook_url/xhtml/docbook.xsl - 2>/dev/null; then
++ glibcxx_stylesheets=yes
++ fi
++ fi
++ AC_MSG_RESULT($glibcxx_stylesheets)
++
+ else
+ glibcxx_stylesheets=no
+ fi
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index a51dfe6eb13..0c462490b81 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -634,6 +634,7 @@ BUILD_EPUB_TRUE
+ XSL_STYLE_DIR
+ XMLLINT
+ XSLTPROC
++XMLCATALOG
+ DOT
+ DOXYGEN
+ BUILD_INFO_FALSE
+@@ -79678,6 +79679,44 @@ fi
+
+
+ # Check for docbook
++# Extract the first word of "xmlcatalog", so it can be a program name with args.
++set dummy xmlcatalog; 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_XMLCATALOG+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$XMLCATALOG"; then
++ ac_cv_prog_XMLCATALOG="$XMLCATALOG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_XMLCATALOG="yes"
++ $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
++
++ test -z "$ac_cv_prog_XMLCATALOG" && ac_cv_prog_XMLCATALOG="no"
++fi
++fi
++XMLCATALOG=$ac_cv_prog_XMLCATALOG
++if test -n "$XMLCATALOG"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLCATALOG" >&5
++$as_echo "$XMLCATALOG" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
+ # Extract the first word of "xsltproc", so it can be a program name with args.
+ set dummy xsltproc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+@@ -79756,31 +79795,28 @@ fi
+
+
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for docbook stylesheets for documentation creation" >&5
+-$as_echo_n "checking for docbook stylesheets for documentation creation... " >&6; }
+-glibcxx_stylesheets=no
+-if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude http://docbook.sourceforge.net/release/xsl-ns/current/xhtml-1_1/docbook.xsl - 2>/dev/null; then
+- glibcxx_stylesheets=yes
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_stylesheets" >&5
+-$as_echo "$glibcxx_stylesheets" >&6; }
++glibcxx_docbook_url=http://docbook.sourceforge.net/release/xsl-ns/current/
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local stylesheet directory" >&5
+ $as_echo_n "checking for local stylesheet directory... " >&6; }
+ glibcxx_local_stylesheets=no
+-if test x"$glibcxx_stylesheets" = x"yes"; then
+- if test -d /usr/share/sgml/docbook/xsl-ns-stylesheets; then
+- glibcxx_local_stylesheets=yes
+- XSL_STYLE_DIR=/usr/share/sgml/docbook/xsl-ns-stylesheets
+- fi
+- if test -d /usr/share/xml/docbook/stylesheet/docbook-xsl-ns; then
+- glibcxx_local_stylesheets=yes
+- XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl-ns
+- fi
+- if test -d /usr/share/xml/docbook/stylesheet/nwalsh5/current; then
+- glibcxx_local_stylesheets=yes
+- XSL_STYLE_DIR=/usr/share/xml/docbook/stylesheet/nwalsh5/current
+- fi
++if test x${XMLCATALOG} = xyes && xsl_style_dir=`xmlcatalog "" $glibcxx_docbook_url 2>/dev/null`
++then
++ XSL_STYLE_DIR=`echo $xsl_style_dir | sed -n 's;^file://;;p'`
++ glibcxx_local_stylesheets=yes
++else
++ for dir in \
++ /usr/share/sgml/docbook/xsl-ns-stylesheets \
++ /usr/share/xml/docbook/stylesheet/docbook-xsl-ns \
++ /usr/share/xml/docbook/stylesheet/nwalsh5/current \
++ /usr/share/xml/docbook/stylesheet/nwalsh/current
++ do
++ if test -d $dir; then
++ glibcxx_local_stylesheets=yes
++ XSL_STYLE_DIR=$dir
++ break
++ fi
++ done
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_local_stylesheets" >&5
+ $as_echo "$glibcxx_local_stylesheets" >&6; }
+@@ -79789,6 +79825,18 @@ if test x"$glibcxx_local_stylesheets" = x"yes"; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $XSL_STYLE_DIR" >&5
+ $as_echo "$as_me: $XSL_STYLE_DIR" >&6;}
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for docbook stylesheets for documentation creation" >&5
++$as_echo_n "checking for docbook stylesheets for documentation creation... " >&6; }
++ glibcxx_stylesheets=no
++ if test x${XMLCATALOG} = xno || xmlcatalog "" $glibcxx_docbook_url/xhtml/docbook.xsl >/dev/null 2>&1; then
++ if test x${XSLTPROC} = xyes && echo '<title/>' | xsltproc --noout --nonet --xinclude $glibcxx_docbook_url/xhtml/docbook.xsl - 2>/dev/null; then
++ glibcxx_stylesheets=yes
++ fi
++ fi
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_stylesheets" >&5
++$as_echo "$glibcxx_stylesheets" >&6; }
++
+ else
+ glibcxx_stylesheets=no
+ fi
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 580fb8b2eb8..92a18b88135 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -422,6 +422,7 @@ AC_CHECK_PROG([DOXYGEN], doxygen, yes, no)
+ AC_CHECK_PROG([DOT], dot, yes, no)
+
+ # Check for docbook
++AC_CHECK_PROG([XMLCATALOG], xmlcatalog, yes, no)
+ AC_CHECK_PROG([XSLTPROC], xsltproc, yes, no)
+ AC_CHECK_PROG([XMLLINT], xmllint, yes, no)
+ GLIBCXX_CONFIGURE_DOCBOOK
+diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
+index 4690fad8ac6..522a96c681d 100644
+--- a/libstdc++-v3/doc/Makefile.in
++++ b/libstdc++-v3/doc/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+
+ # Validate existing XML structure.
+ XMLLINT = xmllint
+diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
+index 591301add5f..c28b1f4504f 100644
+--- a/libstdc++-v3/include/Makefile.in
++++ b/libstdc++-v3/include/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
+index 8f627c6bcd3..5f63c6c0f72 100644
+--- a/libstdc++-v3/libsupc++/Makefile.in
++++ b/libstdc++-v3/libsupc++/Makefile.in
+@@ -273,6 +273,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
+index 5bcf4da7fa5..cabd3f3368c 100644
+--- a/libstdc++-v3/po/Makefile.in
++++ b/libstdc++-v3/po/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
+index 26eb2abfb19..c1f46c02ea1 100644
+--- a/libstdc++-v3/python/Makefile.in
++++ b/libstdc++-v3/python/Makefile.in
+@@ -232,6 +232,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
+index 5221a5d5c29..e0c7bab1e78 100644
+--- a/libstdc++-v3/src/Makefile.in
++++ b/libstdc++-v3/src/Makefile.in
+@@ -265,6 +265,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/c++11/Makefile.in b/libstdc++-v3/src/c++11/Makefile.in
+index 4f92d71d19c..88a2dd5c7a0 100644
+--- a/libstdc++-v3/src/c++11/Makefile.in
++++ b/libstdc++-v3/src/c++11/Makefile.in
+@@ -235,6 +235,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/c++98/Makefile.in b/libstdc++-v3/src/c++98/Makefile.in
+index 8dca17f360e..58ea47a9db6 100644
+--- a/libstdc++-v3/src/c++98/Makefile.in
++++ b/libstdc++-v3/src/c++98/Makefile.in
+@@ -236,6 +236,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/src/filesystem/Makefile.in b/libstdc++-v3/src/filesystem/Makefile.in
+index f8f0180f9ba..c7c997686cb 100644
+--- a/libstdc++-v3/src/filesystem/Makefile.in
++++ b/libstdc++-v3/src/filesystem/Makefile.in
+@@ -244,6 +244,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
+index 4f67a37966d..d7417fe5a1f 100644
+--- a/libstdc++-v3/testsuite/Makefile.in
++++ b/libstdc++-v3/testsuite/Makefile.in
+@@ -202,6 +202,7 @@ VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
+ VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
+ WARN_FLAGS = @WARN_FLAGS@
+ WERROR = @WERROR@
++XMLCATALOG = @XMLCATALOG@
+ XMLLINT = @XMLLINT@
+ XSLTPROC = @XSLTPROC@
+ XSL_STYLE_DIR = @XSL_STYLE_DIR@
+--
+2.40.1
+
diff --git a/gnu/packages/patches/gcc-7-libsanitizer-fsconfig-command.patch b/gnu/packages/patches/gcc-7-libsanitizer-fsconfig-command.patch
new file mode 100644
index 0000000000..f203a5542d
--- /dev/null
+++ b/gnu/packages/patches/gcc-7-libsanitizer-fsconfig-command.patch
@@ -0,0 +1,32 @@
+Avoid redefinition of ‘enum fsconfig_command’ and ‘struct mount_attr’ in
+libsanitizer with glibc 2.38.
+
+ https://github.com/draperlaboratory/hope-llvm-project/commit/d8daef856858ecbd19898c3e0de63e76221e2baa
+ https://github.com/llvm/llvm-project/issues/56421
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113181
+
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -73,7 +73,6 @@
+ #include <sys/vt.h>
+ #include <linux/cdrom.h>
+ #include <linux/fd.h>
+-#include <linux/fs.h>
+ #include <linux/hdreg.h>
+ #include <linux/input.h>
+ #include <linux/ioctl.h>
+@@ -876,10 +875,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+ unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
+ unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
+ #endif
+- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
+- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
+- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
+- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
++ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
++ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
++ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
++ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
+ unsigned IOCTL_GIO_CMAP = GIO_CMAP;
+ unsigned IOCTL_GIO_FONT = GIO_FONT;
+ unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch b/gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch
new file mode 100644
index 0000000000..3e40da4cc6
--- /dev/null
+++ b/gnu/packages/patches/ghc-9-StgCRunAsm-only-when-needed.patch
@@ -0,0 +1,33 @@
+From d61f742876bdf2cd32e76f7bca389106ad99a316 Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben@smart-cactus.org>
+Date: Tue, 3 May 2022 12:40:43 -0400
+Subject: [PATCH] rts/ghc.mk: Only build StgCRunAsm.S when it is needed
+
+Previously the make build system unconditionally included StgCRunAsm.S
+in the link, meaning that the RTS would require an execstack
+unnecessarily.
+
+Fixes #21478.
+---
+ rts/ghc.mk | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/rts/ghc.mk b/rts/ghc.mk
+index 36a82f9f2c8..0e56515a569 100644
+--- a/rts/ghc.mk
++++ b/rts/ghc.mk
+@@ -57,8 +57,11 @@ ifneq "$(PORTING_HOST)" "YES"
+
+ # unregisterised builds use the mini interpreter
+ ifneq "$(GhcUnregisterised)" "YES"
++# use StgCRunAsm.S on ppc, ppc64, s390x, and riscv64
++ifneq "$(findstring $(TargetArch_CPP), ppc)$(findstring $(TargetArch_CPP), ppc64)$(findstring $(TargetArch_CPP), s390x)$(findstring $(TargetArch_CPP), riscv64)" ""
+ rts_S_SRCS += rts/StgCRunAsm.S
+ endif
++endif
+
+ # select adjustor implementation. This much match the logic in rts.cabal.in.
+ ifneq "$(CLEANING)" "YES"
+--
+GitLab
+
diff --git a/gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch b/gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch
deleted file mode 100644
index 5d4afa28c1..0000000000
--- a/gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Slightly modified version of
-https://gitlab.haskell.org/ghc/ghc/-/issues/19029#note_447989, required
-for older, buggy glibc versions < 2.34.
-
-diff -Naur ghc-9.2.5/compiler/GHC/Linker/Unit.hs ghc-9.2.5.patched/compiler/GHC/Linker/Unit.hs
---- ghc-9.2.5/compiler/GHC/Linker/Unit.hs 2022-11-06 20:40:29.000000000 +0100
-+++ ghc-9.2.5.patched/compiler/GHC/Linker/Unit.hs 2023-01-15 14:52:57.511275338 +0100
-@@ -31,11 +31,26 @@
- ps <- mayThrowUnitErr $ preloadUnitsInfo' unit_env pkgs
- return (collectLinkOpts dflags ps)
-
-+fixOrderLinkOpts :: [String] -> [String]
-+fixOrderLinkOpts opts
-+ | have_bad_glibc_version -- glibc version strictly less than 2.34
-+ , let (before, rest) = break (== libc) opts
-+ , not (pthread `elem` before)
-+ , pthread `elem` rest -- optional if we know pthread is definitely present
-+ = before ++ pthread_and_deps ++ rest
-+ | otherwise
-+ = opts
-+ where
-+ pthread = "-lpthread"
-+ libc = "-lc"
-+ pthread_and_deps = [ "-lrt", pthread ] -- should depend on the environment
-+ have_bad_glibc_version = True
-+
- collectLinkOpts :: DynFlags -> [UnitInfo] -> ([String], [String], [String])
- collectLinkOpts dflags ps =
- (
- concatMap (map ("-l" ++) . unitHsLibs (ghcNameVersion dflags) (ways dflags)) ps,
-- concatMap (map ("-l" ++) . map ST.unpack . unitExtDepLibsSys) ps,
-+ fixOrderLinkOpts $ concatMap (map ("-l" ++) . map ST.unpack . unitExtDepLibsSys) ps,
- concatMap (map ST.unpack . unitLinkerOptions) ps
- )
-
diff --git a/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch b/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch
new file mode 100644
index 0000000000..cdaf5b180d
--- /dev/null
+++ b/gnu/packages/patches/ghc-testsuite-recomp015-execstack.patch
@@ -0,0 +1,10 @@
+--- a/testsuite/tests/driver/recomp015/Makefile 2024-01-13 16:22:42.643106725 +0100
++++ b/testsuite/tests/driver/recomp015/Makefile 2024-01-13 16:23:18.406867917 +0100
+@@ -26,6 +26,7 @@
+ # number of sections)
+ '$(TEST_HC)' $(TEST_HC_OPTS) Generate.hs
+ ./Generate > ManySections.s
++ echo '.section .note.GNU-stack,"",@progbits' > ManySections.s
+ echo 'main = putStrLn "Running main..."' > Main.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c ManySections.s
+ '$(TEST_HC)' $(TEST_HC_OPTS) --make -O Main.hs ManySections.o
diff --git a/gnu/packages/patches/glib-gerror-null-format.patch b/gnu/packages/patches/glib-gerror-null-format.patch
new file mode 100644
index 0000000000..3b1f0dc582
--- /dev/null
+++ b/gnu/packages/patches/glib-gerror-null-format.patch
@@ -0,0 +1,137 @@
+From c4203f740ced1f1fc576caf1550441b57107fd00 Mon Sep 17 00:00:00 2001
+From: Philip Withnall <pwithnall@endlessos.org>
+Date: Mon, 20 Feb 2023 16:41:23 +0000
+Subject: [PATCH] gerror: Emit a critical warning if the message format is NULL
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The code has warned about this since commit 6d9f874330 in 2011.
+
+glibc 2.37 has just started asserting if a `NULL` format is passed to
+`sprintf()`, which caused the existing GLib workaround to start
+asserting too.
+
+Bite the bullet and upgrade the warning for `format != NULL` to a
+critical warning. Projects have had 12 years to fix their code.
+
+The original bug reports
+(https://bugzilla.gnome.org/show_bug.cgi?id=660371,
+https://bugzilla.gnome.org/show_bug.cgi?id=560482) are actually both
+about a domain which is `0`, rather than a format which is `NULL`, which
+gives some confidence that this change will actually impact very little
+third party code.
+
+Since it doesn’t currently need changing, I have not touched the warning
+about `domain != 0`.
+
+Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
+
+Fixes: #2913
+---
+ glib/gerror.c | 8 +++++---
+ glib/tests/error.c | 38 +++++++++++++++++++++++---------------
+ 2 files changed, 28 insertions(+), 18 deletions(-)
+
+diff --git a/glib/gerror.c b/glib/gerror.c
+index 61817fa7bc..7ac85fc664 100644
+--- a/glib/gerror.c
++++ b/glib/gerror.c
+@@ -755,13 +755,14 @@ g_error_new_valist (GQuark domain,
+ const gchar *format,
+ va_list args)
+ {
++ g_return_val_if_fail (format != NULL, NULL);
++
+ /* Historically, GError allowed this (although it was never meant to work),
+ * and it has significant use in the wild, which g_return_val_if_fail
+ * would break. It should maybe g_return_val_if_fail in GLib 4.
+ * (GNOME#660371, GNOME#560482)
+ */
+ g_warn_if_fail (domain != 0);
+- g_warn_if_fail (format != NULL);
+
+ return g_error_new_steal (domain, code, g_strdup_vprintf (format, args), NULL);
+ }
+@@ -887,9 +888,10 @@ g_error_copy (const GError *error)
+ ErrorDomainInfo info;
+
+ g_return_val_if_fail (error != NULL, NULL);
+- /* See g_error_new_valist for why these don't return */
++ g_return_val_if_fail (error->message != NULL, NULL);
++
++ /* See g_error_new_valist for why this doesn’t return */
+ g_warn_if_fail (error->domain != 0);
+- g_warn_if_fail (error->message != NULL);
+
+ copy = g_error_new_steal (error->domain,
+ error->code,
+diff --git a/glib/tests/error.c b/glib/tests/error.c
+index fa3a25969d..8dd40aa566 100644
+--- a/glib/tests/error.c
++++ b/glib/tests/error.c
+@@ -129,17 +129,6 @@ test_new_valist_invalid_va (gpointer dummy,
+ * a %NULL format will crash on FreeBSD as its implementation of vasprintf()
+ * is less forgiving than Linux’s. That’s fine: it’s a programmer error in
+ * either case. */
+- const struct
+- {
+- GQuark domain;
+- const gchar *format;
+- }
+- tests[] =
+- {
+- { G_MARKUP_ERROR, NULL },
+- { 0, "Message" },
+- };
+- gsize i;
+
+ g_test_summary ("Test that g_error_new_valist() rejects invalid input");
+
+@@ -149,12 +138,31 @@ test_new_valist_invalid_va (gpointer dummy,
+ return;
+ }
+
+- for (i = 0; i < G_N_ELEMENTS (tests); i++)
+ {
+- GError *error = NULL, *error_copy = NULL;
++ GError *error = NULL;
+ va_list ap;
+
+- g_test_message ("Test %" G_GSIZE_FORMAT, i);
++ va_start (ap, dummy);
++
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wformat-nonliteral"
++#pragma GCC diagnostic ignored "-Wformat-extra-args"
++
++ g_test_expect_message (G_LOG_DOMAIN,
++ G_LOG_LEVEL_CRITICAL,
++ "*g_error_new_valist: assertion 'format != NULL' failed*");
++ error = g_error_new_valist (G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, NULL, ap);
++ g_test_assert_expected_messages ();
++ g_assert_null (error);
++
++#pragma GCC diagnostic pop
++
++ va_end (ap);
++ }
++
++ {
++ GError *error = NULL, *error_copy = NULL;
++ va_list ap;
+
+ va_start (ap, dummy);
+
+@@ -164,7 +172,7 @@ test_new_valist_invalid_va (gpointer dummy,
+ g_test_expect_message (G_LOG_DOMAIN,
+ G_LOG_LEVEL_WARNING,
+ "*g_error_new_valist: runtime check failed*");
+- error = g_error_new_valist (tests[i].domain, G_MARKUP_ERROR_EMPTY, tests[i].format, ap);
++ error = g_error_new_valist (0, G_MARKUP_ERROR_EMPTY, "Message", ap);
+ g_test_assert_expected_messages ();
+ g_assert_nonnull (error);
+
+--
+GitLab
+
diff --git a/gnu/packages/patches/glib-networking-disable-connection-tls1.2-test.patch b/gnu/packages/patches/glib-networking-disable-connection-tls1.2-test.patch
new file mode 100644
index 0000000000..fc61be38b6
--- /dev/null
+++ b/gnu/packages/patches/glib-networking-disable-connection-tls1.2-test.patch
@@ -0,0 +1,18 @@
+diff -u a/tls/tests/meson.build b/tls/tests/meson.build
+--- a/tls/tests/meson.build 2023-12-28 18:16:09.665443016 +0100
++++ b/tls/tests/meson.build 2023-12-28 18:16:47.517128845 +0100
+@@ -94,14 +94,5 @@
+ ]
+
+ test(program_name, exe, env: test_envs, depends: program[4])
+-
+- if program[0] == 'connection'
+- # Run the tests again, this time with TLS 1.3 disabled so we can test TLS 1.2.
+- if backend == 'gnutls'
+- test(program_name + '-tls1.2', exe, env: test_envs + ['G_TLS_GNUTLS_PRIORITY=NORMAL:%COMPAT:!VERS-TLS1.3'])
+- elif backend == 'openssl'
+- test(program_name + '-tls1.2', exe, env: test_envs + ['G_TLS_OPENSSL_MAX_PROTO=0x0303'])
+- endif
+- endif
+ endforeach
+ endforeach
diff --git a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
index 0acaeb1e46..1f34292ad0 100644
--- a/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
+++ b/gnu/packages/patches/glibc-2.37-versioned-locpath.patch
@@ -1,11 +1,3 @@
-From d73ba2caa10b8e9f51ff4239cc32eeb4e0de4279 Mon Sep 17 00:00:00 2001
-Message-Id: <d73ba2caa10b8e9f51ff4239cc32eeb4e0de4279.1683980025.git.dev@jpoiret.xyz>
-From: Josselin Poiret <dev@jpoiret.xyz>
-Date: Sat, 13 May 2023 14:10:43 +0200
-Subject: [PATCH] Add versioned locpath
-
-From: Josselin Poiret <dev@jpoiret.xyz>
-
The format of locale data can be incompatible between libc versions, and
loading incompatible data can lead to 'setlocale' returning EINVAL at best
or triggering an assertion failure at worst. See
@@ -20,20 +12,22 @@ that variable. So, if GUIX_LOCPATH=/foo:/bar, locale data is searched for in
That way, a single 'GUIX_LOCPATH' setting can work even if different libc
versions coexist on the system.
-
-This patch is adapted from the 2.35 patch.
-
----
- locale/newlocale.c | 15 ++--------
- locale/setlocale.c | 68 +++++++++++++++++++++++++++++++++++++-------
- string/Makefile | 1 +
- string/argz-suffix.c | 56 ++++++++++++++++++++++++++++++++++++
- string/argz.h | 10 +++++++
- 5 files changed, 127 insertions(+), 23 deletions(-)
- create mode 100644 string/argz-suffix.c
-
+diff --git a/locale/Makefile b/locale/Makefile
+index d7036b08..b5125166 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -94,7 +94,9 @@ localepath = "$(complocaledir):$(i18ndir)"
+ # -Iprograms doesn't really belong here, but this gets it at the head
+ # of the list instead of the tail, where CPPFLAGS-$(lib) gets added.
+ # We need it before the standard -I's to see programs/config.h first.
++# Define 'LOCALEDIR' for use in 'compute_locale_search_path'.
+ locale-CPPFLAGS = -DCOMPLOCALEDIR='"$(complocaledir)"' \
++ -DLOCALEDIR='"$(libdir)/locale"' \
+ -DLOCALE_ALIAS_PATH='"$(localedir)"' \
+ -Iprograms
+
diff --git a/locale/newlocale.c b/locale/newlocale.c
-index 108d2428bf..6218e0fa77 100644
+index 108d2428..6218e0fa 100644
--- a/locale/newlocale.c
+++ b/locale/newlocale.c
@@ -29,6 +29,7 @@
@@ -73,10 +67,10 @@ index 108d2428bf..6218e0fa77 100644
/* Get the names for the locales we are interested in. We either
allow a composite name or a single name. */
diff --git a/locale/setlocale.c b/locale/setlocale.c
-index dd73fa4248..d8eb799384 100644
+index 6a902faa..2d07a644 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
-@@ -213,12 +213,65 @@ setdata (int category, struct __locale_data *data)
+@@ -213,12 +213,71 @@ setdata (int category, struct __locale_data *data)
}
}
@@ -124,6 +118,12 @@ index dd73fa4248..d8eb799384 100644
+ goto bail_out;
+ }
+
++ /* Last, unconditionally append our own locale directory, which should
++ contain data for C.UTF-8. */
++ if (__argz_add_sep (locale_path, locale_path_len,
++ LOCALEDIR "/" VERSION, ':') != 0)
++ goto bail_out;
++
+ return 0;
+
+ bail_out:
@@ -143,7 +143,7 @@ index dd73fa4248..d8eb799384 100644
char *composite;
/* Sanity check for CATEGORY argument. */
-@@ -249,17 +302,10 @@ setlocale (int category, const char *locale)
+@@ -249,17 +308,10 @@ setlocale (int category, const char *locale)
locale_path = NULL;
locale_path_len = 0;
@@ -165,7 +165,7 @@ index dd73fa4248..d8eb799384 100644
if (category == LC_ALL)
diff --git a/string/Makefile b/string/Makefile
-index 3eced0d027..a7e68729ad 100644
+index 8cdfd5b0..6b0d606d 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -51,6 +51,7 @@ routines := \
@@ -178,7 +178,7 @@ index 3eced0d027..a7e68729ad 100644
bzero \
diff --git a/string/argz-suffix.c b/string/argz-suffix.c
new file mode 100644
-index 0000000000..505b0f248c
+index 00000000..505b0f24
--- /dev/null
+++ b/string/argz-suffix.c
@@ -0,0 +1,56 @@
@@ -239,7 +239,7 @@ index 0000000000..505b0f248c
+}
+weak_alias (__argz_suffix_entries, argz_suffix_entries)
diff --git a/string/argz.h b/string/argz.h
-index cbc588a8e6..bc6e484c9d 100644
+index cbc588a8..bc6e484c 100644
--- a/string/argz.h
+++ b/string/argz.h
@@ -108,6 +108,16 @@ extern error_t argz_replace (char **__restrict __argz,
@@ -259,6 +259,3 @@ index cbc588a8e6..bc6e484c9d 100644
/* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
are no more. If entry is NULL, then the first entry is returned. This
---
-2.40.1
-
diff --git a/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch b/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch
new file mode 100644
index 0000000000..9db412b5f2
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.38-ldd-x86_64.patch
@@ -0,0 +1,8 @@
+By default, 'RTDLLIST' in 'ldd' refers to 'lib64/ld-linux-x86-64.so', whereas
+it's in 'lib/' for us. This patch fixes that.
+
+--- glibc-2.38/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
++++ glibc-2.38/sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
+@@ -1 +1 @@
+-s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2\4\6 \264\4-x86-64\6 \2x32\4-x32\6"_
++s_^\(RTLDLIST=\)\(.*lib\)\(\|64\|x32\)\(/[^/]*\)\(-x86-64\|-x32\)\(\.so\.[0-9.]*\)[ ]*$_\1"\2\4\6 \2\4-x86-64\6 \2x32\4-x32\6"_
diff --git a/gnu/packages/patches/glibc-2.39-bootstrap-system.patch b/gnu/packages/patches/glibc-2.39-bootstrap-system.patch
new file mode 100644
index 0000000000..5495b35948
--- /dev/null
+++ b/gnu/packages/patches/glibc-2.39-bootstrap-system.patch
@@ -0,0 +1,69 @@
+We want to allow builds in chroots that lack /bin/sh. Thus, system(3)
+and popen(3) need to be tweaked to use the right shell. For the bootstrap
+glibc, we just use whatever `sh' can be found in $PATH. The final glibc
+instead uses the hard-coded absolute file name of `bash'.
+
+In addition, status should be initialized to 0 and not -1.
+
+Adapted to glibc-2.39.
+
+diff --git a/libio/iopopen.c b/libio/iopopen.c
+index ebc381ed7c..e0d3ed1bc3 100644
+--- a/libio/iopopen.c
++++ b/libio/iopopen.c
+@@ -85,8 +85,8 @@ spawn_process (posix_spawn_file_actions_t *fa, FILE *fp, const char *command,
+ return false;
+ }
+
+- err = __posix_spawn (&((_IO_proc_file *) fp)->pid, _PATH_BSHELL, fa, 0,
++ err = __posix_spawnp (&((_IO_proc_file *) fp)->pid, "sh", fa, 0,
+ (char *const[]){ (char*) "sh", (char*) "-c", (char*) "--",
+ (char *) command, NULL }, __environ);
+ if (err != 0)
+ return err;
+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
+@@ -5,6 +5,9 @@
+ __typeof (posix_spawn) __posix_spawn;
+ libc_hidden_proto (__posix_spawn)
+
++__typeof (posix_spawnp) __posix_spawnp;
++libc_hidden_proto (__posix_spawnp)
++
+ __typeof (posix_spawn_file_actions_addclose)
+ __posix_spawn_file_actions_addclose attribute_hidden;
+
+--- a/posix/spawnp.c
++++ b/posix/spawnp.c
+@@ -31,6 +31,7 @@ __posix_spawnp (pid_t *pid, const char *file,
+ SPAWN_XFLAGS_USE_PATH);
+ }
+ versioned_symbol (libc, __posix_spawnp, posix_spawnp, GLIBC_2_15);
++libc_hidden_def (__posix_spawnp)
+
+
+ #if SHLIB_COMPAT (libc, GLIBC_2_2, GLIBC_2_15)
+
diff --git a/gnu/packages/patches/glibc-bootstrap-system.patch b/gnu/packages/patches/glibc-bootstrap-system.patch
index 9c0fac3ff5..c1d532198e 100644
--- a/gnu/packages/patches/glibc-bootstrap-system.patch
+++ b/gnu/packages/patches/glibc-bootstrap-system.patch
@@ -6,23 +6,23 @@ instead uses the hard-coded absolute file name of `bash'.
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
+index 4cc405f2de..8842c989c8 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,
- return false;
+@@ -86,7 +86,7 @@ spawn_process (posix_spawn_file_actions_t *fa, FILE *fp, const char *command,
+ }
}
-- if (__posix_spawn (&((_IO_proc_file *) fp)->pid, _PATH_BSHELL, fa, 0,
-+ if (__posix_spawnp (&((_IO_proc_file *) fp)->pid, "sh", fa, 0,
- (char *const[]){ (char*) "sh", (char*) "-c",
- (char *) command, NULL }, __environ) != 0)
- return false;
+- err = __posix_spawn (&((_IO_proc_file *) fp)->pid, _PATH_BSHELL, fa, 0,
++ err = __posix_spawnp (&((_IO_proc_file *) fp)->pid, "sh", fa, 0,
+ (char *const[]){ (char*) "sh", (char*) "-c", (char*) "--",
+ (char *) command, NULL }, __environ);
+ if (err != 0)
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
-index a03f478fc7..94da6facf3 100644
+index 488b95163b..56b8a028ae 100644
--- a/sysdeps/posix/system.c
+++ b/sysdeps/posix/system.c
-@@ -101,7 +101,7 @@ cancel_handler (void *arg)
+@@ -100,7 +100,7 @@ cancel_handler (void *arg)
static int
do_system (const char *line)
{
@@ -31,7 +31,7 @@ index a03f478fc7..94da6facf3 100644
int ret;
pid_t pid;
struct sigaction sa;
-@@ -145,7 +145,7 @@ do_system (const char *line)
+@@ -144,7 +144,7 @@ do_system (const char *line)
__posix_spawnattr_setflags (&spawn_attr,
POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK);
@@ -39,8 +39,9 @@ index a03f478fc7..94da6facf3 100644
+ ret = __posix_spawnp (&pid, SHELL_NAME, 0, &spawn_attr,
(char *const[]){ (char *) SHELL_NAME,
(char *) "-c",
- (char *) line, NULL },
-
+ (char *) "--",
+diff --git a/include/spawn.h b/include/spawn.h
+index 4a0b1849da..9e47f74391 100644
--- a/include/spawn.h
+++ b/include/spawn.h
@@ -5,6 +5,9 @@
diff --git a/gnu/packages/patches/gnumach-support-noide.patch b/gnu/packages/patches/gnumach-support-noide.patch
deleted file mode 100644
index 723d4bcac4..0000000000
--- a/gnu/packages/patches/gnumach-support-noide.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Upstream status: Taken from Debian/upsream.
-
- https://salsa.debian.org/hurd-team/gnumach/-/blob/master/debian/patches/90_noide.patch
-
-This supports using `noide' on the gnumach command line, disabling
-gnumach IDE support and thus forcing use of rumdisk.
-
----
- linux/dev/glue/block.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
---- a/linux/dev/glue/block.c
-+++ b/linux/dev/glue/block.c
-@@ -207,7 +207,10 @@ int
- blk_dev_init ()
- {
- #ifdef CONFIG_BLK_DEV_IDE
-- ide_init ();
-+ extern char *kernel_cmdline;
-+ if (strncmp(kernel_cmdline, "noide", 5) &&
-+ !strstr(kernel_cmdline, " noide"))
-+ ide_init ();
- #endif
- #ifdef CONFIG_BLK_DEV_FD
- floppy_init ();
diff --git a/gnu/packages/patches/gnutls-cross.patch b/gnu/packages/patches/gnutls-cross.patch
deleted file mode 100644
index 82d08da24e..0000000000
--- a/gnu/packages/patches/gnutls-cross.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-Not sent upstream.
-
-From e23de62e28f64599148ff06e439fac116a391299 Mon Sep 17 00:00:00 2001
-From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
-Date: Fri, 10 Apr 2020 07:24:48 +0200
-Subject: [PATCH] guile: Cross build fix.
-
-To cross-build, both the host guile and the native guile-for-build
-must be available. If the native guile is not available, no snarfing
-is done and the guile cross build is skipped.
-
-During the cross-build gnutls.scm does not load when compliling
-extra.scm, becase of missing definitions from guile-gnutls-v-2.
-
-* guile/modules/gnutls.in (protocol/ssl-3 protocol/tls-1.0,
-protocol/tls-1.1, credentials/anonymous, cipher/rijndael-256-cbc,
-cipher/rijndael-128-cbc, cipher/rijndael-cbc, cipher/arcfour-128,
-certificate-verify/allow-any-x509-v1-ca-certificate,
-certificate-verify/allow-x509-v1-ca-certificate): Define to #f
-initially. When "GNUTLS_GUILE_CROSS_COMPILING" not set, set! to value
-from "guile-gnutls-v-2" load-extension C module.
----
- guile/modules/gnutls.in | 40 +++++++++++++++++++++++++++-------------
- 1 file changed, 27 insertions(+), 13 deletions(-)
-
-diff --git a/guile/modules/gnutls.in b/guile/modules/gnutls.in
-index 6461c404a..954e315de 100644
---- a/guile/modules/gnutls.in
-+++ b/guile/modules/gnutls.in
-@@ -564,22 +564,36 @@ This defines 'variable' as an alias for 'alias', and emits a warning when
- (identifier? #'id)
- #'alias))))))))))
-
--
- ;; Renaming.
--(define protocol/ssl-3 protocol/ssl3)
--(define protocol/tls-1.0 protocol/tls1-0)
--(define protocol/tls-1.1 protocol/tls1-1)
-+(define protocol/ssl-3 #f)
-+(define protocol/tls-1.0 #f)
-+(define protocol/tls-1.1 #f)
-
- ;; Aliases.
--(define credentials/anonymous credentials/anon)
--(define cipher/rijndael-256-cbc cipher/aes-256-cbc)
--(define cipher/rijndael-128-cbc cipher/aes-128-cbc)
--(define cipher/rijndael-cbc cipher/aes-128-cbc)
--(define cipher/arcfour-128 cipher/arcfour)
--(define certificate-verify/allow-any-x509-v1-ca-certificate
-- certificate-verify/allow-any-x509-v1-ca-crt)
--(define certificate-verify/allow-x509-v1-ca-certificate
-- certificate-verify/allow-x509-v1-ca-crt)
-+(define credentials/anonymous #f)
-+(define cipher/rijndael-256-cbc #f)
-+(define cipher/rijndael-128-cbc #f)
-+(define cipher/rijndael-cbc #f)
-+(define cipher/arcfour-128 #f)
-+(define certificate-verify/allow-any-x509-v1-ca-certificate #f)
-+(define certificate-verify/allow-x509-v1-ca-certificate #f)
-+
-+(unless (getenv "GNUTLS_GUILE_CROSS_COMPILING")
-+ ;; Renaming.
-+ (set! protocol/ssl-3 protocol/ssl3)
-+ (set! protocol/tls-1.0 protocol/tls1-0)
-+ (set! protocol/tls-1.1 protocol/tls1-1)
-+
-+ ;; Aliases.
-+ (set! credentials/anonymous credentials/anon)
-+ (set! cipher/rijndael-256-cbc cipher/aes-256-cbc)
-+ (set! cipher/rijndael-128-cbc cipher/aes-128-cbc)
-+ (set! cipher/rijndael-cbc cipher/aes-128-cbc)
-+ (set! cipher/arcfour-128 cipher/arcfour)
-+ (set! certificate-verify/allow-any-x509-v1-ca-certificate
-+ certificate-verify/allow-any-x509-v1-ca-crt)
-+ (set! certificate-verify/allow-x509-v1-ca-certificate
-+ certificate-verify/allow-x509-v1-ca-crt))
-
- ;; Deprecated OpenPGP bindings.
- (define-deprecated certificate-type/openpgp)
---
-2.26.0
-
diff --git a/gnu/packages/patches/hurd-add-without-rump-configure-option.patch b/gnu/packages/patches/hurd-add-without-rump-configure-option.patch
deleted file mode 100644
index 14cefdeac1..0000000000
--- a/gnu/packages/patches/hurd-add-without-rump-configure-option.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 80bc1678b7b859decae536e726a3e5870cbe84eb Mon Sep 17 00:00:00 2001
-Message-Id: <80bc1678b7b859decae536e726a3e5870cbe84eb.1678657122.git.dev@jpoiret.xyz>
-In-Reply-To: <c9b816085272dd07ed762c5ae775a994fa77df56.1678657122.git.dev@jpoiret.xyz>
-References: <c9b816085272dd07ed762c5ae775a994fa77df56.1678657122.git.dev@jpoiret.xyz>
-From: Josselin Poiret <dev@jpoiret.xyz>
-Date: Mon, 31 Oct 2022 13:39:28 +0100
-Subject: [PATCH 2/2] Add --without-rump configure option
-
-From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-
-To allow cross-builds which cannot use AC_LINK_IFELSE at all.
----
- configure.ac | 47 ++++++++++++++++++++++++++---------------------
- 1 file changed, 26 insertions(+), 21 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0c1bf9b2..849b5fad 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -234,33 +234,38 @@ AS_IF([test "x$with_libz" != xno], [
- ])
- AC_SUBST([HAVE_LIBZ])
-
--# Save
--oldLIBS="$LIBS"
-+AC_ARG_WITH([rump],
-+ [AS_HELP_STRING([--without-rump], [disable rump])], , [with_rump=yes])
-
--LIBS="$oldLIBS -lrump"
--AC_LINK_IFELSE(
-- [AC_LANG_PROGRAM(
-- [[#include <hurd.h>
-+AS_IF([test "x$with_rump" != xno], [
-+ # Save
-+ oldLIBS="$LIBS"
-+
-+ LIBS="$oldLIBS -lrump"
-+ AC_LINK_IFELSE(
-+ [AC_LANG_PROGRAM(
-+ [[#include <hurd.h>
- #define _STANDALONE
- #include <rump/rump.h>]],
-- [])],
-- [HAVE_LIBRUMP=yes],
-- [HAVE_LIBRUMP=no])
--AC_SUBST([HAVE_LIBRUMP])
--
--LIBS="$oldLIBS -lrumpvfs_nofifofs_pic"
--AC_LINK_IFELSE(
-- [AC_LANG_PROGRAM(
-- [[#include <hurd.h>
-+ [])],
-+ [HAVE_LIBRUMP=yes],
-+ [HAVE_LIBRUMP=no])
-+ AC_SUBST([HAVE_LIBRUMP])
-+
-+ LIBS="$oldLIBS -lrumpvfs_nofifofs_pic"
-+ AC_LINK_IFELSE(
-+ [AC_LANG_PROGRAM(
-+ [[#include <hurd.h>
- #define _STANDALONE
- #include <rump/rump.h>]],
-- [])],
-- [HAVE_LIBRUMP_VFSNOFIFO=yes],
-- [HAVE_LIBRUMP_VFSNOFIFO=no])
--AC_SUBST([HAVE_LIBRUMP_VFSNOFIFO])
-+ [])],
-+ [HAVE_LIBRUMP_VFSNOFIFO=yes],
-+ [HAVE_LIBRUMP_VFSNOFIFO=no])
-+ AC_SUBST([HAVE_LIBRUMP_VFSNOFIFO])
-
--# Reset
--LIBS="$oldLIBS"
-+ # Reset
-+ LIBS="$oldLIBS"
-+])
-
- AC_ARG_ENABLE(boot-store-types,
- [ --enable-boot-store-types=TYPES...
---
-2.39.1
-
diff --git a/gnu/packages/patches/hurd-fix-rumpdisk-build.patch b/gnu/packages/patches/hurd-fix-rumpdisk-build.patch
deleted file mode 100644
index 4ecd5ed0ee..0000000000
--- a/gnu/packages/patches/hurd-fix-rumpdisk-build.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-Upstream status: taken from upstream.
-
-From a2b0f721d077fdc5c9decb21b975b58fb51a3e8f Mon Sep 17 00:00:00 2001
-From: Janneke Nieuwenhuizen <janneke@gnu.org>
-Date: Mon, 22 May 2023 19:21:47 +0200
-Subject: [PATCH] rumpdisk: Do not assume FHS /usr/lib, fixes Guix cross-build.
-
----
- rumpdisk/Makefile | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/rumpdisk/Makefile b/rumpdisk/Makefile
-index 60a209b3..b59aaf9a 100644
---- a/rumpdisk/Makefile
-+++ b/rumpdisk/Makefile
-@@ -1,5 +1,5 @@
- #
--# Copyright (C) 2019 Free Software Foundation, Inc.
-+# Copyright (C) 2019, 2023 Free Software Foundation, Inc.
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License as
-@@ -15,7 +15,6 @@
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
--RUMPPATH=/usr/lib
- RUMPLIBS=rump rumpuser rumpdev rumpdev_disk rumpdev_pci rumpvfs rumpdev_ahcisata rumpdev_piixide rumpdev_ata
- RUMPEXTRA=rumpdev_scsipi
-
-@@ -38,6 +37,6 @@ target = rumpdisk
- OBJS = $(SRCS:.c=.o)
- HURDLIBS = machdev ports trivfs shouldbeinlibc iohelp ihash fshelp
- LDLIBS += -lpthread -lpciaccess -ldl
--LDLIBS += -Wl,--whole-archive $(RUMPLIBS:%=$(RUMPPATH)/lib%_pic.a) -Wl,--no-whole-archive $(RUMPEXTRA:%=$(RUMPPATH)/lib%_pic.a)
-+LDLIBS += -Wl,--whole-archive $(RUMPLIBS:%=-l%_pic) -Wl,--no-whole-archive $(RUMPEXTRA:%=-l%_pic)
-
- include ../Makeconf
---
-2.40.1
-
diff --git a/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods-2.patch b/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods-2.patch
deleted file mode 100644
index dda95fb3d5..0000000000
--- a/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods-2.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From eb1b2057d839249c955189c2cba8bc37c66d4151 Mon Sep 17 00:00:00 2001
-Message-Id: <eb1b2057d839249c955189c2cba8bc37c66d4151.1678793830.git.dev@jpoiret.xyz>
-In-Reply-To: <f0cacda83293e4d792b8d12665fcb795dc11d6fc.1678793830.git.dev@jpoiret.xyz>
-References: <f0cacda83293e4d792b8d12665fcb795dc11d6fc.1678793830.git.dev@jpoiret.xyz>
-From: Josselin Poiret <dev@jpoiret.xyz>
-Date: Tue, 30 Aug 2022 00:59:59 +0200
-Subject: [PATCH 2/2] Fix types of read write and readables methods
-
-From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-
-This completes 5adb4b834b1e
----
- hurd/pci.defs | 2 +-
- lwip/io-ops.c | 6 +++---
- lwip/port/netif/hurdtunif.c | 6 +++---
- lwip/socket-ops.c | 4 ++--
- pci-arbiter/pci-ops.c | 4 ++--
- storeio/open.c | 2 +-
- 6 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/hurd/pci.defs b/hurd/pci.defs
-index 23c90334..e258f5ce 100644
---- a/hurd/pci.defs
-+++ b/hurd/pci.defs
-@@ -51,7 +51,7 @@ routine pci_conf_write(
- */
- routine pci_get_ndevs(
- master: pci_t;
-- out ndevs: vm_size_t
-+ out ndevs: mach_msg_type_number_t
- );
-
- /*
-diff --git a/lwip/io-ops.c b/lwip/io-ops.c
-index 5461d695..6cc724ce 100644
---- a/lwip/io-ops.c
-+++ b/lwip/io-ops.c
-@@ -36,7 +36,7 @@ error_t
- lwip_S_io_write (struct sock_user *user,
- const_data_t data,
- size_t datalen,
-- off_t offset, mach_msg_type_number_t * amount)
-+ off_t offset, vm_size_t * amount)
- {
- int sent;
- int sockflags;
-@@ -59,7 +59,7 @@ lwip_S_io_write (struct sock_user *user,
- error_t
- lwip_S_io_read (struct sock_user * user,
- data_t *data,
-- size_t * datalen, off_t offset, mach_msg_type_number_t amount)
-+ size_t * datalen, off_t offset, vm_size_t amount)
- {
- error_t err;
- int alloced = 0;
-@@ -112,7 +112,7 @@ lwip_S_io_seek (struct sock_user * user,
- }
-
- error_t
--lwip_S_io_readable (struct sock_user * user, mach_msg_type_number_t * amount)
-+lwip_S_io_readable (struct sock_user * user, vm_size_t * amount)
- {
- error_t err;
- if (!user)
-diff --git a/lwip/port/netif/hurdtunif.c b/lwip/port/netif/hurdtunif.c
-index 79a082cf..c976703f 100644
---- a/lwip/port/netif/hurdtunif.c
-+++ b/lwip/port/netif/hurdtunif.c
-@@ -348,7 +348,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t * data_len,
-- loff_t offs, size_t amount)
-+ loff_t offs, vm_size_t amount)
- {
- struct hurdtunif *tunif;
- struct pbuf *p;
-@@ -423,7 +423,7 @@ trivfs_S_io_write (struct trivfs_protid * cred,
- mach_msg_type_name_t replytype,
- const_data_t data,
- mach_msg_type_number_t datalen,
-- off_t offset, mach_msg_type_number_t * amount)
-+ off_t offset, vm_size_t * amount)
- {
- struct netif *netif;
- struct pbuf *p, *q;
-@@ -482,7 +482,7 @@ trivfs_S_io_write (struct trivfs_protid * cred,
- kern_return_t
- trivfs_S_io_readable (struct trivfs_protid * cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
-- mach_msg_type_number_t * amount)
-+ vm_size_t * amount)
- {
- struct hurdtunif *tunif;
-
-diff --git a/lwip/socket-ops.c b/lwip/socket-ops.c
-index 5b50f58c..d5e3cb07 100644
---- a/lwip/socket-ops.c
-+++ b/lwip/socket-ops.c
-@@ -342,7 +342,7 @@ lwip_S_socket_send (struct sock_user * user,
- const mach_port_t * ports,
- size_t nports,
- const char *control,
-- size_t controllen, mach_msg_type_number_t * amount)
-+ size_t controllen, vm_size_t * amount)
- {
- int sent;
- int sockflags;
-@@ -392,7 +392,7 @@ lwip_S_socket_recv (struct sock_user * user,
- size_t * nports,
- char **control,
- size_t * controllen,
-- int *outflags, mach_msg_type_number_t amount)
-+ int *outflags, vm_size_t amount)
- {
- error_t err;
- union { struct sockaddr_storage storage; struct sockaddr sa; } addr;
-diff --git a/pci-arbiter/pci-ops.c b/pci-arbiter/pci-ops.c
-index ef27a3cd..d721f368 100644
---- a/pci-arbiter/pci-ops.c
-+++ b/pci-arbiter/pci-ops.c
-@@ -80,7 +80,7 @@ calculate_ndevs (struct iouser *user)
- */
- error_t
- S_pci_conf_read (struct protid * master, int reg, char **data,
-- size_t * datalen, mach_msg_type_number_t amount)
-+ size_t * datalen, vm_size_t amount)
- {
- error_t err;
- pthread_mutex_t *lock;
-@@ -129,7 +129,7 @@ S_pci_conf_read (struct protid * master, int reg, char **data,
- /* Write `datalen' bytes from `data'. `amount' is updated. */
- error_t
- S_pci_conf_write (struct protid * master, int reg, const char *data, size_t datalen,
-- mach_msg_type_number_t * amount)
-+ vm_size_t * amount)
- {
- error_t err;
- pthread_mutex_t *lock;
-diff --git a/storeio/open.c b/storeio/open.c
-index f8eb6ce0..74902520 100644
---- a/storeio/open.c
-+++ b/storeio/open.c
-@@ -75,7 +75,7 @@ open_write (struct open *open, off_t offs, const void *buf, size_t len,
- otherwise the error code is returned. */
- error_t
- open_read (struct open *open, off_t offs, vm_size_t amount,
-- void **buf, size_t *len)
-+ void **buf, vm_size_t *len)
- {
- error_t err;
- if (offs < 0)
---
-2.39.1
-
diff --git a/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods.patch b/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods.patch
deleted file mode 100644
index aebe8d6847..0000000000
--- a/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods.patch
+++ /dev/null
@@ -1,891 +0,0 @@
-From 5adb4b834b1eba82b7f3eca6324bed0355cae0af Mon Sep 17 00:00:00 2001
-Message-Id: <5adb4b834b1eba82b7f3eca6324bed0355cae0af.1678815112.git.dev@jpoiret.xyz>
-From: Josselin Poiret <dev@jpoiret.xyz>
-Date: Mon, 29 Aug 2022 21:36:17 +0200
-Subject: [PATCH] Fix types of read write and readables methods
-
-From: Etienne Brateau <etienne.brateau@gmail.com>
-
-Message-Id: <20220829193617.13481-1-etienne.brateau@gmail.com>
----
- boot/boot.c | 6 +++---
- console-client/trans.c | 4 ++--
- libdiskfs/io-read.c | 2 +-
- libdiskfs/io-readable.c | 2 +-
- libdiskfs/io-write.c | 2 +-
- libnetfs/io-read.c | 2 +-
- libnetfs/io-readable.c | 2 +-
- libnetfs/io-write.c | 2 +-
- libpager/data-return.c | 2 +-
- libstore/nbd.c | 6 +++---
- libstore/rdwr.c | 4 ++--
- libtrivfs/io-read.c | 2 +-
- libtrivfs/io-readable.c | 2 +-
- libtrivfs/io-write.c | 2 +-
- mach-defpager/default_pager.c | 4 ++--
- pfinet/io-ops.c | 10 +++++-----
- pfinet/socket-ops.c | 16 ++++++++--------
- pfinet/tunnel.c | 6 +++---
- pflocal/io.c | 6 +++---
- pflocal/socket.c | 14 +++++++-------
- storeio/io.c | 8 ++++----
- storeio/open.c | 4 ++--
- storeio/open.h | 6 +++---
- term/ptyio.c | 4 ++--
- term/term.h | 4 ++--
- term/users.c | 14 +++++++-------
- trans/fifo.c | 10 +++++-----
- trans/firmlink.c | 4 ++--
- trans/hello-mt.c | 2 +-
- trans/hello.c | 2 +-
- trans/mtab.c | 4 ++--
- trans/new-fifo.c | 10 +++++-----
- trans/null.c | 8 ++++----
- trans/proxy-defpager.c | 6 +++---
- trans/random.c | 6 +++---
- trans/streamio.c | 6 +++---
- 36 files changed, 97 insertions(+), 97 deletions(-)
-
-diff --git a/boot/boot.c b/boot/boot.c
-index 1b10c86b..f326e5b2 100644
---- a/boot/boot.c
-+++ b/boot/boot.c
-@@ -1412,7 +1412,7 @@ S_io_write (mach_port_t object,
- const_data_t data,
- mach_msg_type_number_t datalen,
- off_t offset,
-- mach_msg_type_number_t *amtwritten)
-+ vm_size_t *amtwritten)
- {
- if (object != pseudo_console)
- return EOPNOTSUPP;
-@@ -1437,7 +1437,7 @@ S_io_read (mach_port_t object,
- data_t *data,
- mach_msg_type_number_t *datalen,
- off_t offset,
-- mach_msg_type_number_t amount)
-+ vm_size_t amount)
- {
- mach_msg_type_number_t avail;
-
-@@ -1489,7 +1489,7 @@ kern_return_t
- S_io_readable (mach_port_t object,
- mach_port_t reply_port,
- mach_msg_type_name_t reply_type,
-- mach_msg_type_number_t *amt)
-+ vm_size_t *amt)
- {
- if (object != pseudo_console)
- return EOPNOTSUPP;
-diff --git a/console-client/trans.c b/console-client/trans.c
-index fe4b9ca4..49e30a61 100644
---- a/console-client/trans.c
-+++ b/console-client/trans.c
-@@ -578,7 +578,7 @@ netfs_S_io_read (struct protid *user,
- data_t *data,
- mach_msg_type_number_t *datalen,
- off_t offset,
-- mach_msg_type_number_t amount)
-+ vm_size_t amount)
- {
- struct node *np;
-
-@@ -597,7 +597,7 @@ netfs_S_io_write (struct protid *user,
- const_data_t data,
- mach_msg_type_number_t datalen,
- off_t offset,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- struct node *np;
-
-diff --git a/libdiskfs/io-read.c b/libdiskfs/io-read.c
-index 71803517..a706d677 100644
---- a/libdiskfs/io-read.c
-+++ b/libdiskfs/io-read.c
-@@ -25,7 +25,7 @@ diskfs_S_io_read (struct protid *cred,
- data_t *data,
- mach_msg_type_number_t *datalen,
- off_t offset,
-- mach_msg_type_number_t maxread)
-+ vm_size_t maxread)
- {
- struct node *np;
- int err;
-diff --git a/libdiskfs/io-readable.c b/libdiskfs/io-readable.c
-index c3debac3..03218bf3 100644
---- a/libdiskfs/io-readable.c
-+++ b/libdiskfs/io-readable.c
-@@ -22,7 +22,7 @@
- /* Implement io_readable as described in <hurd/io.defs>. */
- kern_return_t
- diskfs_S_io_readable (struct protid *cred,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- struct node *np;
-
-diff --git a/libdiskfs/io-write.c b/libdiskfs/io-write.c
-index 154bc887..9efed88f 100644
---- a/libdiskfs/io-write.c
-+++ b/libdiskfs/io-write.c
-@@ -25,7 +25,7 @@ diskfs_S_io_write (struct protid *cred,
- const_data_t data,
- mach_msg_type_number_t datalen,
- off_t offset,
-- mach_msg_type_number_t *amt)
-+ vm_size_t *amt)
- {
- struct node *np;
- error_t err;
-diff --git a/libnetfs/io-read.c b/libnetfs/io-read.c
-index 2427ce6c..688da1f6 100644
---- a/libnetfs/io-read.c
-+++ b/libnetfs/io-read.c
-@@ -28,7 +28,7 @@ netfs_S_io_read (struct protid *user,
- data_t *data,
- mach_msg_type_number_t *datalen,
- off_t offset,
-- mach_msg_type_number_t amount)
-+ vm_size_t amount)
- {
- error_t err;
- off_t start;
-diff --git a/libnetfs/io-readable.c b/libnetfs/io-readable.c
-index 07becf66..7c365484 100644
---- a/libnetfs/io-readable.c
-+++ b/libnetfs/io-readable.c
-@@ -25,7 +25,7 @@
-
- error_t
- netfs_S_io_readable (struct protid *user,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- error_t err;
-
-diff --git a/libnetfs/io-write.c b/libnetfs/io-write.c
-index 482b45fc..2306d1f0 100644
---- a/libnetfs/io-write.c
-+++ b/libnetfs/io-write.c
-@@ -27,7 +27,7 @@ netfs_S_io_write (struct protid *user,
- const_data_t data,
- mach_msg_type_number_t datalen,
- off_t offset,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- error_t err;
- off_t off = offset;
-diff --git a/libpager/data-return.c b/libpager/data-return.c
-index c0f5aaf7..4c4affe8 100644
---- a/libpager/data-return.c
-+++ b/libpager/data-return.c
-@@ -258,7 +258,7 @@ _pager_S_memory_object_data_return (struct pager *p,
- mach_port_t control,
- vm_offset_t offset,
- pointer_t data,
-- vm_size_t length,
-+ mach_msg_type_number_t length,
- int dirty,
- int kcopy)
- {
-diff --git a/libstore/nbd.c b/libstore/nbd.c
-index 3138af01..8e0892e3 100644
---- a/libstore/nbd.c
-+++ b/libstore/nbd.c
-@@ -119,7 +119,7 @@ nbd_write (struct store *store,
- type: htonl (1), /* WRITE */
- };
- error_t err;
-- mach_msg_type_number_t cc;
-+ vm_size_t cc;
-
- addr <<= store->log2_block_size;
- *amount = 0;
-@@ -178,7 +178,7 @@ nbd_read (struct store *store,
- requested can be found in CHUNK. */
- inline error_t request_chunk (char **buf, size_t *len)
- {
-- mach_msg_type_number_t cc;
-+ vm_size_t cc;
-
- chunk = (amount - ofs) < NBD_IO_MAX ? (amount - ofs) : NBD_IO_MAX;
-
-@@ -435,7 +435,7 @@ nbdclose (struct store *store)
- magic: NBD_REQUEST_MAGIC,
- type: htonl (2), /* disconnect */
- };
-- mach_msg_type_number_t cc;
-+ vm_size_t cc;
- (void) io_write (store->port, (char *) &req, sizeof req, -1, &cc);
-
- /* Close the socket. */
-diff --git a/libstore/rdwr.c b/libstore/rdwr.c
-index 9737c515..f443ad9f 100644
---- a/libstore/rdwr.c
-+++ b/libstore/rdwr.c
-@@ -120,7 +120,7 @@ store_write (struct store *store,
- else
- /* ARGH, we've got to split up the write ... */
- {
-- mach_msg_type_number_t try, written;
-+ vm_size_t try, written;
-
- /* Write the initial bit in the first run. Errors here are returned. */
- try = (run->length - addr) << block_shift;
-@@ -138,7 +138,7 @@ store_write (struct store *store,
- && run->start >= 0) /* Check for holes. */
- /* Ok, we can write in this run, at least a bit. */
- {
-- mach_msg_type_number_t seg_written;
-+ vm_size_t seg_written;
-
- if ((len >> block_shift) <= run->length)
- try = len;
-diff --git a/libtrivfs/io-read.c b/libtrivfs/io-read.c
-index a911f778..4d3302e4 100644
---- a/libtrivfs/io-read.c
-+++ b/libtrivfs/io-read.c
-@@ -26,7 +26,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- data_t *data,
- mach_msg_type_number_t *datalen,
- off_t off,
-- mach_msg_type_number_t amt)
-+ vm_size_t amt)
- {
- assert_backtrace (!trivfs_support_read);
- return EOPNOTSUPP;
-diff --git a/libtrivfs/io-readable.c b/libtrivfs/io-readable.c
-index de4d32b8..acb3fa52 100644
---- a/libtrivfs/io-readable.c
-+++ b/libtrivfs/io-readable.c
-@@ -23,7 +23,7 @@ kern_return_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply,
- mach_msg_type_name_t replytype,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- assert_backtrace (!trivfs_support_read);
- return EOPNOTSUPP;
-diff --git a/libtrivfs/io-write.c b/libtrivfs/io-write.c
-index 74cbb32b..787b2544 100644
---- a/libtrivfs/io-write.c
-+++ b/libtrivfs/io-write.c
-@@ -27,7 +27,7 @@ trivfs_S_io_write (struct trivfs_protid *cred,
- const_data_t data,
- mach_msg_type_number_t datalen,
- off_t off,
-- mach_msg_type_number_t *amt)
-+ vm_size_t *amt)
- {
- if (!(trivfs_allow_open & O_WRITE))
- return EBADF;
-diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
-index fd3a7b22..5c1352f4 100644
---- a/mach-defpager/default_pager.c
-+++ b/mach-defpager/default_pager.c
-@@ -2572,7 +2572,7 @@ seqnos_memory_object_data_initialize(ds, seqno, pager_request,
- vm_offset_t offset;
- register
- pointer_t addr;
-- vm_size_t data_cnt;
-+ mach_msg_type_number_t data_cnt;
- {
- vm_offset_t amount_sent;
- static char here[] = "%sdata_initialize";
-@@ -2631,7 +2631,7 @@ seqnos_memory_object_data_return(ds, seqno, pager_request,
- mach_port_t pager_request;
- vm_offset_t offset;
- pointer_t addr;
-- vm_size_t data_cnt;
-+ mach_msg_type_number_t data_cnt;
- boolean_t dirty;
- boolean_t kernel_copy;
- {
-diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c
-index fa6350c3..6269743d 100644
---- a/pfinet/io-ops.c
-+++ b/pfinet/io-ops.c
-@@ -37,9 +37,9 @@
- error_t
- S_io_write (struct sock_user *user,
- const_data_t data,
-- size_t datalen,
-+ mach_msg_type_number_t datalen,
- off_t offset,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- error_t err;
- struct iovec iov = { (void*) data, datalen };
-@@ -70,9 +70,9 @@ S_io_write (struct sock_user *user,
- error_t
- S_io_read (struct sock_user *user,
- data_t *data,
-- size_t *datalen,
-+ mach_msg_type_number_t *datalen,
- off_t offset,
-- mach_msg_type_number_t amount)
-+ vm_size_t amount)
- {
- error_t err;
- int alloced = 0;
-@@ -135,7 +135,7 @@ S_io_seek (struct sock_user *user,
-
- error_t
- S_io_readable (struct sock_user *user,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- struct sock *sk;
- error_t err;
-diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c
-index db1b92cd..8d27c383 100644
---- a/pfinet/socket-ops.c
-+++ b/pfinet/socket-ops.c
-@@ -431,12 +431,12 @@ S_socket_send (struct sock_user *user,
- struct sock_addr *addr,
- int flags,
- const_data_t data,
-- size_t datalen,
-+ mach_msg_type_number_t datalen,
- const mach_port_t *ports,
-- size_t nports,
-+ mach_msg_type_number_t nports,
- const_data_t control,
-- size_t controllen,
-- mach_msg_type_number_t *amount)
-+ mach_msg_type_number_t controllen,
-+ vm_size_t *amount)
- {
- int sent;
- struct iovec iov = { (void*) data, datalen };
-@@ -478,14 +478,14 @@ S_socket_recv (struct sock_user *user,
- mach_msg_type_name_t *addrporttype,
- int flags,
- data_t *data,
-- size_t *datalen,
-+ mach_msg_type_number_t *datalen,
- mach_port_t **ports,
- mach_msg_type_name_t *portstype,
-- size_t *nports,
-+ mach_msg_type_number_t *nports,
- data_t *control,
-- size_t *controllen,
-+ mach_msg_type_number_t *controllen,
- int *outflags,
-- mach_msg_type_number_t amount)
-+ vm_size_t amount)
- {
- error_t err;
- union { struct sockaddr_storage storage; struct sockaddr sa; } addr;
-diff --git a/pfinet/tunnel.c b/pfinet/tunnel.c
-index 1082404e..e11ab670 100644
---- a/pfinet/tunnel.c
-+++ b/pfinet/tunnel.c
-@@ -291,7 +291,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, size_t amount)
-+ off_t offs, vm_size_t amount)
- {
- struct tunnel_device *tdev;
- struct sk_buff *skb;
-@@ -372,7 +372,7 @@ trivfs_S_io_write (struct trivfs_protid *cred,
- const_data_t data,
- mach_msg_type_number_t datalen,
- off_t offset,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- struct tunnel_device *tdev;
- struct sk_buff *skb;
-@@ -415,7 +415,7 @@ trivfs_S_io_write (struct trivfs_protid *cred,
- kern_return_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- struct tunnel_device *tdev;
- struct sk_buff *skb;
-diff --git a/pflocal/io.c b/pflocal/io.c
-index 96b2fc48..06749756 100644
---- a/pflocal/io.c
-+++ b/pflocal/io.c
-@@ -44,7 +44,7 @@
- error_t
- S_io_read (struct sock_user *user,
- data_t *data, mach_msg_type_number_t *data_len,
-- off_t offset, mach_msg_type_number_t amount)
-+ off_t offset, vm_size_t amount)
- {
- error_t err;
- struct pipe *pipe;
-@@ -80,7 +80,7 @@ S_io_read (struct sock_user *user,
- error_t
- S_io_write (struct sock_user *user,
- const_data_t data, mach_msg_type_number_t data_len,
-- off_t offset, mach_msg_type_number_t *amount)
-+ off_t offset, vm_size_t *amount)
- {
- error_t err;
- struct pipe *pipe;
-@@ -119,7 +119,7 @@ S_io_write (struct sock_user *user,
- a "long time" (this should be the same meaning of "long time" used
- by the nonblocking flag. */
- error_t
--S_io_readable (struct sock_user *user, mach_msg_type_number_t *amount)
-+S_io_readable (struct sock_user *user, vm_size_t *amount)
- {
- error_t err;
- struct pipe *pipe;
-diff --git a/pflocal/socket.c b/pflocal/socket.c
-index 8c1ee3e9..8c240e09 100644
---- a/pflocal/socket.c
-+++ b/pflocal/socket.c
-@@ -287,10 +287,10 @@ S_socket_peername (struct sock_user *user,
- /* Send data over a socket, possibly including Mach ports. */
- error_t
- S_socket_send (struct sock_user *user, struct addr *dest_addr, int flags,
-- const_data_t data, size_t data_len,
-- const mach_port_t *ports, size_t num_ports,
-- const_data_t control, size_t control_len,
-- size_t *amount)
-+ const_data_t data, mach_msg_type_number_t data_len,
-+ const mach_port_t *ports, mach_msg_type_number_t num_ports,
-+ const_data_t control, mach_msg_type_number_t control_len,
-+ vm_size_t *amount)
- {
- error_t err = 0;
- int noblock;
-@@ -378,11 +378,11 @@ error_t
- S_socket_recv (struct sock_user *user,
- mach_port_t *addr, mach_msg_type_name_t *addr_type,
- int in_flags,
-- data_t *data, size_t *data_len,
-+ data_t *data, mach_msg_type_name_t *data_len,
- mach_port_t **ports, mach_msg_type_name_t *ports_type,
- size_t *num_ports,
-- data_t *control, size_t *control_len,
-- int *out_flags, size_t amount)
-+ data_t *control, mach_msg_type_name_t *control_len,
-+ int *out_flags, vm_size_t amount)
- {
- error_t err;
- unsigned flags;
-diff --git a/storeio/io.c b/storeio/io.c
-index 634185f7..3c4cb9ff 100644
---- a/storeio/io.c
-+++ b/storeio/io.c
-@@ -83,8 +83,8 @@ trivfs_S_io_map (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, mach_msg_type_number_t amount)
-+ data_t *data, mach_msg_type_name_t *data_len,
-+ off_t offs, vm_size_t amount)
- {
- if (! cred)
- return EOPNOTSUPP;
-@@ -101,7 +101,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- if (! cred)
- return EOPNOTSUPP;
-@@ -126,7 +126,7 @@ error_t
- trivfs_S_io_write (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- const_data_t data, mach_msg_type_number_t data_len,
-- loff_t offs, mach_msg_type_number_t *amount)
-+ off_t offs, vm_size_t *amount)
- {
- if (! cred)
- return EOPNOTSUPP;
-diff --git a/storeio/open.c b/storeio/open.c
-index 4c2870c6..f8eb6ce0 100644
---- a/storeio/open.c
-+++ b/storeio/open.c
-@@ -74,8 +74,8 @@ open_write (struct open *open, off_t offs, const void *buf, size_t len,
- standard mach out-array convention. If no error occurs, zero is returned,
- otherwise the error code is returned. */
- error_t
--open_read (struct open *open, off_t offs, size_t amount,
-- void **buf, vm_size_t *len)
-+open_read (struct open *open, off_t offs, vm_size_t amount,
-+ void **buf, size_t *len)
- {
- error_t err;
- if (offs < 0)
-diff --git a/storeio/open.h b/storeio/open.h
-index 6be930a6..ad2678ff 100644
---- a/storeio/open.h
-+++ b/storeio/open.h
-@@ -51,13 +51,13 @@ void open_free (struct open *open);
- and returns the number of bytes written in AMOUNT. If no error occurs,
- zero is returned, otherwise the error code is returned. */
- error_t open_write (struct open *open, off_t offs, const void *buf, size_t len,
-- size_t *amount);
-+ vm_size_t *amount);
-
- /* Reads up to AMOUNT bytes from the device into BUF and BUF_LEN using the
- standard mach out-array convention. If no error occurs, zero is returned,
- otherwise the error code is returned. */
--error_t open_read (struct open *open, off_t offs, size_t amount,
-- void **buf, size_t *buf_len);
-+error_t open_read (struct open *open, off_t offs, vm_size_t amount,
-+ void **buf, vm_size_t *buf_len);
-
- /* Set OPEN's location to OFFS, interpreted according to WHENCE as by seek.
- The new absolute location is returned in NEW_OFFS (and may not be the same
-diff --git a/term/ptyio.c b/term/ptyio.c
-index 928ae0ac..acd1015a 100644
---- a/term/ptyio.c
-+++ b/term/ptyio.c
-@@ -302,7 +302,7 @@ error_t
- pty_io_read (struct trivfs_protid *cred,
- data_t *data,
- mach_msg_type_number_t *datalen,
-- mach_msg_type_number_t amount)
-+ vm_size_t amount)
- {
- int size;
-
-@@ -386,7 +386,7 @@ error_t
- pty_io_write (struct trivfs_protid *cred,
- const_data_t data,
- mach_msg_type_number_t datalen,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- int i, flush;
- int cancel = 0;
-diff --git a/term/term.h b/term/term.h
-index efe27ffa..1e6be5f2 100644
---- a/term/term.h
-+++ b/term/term.h
-@@ -387,9 +387,9 @@ extern dev_t rdev;
- /* kludge--these are pty versions of trivfs_S_io_* functions called by
- the real functions in users.c to do work for ptys. */
- error_t pty_io_write (struct trivfs_protid *, const char *,
-- mach_msg_type_number_t, mach_msg_type_number_t *);
-+ mach_msg_type_number_t, vm_size_t *);
- error_t pty_io_read (struct trivfs_protid *, char **,
-- mach_msg_type_number_t *, mach_msg_type_number_t);
-+ mach_msg_type_number_t *, vm_size_t);
- error_t pty_io_readable (size_t *);
- error_t pty_io_select (struct trivfs_protid *, mach_port_t,
- struct timespec *, int *);
-diff --git a/term/users.c b/term/users.c
-index 72f5507d..59f02b66 100644
---- a/term/users.c
-+++ b/term/users.c
-@@ -562,9 +562,9 @@ trivfs_S_io_write (struct trivfs_protid *cred,
- mach_port_t reply,
- mach_msg_type_name_t replytype,
- const_data_t data,
-- size_t datalen,
-- loff_t offset,
-- size_t *amt)
-+ mach_msg_type_name_t datalen,
-+ off_t offset,
-+ vm_size_t *amt)
- {
- int i;
- int cancel;
-@@ -640,9 +640,9 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply,
- mach_msg_type_name_t replytype,
- data_t *data,
-- size_t *datalen,
-- loff_t offset,
-- size_t amount)
-+ mach_msg_type_name_t *datalen,
-+ off_t offset,
-+ vm_size_t amount)
- {
- int cancel;
- int i, max;
-@@ -820,7 +820,7 @@ error_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply,
- mach_msg_type_name_t replytype,
-- size_t *amt)
-+ vm_size_t *amt)
- {
- if (!cred)
- return EOPNOTSUPP;
-diff --git a/trans/fifo.c b/trans/fifo.c
-index ce7c7729..894565f6 100644
---- a/trans/fifo.c
-+++ b/trans/fifo.c
-@@ -339,8 +339,8 @@ trivfs_S_io_map (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- data_t *data, size_t *data_len,
-- off_t offs, size_t amount)
-+ data_t *data, mach_msg_type_name_t *data_len,
-+ off_t offs, vm_size_t amount)
- {
- error_t err;
-
-@@ -368,7 +368,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- size_t *amount)
-+ vm_size_t *amount)
- {
- error_t err;
-
-@@ -502,8 +502,8 @@ trivfs_S_io_select_timeout (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_write (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- const_data_t data, size_t data_len,
-- off_t offs, size_t *amount)
-+ const_data_t data, mach_msg_type_name_t data_len,
-+ off_t offs, vm_size_t *amount)
- {
- error_t err;
-
-diff --git a/trans/firmlink.c b/trans/firmlink.c
-index 8a5d01a8..e216146a 100644
---- a/trans/firmlink.c
-+++ b/trans/firmlink.c
-@@ -207,7 +207,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, mach_msg_type_number_t amount)
-+ off_t offs, vm_size_t amount)
- {
- error_t err = 0;
-
-@@ -244,7 +244,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- if (! cred)
- return EOPNOTSUPP;
-diff --git a/trans/hello-mt.c b/trans/hello-mt.c
-index 92f814d6..e99ba754 100644
---- a/trans/hello-mt.c
-+++ b/trans/hello-mt.c
-@@ -125,7 +125,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, mach_msg_type_number_t amount)
-+ off_t offs, vm_size_t amount)
- {
- struct open *op;
-
-diff --git a/trans/hello.c b/trans/hello.c
-index f8f9e7ab..0405fad3 100644
---- a/trans/hello.c
-+++ b/trans/hello.c
-@@ -116,7 +116,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, mach_msg_type_number_t amount)
-+ off_t offs, vm_size_t amount)
- {
- struct open *op;
-
-diff --git a/trans/mtab.c b/trans/mtab.c
-index caff3385..a2feee7d 100644
---- a/trans/mtab.c
-+++ b/trans/mtab.c
-@@ -657,7 +657,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, mach_msg_type_number_t amount)
-+ off_t offs, vm_size_t amount)
- {
- error_t err = 0;
- struct mtab *op;
-@@ -774,7 +774,7 @@ void (*trivfs_peropen_destroy_hook) (struct trivfs_peropen *) = close_hook;
- kern_return_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- error_t err = 0;
- if (!cred)
-diff --git a/trans/new-fifo.c b/trans/new-fifo.c
-index 9a959a39..3e9a886c 100644
---- a/trans/new-fifo.c
-+++ b/trans/new-fifo.c
-@@ -524,8 +524,8 @@ trivfs_S_io_map (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- data_t *data, size_t *data_len,
-- off_t offs, size_t amount)
-+ data_t *data, mach_msg_type_name_t *data_len,
-+ off_t offs, vm_size_t amount)
- {
- error_t err;
-
-@@ -554,7 +554,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- size_t *amount)
-+ vm_size_t *amount)
- {
- error_t err;
-
-@@ -689,8 +689,8 @@ trivfs_S_io_select_timeout (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_write (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- const_data_t data, size_t data_len,
-- off_t offs, size_t *amount)
-+ const_data_t data, mach_msg_type_name_t data_len,
-+ off_t offs, vm_size_t *amount)
- {
- error_t err;
-
-diff --git a/trans/null.c b/trans/null.c
-index 034bb103..f4ba5582 100644
---- a/trans/null.c
-+++ b/trans/null.c
-@@ -149,8 +149,8 @@ trivfs_S_io_read(struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
- data_t *data,
- mach_msg_type_number_t *datalen,
-- loff_t offs,
-- mach_msg_type_number_t amt)
-+ off_t offs,
-+ vm_size_t amt)
- {
- if (!cred)
- return EOPNOTSUPP;
-@@ -169,7 +169,7 @@ trivfs_S_io_read(struct trivfs_protid *cred,
- kern_return_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- if (!cred)
- return EOPNOTSUPP;
-@@ -228,7 +228,7 @@ kern_return_t
- trivfs_S_io_write (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
- const_data_t data, mach_msg_type_number_t datalen,
-- loff_t offs, mach_msg_type_number_t *amt)
-+ off_t offs, vm_size_t *amt)
- {
- if (!cred)
- return EOPNOTSUPP;
-diff --git a/trans/proxy-defpager.c b/trans/proxy-defpager.c
-index 8ca25b72..bfeda063 100644
---- a/trans/proxy-defpager.c
-+++ b/trans/proxy-defpager.c
-@@ -169,8 +169,8 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
- data_t *data,
- mach_msg_type_number_t *datalen,
-- loff_t offs,
-- mach_msg_type_number_t amt)
-+ off_t offs,
-+ vm_size_t amt)
- {
- if (!cred)
- return EOPNOTSUPP;
-@@ -181,7 +181,7 @@ kern_return_t
- trivfs_S_io_write (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t replytype,
- const_data_t data, mach_msg_type_number_t datalen,
-- loff_t offs, mach_msg_type_number_t *amt)
-+ loff_t offs, vm_size_t *amt)
- {
- if (!cred)
- return EOPNOTSUPP;
-diff --git a/trans/random.c b/trans/random.c
-index c230280a..297253e4 100644
---- a/trans/random.c
-+++ b/trans/random.c
-@@ -318,7 +318,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, mach_msg_type_number_t amount)
-+ off_t offs, vm_size_t amount)
- {
- error_t err;
- void *buf = NULL;
-@@ -377,8 +377,8 @@ trivfs_S_io_write (struct trivfs_protid *cred,
- mach_msg_type_name_t replytype,
- const_data_t data,
- mach_msg_type_number_t datalen,
-- loff_t offset,
-- mach_msg_type_number_t *amount)
-+ off_t offset,
-+ vm_size_t *amount)
- {
- /* Deny access if they have bad credentials. */
- if (! cred)
-diff --git a/trans/streamio.c b/trans/streamio.c
-index 30b8b20e..acd5d674 100644
---- a/trans/streamio.c
-+++ b/trans/streamio.c
-@@ -482,7 +482,7 @@ error_t
- trivfs_S_io_read (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- data_t *data, mach_msg_type_number_t *data_len,
-- loff_t offs, mach_msg_type_number_t amount)
-+ off_t offs, vm_size_t amount)
- {
- error_t err;
-
-@@ -501,7 +501,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
- error_t
- trivfs_S_io_readable (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
-- mach_msg_type_number_t *amount)
-+ vm_size_t *amount)
- {
- error_t err;
-
-@@ -521,7 +521,7 @@ error_t
- trivfs_S_io_write (struct trivfs_protid *cred,
- mach_port_t reply, mach_msg_type_name_t reply_type,
- const_data_t data, mach_msg_type_number_t data_len,
-- loff_t offs, mach_msg_type_number_t *amount)
-+ off_t offs, vm_size_t *amount)
- {
- error_t err;
-
-
-base-commit: b6509385bb1dd2a6d47401465bfb98b6339c5c2b
-prerequisite-patch-id: 33c640aa0fcf19d49fff88cc58cecd3be8f7892d
-prerequisite-patch-id: 411256b31780cf9ea0b24efe9f2b20f82c6ce9c1
-prerequisite-patch-id: 830470d11762c6c5e09488a2b834dff0f4f6e434
-prerequisite-patch-id: 1a1293bebf97550d54d9dba3a1817f20a3ef6a2a
-prerequisite-patch-id: f12e5842dea12ed7b0ff4ae3fa2afe78f3647288
-prerequisite-patch-id: 4436fa0181c5e21580e6656634e35febf251dc5b
-prerequisite-patch-id: a938f788841d96151e9e4cc134114dc7652e4f27
-prerequisite-patch-id: bfc7264e11d3ca2dbc520f221cf8bf13857d4732
-prerequisite-patch-id: 50393cc222a3e9de9cfab0762f5acf10e394c9f0
---
-2.39.1
-
diff --git a/gnu/packages/patches/imagemagick-CVE-2020-27829.patch b/gnu/packages/patches/imagemagick-CVE-2020-27829.patch
deleted file mode 100644
index b15c1d0879..0000000000
--- a/gnu/packages/patches/imagemagick-CVE-2020-27829.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-We omit the ChangeLog changes below, since they do not apply cleanly.
-
-
-From 6ee5059cd3ac8d82714a1ab1321399b88539abf0 Mon Sep 17 00:00:00 2001
-From: Cristy <urban-warrior@imagemagick.org>
-Date: Mon, 30 Nov 2020 16:26:59 +0000
-Subject: [PATCH] possible TIFF related-heap buffer overflow (alert & POC by
- Hardik Shah)
-
----
- ChangeLog | 6 ++++++
- coders/tiff.c | 2 +-
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/coders/tiff.c b/coders/tiff.c
-index e98f927ab..1eecf17ae 100644
---- a/coders/tiff.c
-+++ b/coders/tiff.c
-@@ -1975,7 +1975,7 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
- extent+=image->columns*sizeof(uint32);
- #endif
- strip_pixels=(unsigned char *) AcquireQuantumMemory(extent,
-- sizeof(*strip_pixels));
-+ 2*sizeof(*strip_pixels));
- if (strip_pixels == (unsigned char *) NULL)
- ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
- (void) memset(strip_pixels,0,extent*sizeof(*strip_pixels));
diff --git a/gnu/packages/patches/imagemagick-ReadDCMImage-fix.patch b/gnu/packages/patches/imagemagick-ReadDCMImage-fix.patch
deleted file mode 100644
index 42ece43682..0000000000
--- a/gnu/packages/patches/imagemagick-ReadDCMImage-fix.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 512668dfd92b20d0d08b91d62b422d8262573281 Mon Sep 17 00:00:00 2001
-From: Dirk Lemstra <dirk@lemstra.org>
-Date: Wed, 24 Mar 2021 20:37:15 +0100
-Subject: [PATCH] Throw exception when no exception was raised but status was
- false (#3432).
-
----
- coders/dcm.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/coders/dcm.c b/coders/dcm.c
-index 7a68ed6e8..ed17c9567 100644
---- a/coders/dcm.c
-+++ b/coders/dcm.c
-@@ -3989,6 +3989,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception)
- if (redmap != (int *) NULL)
- redmap=(int *) RelinquishMagickMemory(redmap);
- image=DestroyImageList(image);
-+ if ((status == MagickFalse) && (exception->severity < ErrorException))
-+ ThrowReaderException(CorruptImageError,"CorruptImage");
- return(GetFirstImageInList(images));
- }
- if (info.depth != (1UL*MAGICKCORE_QUANTUM_DEPTH))
---
-2.31.0
-
diff --git a/gnu/packages/patches/imagemagick-ReadDCMPixels-fix.patch b/gnu/packages/patches/imagemagick-ReadDCMPixels-fix.patch
deleted file mode 100644
index a91999186b..0000000000
--- a/gnu/packages/patches/imagemagick-ReadDCMPixels-fix.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From c8f25953ad1dd38a8b2d92738f0f742ad7e0bce7 Mon Sep 17 00:00:00 2001
-From: Cristy <mikayla-grace@urban-warrior.org>
-Date: Sun, 21 Mar 2021 21:21:15 -0400
-Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32322
-
----
- coders/dcm.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/coders/dcm.c b/coders/dcm.c
-index 29eed9618..7a68ed6e8 100644
---- a/coders/dcm.c
-+++ b/coders/dcm.c
-@@ -2984,12 +2984,12 @@ static MagickBooleanType ReadDCMPixels(Image *image,DCMInfo *info,
- }
- else
- {
-- SetPixelRed(q,(Quantum) (((ssize_t) pixel.red) |
-- (((ssize_t) GetPixelRed(q)) << 8)));
-- SetPixelGreen(q,(Quantum) (((ssize_t) pixel.green) |
-- (((ssize_t) GetPixelGreen(q)) << 8)));
-- SetPixelBlue(q,(Quantum) (((ssize_t) pixel.blue) |
-- (((ssize_t) GetPixelBlue(q)) << 8)));
-+ SetPixelRed(q,(Quantum) (((size_t) pixel.red) |
-+ (((size_t) GetPixelRed(q)) << 8)));
-+ SetPixelGreen(q,(Quantum) (((size_t) pixel.green) |
-+ (((size_t) GetPixelGreen(q)) << 8)));
-+ SetPixelBlue(q,(Quantum) (((size_t) pixel.blue) |
-+ (((size_t) GetPixelBlue(q)) << 8)));
- }
- q++;
- }
---
-2.31.0
-
diff --git a/gnu/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch b/gnu/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch
deleted file mode 100644
index f38a45b800..0000000000
--- a/gnu/packages/patches/imagemagick-WriteTHUMBNAILImage-fix.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 6a5d3575487487f2703383338bd17c8c25068f19 Mon Sep 17 00:00:00 2001
-From: Cristy <mikayla-grace@urban-warrior.org>
-Date: Thu, 25 Mar 2021 08:58:18 -0400
-Subject: [PATCH] eliminate compiler warning
-
----
- coders/thumbnail.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/coders/thumbnail.c b/coders/thumbnail.c
-index 3833341b0..1e2bfe8c2 100644
---- a/coders/thumbnail.c
-+++ b/coders/thumbnail.c
-@@ -199,7 +199,7 @@ static MagickBooleanType WriteTHUMBNAILImage(const ImageInfo *image_info,
- q++;
- }
- if ((q > (GetStringInfoDatum(profile)+GetStringInfoLength(profile))) ||
-- (length > (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q)))
-+ ((ssize_t) length > (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q)))
- ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail");
- thumbnail_image=BlobToImage(image_info,q,length,&image->exception);
- if (thumbnail_image == (Image *) NULL)
---
-2.31.0
-
diff --git a/gnu/packages/patches/libsepol-versioned-docbook.patch b/gnu/packages/patches/libsepol-versioned-docbook.patch
new file mode 100644
index 0000000000..6b39de0a5b
--- /dev/null
+++ b/gnu/packages/patches/libsepol-versioned-docbook.patch
@@ -0,0 +1,56 @@
+# Sent upstream: <https://lore.kernel.org/selinux/260cd39c55ff2d13f5ac916b508f023bedecfce9.1692025627.git.mirai@makinata.eu/>
+
+From 260cd39c55ff2d13f5ac916b508f023bedecfce9 Mon Sep 17 00:00:00 2001
+Message-Id: <260cd39c55ff2d13f5ac916b508f023bedecfce9.1692827278.git.mirai@makinata.eu>
+From: Bruno Victal <mirai@makinata.eu>
+Date: Mon, 14 Aug 2023 15:51:05 +0100
+Subject: [PATCH] secilc: Use versioned DocBook public identifier.
+
+Fix xml validation issues that often crop up since the XML catalogs
+for DocBook often only contain versioned public identifiers.
+
+Signed-off-by: Bruno Victal <mirai@makinata.eu>
+---
+ secilc/secil2conf.8.xml | 2 +-
+ secilc/secil2tree.8.xml | 2 +-
+ secilc/secilc.8.xml | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/secilc/secil2conf.8.xml b/secilc/secil2conf.8.xml
+index 33646f97..330b6a07 100644
+--- a/secilc/secil2conf.8.xml
++++ b/secilc/secil2conf.8.xml
+@@ -1,5 +1,5 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML//EN"
++<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+ <refentry>
+diff --git a/secilc/secil2tree.8.xml b/secilc/secil2tree.8.xml
+index e95a8947..d7bb177e 100644
+--- a/secilc/secil2tree.8.xml
++++ b/secilc/secil2tree.8.xml
+@@ -1,5 +1,5 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML//EN"
++<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+ <refentry>
+diff --git a/secilc/secilc.8.xml b/secilc/secilc.8.xml
+index e9a121e2..5c0680a8 100644
+--- a/secilc/secilc.8.xml
++++ b/secilc/secilc.8.xml
+@@ -1,5 +1,5 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML//EN"
++<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+ <refentry>
+
+base-commit: f6dc6acfa00707ce25c6357169111937f12512dd
+--
+2.40.1
+
diff --git a/gnu/packages/patches/openjdk-10-char-reproducibility.patch b/gnu/packages/patches/openjdk-10-char-reproducibility.patch
new file mode 100644
index 0000000000..a7932678af
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-char-reproducibility.patch
@@ -0,0 +1,12 @@
+Danny
+--- orig/jdk-6fa770f9f8ab/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java 2022-04-13 19:24:10.211683257 +0200
++++ jdk-6fa770f9f8ab/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java 2022-04-13 22:51:50.680487330 +0200
+@@ -693,7 +693,7 @@
+ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(theOutputFileName)));
+ out.println(commentStart +
+ " This file was generated AUTOMATICALLY from a template file " +
+- new java.util.Date() + commentEnd);
++ (System.getenv("SOURCE_DATE_EPOCH") == null ? new java.util.Date() : new java.util.Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")))) + commentEnd);
+ int marklen = commandMarker.length();
+ LOOP: while(true) {
+ try {
diff --git a/gnu/packages/patches/openjdk-10-classlist-reproducibility.patch b/gnu/packages/patches/openjdk-10-classlist-reproducibility.patch
new file mode 100644
index 0000000000..e1292ba82d
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-classlist-reproducibility.patch
@@ -0,0 +1,27 @@
+--- orig/jdk-6fa770f9f8ab/make/GenerateLinkOptData.gmk 2022-04-04 17:16:29.365930149 +0200
++++ jdk-6fa770f9f8ab/make/GenerateLinkOptData.gmk 2022-04-04 17:16:54.954624358 +0200
+@@ -61,11 +61,12 @@
+ $(call MakeDir, $(LINK_OPT_DIR))
+ $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
+ $(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $(JLI_TRACE_FILE)))
+- $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@ \
++ $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.tmp \
+ -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
+ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
+ build.tools.classlist.HelloClasslist \
+ $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE)
++ sort $@.tmp > $@
+
+ # The jli trace is created by the same recipe as classlist. By declaring these
+ # dependencies, make will correctly rebuild both jli trace and classlist
+--- orig/jdk-6fa770f9f8ab/make/gendata/Gendata-jdk.compiler.gmk 2022-04-13 19:24:10.191682716 +0200
++++ jdk-6fa770f9f8ab/make/gendata/Gendata-jdk.compiler.gmk 2022-04-13 20:58:57.891368216 +0200
+@@ -83,6 +83,8 @@
+ $(CT_MODULESOURCEPATH) \
+ $(CT_MODULES) \
+ >$(@D)/A/system-modules
++ # Make files reproducible
++ find $(@D) -exec $(TOUCH) -h -c -t 197001010000.01 {} \;
+ $(TOUCH) $@
+
+ # Can't generate ct.sym directly into modules libs as the SetupJarArchive macro
diff --git a/gnu/packages/patches/openjdk-10-corba-reproducibility.patch b/gnu/packages/patches/openjdk-10-corba-reproducibility.patch
new file mode 100644
index 0000000000..bd5ce1fd2b
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-corba-reproducibility.patch
@@ -0,0 +1,12 @@
+Danny
+--- orig/jdk-6fa770f9f8ab/make/corba/src/classes/build/tools/logutil/MC.java 2022-04-13 19:24:10.111680549 +0200
++++ jdk-6fa770f9f8ab/make/corba/src/classes/build/tools/logutil/MC.java 2022-04-13 22:51:13.399462259 +0200
+@@ -154,7 +154,7 @@
+ groupName);
+ pw.println("//");
+ pw.printMsg("// Generated by MC.java version @, DO NOT EDIT BY HAND!", VERSION);
+- pw.printMsg("// Generated from input file @ on @", inFile, new Date());
++ pw.printMsg("// Generated from input file @ on @", inFile, System.getenv("SOURCE_DATE_EPOCH") == null ? new Date() : new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))));
+ pw.println();
+ }
+
diff --git a/gnu/packages/patches/openjdk-10-jar-reproducibility.patch b/gnu/packages/patches/openjdk-10-jar-reproducibility.patch
new file mode 100644
index 0000000000..176eedfce6
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-jar-reproducibility.patch
@@ -0,0 +1,103 @@
+diff -ru orig/jdk-6fa770f9f8ab/make/common/JarArchive.gmk jdk-6fa770f9f8ab/make/common/JarArchive.gmk
+--- orig/jdk-6fa770f9f8ab/make/common/JarArchive.gmk 2022-04-13 19:24:10.107680441 +0200
++++ jdk-6fa770f9f8ab/make/common/JarArchive.gmk 2022-04-13 19:31:18.031271019 +0200
+@@ -251,12 +251,14 @@
+ $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
+ $$(if $$($1_EXTRA_MANIFEST_ATTR), \
+ $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
++ $(TOUCH) -h -c -t 197001010000.00 $$($1_MANIFEST_FILE) $$(NEWLINE) \
+ $(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
+ $$($1_JAR_CMD) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \
+ $$($1_SCAPTURE_CONTENTS) \
+ $$($1_SCAPTURE_METAINF) \
+ $$($1_SUPDATE_CONTENTS) \
+- $$($1_JARINDEX) && true \
++ $$($1_JARINDEX) && true $$(NEWLINE) \
++ d="`mktemp -d`" && $(CP) -f $$@ "$$$$d/a.jar" && (cd "$$$$d" && unzip a.jar META-INF/MANIFEST.MF && $(TOUCH) -h -c -t 197001010000.00 META-INF && $(TOUCH) -h -c -t 197001010000.00 META-INF/MANIFEST.MF && (zip --symlinks -0 -X a.jar META-INF META-INF/MANIFEST.MF; zip --symlinks -0 -X a.jar META-INF META-INF/MANIFEST.MF)) && $(CP) -f "$$$$d/a.jar" $$@ \
+ , \
+ $(ECHO) Modifying $$($1_NAME) $$(NEWLINE) \
+ $$($1_CAPTURE_CONTENTS) \
+diff -ru orig/jdk-6fa770f9f8ab/make/JrtfsJar.gmk jdk-6fa770f9f8ab/make/JrtfsJar.gmk
+--- orig/jdk-6fa770f9f8ab/make/JrtfsJar.gmk 2022-04-13 19:24:10.091680007 +0200
++++ jdk-6fa770f9f8ab/make/JrtfsJar.gmk 2022-04-13 19:29:30.044346222 +0200
+@@ -57,13 +57,18 @@
+ # file will not be copied unless META-INF/services would also be added to the INCLUDES.
+ # Adding META-INF/services would include all files in that directory when only the one
+ # is needed, which is why this explicit copy is defined instead.
+-$(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
++$(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
+ SRC := $(TOPDIR)/src/java.base/share/classes, \
+ DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
+ FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
+
++.PHONY: $(COPY_JIMAGE_SERVICE_PROVIDER)_fix
++$(COPY_JIMAGE_SERVICE_PROVIDER)_fix: $(COPY_JIMAGE_SERVICE_PROVIDER)
++ find $(SUPPORT_OUTPUTDIR)/jrtfs_classes -exec $(TOUCH) -h -c -t 197001010000.00 {} \;
++ $(TOUCH) -h -c -t 197001010000.00 $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf
++
+ $(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \
+- DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
++ DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER)_fix, \
+ SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
+ JAR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar, \
+ MANIFEST := $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf, \
+diff -ru orig/jdk-6fa770f9f8ab/src/jdk.jartool/share/classes/sun/tools/jar/Main.java jdk-6fa770f9f8ab/src/jdk.jartool/share/classes/sun/tools/jar/Main.java
+--- orig/jdk-6fa770f9f8ab/src/jdk.jartool/share/classes/sun/tools/jar/Main.java 2022-04-13 19:24:12.555746751 +0200
++++ jdk-6fa770f9f8ab/src/jdk.jartool/share/classes/sun/tools/jar/Main.java 2022-04-13 19:25:34.117955999 +0200
+@@ -849,12 +849,18 @@
+ output(getMsg("out.added.manifest"));
+ }
+ ZipEntry e = new ZipEntry(MANIFEST_DIR);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ e.setSize(0);
+ e.setCrc(0);
+ zos.putNextEntry(e);
+ e = new ZipEntry(MANIFEST_NAME);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ crc32Manifest(e, manifest);
+ }
+@@ -1021,7 +1027,10 @@
+ throws IOException
+ {
+ ZipEntry e = new ZipEntry(INDEX_NAME);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ CRC32OutputStream os = new CRC32OutputStream();
+ index.write(os);
+@@ -1040,7 +1049,10 @@
+ String name = mi.getKey();
+ byte[] bytes = mi.getValue();
+ ZipEntry e = new ZipEntry(name);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ crc32ModuleInfo(e, bytes);
+ }
+@@ -1065,7 +1077,10 @@
+ addMultiRelease(m);
+ }
+ ZipEntry e = new ZipEntry(MANIFEST_NAME);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ crc32Manifest(e, m);
+ }
diff --git a/gnu/packages/patches/openjdk-10-jtask-reproducibility.patch b/gnu/packages/patches/openjdk-10-jtask-reproducibility.patch
new file mode 100644
index 0000000000..3411ca12ae
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-jtask-reproducibility.patch
@@ -0,0 +1,53 @@
+--- jdk-10/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java.orig 2022-04-04 11:18:52.760626467 +0200
++++ jdk-10/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2022-04-04 12:03:40.645325687 +0200
+@@ -105,6 +105,7 @@
+ import jdk.internal.module.ModuleTarget;
+ import jdk.internal.module.Resources;
+ import jdk.tools.jlink.internal.Utils;
++import java.util.TreeSet;
+
+ import static java.util.stream.Collectors.joining;
+
+@@ -768,6 +769,7 @@
+ void processSection(JmodOutputStream out, Section section, Path path)
+ throws IOException
+ {
++ TreeSet<Path> paths = new TreeSet<>();
+ Files.walkFileTree(path, Set.of(FileVisitOption.FOLLOW_LINKS),
+ Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
+ @Override
+@@ -781,20 +783,24 @@
+
+ if (!relPath.toString().equals(MODULE_INFO)
+ && !matches(relPath, excludes)) {
+- try (InputStream in = Files.newInputStream(file)) {
+- out.writeEntry(in, section, relPath.toString());
+- } catch (IOException x) {
+- if (x.getMessage().contains("duplicate entry")) {
+- warning("warn.ignore.duplicate.entry",
+- relPath.toString(), section);
+- return FileVisitResult.CONTINUE;
+- }
+- throw x;
+- }
++ paths.add(file);
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
++ for (Path file : paths) {
++ Path relPath = path.relativize(file);
++ try (InputStream in = Files.newInputStream(file)) {
++ out.writeEntry(in, section, relPath.toString());
++ } catch (IOException x) {
++ if (x.getMessage().contains("duplicate entry")) {
++ warning("warn.ignore.duplicate.entry",
++ relPath.toString(), section);
++ continue;
++ }
++ throw x;
++ }
++ }
+ }
+
+ boolean matches(Path path, List<PathMatcher> matchers) {
diff --git a/gnu/packages/patches/openjdk-10-module-reproducibility.patch b/gnu/packages/patches/openjdk-10-module-reproducibility.patch
new file mode 100644
index 0000000000..165edd3b4a
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-module-reproducibility.patch
@@ -0,0 +1,305 @@
+From a52c4ef44c0553a399a8a47e528db92e3bf51c6c Mon Sep 17 00:00:00 2001
+From: Alan Bateman <alanb@openjdk.org>
+Date: Wed, 29 Apr 2020 08:38:28 +0100
+Subject: [PATCH] 8243666: ModuleHashes attribute generated for JMOD and JAR
+ files depends on timestamps
+
+Reviewed-by: mchung
+---
+
+--- orig/jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java 2022-04-13 19:24:10.655695284 +0200
++++ jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java 2022-04-14 02:43:48.610326492 +0200
+@@ -27,9 +27,8 @@
+
+ import java.io.PrintStream;
+ import java.lang.module.Configuration;
++import java.lang.module.ModuleReference;
+ import java.lang.module.ResolvedModule;
+-import java.net.URI;
+-import java.nio.file.Path;
+ import java.nio.file.Paths;
+ import java.util.ArrayDeque;
+ import java.util.Collections;
+@@ -39,8 +38,8 @@
+ import java.util.LinkedList;
+ import java.util.Map;
+ import java.util.Set;
++import java.util.TreeMap;
+ import java.util.function.Consumer;
+-import java.util.function.Function;
+ import java.util.stream.Stream;
+ import static java.util.stream.Collectors.*;
+
+@@ -101,7 +100,7 @@
+ // the modules to record the hashes - it is the first matching
+ // module and has not been hashed during the traversal.
+ Set<String> mods = new HashSet<>();
+- Map<String, ModuleHashes> hashes = new HashMap<>();
++ Map<String, ModuleHashes> hashes = new TreeMap<>();
+ builder.build()
+ .orderedNodes()
+ .filter(mn -> roots.contains(mn) && !mods.contains(mn))
+@@ -116,27 +115,17 @@
+ mods.addAll(ns);
+
+ if (!ns.isEmpty()) {
+- Map<String, Path> moduleToPath = ns.stream()
+- .collect(toMap(Function.identity(), this::moduleToPath));
+- hashes.put(mn, ModuleHashes.generate(moduleToPath, "SHA-256"));
++ Set<ModuleReference> mrefs = ns.stream()
++ .map(name -> configuration.findModule(name)
++ .orElseThrow(InternalError::new))
++ .map(ResolvedModule::reference)
++ .collect(toSet());
++ hashes.put(mn, ModuleHashes.generate(mrefs, "SHA-256"));
+ }
+ });
+ return hashes;
+ }
+
+- private Path moduleToPath(String name) {
+- ResolvedModule rm = configuration.findModule(name).orElseThrow(
+- () -> new InternalError("Selected module " + name + " not on module path"));
+-
+- URI uri = rm.reference().location().get();
+- Path path = Paths.get(uri);
+- String fn = path.getFileName().toString();
+- if (!fn.endsWith(".jar") && !fn.endsWith(".jmod")) {
+- throw new UnsupportedOperationException(path + " is not a modular JAR or jmod file");
+- }
+- return path;
+- }
+-
+ /*
+ * Utility class
+ */diff -ru orig/jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java
+--- orig/jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java 2022-04-12 16:58:05.639985936 +0200
+@@ -26,17 +26,21 @@
+ package jdk.internal.module;
+
+ import java.io.IOException;
++import java.io.InputStream;
+ import java.io.UncheckedIOException;
+-import java.nio.ByteBuffer;
+-import java.nio.channels.FileChannel;
+-import java.nio.file.Path;
++import java.lang.module.ModuleReader;
++import java.lang.module.ModuleReference;
++import java.nio.charset.StandardCharsets;
+ import java.security.MessageDigest;
+ import java.security.NoSuchAlgorithmException;
++import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.HashMap;
+ import java.util.Map;
+ import java.util.Objects;
+ import java.util.Set;
++import java.util.TreeMap;
++import java.util.function.Supplier;
+
+ /**
+ * The result of hashing the contents of a number of module artifacts.
+@@ -60,8 +64,8 @@
+ * @param algorithm the algorithm used to create the hashes
+ * @param nameToHash the map of module name to hash value
+ */
+- public ModuleHashes(String algorithm, Map<String, byte[]> nameToHash) {
+- this.algorithm = algorithm;
++ ModuleHashes(String algorithm, Map<String, byte[]> nameToHash) {
++ this.algorithm = Objects.requireNonNull(algorithm);
+ this.nameToHash = Collections.unmodifiableMap(nameToHash);
+ }
+
+@@ -95,54 +99,125 @@
+ }
+
+ /**
+- * Computes the hash for the given file with the given message digest
+- * algorithm.
++ * Computes a hash from the names and content of a module.
+ *
++ * @param reader the module reader to access the module content
++ * @param algorithm the name of the message digest algorithm to use
++ * @return the hash
++ * @throws IllegalArgumentException if digest algorithm is not supported
+ * @throws UncheckedIOException if an I/O error occurs
+ * @throws RuntimeException if the algorithm is not available
+ */
+- public static byte[] computeHash(Path file, String algorithm) {
++ private static byte[] computeHash(ModuleReader reader, String algorithm) {
++ MessageDigest md;
+ try {
+- MessageDigest md = MessageDigest.getInstance(algorithm);
+-
+- // Ideally we would just mmap the file but this consumes too much
+- // memory when jlink is running concurrently on very large jmods
+- try (FileChannel fc = FileChannel.open(file)) {
+- ByteBuffer bb = ByteBuffer.allocate(32*1024);
+- while (fc.read(bb) > 0) {
+- bb.flip();
+- md.update(bb);
+- assert bb.remaining() == 0;
+- bb.clear();
+- }
+- }
+-
+- return md.digest();
++ md = MessageDigest.getInstance(algorithm);
+ } catch (NoSuchAlgorithmException e) {
+- throw new RuntimeException(e);
++ throw new IllegalArgumentException(e);
++ }
++ try {
++ byte[] buf = new byte[32*1024];
++ reader.list().sorted().forEach(rn -> {
++ md.update(rn.getBytes(StandardCharsets.UTF_8));
++ try (InputStream in = reader.open(rn).orElseThrow(java.util.NoSuchElementException::new)) {
++ int n;
++ while ((n = in.read(buf)) > 0) {
++ md.update(buf, 0, n);
++ }
++ } catch (IOException ioe) {
++ throw new UncheckedIOException(ioe);
++ }
++ });
+ } catch (IOException ioe) {
+ throw new UncheckedIOException(ioe);
+ }
++ return md.digest();
+ }
+
+ /**
+- * Computes the hash for every entry in the given map, returning a
+- * {@code ModuleHashes} to encapsulate the result. The map key is
+- * the entry name, typically the module name. The map value is the file
+- * path to the entry (module artifact).
++ * Computes a hash from the names and content of a module.
+ *
++ * @param supplier supplies the module reader to access the module content
++ * @param algorithm the name of the message digest algorithm to use
++ * @return the hash
++ * @throws IllegalArgumentException if digest algorithm is not supported
++ * @throws UncheckedIOException if an I/O error occurs
++ */
++ static byte[] computeHash(Supplier<ModuleReader> supplier, String algorithm) {
++ try (ModuleReader reader = supplier.get()) {
++ return computeHash(reader, algorithm);
++ } catch (IOException ioe) {
++ throw new UncheckedIOException(ioe);
++ }
++ }
++
++ /**
++ * Computes the hash from the names and content of a set of modules. Returns
++ * a {@code ModuleHashes} to encapsulate the result.
++ * @param mrefs the set of modules
++ * @param algorithm the name of the message digest algorithm to use
+ * @return ModuleHashes that encapsulates the hashes
++ * @throws IllegalArgumentException if digest algorithm is not supported
++ * @throws UncheckedIOException if an I/O error occurs
+ */
+- public static ModuleHashes generate(Map<String, Path> map, String algorithm) {
++ static ModuleHashes generate(Set<ModuleReference> mrefs, String algorithm) {
+ Map<String, byte[]> nameToHash = new HashMap<>();
+- for (Map.Entry<String, Path> entry: map.entrySet()) {
+- String name = entry.getKey();
+- Path path = entry.getValue();
+- nameToHash.put(name, computeHash(path, algorithm));
++ for (ModuleReference mref : mrefs) {
++ try (ModuleReader reader = mref.open()) {
++ byte[] hash = computeHash(reader, algorithm);
++ nameToHash.put(mref.descriptor().name(), hash);
++ } catch (IOException ioe) {
++ throw new UncheckedIOException(ioe);
++ }
+ }
+ return new ModuleHashes(algorithm, nameToHash);
+ }
+
++ @Override
++ public int hashCode() {
++ int h = algorithm.hashCode();
++ for (Map.Entry<String, byte[]> e : nameToHash.entrySet()) {
++ h = h * 31 + e.getKey().hashCode();
++ h = h * 31 + Arrays.hashCode(e.getValue());
++ }
++ return h;
++ }
++
++ @Override
++ public boolean equals(Object obj) {
++ if (!(obj instanceof ModuleHashes))
++ return false;
++ ModuleHashes other = (ModuleHashes) obj;
++ if (!algorithm.equals(other.algorithm)
++ || nameToHash.size() != other.nameToHash.size())
++ return false;
++ for (Map.Entry<String, byte[]> e : nameToHash.entrySet()) {
++ String name = e.getKey();
++ byte[] hash = e.getValue();
++ if (!Arrays.equals(hash, other.nameToHash.get(name)))
++ return false;
++ }
++ return true;
++ }
++
++ @Override
++ public String toString() {
++ StringBuilder sb = new StringBuilder(algorithm);
++ sb.append(" ");
++ nameToHash.entrySet()
++ .stream()
++ .sorted(Map.Entry.comparingByKey())
++ .forEach(e -> {
++ sb.append(e.getKey());
++ sb.append("=");
++ byte[] ba = e.getValue();
++ for (byte b : ba) {
++ sb.append(String.format("%02x", b & 0xff));
++ }
++ });
++ return sb.toString();
++ }
++
+ /**
+ * This is used by jdk.internal.module.SystemModules class
+ * generated at link time.
+diff -ru orig/jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java
+--- orig/jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java 2022-04-12 16:43:12.967868689 +0200
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+diff -ru orig/jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java
+--- orig/jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java 2022-04-12 16:43:12.971868797 +0200
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -95,7 +95,7 @@
+ Path file) {
+ URI uri = file.toUri();
+ Supplier<ModuleReader> supplier = () -> new JarModuleReader(file, uri);
+- HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a);
++ HashSupplier hasher = (a) -> ModuleHashes.computeHash(supplier, a);
+ return newModule(attrs, uri, supplier, patcher, hasher);
+ }
+
+@@ -105,7 +105,7 @@
+ static ModuleReference newJModModule(ModuleInfo.Attributes attrs, Path file) {
+ URI uri = file.toUri();
+ Supplier<ModuleReader> supplier = () -> new JModModuleReader(file, uri);
+- HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a);
++ HashSupplier hasher = (a) -> ModuleHashes.computeHash(supplier, a);
+ return newModule(attrs, uri, supplier, null, hasher);
+ }
+
diff --git a/gnu/packages/patches/openjdk-10-module3-reproducibility.patch b/gnu/packages/patches/openjdk-10-module3-reproducibility.patch
new file mode 100644
index 0000000000..bc54803bea
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-module3-reproducibility.patch
@@ -0,0 +1,34 @@
+Danny wrote.
+
+--- orig/jdk-3cc80be736f2/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 2022-04-13 17:30:37.242775977 +0200
+@@ -43,6 +43,7 @@
+ import java.util.Objects;
+ import java.util.Optional;
+ import java.util.Set;
++import java.util.TreeSet;
+ import java.util.function.Supplier;
+ import java.util.stream.Collectors;
+ import java.util.stream.Stream;
+@@ -2155,9 +2156,9 @@
+ * @return The module descriptor
+ */
+ public ModuleDescriptor build() {
+- Set<Requires> requires = new HashSet<>(this.requires.values());
+- Set<Exports> exports = new HashSet<>(this.exports.values());
+- Set<Opens> opens = new HashSet<>(this.opens.values());
++ Set<Requires> requires = new TreeSet<>(this.requires.values());
++ Set<Exports> exports = new TreeSet<>(this.exports.values());
++ Set<Opens> opens = new TreeSet<>(this.opens.values());
+
+ // add dependency on java.base
+ if (strict
+@@ -2169,7 +2170,7 @@
+ null));
+ }
+
+- Set<Provides> provides = new HashSet<>(this.provides.values());
++ Set<Provides> provides = new TreeSet<>(this.provides.values());
+
+ return new ModuleDescriptor(name,
+ version,
diff --git a/gnu/packages/patches/openjdk-10-module4-reproducibility.patch b/gnu/packages/patches/openjdk-10-module4-reproducibility.patch
new file mode 100644
index 0000000000..051c9344eb
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-module4-reproducibility.patch
@@ -0,0 +1,14 @@
+Danny wrote it
+
+--- orig/jdk-6fa770f9f8ab/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java 2022-04-13 19:24:12.655749459 +0200
++++ jdk-6fa770f9f8ab/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java 2022-04-14 01:53:23.555465018 +0200
+@@ -861,7 +861,8 @@
+ */
+ private void genModuleReads(ClassWriter cw, Configuration cf) {
+ // module name -> names of modules that it reads
+- Map<String, Set<String>> map = cf.modules().stream()
++ Map<String, Set<String>> map = cf.modules().stream()
++ .sorted(java.util.Comparator.comparing(ResolvedModule::name))
+ .collect(Collectors.toMap(
+ ResolvedModule::name,
+ m -> m.reads().stream()
diff --git a/gnu/packages/patches/openjdk-11-classlist-reproducibility.patch b/gnu/packages/patches/openjdk-11-classlist-reproducibility.patch
new file mode 100644
index 0000000000..2ac7c2b664
--- /dev/null
+++ b/gnu/packages/patches/openjdk-11-classlist-reproducibility.patch
@@ -0,0 +1,11 @@
+--- jdk-11.0.13-ga/make/GenerateLinkOptData.gmk.orig 2022-04-04 17:18:56.801929954 +0200
++++ jdk-11.0.13-ga/make/GenerateLinkOptData.gmk 2022-04-04 17:19:14.962422622 +0200
+@@ -66,7 +66,7 @@
+ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
+ build.tools.classlist.HelloClasslist \
+ $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE)
+- $(GREP) -v HelloClasslist $@.raw > $@
++ $(GREP) -v HelloClasslist $@.raw |sort > $@
+
+ # The jli trace is created by the same recipe as classlist. By declaring these
+ # dependencies, make will correctly rebuild both jli trace and classlist
diff --git a/gnu/packages/patches/openjdk-13-classlist-reproducibility.patch b/gnu/packages/patches/openjdk-13-classlist-reproducibility.patch
new file mode 100644
index 0000000000..326f6875ec
--- /dev/null
+++ b/gnu/packages/patches/openjdk-13-classlist-reproducibility.patch
@@ -0,0 +1,11 @@
+--- 6cllxkf0narh0b4wgx8npwjkznd7ifq0-openjdk-13.0.7-checkout/make/GenerateLinkOptData.gmk.orig 2022-04-04 17:20:33.012539984 +0200
++++ 6cllxkf0narh0b4wgx8npwjkznd7ifq0-openjdk-13.0.7-checkout/make/GenerateLinkOptData.gmk 2022-04-04 17:20:51.181032859 +0200
+@@ -78,7 +78,7 @@
+ $(CAT) $(LINK_OPT_DIR)/stderr $(JLI_TRACE_FILE) ; \
+ exit $$exitcode \
+ )
+- $(GREP) -v HelloClasslist $@.raw > $@
++ $(GREP) -v HelloClasslist $@.raw | sort > $@
+
+ # The jli trace is created by the same recipe as classlist. By declaring these
+ # dependencies, make will correctly rebuild both jli trace and classlist
diff --git a/gnu/packages/patches/openjdk-15-jtask-reproducibility.patch b/gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
new file mode 100644
index 0000000000..2052983ade
--- /dev/null
+++ b/gnu/packages/patches/openjdk-15-jtask-reproducibility.patch
@@ -0,0 +1,40 @@
+--- 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java.orig 2022-04-04 10:57:40.346312924 +0200
++++ 22kjr9lzrml0h5m55viq7zlfkqr9p7ny-openjdk-15.0.3-checkout/src/jdk.jlink/share/classes/jdk/tools/jmod/JmodTask.java 2022-04-04 11:01:38.480751902 +0200
+@@ -82,6 +82,7 @@
+ import jdk.internal.module.ModuleTarget;
+ import jdk.internal.module.Resources;
+ import jdk.tools.jlink.internal.Utils;
++import java.util.TreeSet;
+
+ import static java.util.stream.Collectors.joining;
+
+@@ -750,6 +751,7 @@
+ void processSection(JmodOutputStream out, Section section, Path path)
+ throws IOException
+ {
++ TreeSet<Path> paths = new TreeSet<>();
+ Files.walkFileTree(path, Set.of(FileVisitOption.FOLLOW_LINKS),
+ Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
+ @Override
+@@ -765,14 +767,18 @@
+ if (out.contains(section, name)) {
+ warning("warn.ignore.duplicate.entry", name, section);
+ } else {
+- try (InputStream in = Files.newInputStream(file)) {
+- out.writeEntry(in, section, name);
+- }
++ paths.add(file);
+ }
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
++
++ for (Path file : paths) {
++ try (InputStream in = Files.newInputStream(file)) {
++ out.writeEntry(in, section, path.relativize(file).toString());
++ }
++ }
+ }
+
+ boolean matches(Path path, List<PathMatcher> matchers) {
diff --git a/gnu/packages/patches/openjdk-9-classlist-reproducibility.patch b/gnu/packages/patches/openjdk-9-classlist-reproducibility.patch
new file mode 100644
index 0000000000..d0ce7bc4d6
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-classlist-reproducibility.patch
@@ -0,0 +1,31 @@
+From: Danny Milosavljevic <dannym@scratchpost.org>
+Date: Wed, 18 Apr 2022 18:38:28 +0100
+Subject: Make classlist reproducible
+
+--- jdk-09/make/GenerateLinkOptData.gmk.orig 2022-04-05 10:05:35.892134188 +0200
++++ jdk-09/make/GenerateLinkOptData.gmk 2022-04-05 10:06:07.885003056 +0200
+@@ -61,11 +61,12 @@
+ $(call MakeDir, $(LINK_OPT_DIR))
+ $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
+ $(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $(JLI_TRACE_FILE)))
+- $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@ \
++ $(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.tmp \
+ -Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
+ -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
+ build.tools.classlist.HelloClasslist \
+ $(LOG_DEBUG) 2>&1 > $(JLI_TRACE_FILE)
++ sort $@.tmp >$@
+
+ # The jli trace is created by the same recipe as classlist. By declaring these
+ # dependencies, make will correctly rebuild both jli trace and classlist
+--- jdk-09/langtools/make/gendata/Gendata-jdk.compiler.gmk.orig 2022-04-08 22:04:05.784424812 +0200
++++ jdk-09/langtools/make/gendata/Gendata-jdk.compiler.gmk 2022-04-08 22:09:36.333575143 +0200
+@@ -79,6 +79,8 @@
+ $(CT_MODULESOURCEPATH) \
+ $(CT_MODULES) \
+ >$(@D)/9/system-modules
++ # Make files reproducible
++ find $(@D) -exec $(TOUCH) -h -c -t 197001010000.01 {} \;
+ $(TOUCH) $@
+
+ # Can't generate ct.sym directly into modules libs as the SetupJarArchive macro
diff --git a/gnu/packages/patches/openjdk-9-idlj-reproducibility.patch b/gnu/packages/patches/openjdk-9-idlj-reproducibility.patch
new file mode 100644
index 0000000000..30dcdf2496
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-idlj-reproducibility.patch
@@ -0,0 +1,37 @@
+From: Danny Milosavljevic <dannym@scratchpost.org>
+Date: Wed, 18 Apr 2022 19:28:00 +0100
+Subject: Make IDL reproducible
+
+--- jdk-09/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java.orig 2022-04-05 02:46:26.805340292 +0200
++++ jdk-09/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/toJavaPortable/Util.java 2022-04-05 02:48:23.152494213 +0200
+@@ -1146,7 +1146,7 @@
+ else
+ formatter.setTimeZone (java.util.TimeZone.getDefault ());
+
+- stream.println ("* " + formatter.format (new Date ()));
++ stream.println ("* " + formatter.format (System.getenv("SOURCE_DATE_EPOCH") == null ? new Date () : new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")))));
+
+ // <daz>
+ ///////////////
+--- jdk-09/corba/make/src/classes/build/tools/logutil/MC.java.orig 2022-04-05 11:09:43.824720493 +0200
++++ jdk-09/corba/make/src/classes/build/tools/logutil/MC.java 2022-04-05 11:10:46.518435511 +0200
+@@ -154,7 +154,7 @@
+ groupName);
+ pw.println("//");
+ pw.printMsg("// Generated by MC.java version @, DO NOT EDIT BY HAND!", VERSION);
+- pw.printMsg("// Generated from input file @ on @", inFile, new Date());
++ pw.printMsg("// Generated from input file @ on @", inFile, System.getenv("SOURCE_DATE_EPOCH") == null ? new Date() : new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))));
+ pw.println();
+ }
+
+--- jdk-09/jdk/make/src/classes/build/tools/generatecharacter/GenerateCharacter.java.orig 2022-04-05 11:14:29.228526408 +0200
++++ jdk-09/jdk/make/src/classes/build/tools/generatecharacter/GenerateCharacter.java 2022-04-05 11:15:32.658260748 +0200
+@@ -693,7 +693,7 @@
+ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(theOutputFileName)));
+ out.println(commentStart +
+ " This file was generated AUTOMATICALLY from a template file " +
+- new java.util.Date() + commentEnd);
++ (System.getenv("SOURCE_DATE_EPOCH") == null ? new java.util.Date() : new java.util.Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")))) + commentEnd);
+ int marklen = commandMarker.length();
+ LOOP: while(true) {
+ try {
diff --git a/gnu/packages/patches/openjdk-9-jar-reproducibility.patch b/gnu/packages/patches/openjdk-9-jar-reproducibility.patch
new file mode 100644
index 0000000000..130eacd867
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-jar-reproducibility.patch
@@ -0,0 +1,107 @@
+From: Danny Milosavljevic <dannym@scratchpost.org>
+Date: Wed, 18 Apr 2022 20:10:01 +0100
+Subject: Make JARs reproducible
+
+--- jdk-09/make/common/JarArchive.gmk.orig 2022-04-08 21:56:04.075111687 +0200
++++ jdk-09/make/common/JarArchive.gmk 2022-04-11 00:49:16.809140388 +0200
+@@ -249,12 +249,16 @@
+ $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
+ $$(if $$($1_EXTRA_MANIFEST_ATTR), \
+ $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE) $$(NEWLINE)) \
+- $(ECHO) Creating $$($1_NAME) $$(NEWLINE) \
++ $(TOUCH) -h -c -t 197001010000.00 $$($1_MANIFEST_FILE) $$(NEWLINE) \
++ $(ECHO) XCreating $$($1_NAME) $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \
+ $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \
+ $$($1_SCAPTURE_CONTENTS) \
+ $$($1_SCAPTURE_METAINF) \
+ $$($1_SUPDATE_CONTENTS) \
+- $$($1_JARINDEX) && true \
++ $$($1_JARINDEX) && true $$(NEWLINE) \
++ $(ECHO) Kreppel2 $$@ $$(NEWLINE) \
++ unzip -v $$@ $$(NEWLINE) \
++ d="`mktemp -d`" && $(CP) -f $$@ "$$$$d/a.jar" && (cd "$$$$d" && unzip a.jar META-INF/MANIFEST.MF && $(TOUCH) -h -c -t 197001010000.00 META-INF && $(TOUCH) -h -c -t 197001010000.00 META-INF/MANIFEST.MF && (zip --symlinks -0 -X a.jar META-INF META-INF/MANIFEST.MF; zip --symlinks -0 -X a.jar META-INF META-INF/MANIFEST.MF)) && $(CP) -f "$$$$d/a.jar" $$@ \
+ , \
+ $(ECHO) Modifying $$($1_NAME) $$(NEWLINE) \
+ $$($1_CAPTURE_CONTENTS) \
+--- jdk-09/make/JrtfsJar.gmk.orig 2022-04-10 13:48:57.385120008 +0200
++++ jdk-09/make/JrtfsJar.gmk 2022-04-10 13:58:04.688158538 +0200
+@@ -57,13 +57,18 @@
+ # file will not be copied unless META-INF/services would also be added to the INCLUDES.
+ # Adding META-INF/services would include all files in that directory when only the one
+ # is needed, which is why this explicit copy is defined instead.
+-$(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
++$(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER1, \
+ SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+ DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
+ FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
+
++.PHONY: jrtfsfixtimestamps47
++jrtfsfixtimestamps47: $(COPY_JIMAGE_SERVICE_PROVIDER1)
++ find $(SUPPORT_OUTPUTDIR)/jrtfs_classes -exec $(TOUCH) -h -c -t 197001010000.00 {} \;
++ $(TOUCH) -h -c -t 197001010000.00 $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf
++
+ $(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \
+- DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
++ DEPENDENCIES := $(BUILD_JRTFS) jrtfsfixtimestamps47, \
+ SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
+ JAR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar, \
+ MANIFEST := $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf, \
+--- jdk-09/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java.orig 2022-04-10 02:05:50.983247794 +0200
++++ jdk-09/jdk/src/jdk.jartool/share/classes/sun/tools/jar/Main.java 2022-04-10 02:13:01.638960337 +0200
+@@ -850,12 +850,18 @@
+ output(getMsg("out.added.manifest"));
+ }
+ ZipEntry e = new ZipEntry(MANIFEST_DIR);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ e.setSize(0);
+ e.setCrc(0);
+ zos.putNextEntry(e);
+ e = new ZipEntry(MANIFEST_NAME);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ crc32Manifest(e, manifest);
+ }
+@@ -1022,7 +1028,10 @@
+ throws IOException
+ {
+ ZipEntry e = new ZipEntry(INDEX_NAME);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ CRC32OutputStream os = new CRC32OutputStream();
+ index.write(os);
+@@ -1041,7 +1050,10 @@
+ String name = mi.getKey();
+ byte[] bytes = mi.getValue();
+ ZipEntry e = new ZipEntry(name);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ crc32ModuleInfo(e, bytes);
+ }
+@@ -1066,7 +1078,10 @@
+ addMultiRelease(m);
+ }
+ ZipEntry e = new ZipEntry(MANIFEST_NAME);
+- e.setTime(System.currentTimeMillis());
++ if (System.getenv("SOURCE_DATE_EPOCH") != null)
++ e.setTime(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH")));
++ else
++ e.setTime(System.currentTimeMillis());
+ if (flag0) {
+ crc32Manifest(e, m);
+ }
diff --git a/gnu/packages/patches/openjdk-9-module-reproducibility.patch b/gnu/packages/patches/openjdk-9-module-reproducibility.patch
new file mode 100644
index 0000000000..320bb7806a
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-module-reproducibility.patch
@@ -0,0 +1,297 @@
+From a52c4ef44c0553a399a8a47e528db92e3bf51c6c Mon Sep 17 00:00:00 2001
+From: Alan Bateman <alanb@openjdk.org>
+Date: Wed, 29 Apr 2020 08:38:28 +0100
+Subject: [PATCH] 8243666: ModuleHashes attribute generated for JMOD and JAR
+ files depends on timestamps
+See: https://bugs.openjdk.org/browse/JDK-8243666
+
+Reviewed-by: mchung
+---
+
+diff -ru orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java
+--- orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java 2022-04-12 16:47:15.690423653 +0200
+@@ -27,9 +27,8 @@
+
+ import java.io.PrintStream;
+ import java.lang.module.Configuration;
++import java.lang.module.ModuleReference;
+ import java.lang.module.ResolvedModule;
+-import java.net.URI;
+-import java.nio.file.Path;
+ import java.nio.file.Paths;
+ import java.util.ArrayDeque;
+ import java.util.Collections;
+@@ -40,7 +39,6 @@
+ import java.util.Map;
+ import java.util.Set;
+ import java.util.function.Consumer;
+-import java.util.function.Function;
+ import java.util.stream.Stream;
+ import static java.util.stream.Collectors.*;
+
+@@ -116,27 +114,17 @@
+ mods.addAll(ns);
+
+ if (!ns.isEmpty()) {
+- Map<String, Path> moduleToPath = ns.stream()
+- .collect(toMap(Function.identity(), this::moduleToPath));
+- hashes.put(mn, ModuleHashes.generate(moduleToPath, "SHA-256"));
++ Set<ModuleReference> mrefs = ns.stream()
++ .map(name -> configuration.findModule(name)
++ .orElseThrow(InternalError::new))
++ .map(ResolvedModule::reference)
++ .collect(toSet());
++ hashes.put(mn, ModuleHashes.generate(mrefs, "SHA-256"));
+ }
+ });
+ return hashes;
+ }
+
+- private Path moduleToPath(String name) {
+- ResolvedModule rm = configuration.findModule(name).orElseThrow(
+- () -> new InternalError("Selected module " + name + " not on module path"));
+-
+- URI uri = rm.reference().location().get();
+- Path path = Paths.get(uri);
+- String fn = path.getFileName().toString();
+- if (!fn.endsWith(".jar") && !fn.endsWith(".jmod")) {
+- throw new UnsupportedOperationException(path + " is not a modular JAR or jmod file");
+- }
+- return path;
+- }
+-
+ /*
+ * Utility class
+ */
+diff -ru orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java
+--- orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java 2022-04-12 16:58:05.639985936 +0200
+@@ -26,17 +26,21 @@
+ package jdk.internal.module;
+
+ import java.io.IOException;
++import java.io.InputStream;
+ import java.io.UncheckedIOException;
+-import java.nio.ByteBuffer;
+-import java.nio.channels.FileChannel;
+-import java.nio.file.Path;
++import java.lang.module.ModuleReader;
++import java.lang.module.ModuleReference;
++import java.nio.charset.StandardCharsets;
+ import java.security.MessageDigest;
+ import java.security.NoSuchAlgorithmException;
++import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.HashMap;
+ import java.util.Map;
+ import java.util.Objects;
+ import java.util.Set;
++import java.util.TreeMap;
++import java.util.function.Supplier;
+
+ /**
+ * The result of hashing the contents of a number of module artifacts.
+@@ -60,8 +64,8 @@
+ * @param algorithm the algorithm used to create the hashes
+ * @param nameToHash the map of module name to hash value
+ */
+- public ModuleHashes(String algorithm, Map<String, byte[]> nameToHash) {
+- this.algorithm = algorithm;
++ ModuleHashes(String algorithm, Map<String, byte[]> nameToHash) {
++ this.algorithm = Objects.requireNonNull(algorithm);
+ this.nameToHash = Collections.unmodifiableMap(nameToHash);
+ }
+
+@@ -95,54 +99,125 @@
+ }
+
+ /**
+- * Computes the hash for the given file with the given message digest
+- * algorithm.
++ * Computes a hash from the names and content of a module.
+ *
++ * @param reader the module reader to access the module content
++ * @param algorithm the name of the message digest algorithm to use
++ * @return the hash
++ * @throws IllegalArgumentException if digest algorithm is not supported
+ * @throws UncheckedIOException if an I/O error occurs
+ * @throws RuntimeException if the algorithm is not available
+ */
+- public static byte[] computeHash(Path file, String algorithm) {
++ private static byte[] computeHash(ModuleReader reader, String algorithm) {
++ MessageDigest md;
+ try {
+- MessageDigest md = MessageDigest.getInstance(algorithm);
+-
+- // Ideally we would just mmap the file but this consumes too much
+- // memory when jlink is running concurrently on very large jmods
+- try (FileChannel fc = FileChannel.open(file)) {
+- ByteBuffer bb = ByteBuffer.allocate(32*1024);
+- while (fc.read(bb) > 0) {
+- bb.flip();
+- md.update(bb);
+- assert bb.remaining() == 0;
+- bb.clear();
+- }
+- }
+-
+- return md.digest();
++ md = MessageDigest.getInstance(algorithm);
+ } catch (NoSuchAlgorithmException e) {
+- throw new RuntimeException(e);
++ throw new IllegalArgumentException(e);
++ }
++ try {
++ byte[] buf = new byte[32*1024];
++ reader.list().sorted().forEach(rn -> {
++ md.update(rn.getBytes(StandardCharsets.UTF_8));
++ try (InputStream in = reader.open(rn).orElseThrow(java.util.NoSuchElementException::new)) {
++ int n;
++ while ((n = in.read(buf)) > 0) {
++ md.update(buf, 0, n);
++ }
++ } catch (IOException ioe) {
++ throw new UncheckedIOException(ioe);
++ }
++ });
+ } catch (IOException ioe) {
+ throw new UncheckedIOException(ioe);
+ }
++ return md.digest();
+ }
+
+ /**
+- * Computes the hash for every entry in the given map, returning a
+- * {@code ModuleHashes} to encapsulate the result. The map key is
+- * the entry name, typically the module name. The map value is the file
+- * path to the entry (module artifact).
++ * Computes a hash from the names and content of a module.
+ *
++ * @param supplier supplies the module reader to access the module content
++ * @param algorithm the name of the message digest algorithm to use
++ * @return the hash
++ * @throws IllegalArgumentException if digest algorithm is not supported
++ * @throws UncheckedIOException if an I/O error occurs
++ */
++ static byte[] computeHash(Supplier<ModuleReader> supplier, String algorithm) {
++ try (ModuleReader reader = supplier.get()) {
++ return computeHash(reader, algorithm);
++ } catch (IOException ioe) {
++ throw new UncheckedIOException(ioe);
++ }
++ }
++
++ /**
++ * Computes the hash from the names and content of a set of modules. Returns
++ * a {@code ModuleHashes} to encapsulate the result.
++ * @param mrefs the set of modules
++ * @param algorithm the name of the message digest algorithm to use
+ * @return ModuleHashes that encapsulates the hashes
++ * @throws IllegalArgumentException if digest algorithm is not supported
++ * @throws UncheckedIOException if an I/O error occurs
+ */
+- public static ModuleHashes generate(Map<String, Path> map, String algorithm) {
++ static ModuleHashes generate(Set<ModuleReference> mrefs, String algorithm) {
+ Map<String, byte[]> nameToHash = new HashMap<>();
+- for (Map.Entry<String, Path> entry: map.entrySet()) {
+- String name = entry.getKey();
+- Path path = entry.getValue();
+- nameToHash.put(name, computeHash(path, algorithm));
++ for (ModuleReference mref : mrefs) {
++ try (ModuleReader reader = mref.open()) {
++ byte[] hash = computeHash(reader, algorithm);
++ nameToHash.put(mref.descriptor().name(), hash);
++ } catch (IOException ioe) {
++ throw new UncheckedIOException(ioe);
++ }
+ }
+ return new ModuleHashes(algorithm, nameToHash);
+ }
+
++ @Override
++ public int hashCode() {
++ int h = algorithm.hashCode();
++ for (Map.Entry<String, byte[]> e : nameToHash.entrySet()) {
++ h = h * 31 + e.getKey().hashCode();
++ h = h * 31 + Arrays.hashCode(e.getValue());
++ }
++ return h;
++ }
++
++ @Override
++ public boolean equals(Object obj) {
++ if (!(obj instanceof ModuleHashes))
++ return false;
++ ModuleHashes other = (ModuleHashes) obj;
++ if (!algorithm.equals(other.algorithm)
++ || nameToHash.size() != other.nameToHash.size())
++ return false;
++ for (Map.Entry<String, byte[]> e : nameToHash.entrySet()) {
++ String name = e.getKey();
++ byte[] hash = e.getValue();
++ if (!Arrays.equals(hash, other.nameToHash.get(name)))
++ return false;
++ }
++ return true;
++ }
++
++ @Override
++ public String toString() {
++ StringBuilder sb = new StringBuilder(algorithm);
++ sb.append(" ");
++ nameToHash.entrySet()
++ .stream()
++ .sorted(Map.Entry.comparingByKey())
++ .forEach(e -> {
++ sb.append(e.getKey());
++ sb.append("=");
++ byte[] ba = e.getValue();
++ for (byte b : ba) {
++ sb.append(String.format("%02x", b & 0xff));
++ }
++ });
++ return sb.toString();
++ }
++
+ /**
+ * This is used by jdk.internal.module.SystemModules class
+ * generated at link time.
+diff -ru orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java
+--- orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java 2022-04-12 16:43:12.967868689 +0200
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+diff -ru orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java
+--- orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/jdk/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java 2022-04-12 16:43:12.971868797 +0200
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -95,7 +95,7 @@
+ Path file) {
+ URI uri = file.toUri();
+ Supplier<ModuleReader> supplier = () -> new JarModuleReader(file, uri);
+- HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a);
++ HashSupplier hasher = (a) -> ModuleHashes.computeHash(supplier, a);
+ return newModule(attrs, uri, supplier, patcher, hasher);
+ }
+
+@@ -105,7 +105,7 @@
+ static ModuleReference newJModModule(ModuleInfo.Attributes attrs, Path file) {
+ URI uri = file.toUri();
+ Supplier<ModuleReader> supplier = () -> new JModModuleReader(file, uri);
+- HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a);
++ HashSupplier hasher = (a) -> ModuleHashes.computeHash(supplier, a);
+ return newModule(attrs, uri, supplier, null, hasher);
+ }
+
diff --git a/gnu/packages/patches/openjdk-9-module2-reproducibility.patch b/gnu/packages/patches/openjdk-9-module2-reproducibility.patch
new file mode 100644
index 0000000000..f167d94dc8
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-module2-reproducibility.patch
@@ -0,0 +1,125 @@
+Backport from openjdk 10
+
+--- orig/jdk-3cc80be736f2/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleSorter.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleSorter.java 2022-04-12 20:48:04.474353305 +0200
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+@@ -30,13 +30,16 @@
+ import jdk.tools.jlink.plugin.ResourcePoolModuleView;
+
+ import java.lang.module.ModuleDescriptor;
++import java.lang.module.ModuleDescriptor.Requires;
+ import java.lang.module.ModuleDescriptor.Requires.Modifier;
+
+ import java.nio.ByteBuffer;
+-import java.util.Deque;
++import java.util.ArrayList;
++import java.util.Comparator;
+ import java.util.HashMap;
+ import java.util.HashSet;
+-import java.util.LinkedList;
++import java.util.LinkedHashSet;
++import java.util.List;
+ import java.util.Map;
+ import java.util.Set;
+ import java.util.stream.Stream;
+@@ -45,9 +48,8 @@
+ * Helper class to sort modules in topological order
+ */
+ public final class ModuleSorter {
+- private final Deque<ResourcePoolModule> nodes = new LinkedList<>();
+- private final Map<String, Set<ResourcePoolModule>> edges = new HashMap<>();
+- private final Deque<ResourcePoolModule> result = new LinkedList<>();
++ private final Map<ResourcePoolModule, Set<ResourcePoolModule>> graph = new HashMap<>();
++ private final List<ResourcePoolModule> result = new ArrayList<>();
+
+ private final ResourcePoolModuleView moduleView;
+
+@@ -69,11 +71,17 @@
+
+ private ModuleSorter addModule(ResourcePoolModule module) {
+ addNode(module);
+- readModuleDescriptor(module).requires().forEach(req -> {
++ // the module graph will be traversed in a stable order for
++ // the topological sort. So add the dependences in the module name order
++ readModuleDescriptor(module).requires()
++ .stream()
++ .sorted(Comparator.comparing(Requires::name))
++ .forEach(req ->
++ {
+ ResourcePoolModule dep = moduleView.findModule(req.name()).orElse(null);
+ if (dep != null) {
+ addNode(dep);
+- edges.get(module.name()).add(dep);
++ graph.get(module).add(dep);
+ } else if (!req.modifiers().contains(Modifier.STATIC)) {
+ throw new PluginException(req.name() + " not found");
+ }
+@@ -82,22 +90,23 @@
+ }
+
+ private void addNode(ResourcePoolModule module) {
+- nodes.add(module);
+- edges.computeIfAbsent(module.name(), _n -> new HashSet<>());
++ graph.computeIfAbsent(module, _n -> new LinkedHashSet<>());
+ }
+
++ /*
++ * The module graph will be traversed in a stable order
++ * (traversing the modules and their dependences in alphabetical order)
++ * so that it will produce the same result of a given module graph.
++ */
+ private synchronized void build() {
+- if (!result.isEmpty() || nodes.isEmpty())
++ if (!result.isEmpty() || graph.isEmpty())
+ return;
+
+- Deque<ResourcePoolModule> visited = new LinkedList<>();
+- Deque<ResourcePoolModule> done = new LinkedList<>();
+- ResourcePoolModule node;
+- while ((node = nodes.poll()) != null) {
+- if (!visited.contains(node)) {
+- visit(node, visited, done);
+- }
+- }
++ Set<ResourcePoolModule> visited = new HashSet<>();
++ Set<ResourcePoolModule> done = new HashSet<>();
++ graph.keySet().stream()
++ .sorted(Comparator.comparing(ResourcePoolModule::name))
++ .forEach(node -> visit(node, visited, done));
+ }
+
+ public Stream<ResourcePoolModule> sorted() {
+@@ -106,19 +115,21 @@
+ }
+
+ private void visit(ResourcePoolModule node,
+- Deque<ResourcePoolModule> visited,
+- Deque<ResourcePoolModule> done) {
++ Set<ResourcePoolModule> visited,
++ Set<ResourcePoolModule> done) {
+ if (visited.contains(node)) {
+ if (!done.contains(node)) {
+ throw new IllegalArgumentException("Cyclic detected: " +
+- node + " " + edges.get(node.name()));
++ node + " " + graph.get(node));
+ }
+ return;
+ }
++
++ // traverse the dependences of the given module which are
++ // also sorted in alphabetical order
+ visited.add(node);
+- edges.get(node.name())
+- .forEach(x -> visit(x, visited, done));
++ graph.get(node).forEach(x -> visit(x, visited, done));
+ done.add(node);
+- result.addLast(node);
++ result.add(node);
+ }
+ }
diff --git a/gnu/packages/patches/openjdk-9-module3-reproducibility.patch b/gnu/packages/patches/openjdk-9-module3-reproducibility.patch
new file mode 100644
index 0000000000..9db54f5531
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-module3-reproducibility.patch
@@ -0,0 +1,36 @@
+From: Danny Milosavljevic <dannym@scratchpost.org>
+Date: Wed, 18 Apr 2022 21:50:00 +0100
+Subject: Make module descriptor reproducible
+
+--- orig/jdk-3cc80be736f2/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 1970-01-01 01:00:01.000000000 +0100
++++ jdk-3cc80be736f2/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 2022-04-13 17:30:37.242775977 +0200
+@@ -43,6 +43,7 @@
+ import java.util.Objects;
+ import java.util.Optional;
+ import java.util.Set;
++import java.util.TreeSet;
+ import java.util.function.Supplier;
+ import java.util.stream.Collectors;
+ import java.util.stream.Stream;
+@@ -2155,9 +2156,9 @@
+ * @return The module descriptor
+ */
+ public ModuleDescriptor build() {
+- Set<Requires> requires = new HashSet<>(this.requires.values());
+- Set<Exports> exports = new HashSet<>(this.exports.values());
+- Set<Opens> opens = new HashSet<>(this.opens.values());
++ Set<Requires> requires = new TreeSet<>(this.requires.values());
++ Set<Exports> exports = new TreeSet<>(this.exports.values());
++ Set<Opens> opens = new TreeSet<>(this.opens.values());
+
+ // add dependency on java.base
+ if (strict
+@@ -2169,7 +2170,7 @@
+ null));
+ }
+
+- Set<Provides> provides = new HashSet<>(this.provides.values());
++ Set<Provides> provides = new TreeSet<>(this.provides.values());
+
+ return new ModuleDescriptor(name,
+ version,
diff --git a/gnu/packages/patches/python-3-reproducible-build.patch b/gnu/packages/patches/python-3-reproducible-build.patch
new file mode 100644
index 0000000000..12bd8de7c2
--- /dev/null
+++ b/gnu/packages/patches/python-3-reproducible-build.patch
@@ -0,0 +1,30 @@
+From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001
+From: Inada Naoki <songofacandy@gmail.com>
+Date: Sat, 14 Jul 2018 00:46:11 +0900
+Subject: [PATCH] Use FLAG_REF always for interned strings
+
+---
+ Python/marshal.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/Python/marshal.c b/Python/marshal.c
+index 6d06266c6a8e2e..51db2e3b2e29a2 100644
+--- a/Python/marshal.c
++++ b/Python/marshal.c
+@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
+ if (p->version < 3 || p->hashtable == NULL)
+ return 0; /* not writing object references */
+
+- /* if it has only one reference, it definitely isn't shared */
+- if (Py_REFCNT(v) == 1)
++ /* If it has only one reference, it definitely isn't shared.
++ * But we use TYPE_REF always for interned string, to PYC file stable
++ * as possible.
++ */
++ if (Py_REFCNT(v) == 1 &&
++ !(PyUnicode_CheckExact(v) && PyUnicode_CHECK_INTERNED(v))) {
+ return 0;
++ }
+
+ entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
+ if (entry != NULL) {
diff --git a/gnu/packages/patches/python-matplotlib-fix-legend-loc-best-test.patch b/gnu/packages/patches/python-matplotlib-fix-legend-loc-best-test.patch
new file mode 100644
index 0000000000..9046eb2b4c
--- /dev/null
+++ b/gnu/packages/patches/python-matplotlib-fix-legend-loc-best-test.patch
@@ -0,0 +1,84 @@
+From 3cc6610597ee16a0cce39f7b033ae529972177e7 Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
+Date: Thu, 10 Aug 2023 00:09:53 -0400
+Subject: [PATCH] TST: Improve test for Legend(loc='best') warning
+
+By patching the timer instead of using actually large data, we can both
+a) speed up these tests (~7.5s vs <0.2s for both), and b) consistently
+trigger the warning even on systems which are fast (such as the M1
+systems on Cirrus.)
+
+Also, copy the test data from `test_legend_auto3`, which correctly hits
+all candidate locations for the 'best' legend locator without having to
+fill up the entire Axes with data.
+---
+ lib/matplotlib/tests/test_legend.py | 38 ++++++++++++++++++++---------
+ 1 file changed, 27 insertions(+), 11 deletions(-)
+
+diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py
+index 759ac6aadaff..1549354ba56b 100644
+--- a/lib/matplotlib/tests/test_legend.py
++++ b/lib/matplotlib/tests/test_legend.py
+@@ -1,5 +1,7 @@
+ import collections
++import itertools
+ import platform
++import time
+ from unittest import mock
+ import warnings
+
+@@ -1109,29 +1111,43 @@ def test_usetex_no_warn(caplog):
+ assert "Font family ['serif'] not found." not in caplog.text
+
+
+-def test_warn_big_data_best_loc():
++def test_warn_big_data_best_loc(monkeypatch):
++ # Force _find_best_position to think it took a long time.
++ counter = itertools.count(0, step=1.5)
++ monkeypatch.setattr(time, 'perf_counter', lambda: next(counter))
++
+ fig, ax = plt.subplots()
+ fig.canvas.draw() # So that we can call draw_artist later.
+- for idx in range(1000):
+- ax.plot(np.arange(5000), label=idx)
++
++ # Place line across all possible legend locations.
++ x = [0.9, 0.1, 0.1, 0.9, 0.9, 0.5]
++ y = [0.95, 0.95, 0.05, 0.05, 0.5, 0.5]
++ ax.plot(x, y, 'o-', label='line')
++
+ with rc_context({'legend.loc': 'best'}):
+ legend = ax.legend()
+- with pytest.warns(UserWarning) as records:
++ with pytest.warns(UserWarning,
++ match='Creating legend with loc="best" can be slow with large '
++ 'amounts of data.') as records:
+ fig.draw_artist(legend) # Don't bother drawing the lines -- it's slow.
+ # The _find_best_position method of Legend is called twice, duplicating
+ # the warning message.
+ assert len(records) == 2
+- for record in records:
+- assert str(record.message) == (
+- 'Creating legend with loc="best" can be slow with large '
+- 'amounts of data.')
+
+
+-def test_no_warn_big_data_when_loc_specified():
++def test_no_warn_big_data_when_loc_specified(monkeypatch):
++ # Force _find_best_position to think it took a long time.
++ counter = itertools.count(0, step=1.5)
++ monkeypatch.setattr(time, 'perf_counter', lambda: next(counter))
++
+ fig, ax = plt.subplots()
+ fig.canvas.draw()
+- for idx in range(1000):
+- ax.plot(np.arange(5000), label=idx)
++
++ # Place line across all possible legend locations.
++ x = [0.9, 0.1, 0.1, 0.9, 0.9, 0.5]
++ y = [0.95, 0.95, 0.05, 0.05, 0.5, 0.5]
++ ax.plot(x, y, 'o-', label='line')
++
+ legend = ax.legend('best')
+ fig.draw_artist(legend) # Check that no warning is emitted.
+
diff --git a/gnu/packages/patches/python-pillow-use-zlib-1.3.patch b/gnu/packages/patches/python-pillow-use-zlib-1.3.patch
new file mode 100644
index 0000000000..48863ba8da
--- /dev/null
+++ b/gnu/packages/patches/python-pillow-use-zlib-1.3.patch
@@ -0,0 +1,21 @@
+From 9ef7cb39def45b0fe1cdf4828ca20838a1fc39d1 Mon Sep 17 00:00:00 2001
+From: Andrew Murray <radarhere@users.noreply.github.com>
+Date: Fri, 18 Aug 2023 22:22:51 +1000
+Subject: [PATCH] Updated zlib to 1.3
+
+---
+ Tests/test_file_png.py | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py
+index 3ffe93c6d15..f8df88d6777 100644
+--- a/Tests/test_file_png.py
++++ b/Tests/test_file_png.py
+@@ -79,6 +79,6 @@ def get_chunks(self, filename):
+
+ def test_sanity(self, tmp_path):
+ # internal version number
+- assert re.search(r"\d+\.\d+\.\d+(\.\d+)?$", features.version_codec("zlib"))
++ assert re.search(r"\d+(\.\d+){1,3}$", features.version_codec("zlib"))
+
+ test_file = str(tmp_path / "temp.png")
diff --git a/gnu/packages/patches/sway-add-libinput-config-accel.patch b/gnu/packages/patches/sway-add-libinput-config-accel.patch
new file mode 100644
index 0000000000..29d6b13800
--- /dev/null
+++ b/gnu/packages/patches/sway-add-libinput-config-accel.patch
@@ -0,0 +1,49 @@
+From dee032d0a0ecd958c902b88302dc59703d703c7f Mon Sep 17 00:00:00 2001
+From: Simon Ser <contact@emersion.fr>
+Date: Sun, 26 Mar 2023 23:27:40 +0200
+Subject: [PATCH] ipc: add LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM entry
+
+This was introduced in the last libinput release.
+
+Fixes the following error:
+
+ ../sway/ipc-json.c:928:17: error: enumeration value 'LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM' not handled in switch [-Werror=switch]
+ 928 | switch (libinput_device_config_accel_get_profile(device)) {
+ | ^~~~~~
+---
+ meson.build | 5 +++++
+ sway/ipc-json.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 84e7c6c56f..d1fbfa38ab 100644
+--- a/meson.build
++++ b/meson.build
+@@ -117,6 +117,11 @@ conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd
+ conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind')
+ conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu')
+ conf_data.set10('HAVE_TRAY', have_tray)
++conf_data.set10('HAVE_LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM', cc.has_header_symbol(
++ 'libinput.h',
++ 'LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM',
++ dependencies: libinput,
++))
+
+ scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages'))
+ if scdoc.found()
+diff --git a/sway/ipc-json.c b/sway/ipc-json.c
+index 51e6a99518..c7cbea0136 100644
+--- a/sway/ipc-json.c
++++ b/sway/ipc-json.c
+@@ -935,6 +935,11 @@ static json_object *describe_libinput_device(struct libinput_device *device) {
+ case LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE:
+ accel_profile = "adaptive";
+ break;
++#if HAVE_LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM
++ case LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM:
++ accel_profile = "custom";
++ break;
++#endif
+ }
+ json_object_object_add(object, "accel_profile",
+ json_object_new_string(accel_profile));
diff --git a/gnu/packages/patches/webrtc-audio-processing-big-endian.patch b/gnu/packages/patches/webrtc-audio-processing-big-endian.patch
deleted file mode 100644
index 78333fe7b7..0000000000
--- a/gnu/packages/patches/webrtc-audio-processing-big-endian.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-https://bugs.freedesktop.org/show_bug.cgi?id=95738
-https://bugs.freedesktop.org/attachment.cgi?id=124025
-
-diff -up webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc.than webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc
---- webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc.than 2016-05-24 08:28:45.749940095 -0400
-+++ webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc 2016-05-24 08:50:30.361020010 -0400
-@@ -64,9 +64,6 @@ WavReader::~WavReader() {
- }
-
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
- // There could be metadata after the audio; ensure we don't read it.
- num_samples = std::min(rtc::checked_cast<uint32_t>(num_samples),
- num_samples_remaining_);
-@@ -76,6 +73,12 @@ size_t WavReader::ReadSamples(size_t num
- RTC_CHECK(read == num_samples || feof(file_handle_));
- RTC_CHECK_LE(read, num_samples_remaining_);
- num_samples_remaining_ -= rtc::checked_cast<uint32_t>(read);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+ //convert to big-endian
-+ for(size_t idx = 0; idx < num_samples; idx++) {
-+ samples[idx] = (samples[idx]<<8) | (samples[idx]>>8);
-+ }
-+#endif
- return read;
- }
-
-@@ -120,10 +123,17 @@ WavWriter::~WavWriter() {
-
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+ int16_t * le_samples = new int16_t[num_samples];
-+ for(size_t idx = 0; idx < num_samples; idx++) {
-+ le_samples[idx] = (samples[idx]<<8) | (samples[idx]>>8);
-+ }
-+ const size_t written =
-+ fwrite(le_samples, sizeof(*le_samples), num_samples, file_handle_);
-+ delete []le_samples;
-+#else
- const size_t written =
- fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-+#endif
- RTC_CHECK_EQ(num_samples, written);
- num_samples_ += static_cast<uint32_t>(written);
- RTC_CHECK(written <= std::numeric_limits<uint32_t>::max() ||
-diff -up webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc.than webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc
---- webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc.than 2016-05-24 08:50:52.591379263 -0400
-+++ webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc 2016-05-24 08:52:08.552606848 -0400
-@@ -129,7 +129,39 @@ static inline std::string ReadFourCC(uin
- return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+ *f = ((x << 8) & 0xff00) | ( ( x >> 8) & 0x00ff);
-+}
-+
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+ *f = ( (x & 0x000000ff) << 24 )
-+ | ((x & 0x0000ff00) << 8)
-+ | ((x & 0x00ff0000) >> 8)
-+ | ((x & 0xff000000) >> 24 );
-+}
-+
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+ *f = (static_cast<uint32_t>(a) << 24 )
-+ | (static_cast<uint32_t>(b) << 16)
-+ | (static_cast<uint32_t>(c) << 8)
-+ | (static_cast<uint32_t>(d) );
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+ return (( x & 0x00ff) << 8 )| ((x & 0xff00)>>8);
-+}
-+
-+static inline uint32_t ReadLE32(uint32_t x) {
-+ return ( (x & 0x000000ff) << 24 )
-+ | ( (x & 0x0000ff00) << 8 )
-+ | ( (x & 0x00ff0000) >> 8)
-+ | ( (x & 0xff000000) >> 24 );
-+}
-+
-+static inline std::string ReadFourCC(uint32_t x) {
-+ x = ReadLE32(x);
-+ return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
-
- static inline uint32_t RiffChunkSize(uint32_t bytes_in_payload) {
diff --git a/gnu/packages/patches/zig-do-not-link-against-librt.patch b/gnu/packages/patches/zig-do-not-link-against-librt.patch
deleted file mode 100644
index 3239efbdd4..0000000000
--- a/gnu/packages/patches/zig-do-not-link-against-librt.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/target.zig 2023-04-22 11:44:47.917416658 +0200
-+++ b/src/target.zig 2023-04-22 11:45:04.577465352 +0200
-@@ -478,7 +478,6 @@
- "-lpthread",
- "-lc",
- "-ldl",
-- "-lrt",
- "-lutil",
- },
- },