summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/autotrace-glib-compat.patch50
-rw-r--r--gnu/packages/patches/bash-completion-directories.patch20
-rw-r--r--gnu/packages/patches/bc-fix-cross-compilation.patch74
-rw-r--r--gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch231
-rw-r--r--gnu/packages/patches/binutils-CVE-2021-45078.patch257
-rw-r--r--gnu/packages/patches/camlboot-dynamically-allocate-stack-signal.patch52
-rw-r--r--gnu/packages/patches/cmake-curl-certificates.patch40
-rw-r--r--gnu/packages/patches/coreutils-ls.patch117
-rw-r--r--gnu/packages/patches/curl-easy-lock.patch31
-rw-r--r--gnu/packages/patches/cyrus-sasl-CVE-2019-19906.patch25
-rw-r--r--gnu/packages/patches/emacs-xelb-ignore-length-element.patch19
-rw-r--r--gnu/packages/patches/freeimage-libtiff-compat.patch19
-rw-r--r--gnu/packages/patches/gash-utils-ls-test.patch25
-rw-r--r--gnu/packages/patches/gcc-10-tree-sra-union-handling.patch33
-rw-r--r--gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch62
-rw-r--r--gnu/packages/patches/gcc-11-libstdc++-powerpc.patch20
-rw-r--r--gnu/packages/patches/gcc-4.9-inline.patch13
-rw-r--r--gnu/packages/patches/gdb-fix-gnu-nat-build.patch254
-rw-r--r--gnu/packages/patches/gettext-libunicode-update.patch99
-rw-r--r--gnu/packages/patches/ghc-9.2-grep-warnings.patch37
-rw-r--r--gnu/packages/patches/ghc-testsuite-grep-compat.patch39
-rw-r--r--gnu/packages/patches/ghostscript-no-header-creationdate.patch20
-rw-r--r--gnu/packages/patches/ghostscript-no-header-id.patch29
-rw-r--r--gnu/packages/patches/ghostscript-no-header-uuid.patch11
-rw-r--r--gnu/packages/patches/glib-networking-32-bit-time.patch61
-rw-r--r--gnu/packages/patches/glibc-dl-cache.patch5
-rw-r--r--gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch4
-rw-r--r--gnu/packages/patches/glibc-static-nss.patch1244
-rw-r--r--gnu/packages/patches/gnumach-add-missing-const_mach_port_name_array_t-type.patch32
-rw-r--r--gnu/packages/patches/gnupg-CVE-2022-34903.patch54
-rw-r--r--gnu/packages/patches/gnutls-guile-eintr-eagain.patch56
-rw-r--r--gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch51
-rw-r--r--gnu/packages/patches/gobject-introspection-cc.patch11
-rw-r--r--gnu/packages/patches/guile-hurd-posix-spawn.patch44
-rw-r--r--gnu/packages/patches/hurd-add-without-rump-configure-option.patch82
-rw-r--r--gnu/packages/patches/hurd-cross.patch33
-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/hurd-xattr.patch53
-rw-r--r--gnu/packages/patches/icedtea-7-hotspot-pointer-comparison.patch36
-rw-r--r--gnu/packages/patches/inkscape-poppler-compat.patch45
-rw-r--r--gnu/packages/patches/jsoncpp-pkg-config-version.patch24
-rw-r--r--gnu/packages/patches/julia-Use-MPFR-4.2.patch228
-rw-r--r--gnu/packages/patches/libaio-32bit-test.patch26
-rw-r--r--gnu/packages/patches/libffi-3.3-powerpc-fixes.patch138
-rw-r--r--gnu/packages/patches/libffi-float128-powerpc64le.patch58
-rw-r--r--gnu/packages/patches/libssh2-CVE-2019-17498.patch126
-rw-r--r--gnu/packages/patches/libtiff-CVE-2022-34526.patch22
-rw-r--r--gnu/packages/patches/libtool-grep-compat.patch51
-rw-r--r--gnu/packages/patches/libtool-skip-tests2.patch4
-rw-r--r--gnu/packages/patches/libwpd-gcc-compat.patch17
-rw-r--r--gnu/packages/patches/libxml2-parent-pointers.patch228
-rw-r--r--gnu/packages/patches/libxml2-terminating-newline.patch33
-rw-r--r--gnu/packages/patches/libxml2-xpath-recursion-limit.patch20
-rw-r--r--gnu/packages/patches/linphone-desktop-without-sdk.patch187
-rw-r--r--gnu/packages/patches/linux-pam-unix_chkpwd.patch9
-rw-r--r--gnu/packages/patches/llvm-8-missing-include.patch17
-rw-r--r--gnu/packages/patches/lxqt-session-procps-4.patch82
-rw-r--r--gnu/packages/patches/m4-gnulib-libio.patch128
-rw-r--r--gnu/packages/patches/mesa-fix-sporadic-test-failures.patch27
-rw-r--r--gnu/packages/patches/mesa-skip-tests.patch19
-rw-r--r--gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch20
-rw-r--r--gnu/packages/patches/mig-cpu.h-generation.patch16
-rw-r--r--gnu/packages/patches/mm-common-reproducible-tarball.patch40
-rw-r--r--gnu/packages/patches/ocaml-4.07-dynamically-allocate-signal-stack.patch52
-rw-r--r--gnu/packages/patches/ocaml-4.09-dynamically-allocate-signal-stack.patch52
-rw-r--r--gnu/packages/patches/opencolorio-fix-build-with-gcc11.patch37
-rw-r--r--gnu/packages/patches/openjdk-10-pointer-comparison.patch14
-rw-r--r--gnu/packages/patches/openjdk-10-setsignalhandler.patch25
-rw-r--r--gnu/packages/patches/openjdk-9-pointer-comparison.patch27
-rw-r--r--gnu/packages/patches/openjdk-9-setsignalhandler.patch24
-rw-r--r--gnu/packages/patches/p7zip-fix-build-with-gcc-11.patch49
-rw-r--r--gnu/packages/patches/pciutils-hurd-configure.patch35
-rw-r--r--gnu/packages/patches/pciutils-hurd-fix.patch23
-rw-r--r--gnu/packages/patches/procps-strtod-test.patch36
-rw-r--r--gnu/packages/patches/prusa-slicer-boost-fixes.patch97
-rw-r--r--gnu/packages/patches/prusa-slicer-fix-tests.patch17
-rw-r--r--gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch52
-rw-r--r--gnu/packages/patches/pytest-fix-unstrable-exception-test.patch34
-rw-r--r--gnu/packages/patches/python-2.7-expat-compat.patch59
-rw-r--r--gnu/packages/patches/python-3-fix-tests.patch155
-rw-r--r--gnu/packages/patches/python-3-no-static-lib.patch75
-rw-r--r--gnu/packages/patches/python-execnet-read-only-fix.patch77
-rw-r--r--gnu/packages/patches/python-feedparser-missing-import.patch34
-rw-r--r--gnu/packages/patches/python-magic-python-bytecode.patch19
-rw-r--r--gnu/packages/patches/python-parso-unit-tests-in-3.10.patch186
-rw-r--r--gnu/packages/patches/python-sgmllib3k-assertions.patch221
-rw-r--r--gnu/packages/patches/python-shiboken-2-compat.patch15
-rw-r--r--gnu/packages/patches/python-sip-include-dirs.patch20
-rw-r--r--gnu/packages/patches/python-typeguard-python3.10.patch47
-rw-r--r--gnu/packages/patches/python-unittest2-python3-compat.patch12
-rw-r--r--gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch52
-rw-r--r--gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch291
-rw-r--r--gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch20
-rw-r--r--gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch129
-rw-r--r--gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch28
-rw-r--r--gnu/packages/patches/softhsm-fix-openssl3-tests.patch1107
-rw-r--r--gnu/packages/patches/source-highlight-gcc-compat.patch74
-rw-r--r--gnu/packages/patches/swig-support-gcc-12.patch16
-rw-r--r--gnu/packages/patches/texinfo-headings-single.patch21
-rw-r--r--gnu/packages/patches/u-boot-fix-build-python-3.10.patch37
-rw-r--r--gnu/packages/patches/ucx-tcp-iface-ioctl.patch6
-rw-r--r--gnu/packages/patches/util-linux-CVE-2021-3995.patch146
-rw-r--r--gnu/packages/patches/util-linux-CVE-2021-3996.patch233
-rw-r--r--gnu/packages/patches/valgrind-fix-default-debuginfo-path.patch100
-rw-r--r--gnu/packages/patches/zig-do-not-link-against-librt.patch10
-rw-r--r--gnu/packages/patches/zsh-egrep-failing-test.patch11
107 files changed, 5401 insertions, 4328 deletions
diff --git a/gnu/packages/patches/autotrace-glib-compat.patch b/gnu/packages/patches/autotrace-glib-compat.patch
deleted file mode 100644
index e63dcedf83..0000000000
--- a/gnu/packages/patches/autotrace-glib-compat.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Fix build with GLib 2.68 and later.
-
-Taken from upstream pull request:
-https://github.com/autotrace/autotrace/pull/41
-
-diff --git a/src/autotrace.h b/src/autotrace.h
---- a/src/autotrace.h
-+++ b/src/autotrace.h
-@@ -23,6 +23,9 @@
-
- #include <stdio.h>
-
-+#include "types.h"
-+#include "color.h"
-+
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
-@@ -35,9 +38,6 @@ extern "C" {
- * Typedefs
- * ===================================================================== */
-
--#include "types.h"
--#include "color.h"
--
- /* Third degree is the highest we deal with. */
- enum _at_polynomial_degree {
- AT_LINEARTYPE = 1,
-diff --git a/src/color.h b/src/color.h
---- a/src/color.h
-+++ b/src/color.h
-@@ -24,6 +24,10 @@
- #include <glib.h>
- #include <glib-object.h>
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
- typedef struct _at_color at_color;
- struct _at_color {
- guint8 r;
-@@ -43,4 +47,7 @@ void at_color_free(at_color * color);
- GType at_color_get_type(void);
- #define AT_TYPE_COLOR (at_color_get_type ())
-
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
- #endif /* not AT_COLOR_H */
diff --git a/gnu/packages/patches/bash-completion-directories.patch b/gnu/packages/patches/bash-completion-directories.patch
index 021e34653b..a9b88203bd 100644
--- a/gnu/packages/patches/bash-completion-directories.patch
+++ b/gnu/packages/patches/bash-completion-directories.patch
@@ -4,24 +4,28 @@ up by the dynamic completion loader from there---whether they are
part of bash-completion or installed by another package.
On Guix systems, we want not only to search within bash-completion's own
-directory, but also in the user's profile and in the system profile.
+directory, but also in the user's profile and guix home profile, as well
+as in the system profile.
This is what this patch does.
--- a/bash_completion
+++ b/bash_completion
-@@ -2016,7 +2016,13 @@ complete -F _minimal ''
+@@ -2173,7 +2173,15 @@ complete -F _minimal ''
__load_completion()
{
-- local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
+- local -a dirs=(${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions)
+ local -a dirs=(
+ ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions
-+ "$HOME/.guix-profile/share/bash-completion/completions/$base"
-+ "$HOME/.guix-profile/etc/bash_completion.d/$base"
-+ "/run/current-system/profile/share/bash-completion/completions/$base"
-+ "/run/current-system/profile/etc/bash_completion.d/$base" )
++ "$HOME/.guix-profile/share/bash-completion/completions"
++ "$HOME/.guix-profile/etc/bash_completion.d"
++ "$HOME/.guix-home/profile/share/bash-completion/completions"
++ "$HOME/.guix-home/profile/etc/bash_completion.d"
++ "/run/current-system/profile/share/bash-completion/completions"
++ "/run/current-system/profile/etc/bash_completion.d" )
+
- local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile
+ local ifs=$IFS IFS=: dir cmd="${1##*/}" compfile
+ [[ -n $cmd ]] || return 1
for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
dirs+=( $dir/bash-completion/completions )
diff --git a/gnu/packages/patches/bc-fix-cross-compilation.patch b/gnu/packages/patches/bc-fix-cross-compilation.patch
index 14dfecdbde..04f2c92abf 100644
--- a/gnu/packages/patches/bc-fix-cross-compilation.patch
+++ b/gnu/packages/patches/bc-fix-cross-compilation.patch
@@ -1,15 +1,19 @@
-Patch taken from nix.
-
-commit fdda59736ddc048cf38a2c7103f4f5d9eeaf995e
-Author: Ben Gamari <ben@smart-cactus.org>
-Date: Tue Oct 17 10:51:34 2017 -0400
-
- Try implementing cross-compilation
+Patch adapted from Nix.
+Upstream-status: Submitted to bug-bc@gnu.org.
diff --git a/bc/Makefile.am b/bc/Makefile.am
-index d9d412e..fdef633 100644
+index d9d412e..13f2b1e 100644
--- a/bc/Makefile.am
+++ b/bc/Makefile.am
+@@ -8,7 +8,7 @@ EXTRA_DIST = bc.h bcdefs.h const.h fix-libmath_h global.h libmath.b proto.h \
+ sbc.y
+ noinst_HEADERS = libmath.h
+
+-DISTCLEANFILES = sbc sbc.c sbc.h libmath.h
++DISTCLEANFILES = fbc sbc sbc.c sbc.h libmath.h
+
+ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \
+ bc.y bcdefs.h const.h execute.c fix-libmath_h \
@@ -17,6 +17,7 @@ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../h
@@ -18,31 +22,36 @@ index d9d412e..fdef633 100644
LIBL = @LEXLIB@
LDADD = $(LIBBC) $(LIBL) @READLINELIB@
-@@ -29,12 +30,20 @@ $(PROGRAMS): libmath.h $(LIBBC)
+@@ -29,15 +30,22 @@ $(PROGRAMS): libmath.h $(LIBBC)
scan.o: bc.h
global.o: libmath.h
-+
-+main_host.c : main.c
-+ cp $< $@
-fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
-+fbcOBJ = $(addsuffix _host,main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o)
-+
-+%.o_host : CC:=$(CC_FOR_BUILD)
-+
-+%.o_host : %.c
-+ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
++%.o_host: CC := $(CC_FOR_BUILD)
++%.o_host: %.c
++ $(COMPILE) -c -o $@ $<
-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
-+libmath.h: libmath.b $(fbcOBJ) $(LIBBC_HOST)
- echo '{0}' > libmath.h
+- echo '{0}' > libmath.h
- $(MAKE) global.o
- $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
-+ $(MAKE) global.o_host
-+ $(CC_FOR_BUILD) -o fbc $(fbcOBJ) global.o_host $(LIBBC_HOST) $(LIBL) ${READLINELIB} $(LIBS)
- ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
+- ./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
++fbcOBJ = $(addsuffix _host,\
++ main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o)
++
++global_host.c: global.c
++ sed 's/#include "libmath.h"/{0}/' $< > $@
++
++fbc: $(fbcOBJ) global_host.o_host $(LIBBC_HOST) $(LIBS)
++ $(CC_FOR_BUILD) $(LIBL) $(READLINELIB) -o $@ $^
++
++libmath.h: libmath.b fbc $(LIBBC_HOST)
++ ./fbc -c $(srcdir)/libmath.b < /dev/null > libmath.h
$(srcdir)/fix-libmath_h
- rm -f ./fbc ./global.o
+- rm -f ./fbc ./global.o
+
+ sbcOBJ = main.o sbc.o scan.o execute.o global.o load.o storage.o util.o \
+ warranty.o
diff --git a/configure.ac b/configure.ac
index fc74573..5cabb73 100644
--- a/configure.ac
@@ -64,7 +73,7 @@ index fc74573..5cabb73 100644
AM_PROG_LEX
diff --git a/lib/Makefile.am b/lib/Makefile.am
-index ec4bf59..c670f5b 100644
+index ec4bf59..24c9f42 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,5 +1,5 @@
@@ -74,14 +83,23 @@ index ec4bf59..c670f5b 100644
AM_CPPFLAGS = -I. -I.. -I$(srcdir)/../h
-@@ -24,3 +24,11 @@ testmul: testmul.o number.o
+@@ -7,8 +7,6 @@ libbc_a_SOURCES = getopt.c getopt1.c vfprintf.c number.c
+
+ DEFS = @DEFS@ $(DEFSADD)
+
+-AM_CFLAGS = @CFLAGS@
+-
+ MAINTAINERCLEANFILES = Makefile.in number.c
+ CLEANFILES = testmul specialnumber muldigits.h
+
+@@ -24,3 +22,11 @@ testmul: testmul.o number.o
specialnumber: newnumber.o
cp newnumber.o number.o
+
-+%.o_host : CC:=$(CC_FOR_BUILD)
++%.o_host: CC := $(CC_FOR_BUILD)
+%.o_host : %.c
-+ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
++ $(COMPILE) -c -o $@ $<
+
+libbc_host.a : $(addsuffix _host,$(libbc_a_OBJECTS))
+ ar cru $@ $+
diff --git a/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch b/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch
deleted file mode 100644
index 1fd3d3d9b7..0000000000
--- a/gnu/packages/patches/binutils-2.37-file-descriptor-leak.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 26 Jul 2021 05:59:55 -0700
-Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd
-
-Close the file descriptor if there is no archive plugin file descriptor
-to avoid running out of file descriptors on thin archives with many
-archive members.
-
-bfd/
-
- PR ld/28138
- * plugin.c (bfd_plugin_close_file_descriptor): Close the file
- descriptor there is no archive plugin file descriptor.
-
-ld/
-
- PR ld/28138
- * testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for
- native build.
-
- PR ld/28138
- * testsuite/ld-plugin/lto.exp: Run ld/28138 tests.
- * testsuite/ld-plugin/pr28138.c: New file.
- * testsuite/ld-plugin/pr28138-1.c: Likewise.
- * testsuite/ld-plugin/pr28138-2.c: Likewise.
- * testsuite/ld-plugin/pr28138-3.c: Likewise.
- * testsuite/ld-plugin/pr28138-4.c: Likewise.
- * testsuite/ld-plugin/pr28138-5.c: Likewise.
- * testsuite/ld-plugin/pr28138-6.c: Likewise.
- * testsuite/ld-plugin/pr28138-7.c: Likewise.
-
-(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742)
-(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2)
----
- bfd/plugin.c | 8 +++++++
- ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++
- ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++
- ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++
- ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++
- ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++
- ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++
- ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++
- ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++
- ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++
- 10 files changed, 104 insertions(+)
- create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c
- create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c
- create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c
- create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c
- create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c
- create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c
- create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c
- create mode 100644 ld/testsuite/ld-plugin/pr28138.c
-
-diff --git a/bfd/plugin.c b/bfd/plugin.c
-index 6cfa2b66470..3bab8febe88 100644
---- a/bfd/plugin.c
-+++ b/bfd/plugin.c
-@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd)
- && !bfd_is_thin_archive (abfd->my_archive))
- abfd = abfd->my_archive;
-
-+ /* Close the file descriptor if there is no archive plugin file
-+ descriptor. */
-+ if (abfd->archive_plugin_fd == -1)
-+ {
-+ close (fd);
-+ return;
-+ }
-+
- abfd->archive_plugin_fd_open_count--;
- /* Dup the archive plugin file descriptor for later use, which
- will be closed by _bfd_archive_close_and_cleanup. */
-diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
-index def69e43ab3..999d911ce6a 100644
---- a/ld/testsuite/ld-plugin/lto.exp
-+++ b/ld/testsuite/ld-plugin/lto.exp
-@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } {
- }
- }
-
-+run_cc_link_tests [list \
-+ [list \
-+ "Build pr28138.a" \
-+ "-T" "" \
-+ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \
-+ pr28138-6.c pr28138-7.c} {} "pr28138.a" \
-+ ] \
-+ [list \
-+ "Build pr28138.o" \
-+ "" "" \
-+ {pr28138.c} {} \
-+ ] \
-+]
-+
-+set exec_output [run_host_cmd "sh" \
-+ "-c \"ulimit -n 20; \
-+ $CC -Btmpdir/ld -o tmpdir/pr28138 \
-+ tmpdir/pr28138.o tmpdir/pr28138.a\""]
-+set exec_output [prune_warnings $exec_output]
-+if [string match "" $exec_output] then {
-+ if { [isnative] } {
-+ set exec_output [run_host_cmd "tmpdir/pr28138" ""]
-+ if [string match "PASS" $exec_output] then {
-+ pass "PR ld/28138"
-+ } else {
-+ fail "PR ld/28138"
-+ }
-+ } else {
-+ pass "PR ld/28138"
-+ }
-+} else {
-+ fail "PR ld/28138"
-+}
-+
- set testname "Build liblto-11.a"
- remote_file host delete "tmpdir/liblto-11.a"
- set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"]
-diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c
-new file mode 100644
-index 00000000000..51d119e1642
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138-1.c
-@@ -0,0 +1,6 @@
-+extern int a0(void);
-+int
-+a1(void)
-+{
-+ return 1 + a0();
-+}
-diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c
-new file mode 100644
-index 00000000000..1120cd797e9
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138-2.c
-@@ -0,0 +1,6 @@
-+extern int a1(void);
-+int
-+a2(void)
-+{
-+ return 1 + a1();
-+}
-diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c
-new file mode 100644
-index 00000000000..ec464947ee6
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138-3.c
-@@ -0,0 +1,6 @@
-+extern int a2(void);
-+int
-+a3(void)
-+{
-+ return 1 + a2();
-+}
-diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c
-new file mode 100644
-index 00000000000..475701b2c5c
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138-4.c
-@@ -0,0 +1,6 @@
-+extern int a3(void);
-+int
-+a4(void)
-+{
-+ return 1 + a3();
-+}
-diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c
-new file mode 100644
-index 00000000000..e24f86c363e
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138-5.c
-@@ -0,0 +1,6 @@
-+extern int a4(void);
-+int
-+a5(void)
-+{
-+ return 1 + a4();
-+}
-diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c
-new file mode 100644
-index 00000000000..b5b938bdb21
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138-6.c
-@@ -0,0 +1,6 @@
-+extern int a5(void);
-+int
-+a6(void)
-+{
-+ return 1 + a5();
-+}
-diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c
-new file mode 100644
-index 00000000000..4ef75bf0f0c
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138-7.c
-@@ -0,0 +1,6 @@
-+extern int a6(void);
-+int
-+a7(void)
-+{
-+ return 1 + a6();
-+}
-diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c
-new file mode 100644
-index 00000000000..68252c9f382
---- /dev/null
-+++ b/ld/testsuite/ld-plugin/pr28138.c
-@@ -0,0 +1,20 @@
-+#include <stdio.h>
-+
-+extern int a7(void);
-+
-+int
-+a0(void)
-+{
-+ return 0;
-+}
-+
-+int
-+main()
-+{
-+ if (a7() == 7)
-+ {
-+ printf ("PASS\n");
-+ return 0;
-+ }
-+ return 1;
-+}
---
-2.27.0
diff --git a/gnu/packages/patches/binutils-CVE-2021-45078.patch b/gnu/packages/patches/binutils-CVE-2021-45078.patch
deleted file mode 100644
index fca692bdb5..0000000000
--- a/gnu/packages/patches/binutils-CVE-2021-45078.patch
+++ /dev/null
@@ -1,257 +0,0 @@
-Fix CVE-2021-45078 (incomplete fix for CVE-2018-12699):
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45078
-https://sourceware.org/bugzilla/show_bug.cgi?id=28694
-
-Patch copied from upstream source repository:
-
-https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=161e87d12167b1e36193385485c1f6ce92f74f02
-
-From 161e87d12167b1e36193385485c1f6ce92f74f02 Mon Sep 17 00:00:00 2001
-From: Alan Modra <amodra@gmail.com>
-Date: Wed, 15 Dec 2021 11:48:42 +1030
-Subject: [PATCH] PR28694, Out-of-bounds write in stab_xcoff_builtin_type
-
- PR 28694
- * stabs.c (stab_xcoff_builtin_type): Make typenum unsigned.
- Negate typenum earlier, simplifying bounds checking. Correct
- off-by-one indexing. Adjust switch cases.
----
- binutils/stabs.c | 87 ++++++++++++++++++++++++------------------------
- 1 file changed, 43 insertions(+), 44 deletions(-)
-
-diff --git a/binutils/stabs.c b/binutils/stabs.c
-index 274bfb0e7fa..83ee3ea5fa4 100644
---- a/binutils/stabs.c
-+++ b/binutils/stabs.c
-@@ -202,7 +202,7 @@ static debug_type stab_find_type (void *, struct stab_handle *, const int *);
- static bool stab_record_type
- (void *, struct stab_handle *, const int *, debug_type);
- static debug_type stab_xcoff_builtin_type
-- (void *, struct stab_handle *, int);
-+ (void *, struct stab_handle *, unsigned int);
- static debug_type stab_find_tagged_type
- (void *, struct stab_handle *, const char *, int, enum debug_type_kind);
- static debug_type *stab_demangle_argtypes
-@@ -3496,166 +3496,167 @@ stab_record_type (void *dhandle ATTRIBUTE_UNUSED, struct stab_handle *info,
-
- static debug_type
- stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info,
-- int typenum)
-+ unsigned int typenum)
- {
- debug_type rettype;
- const char *name;
-
-- if (typenum >= 0 || typenum < -XCOFF_TYPE_COUNT)
-+ typenum = -typenum - 1;
-+ if (typenum >= XCOFF_TYPE_COUNT)
- {
-- fprintf (stderr, _("Unrecognized XCOFF type %d\n"), typenum);
-+ fprintf (stderr, _("Unrecognized XCOFF type %d\n"), -typenum - 1);
- return DEBUG_TYPE_NULL;
- }
-- if (info->xcoff_types[-typenum] != NULL)
-- return info->xcoff_types[-typenum];
-+ if (info->xcoff_types[typenum] != NULL)
-+ return info->xcoff_types[typenum];
-
-- switch (-typenum)
-+ switch (typenum)
- {
-- case 1:
-+ case 0:
- /* The size of this and all the other types are fixed, defined
- by the debugging format. */
- name = "int";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
-- case 2:
-+ case 1:
- name = "char";
- rettype = debug_make_int_type (dhandle, 1, false);
- break;
-- case 3:
-+ case 2:
- name = "short";
- rettype = debug_make_int_type (dhandle, 2, false);
- break;
-- case 4:
-+ case 3:
- name = "long";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
-- case 5:
-+ case 4:
- name = "unsigned char";
- rettype = debug_make_int_type (dhandle, 1, true);
- break;
-- case 6:
-+ case 5:
- name = "signed char";
- rettype = debug_make_int_type (dhandle, 1, false);
- break;
-- case 7:
-+ case 6:
- name = "unsigned short";
- rettype = debug_make_int_type (dhandle, 2, true);
- break;
-- case 8:
-+ case 7:
- name = "unsigned int";
- rettype = debug_make_int_type (dhandle, 4, true);
- break;
-- case 9:
-+ case 8:
- name = "unsigned";
- rettype = debug_make_int_type (dhandle, 4, true);
- break;
-- case 10:
-+ case 9:
- name = "unsigned long";
- rettype = debug_make_int_type (dhandle, 4, true);
- break;
-- case 11:
-+ case 10:
- name = "void";
- rettype = debug_make_void_type (dhandle);
- break;
-- case 12:
-+ case 11:
- /* IEEE single precision (32 bit). */
- name = "float";
- rettype = debug_make_float_type (dhandle, 4);
- break;
-- case 13:
-+ case 12:
- /* IEEE double precision (64 bit). */
- name = "double";
- rettype = debug_make_float_type (dhandle, 8);
- break;
-- case 14:
-+ case 13:
- /* This is an IEEE double on the RS/6000, and different machines
- with different sizes for "long double" should use different
- negative type numbers. See stabs.texinfo. */
- name = "long double";
- rettype = debug_make_float_type (dhandle, 8);
- break;
-- case 15:
-+ case 14:
- name = "integer";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
-- case 16:
-+ case 15:
- name = "boolean";
- rettype = debug_make_bool_type (dhandle, 4);
- break;
-- case 17:
-+ case 16:
- name = "short real";
- rettype = debug_make_float_type (dhandle, 4);
- break;
-- case 18:
-+ case 17:
- name = "real";
- rettype = debug_make_float_type (dhandle, 8);
- break;
-- case 19:
-+ case 18:
- /* FIXME */
- name = "stringptr";
- rettype = NULL;
- break;
-- case 20:
-+ case 19:
- /* FIXME */
- name = "character";
- rettype = debug_make_int_type (dhandle, 1, true);
- break;
-- case 21:
-+ case 20:
- name = "logical*1";
- rettype = debug_make_bool_type (dhandle, 1);
- break;
-- case 22:
-+ case 21:
- name = "logical*2";
- rettype = debug_make_bool_type (dhandle, 2);
- break;
-- case 23:
-+ case 22:
- name = "logical*4";
- rettype = debug_make_bool_type (dhandle, 4);
- break;
-- case 24:
-+ case 23:
- name = "logical";
- rettype = debug_make_bool_type (dhandle, 4);
- break;
-- case 25:
-+ case 24:
- /* Complex type consisting of two IEEE single precision values. */
- name = "complex";
- rettype = debug_make_complex_type (dhandle, 8);
- break;
-- case 26:
-+ case 25:
- /* Complex type consisting of two IEEE double precision values. */
- name = "double complex";
- rettype = debug_make_complex_type (dhandle, 16);
- break;
-- case 27:
-+ case 26:
- name = "integer*1";
- rettype = debug_make_int_type (dhandle, 1, false);
- break;
-- case 28:
-+ case 27:
- name = "integer*2";
- rettype = debug_make_int_type (dhandle, 2, false);
- break;
-- case 29:
-+ case 28:
- name = "integer*4";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
-- case 30:
-+ case 29:
- /* FIXME */
- name = "wchar";
- rettype = debug_make_int_type (dhandle, 2, false);
- break;
-- case 31:
-+ case 30:
- name = "long long";
- rettype = debug_make_int_type (dhandle, 8, false);
- break;
-- case 32:
-+ case 31:
- name = "unsigned long long";
- rettype = debug_make_int_type (dhandle, 8, true);
- break;
-- case 33:
-+ case 32:
- name = "logical*8";
- rettype = debug_make_bool_type (dhandle, 8);
- break;
-- case 34:
-+ case 33:
- name = "integer*8";
- rettype = debug_make_int_type (dhandle, 8, false);
- break;
-@@ -3664,9 +3665,7 @@ stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info,
- }
-
- rettype = debug_name_type (dhandle, name, rettype);
--
-- info->xcoff_types[-typenum] = rettype;
--
-+ info->xcoff_types[typenum] = rettype;
- return rettype;
- }
-
---
-2.27.0
-
diff --git a/gnu/packages/patches/camlboot-dynamically-allocate-stack-signal.patch b/gnu/packages/patches/camlboot-dynamically-allocate-stack-signal.patch
new file mode 100644
index 0000000000..d27232214b
--- /dev/null
+++ b/gnu/packages/patches/camlboot-dynamically-allocate-stack-signal.patch
@@ -0,0 +1,52 @@
+From 883d68803d17d6f64cdabf2c8ef846345e2d0094 Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sun, 19 Feb 2023 10:20:19 +0100
+Subject: [PATCH] Dynamically allocate the alternate signal stack.
+
+This patch is a backport of https://github.com/ocaml/ocaml/pull/10266.
+---
+ ocaml-src/asmrun/signals_asm.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/ocaml-src/asmrun/signals_asm.c b/ocaml-src/asmrun/signals_asm.c
+index 3895d75..d37b481 100644
+--- a/ocaml-src/asmrun/signals_asm.c
++++ b/ocaml-src/asmrun/signals_asm.c
+@@ -182,7 +182,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+
+ static char * system_stack_top;
+-static char sig_alt_stack[SIGSTKSZ];
+
+ #if defined(SYS_linux)
+ /* PR#4746: recent Linux kernels with support for stack randomization
+@@ -274,15 +273,19 @@ void caml_init_signals(void)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+ {
+ stack_t stk;
+- struct sigaction act;
+- stk.ss_sp = sig_alt_stack;
++ stk.ss_sp = malloc(SIGSTKSZ);
+ stk.ss_size = SIGSTKSZ;
+ stk.ss_flags = 0;
+- SET_SIGACT(act, segv_handler);
+- act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+- sigemptyset(&act.sa_mask);
+- system_stack_top = (char *) &act;
+- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
++ if (stk.ss_sp != NULL) {
++ if (sigaltstack(&stk, NULL) != -1) {
++ struct sigaction act;
++ SET_SIGACT(act, segv_handler);
++ act.sa_flags |= SA_ONSTACK | SA_NODEFER;
++ sigemptyset(&act.sa_mask);
++ system_stack_top = (char *) &act;
++ sigaction(SIGSEGV, &act, NULL);
++ }
++ }
+ }
+ #endif
+ }
+--
+2.38.1
+
diff --git a/gnu/packages/patches/cmake-curl-certificates.patch b/gnu/packages/patches/cmake-curl-certificates.patch
deleted file mode 100644
index 7fe2615271..0000000000
--- a/gnu/packages/patches/cmake-curl-certificates.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-By default commands such as "ctest" would not look for certificates
-at all: <https://issues.guix.gnu.org/issue/37371>.
-
-This changes CMake such that commands honor SSL_CERT_FILE and SSL_CERT_DIR
-as well as /etc/ssl/certs.
-
---- cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:27:36.926907260 +0200
-+++ cmake-3.13.1/Source/cmCurl.cxx 2019-09-10 17:52:35.475903919 +0200
-@@ -2,11 +2,8 @@
- file Copyright.txt or https://cmake.org/licensing for details. */
- #include "cmCurl.h"
-
--#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \
-- !defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH)
- # define CMAKE_FIND_CAFILE
- # include "cmSystemTools.h"
--#endif
- #include "cmStringAlgorithms.h"
-
- // curl versions before 7.21.5 did not provide this error code
-@@ -30,6 +27,19 @@
- ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile);
- check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
- }
-+
-+ /* Honor the usual environment variables. */
-+ else if (cmSystemTools::GetEnv("SSL_CERT_FILE", e)) {
-+ ::CURLcode res =
-+ ::curl_easy_setopt(curl, CURLOPT_CAINFO, e.c_str());
-+ check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
-+ }
-+ else if (cmSystemTools::GetEnv("SSL_CERT_DIR", e)) {
-+ ::CURLcode res =
-+ ::curl_easy_setopt(curl, CURLOPT_CAPATH, e.c_str());
-+ check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
-+ }
-+
- #ifdef CMAKE_FIND_CAFILE
- # define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt"
- else if (cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) {
diff --git a/gnu/packages/patches/coreutils-ls.patch b/gnu/packages/patches/coreutils-ls.patch
deleted file mode 100644
index 59cbbf00b5..0000000000
--- a/gnu/packages/patches/coreutils-ls.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-Patch taken from upstream to fix cross-compilation for aarch64. This can be
-removed on the next coreutils release.
-
-From 10fcb97bd728f09d4a027eddf8ad2900f0819b0a Mon Sep 17 00:00:00 2001
-From: Paul Eggert <eggert@cs.ucla.edu>
-Date: Thu, 5 Mar 2020 17:25:29 -0800
-Subject: [PATCH] ls: restore 8.31 behavior on removed directories
-
-* NEWS: Mention this.
-* src/ls.c: Do not include <sys/sycall.h>
-(print_dir): Don't worry about whether the directory is removed.
-* tests/ls/removed-directory.sh: Adjust to match new (i.e., old)
-behavior.
----
- NEWS | 6 ++++++
- src/ls.c | 22 ----------------------
- tests/ls/removed-directory.sh | 10 ++--------
- 3 files changed, 8 insertions(+), 30 deletions(-)
-
-diff --git a/NEWS b/NEWS
-index fdc8bf5db..653e7178b 100644
---- a/NEWS
-+++ b/NEWS
-@@ -2,6 +2,12 @@ GNU coreutils NEWS -*- outline -*-
-
- * Noteworthy changes in release ?.? (????-??-??) [?]
-
-+** Changes in behavior
-+
-+ On GNU/Linux systems, ls no longer issues an error message on
-+ directory merely because it was removed. This reverts a change
-+ that was made in release 8.32.
-+
-
- * Noteworthy changes in release 8.32 (2020-03-05) [stable]
-
-diff --git a/src/ls.c b/src/ls.c
-index 24b983287..4acf5f44d 100644
---- a/src/ls.c
-+++ b/src/ls.c
-@@ -49,10 +49,6 @@
- # include <sys/ptem.h>
- #endif
-
--#ifdef __linux__
--# include <sys/syscall.h>
--#endif
--
- #include <stdio.h>
- #include <assert.h>
- #include <setjmp.h>
-@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
- struct dirent *next;
- uintmax_t total_blocks = 0;
- static bool first = true;
-- bool found_any_entries = false;
-
- errno = 0;
- dirp = opendir (name);
-@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
- next = readdir (dirp);
- if (next)
- {
-- found_any_entries = true;
- if (! file_ignored (next->d_name))
- {
- enum filetype type = unknown;
-@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
- if (errno != EOVERFLOW)
- break;
- }
--#ifdef __linux__
-- else if (! found_any_entries)
-- {
-- /* If readdir finds no directory entries at all, not even "." or
-- "..", then double check that the directory exists. */
-- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1
-- && errno != EINVAL)
-- {
-- /* We exclude EINVAL as that pertains to buffer handling,
-- and we've passed NULL as the buffer for simplicity.
-- ENOENT is returned if appropriate before buffer handling. */
-- file_failure (command_line_arg, _("reading directory %s"), name);
-- }
-- break;
-- }
--#endif
- else
- break;
-
-diff --git a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh
-index e8c835dab..fe8f929a1 100755
---- a/tests/ls/removed-directory.sh
-+++ b/tests/ls/removed-directory.sh
-@@ -26,20 +26,14 @@ case $host_triplet in
- *) skip_ 'non linux kernel' ;;
- esac
-
--LS_FAILURE=2
--
--cat <<\EOF >exp-err || framework_failure_
--ls: reading directory '.': No such file or directory
--EOF
--
- cwd=$(pwd)
- mkdir d || framework_failure_
- cd d || framework_failure_
- rmdir ../d || framework_failure_
-
--returns_ $LS_FAILURE ls >../out 2>../err || fail=1
-+ls >../out 2>../err || fail=1
- cd "$cwd" || framework_failure_
- compare /dev/null out || fail=1
--compare exp-err err || fail=1
-+compare /dev/null err || fail=1
-
- Exit $fail
diff --git a/gnu/packages/patches/curl-easy-lock.patch b/gnu/packages/patches/curl-easy-lock.patch
deleted file mode 100644
index 137106f57c..0000000000
--- a/gnu/packages/patches/curl-easy-lock.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-This patch is taken from upstream master, and should probably be dropped
-with the next release.
-
-ihttps://github.com/curl/curl/commit/e2e7f54b7bea521fa8373095d0f43261a720cda0.patch
-
-From e2e7f54b7bea521fa8373095d0f43261a720cda0 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg <daniel@haxx.se>
-Date: Mon, 27 Jun 2022 08:46:21 +0200
-Subject: [PATCH] easy_lock.h: include sched.h if available to fix build
-
-Patched-by: Harry Sintonen
-
-Closes #9054
----
- lib/easy_lock.h | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/lib/easy_lock.h b/lib/easy_lock.h
-index 819f50ce815b8..1f54289ceb2d3 100644
---- a/lib/easy_lock.h
-+++ b/lib/easy_lock.h
-@@ -36,6 +36,9 @@
-
- #elif defined (HAVE_ATOMIC)
- #include <stdatomic.h>
-+#if defined(HAVE_SCHED_YIELD)
-+#include <sched.h>
-+#endif
-
- #define curl_simple_lock atomic_bool
- #define CURL_SIMPLE_LOCK_INIT false
diff --git a/gnu/packages/patches/cyrus-sasl-CVE-2019-19906.patch b/gnu/packages/patches/cyrus-sasl-CVE-2019-19906.patch
deleted file mode 100644
index acdf682430..0000000000
--- a/gnu/packages/patches/cyrus-sasl-CVE-2019-19906.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From dcc9f51cbd4ed622cfb0f9b1c141eb2ffe3b12f1 Mon Sep 17 00:00:00 2001
-From: Quanah Gibson-Mount <quanah@symas.com>
-Date: Tue, 18 Feb 2020 19:05:12 +0000
-Subject: [PATCH] Fix #587
-
-Off by one error in common.c, CVE-2019-19906.
-
-Thanks to Stephan Zeisberg for reporting
----
- lib/common.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/common.c b/lib/common.c
-index bc3bf1df..9969d6aa 100644
---- a/lib/common.c
-+++ b/lib/common.c
-@@ -190,7 +190,7 @@ int _sasl_add_string(char **out, size_t *alloclen,
-
- if (add==NULL) add = "(null)";
-
-- addlen=strlen(add); /* only compute once */
-+ addlen=strlen(add)+1; /* only compute once */
- if (_buf_alloc(out, alloclen, (*outlen)+addlen)!=SASL_OK)
- return SASL_NOMEM;
-
diff --git a/gnu/packages/patches/emacs-xelb-ignore-length-element.patch b/gnu/packages/patches/emacs-xelb-ignore-length-element.patch
new file mode 100644
index 0000000000..48c3e35155
--- /dev/null
+++ b/gnu/packages/patches/emacs-xelb-ignore-length-element.patch
@@ -0,0 +1,19 @@
+Work around build failure due to XCB "length" element.
+Patch from <https://sources.debian.org/patches/xelb/0.18-4/>.
+
+Author: Martin <debacle@debian.org>
+Bug: https://github.com/ch11ng/xelb/issues/28
+Bug-Debian: https://bugs.debian.org/1017294
+
+---
+--- a/el_client.el
++++ b/el_client.el
+@@ -519,7 +519,7 @@
+ (`list (xelb-parse-list node))
+ (`exprfield (xelb-parse-exprfield node))
+ (`switch (xelb-parse-switch node))
+- ((or `comment `doc)) ;simply ignored
++ ((or `comment `doc `length)) ;simply ignored
+ (x (error "Unsupported structure content: <%s>" x))))
+
+ ;; The car of the result shall be renamed to prevent duplication of slot names
diff --git a/gnu/packages/patches/freeimage-libtiff-compat.patch b/gnu/packages/patches/freeimage-libtiff-compat.patch
new file mode 100644
index 0000000000..00c5bf659a
--- /dev/null
+++ b/gnu/packages/patches/freeimage-libtiff-compat.patch
@@ -0,0 +1,19 @@
+Use the new TIFFFieldSetGetSize API from libtiff 4.4 instead of the
+private and removed _TIFFDataSize declared in the unbundling patch.
+
+Patch taken from Fedora:
+
+ https://src.fedoraproject.org/rpms/freeimage/blob/rawhide/f/freeimage-libtiff44.patch
+
+diff -rupN --no-dereference freeimage-svn-r1889-FreeImage-trunk/Source/Metadata/XTIFF.cpp freeimage-svn-r1889-FreeImage-trunk-new/Source/Metadata/XTIFF.cpp
+--- freeimage-svn-r1889-FreeImage-trunk/Source/Metadata/XTIFF.cpp 2022-06-23 11:56:32.561043826 +0200
++++ freeimage-svn-r1889-FreeImage-trunk-new/Source/Metadata/XTIFF.cpp 2022-06-23 11:56:32.764043827 +0200
+@@ -747,7 +747,7 @@ tiff_write_exif_tags(TIFF *tif, TagLib::
+ continue;
+ }
+ // type of storage may differ (e.g. rationnal array vs float array type)
+- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) {
++ if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) {
+ // skip tag or _TIFFmemcpy will fail
+ continue;
+ }
diff --git a/gnu/packages/patches/gash-utils-ls-test.patch b/gnu/packages/patches/gash-utils-ls-test.patch
deleted file mode 100644
index e1dfb9c23b..0000000000
--- a/gnu/packages/patches/gash-utils-ls-test.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-'ls.scm' monkey-patches (ice-9 getopt-long) to allow it to recognize '-1'
-as a valid option. Unfortunately, monkey patching no longer works with
-Guile 3.0 due to inlining, so change the test to make do without '-1'.
-
-diff --git a/tests/core-utils.org b/tests/core-utils.org
-index d35ede8..22718e3 100644
---- a/tests/core-utils.org
-+++ b/tests/core-utils.org
-@@ -93,14 +93,11 @@
- * ls
- :script:
- #+begin_src sh
-- ls -1 tests/data/star
-+ ls tests/data/star
- #+end_src
- :stdout:
- #+begin_example
-- 0
-- 1
-- 2
-- 3
-+ 0 1 2 3
- #+end_example
-
- * test-file
diff --git a/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch b/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch
new file mode 100644
index 0000000000..aae5fc9f72
--- /dev/null
+++ b/gnu/packages/patches/gcc-10-tree-sra-union-handling.patch
@@ -0,0 +1,33 @@
+Fix a regression in GCC 10/11/12 where some union structures
+could get miscompiled when optimizations are enabled:
+
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105860
+
+Taken from upstream:
+
+ https://gcc.gnu.org/g:16afe2e2862f3dd93c711d7f8d436dee23c6c34d
+
+diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
+index 09d951a261b..420329f63f6 100644
+--- a/gcc/tree-sra.c
++++ b/gcc/tree-sra.c
+@@ -1647,7 +1647,18 @@ build_ref_for_offset (location_t loc, tree base, poly_int64 offset,
+ static tree
+ build_reconstructed_reference (location_t, tree base, struct access *model)
+ {
+- tree expr = model->expr, prev_expr = NULL;
++ tree expr = model->expr;
++ /* We have to make sure to start just below the outermost union. */
++ tree start_expr = expr;
++ while (handled_component_p (expr))
++ {
++ if (TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == UNION_TYPE)
++ start_expr = expr;
++ expr = TREE_OPERAND (expr, 0);
++ }
++
++ expr = start_expr;
++ tree prev_expr = NULL_TREE;
+ while (!types_compatible_p (TREE_TYPE (expr), TREE_TYPE (base)))
+ {
+ if (!handled_component_p (expr))
diff --git a/gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch b/gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch
new file mode 100644
index 0000000000..1845583ac5
--- /dev/null
+++ b/gnu/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch
@@ -0,0 +1,62 @@
+From f0065f207cf19cd960b33d961472c6d69514336f Mon Sep 17 00:00:00 2001
+From: Samuel Thibault <samuel.thibault@gnu.org>
+Date: Fri, 7 Oct 2022 22:45:06 +0200
+Subject: [PATCH] libstdc++: Mark pieces of gnu-linux/os_support.h
+ linux-specific
+
+This is notably needed because in glibc 2.34, the move of pthread functions
+into libc.so happened for Linux only, not GNU/Hurd.
+
+The pthread_self() function can also always be used fine as it is on
+GNU/Hurd.
+
+libstdc++-v3/ChangeLog:
+
+ * config/os/gnu-linux/os_defines.h [!__linux__]
+ (_GLIBCXX_NATIVE_THREAD_ID, _GLIBCXX_GTHREAD_USE_WEAK): Do not define.
+
+Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
+---
+ libstdc++-v3/config/os/gnu-linux/os_defines.h | 22 +++++++++++--------
+ 1 file changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/libstdc++-v3/config/os/gnu-linux/os_defines.h b/libstdc++-v3/config/os/gnu-linux/os_defines.h
+index 3064f8d908ac2..87317031fcd71 100644
+--- a/libstdc++-v3/config/os/gnu-linux/os_defines.h
++++ b/libstdc++-v3/config/os/gnu-linux/os_defines.h
+@@ -60,22 +60,26 @@
+ # define _GLIBCXX_HAVE_FLOAT128_MATH 1
+ #endif
+
+-#if __GLIBC_PREREQ(2, 27)
++#ifdef __linux__
++// The following libpthread properties only apply to Linux, not GNU/Hurd.
++
++# if __GLIBC_PREREQ(2, 27)
+ // Since glibc 2.27 pthread_self() is usable without linking to libpthread.
+-# define _GLIBCXX_NATIVE_THREAD_ID pthread_self()
+-#else
++# define _GLIBCXX_NATIVE_THREAD_ID pthread_self()
++# else
+ // Before then it was in libc.so.6 but not libc.a, and always returns 0,
+ // which breaks the invariant this_thread::get_id() != thread::id{}.
+ // So only use it if we know the libpthread version is available.
+ // Otherwise use (__gthread_t)1 as the ID of the main (and only) thread.
+-# define _GLIBCXX_NATIVE_THREAD_ID \
+- (__gthread_active_p() ? __gthread_self() : (__gthread_t)1)
+-#endif
++# define _GLIBCXX_NATIVE_THREAD_ID \
++ (__gthread_active_p() ? __gthread_self() : (__gthread_t)1)
++# endif
+
+-#if __GLIBC_PREREQ(2, 34)
++# if __GLIBC_PREREQ(2, 34)
+ // Since glibc 2.34 all pthreads functions are usable without linking to
+ // libpthread.
+-# define _GLIBCXX_GTHREAD_USE_WEAK 0
+-#endif
++# define _GLIBCXX_GTHREAD_USE_WEAK 0
++# endif
++#endif // __linux__
+
+ #endif
diff --git a/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
new file mode 100644
index 0000000000..c0b96c3bc8
--- /dev/null
+++ b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
@@ -0,0 +1,20 @@
+--- a/libstdc++-v3/src/c++17/floating_from_chars.cc
++++ b/libstdc++-v3/src/c++17/floating_from_chars.cc
+@@ -495,10 +495,16 @@
+ from_chars(const char* first, const char* last, __ieee128& value,
+ chars_format fmt) noexcept
+ {
++ errc ec = errc::invalid_argument;
++#if _GLIBCXX_USE_CXX11_ABI
+ buffer_resource mr;
+ pmr::string buf(&mr);
++#else
++ string buf;
++ if (!reserve_string(buf))
++ return make_result(first, 0, {}, ec);
++#endif
+ size_t len = 0;
+- errc ec = errc::invalid_argument;
+ __try
+ {
+ if (const char* pat = pattern(first, last, fmt, buf)) [[likely]]
diff --git a/gnu/packages/patches/gcc-4.9-inline.patch b/gnu/packages/patches/gcc-4.9-inline.patch
new file mode 100644
index 0000000000..f2762c903a
--- /dev/null
+++ b/gnu/packages/patches/gcc-4.9-inline.patch
@@ -0,0 +1,13 @@
+diff -ru a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+--- a/gcc/cp/cfns.h 1970-01-01 01:00:01.000000000 +0100
++++ b/gcc/cp/cfns.h 2023-04-23 09:23:28.883815598 +0200
+@@ -53,6 +53,9 @@
+ static unsigned int hash (const char *, unsigned int);
+ #ifdef __GNUC__
+ __inline
++#ifdef __GNUC_STDC_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
+ #endif
+ const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
diff --git a/gnu/packages/patches/gdb-fix-gnu-nat-build.patch b/gnu/packages/patches/gdb-fix-gnu-nat-build.patch
deleted file mode 100644
index b0249d9cec..0000000000
--- a/gnu/packages/patches/gdb-fix-gnu-nat-build.patch
+++ /dev/null
@@ -1,254 +0,0 @@
-Fix build on the Hurd.
-
-Patch #1 taken from upstream
-
- https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a1700a3199d31910b87cd7db3c394ddd091cfcde
-
-Patch #2 taken from upstream mailing list
-
- https://sourceware.org/pipermail/gdb/2021-November/049777.html
-
-Patch #3 sent to upstream
-
- https://sourceware.org/pipermail/gdb/2021-November/049788.html
-
-From 30d89407ad6bb62fafc72fa9c547c2d7ff371401 Mon Sep 17 00:00:00 2001
-From: Simon Marchi <simon.marchi@polymtl.ca>
-Date: Wed, 3 Nov 2021 15:09:19 -0400
-Subject: [PATCH 1/3] gdb: fix gnu-nat build
-Content-Transfer-Encoding: 8bit
-Content-Type: text/plain; charset=UTF-8
-
-When building gnu-nat.c, we get:
-
- CXX gnu-nat.o
- gnu-nat.c: In member function 'virtual void gnu_nat_target::create_inferior(const char*, const string&, char**, int)':
- gnu-nat.c:2117:13: error: 'struct inf' has no member named 'target_is_pushed'
- 2117 | if (!inf->target_is_pushed (this))
- | ^~~~~~~~~~~~~~~~
- gnu-nat.c:2118:10: error: 'struct inf' has no member named 'push_target'
- 2118 | inf->push_target (this);
- | ^~~~~~~~~~~
-
-This is because of a confusion between the generic `struct inferior`
-variable and the gnu-nat-specific `struct inf` variable. Fix by
-referring to `inferior`, not `inf`.
-
-Adjust the comment on top of `struct inf` to clarify the purpose of that
-type.
-
-Co-Authored-By: Andrea Monaco <andrea.monaco@autistici.org>
-Change-Id: I2fe2f7f6ef61a38d79860fd262b08835c963fc77
----
- gdb/gnu-nat.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
-index 67ce00e9c30..ab539b4d8b4 100644
---- a/gdb/gnu-nat.c
-+++ b/gdb/gnu-nat.c
-@@ -149,7 +149,7 @@ struct inf_wait
- int suppress; /* Something trivial happened. */
- };
-
--/* The state of an inferior. */
-+/* Further Hurd-specific state of an inferior. */
- struct inf
- {
- /* Fields describing the current inferior. */
-@@ -2114,8 +2114,8 @@ gnu_nat_target::create_inferior (const char *exec_file,
-
- inf_debug (inf, "creating inferior");
-
-- if (!inf->target_is_pushed (this))
-- inf->push_target (this);
-+ if (!inferior->target_is_pushed (this))
-+ inferior->push_target (this);
-
- pid = fork_inferior (exec_file, allargs, env, gnu_ptrace_me,
- NULL, NULL, NULL, NULL);
-From ebc0837f4693232f74eb2cc3033515b18a8f0900 Mon Sep 17 00:00:00 2001
-From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
-Date: Mon, 22 Nov 2021 07:47:28 +0100
-Subject: [PATCH 2/3] gdb: gnu-nat.c: port-rights.
-Content-Transfer-Encoding: 8bit
-Content-Type: text/plain; charset=UTF-8
-
-Taken from:
-
- https://sourceware.org/pipermail/gdb/2021-November/049777.html
----
- gdb/gnu-nat.c | 18 ++++++++++--------
- 1 file changed, 10 insertions(+), 8 deletions(-)
-
-diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
-index ab539b4d8b4..8cd876b21d0 100644
---- a/gdb/gnu-nat.c
-+++ b/gdb/gnu-nat.c
-@@ -3292,15 +3292,17 @@ This is the same as setting `task pause', `exceptions', and\n\
- _("Show information about the task's send rights."));
- add_info ("receive-rights", info_recv_rights_cmd,
- _("Show information about the task's receive rights."));
-- add_info ("port-rights", info_port_rights_cmd,
-- _("Show information about the task's port rights."));
-- add_info ("port-sets", info_port_sets_cmd,
-- _("Show information about the task's port sets."));
-+ cmd_list_element *port_rights_cmd =
-+ add_info ("port-rights", info_port_rights_cmd,
-+ _("Show information about the task's port rights."));
-+ cmd_list_element *port_sets_cmd =
-+ add_info ("port-sets", info_port_sets_cmd,
-+ _("Show information about the task's port sets."));
- add_info ("dead-names", info_dead_names_cmd,
-- _("Show information about the task's dead names."));
-- add_info_alias ("ports", "port-rights", 1);
-- add_info_alias ("port", "port-rights", 1);
-- add_info_alias ("psets", "port-sets", 1);
-+ _("Show information about the task's dead names."));
-+ add_info_alias ("ports", port_rights_cmd, 1);
-+ add_info_alias ("port", port_rights_cmd, 1);
-+ add_info_alias ("psets", port_sets_cmd, 1);
- }
-
-
-From e8df985cdd95e4808c390e226a0e852d23c502f9 Mon Sep 17 00:00:00 2001
-From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
-Date: Mon, 22 Nov 2021 08:22:15 +0100
-Subject: [PATCH 3/3] gdb: More compile fixes for gnu-nat.c.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-Content-Transfer-Encoding: 8bit
-Content-Type: text/plain; charset=UTF-8
-
-This fixes compile errors like
-
- ../../gdb-11.1/gdb/gnu-nat.c: In function ‘void add_task_commands()’:
- ../../gdb-11.1/gdb/gnu-nat.c:3204:17: error: no matching function for call to ‘add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)’
- 3204 | &setlist);
- | ^
- In file included from ../../gdb-11.1/gdb/completer.h:21,
- from ../../gdb-11.1/gdb/symtab.h:36,
- from ../../gdb-11.1/gdb/infrun.h:21,
- from ../../gdb-11.1/gdb/target.h:42,
- from ../../gdb-11.1/gdb/inf-child.h:23,
- from ../../gdb-11.1/gdb/gnu-nat.h:38,
- from ../../gdb-11.1/gdb/gnu-nat.c:24:
- ../../gdb-11.1/gdb/command.h:160:33: note: candidate: ‘cmd_list_element* add_cmd(const char*, command_class, void (*)(const char*, int), const char*, cmd_list_element**)’
- 160 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
- | ^~~~~~~
- ../../gdb-11.1/gdb/command.h:161:30: note: no known conversion for argument 3 from ‘cmd_list_element*’ to ‘void (*)(const char*, int)’
- 161 | cmd_const_cfunc_ftype *fun,
- | ~~~~~~~~~~~~~~~~~~~~~~~^~~
- ../../gdb-11.1/gdb/command.h:167:33: note: candidate: ‘cmd_list_element* add_cmd(const char*, command_class, const char*, cmd_list_element**)’
- 167 | extern struct cmd_list_element *add_cmd (const char *, enum command_class,
- | ^~~~~~~
- ../../gdb-11.1/gdb/command.h:167:33: note: candidate expects 4 arguments, 5 provided
- ../../gdb-11.1/gdb/gnu-nat.c:3210:18: error: no matching function for call to ‘add_cmd(const char [8], command_class, cmd_list_element*&, char*, cmd_list_element**)’
- 3210 | &showlist);
- | ^
-
-* gdb/gnu-nat.c (add_task_commands): Use a fresh variable instead of
-shadowing set_signals_cmd etc.
-(add_thread_commands): Likewise.
----
- gdb/gnu-nat.c | 33 +++++++++++++++++----------------
- 1 file changed, 17 insertions(+), 16 deletions(-)
-
-diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
-index 8cd876b21d0..7aecc2295f8 100644
---- a/gdb/gnu-nat.c
-+++ b/gdb/gnu-nat.c
-@@ -3197,31 +3197,31 @@ Show whether new threads are allowed to run (once gdb has noticed them)."),
- _("Show the default detach-suspend-count value for new threads."),
- &show_thread_default_cmd_list);
-
-- cmd_list_element *set_signals_cmd
-+ cmd_list_element *set_signals_cmd_
- = add_cmd ("signals", class_run, set_signals_cmd, _("\
- Set whether the inferior process's signals will be intercepted.\n\
- Mach exceptions (such as breakpoint traps) are not affected."),
- &setlist);
-- add_alias_cmd ("sigs", set_signals_cmd, class_run, 1, &setlist);
-+ add_alias_cmd ("sigs", set_signals_cmd_, class_run, 1, &setlist);
-
-- cmd_list_element *show_signals_cmd
-+ cmd_list_element *show_signals_cmd_
- = add_cmd ("signals", no_class, show_signals_cmd, _("\
- Show whether the inferior process's signals will be intercepted."),
- &showlist);
-- add_alias_cmd ("sigs", show_signals_cmd, no_class, 1, &showlist);
-+ add_alias_cmd ("sigs", show_signals_cmd_, no_class, 1, &showlist);
-
-- cmd_list_element *set_signal_thread_cmd
-+ cmd_list_element *set_signal_thread_cmd_
- = add_cmd ("signal-thread", class_run, set_sig_thread_cmd, _("\
- Set the thread that gdb thinks is the libc signal thread.\n\
- This thread is run when delivering a signal to a non-stopped process."),
- &setlist);
-- add_alias_cmd ("sigthread", set_signal_thread_cmd, class_run, 1, &setlist);
-+ add_alias_cmd ("sigthread", set_signal_thread_cmd_, class_run, 1, &setlist);
-
-- cmd_list_element *show_signal_thread_cmd
-+ cmd_list_element *show_signal_thread_cmd_
- = add_cmd ("signal-thread", no_class, show_sig_thread_cmd, _("\
- Set the thread that gdb thinks is the libc signal thread."),
- &showlist);
-- add_alias_cmd ("sigthread", show_signal_thread_cmd, no_class, 1, &showlist);
-+ add_alias_cmd ("sigthread", show_signal_thread_cmd_, no_class, 1, &showlist);
-
- add_cmd ("stopped", class_run, set_stopped_cmd, _("\
- Set whether gdb thinks the inferior process is stopped as with SIGSTOP.\n\
-@@ -3231,13 +3231,13 @@ Stopped process will be continued by sending them a signal."),
- Show whether gdb thinks the inferior process is stopped as with SIGSTOP."),
- &showlist);
-
-- cmd_list_element *set_exceptions_cmd
-+ cmd_list_element *set_exceptions_cmd_
- = add_cmd ("exceptions", class_run, set_exceptions_cmd, _("\
- Set whether exceptions in the inferior process will be trapped.\n\
- When exceptions are turned off, neither breakpoints nor single-stepping\n\
- will work."), &setlist);
- /* Allow `set exc' despite conflict with `set exception-port'. */
-- add_alias_cmd ("exc", set_exceptions_cmd, class_run, 1, &setlist);
-+ add_alias_cmd ("exc", set_exceptions_cmd_, class_run, 1, &setlist);
-
- add_cmd ("exceptions", no_class, show_exceptions_cmd, _("\
- Show whether exceptions in the inferior process will be trapped."),
-@@ -3269,14 +3269,14 @@ used to pause individual threads by default instead."),
- "on the thread when detaching."),
- &show_task_cmd_list);
-
-- cmd_list_element *set_task_exception_port_cmd
-+ cmd_list_element *set_task_exception_port_cmd_
- = add_cmd ("exception-port", no_class, set_task_exc_port_cmd, _("\
- Set the task exception port to which we forward exceptions.\n\
- The argument should be the value of the send right in the task."),
- &set_task_cmd_list);
-- add_alias_cmd ("excp", set_task_exception_port_cmd, no_class, 1,
-+ add_alias_cmd ("excp", set_task_exception_port_cmd_, no_class, 1,
- &set_task_cmd_list);
-- add_alias_cmd ("exc-port", set_task_exception_port_cmd, no_class, 1,
-+ add_alias_cmd ("exc-port", set_task_exception_port_cmd_, no_class, 1,
- &set_task_cmd_list);
-
- /* A convenient way of turning on all options require to noninvasively
-@@ -3464,14 +3464,15 @@ Note that this is relative to suspend count when gdb noticed the thread;\n\
- use the `thread takeover-suspend-count' to force it to an absolute value."),
- &show_thread_cmd_list);
-
-- add_cmd ("exception-port", no_class, set_thread_exc_port_cmd, _("\
-+ cmd_list_element *set_thread_exception_port_cmd_
-+ = add_cmd ("exception-port", no_class, set_thread_exc_port_cmd, _("\
- Set the thread exception port to which we forward exceptions.\n\
- This overrides the task exception port.\n\
- The argument should be the value of the send right in the task."),
- &set_thread_cmd_list);
-- add_alias_cmd ("excp", set_thread_exception_port_cmd, no_class, 1,
-+ add_alias_cmd ("excp", set_thread_exception_port_cmd_, no_class, 1,
- &set_thread_cmd_list);
-- add_alias_cmd ("exc-port", set_thread_exception_port_cmd, no_class, 1,
-+ add_alias_cmd ("exc-port", set_thread_exception_port_cmd_, no_class, 1,
- &set_thread_cmd_list);
-
- add_cmd ("takeover-suspend-count", no_class, thread_takeover_sc_cmd, _("\
diff --git a/gnu/packages/patches/gettext-libunicode-update.patch b/gnu/packages/patches/gettext-libunicode-update.patch
new file mode 100644
index 0000000000..2a67f4803a
--- /dev/null
+++ b/gnu/packages/patches/gettext-libunicode-update.patch
@@ -0,0 +1,99 @@
+https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commit;h=56dc658db752c2894861ee574866d507f12a17f8
+Due to the encoding it needs to be retrieved from a git clone.
+
+commit 56dc658db752c2894861ee574866d507f12a17f8
+Author: Bruno Haible <bruno@clisp.org>
+Date: Sun Jan 2 15:43:41 2022 +0100
+
+ Update after gnulib changed.
+
+ * gettext-tools/tests/msgcat-17: Update test for changed libunistring line
+ breaking behaviour.
+ * gettext-tools/tests/msgfilter-sr-latin-1: Likewise.
+ * gettext-tools/tests/msgmerge-11: Likewise.
+ * gettext-tools/tests/xgettext-python-1: Likewise.
+
+diff --git a/gettext-tools/tests/msgcat-17 b/gettext-tools/tests/msgcat-17
+index 8fecc4039..c4aa220b9 100755
+--- a/gettext-tools/tests/msgcat-17
++++ b/gettext-tools/tests/msgcat-17
+@@ -39,9 +39,9 @@ msgstr ""
+ #, c-format
+ msgid "write error of a big result on a too small disk% s% s"
+ msgstr ""
+-"Fehler beim Schreiben eines großen Ergebnisses auf eine zu kleine Platte% s"
+-"% smit der jederzeitigen Möglichkeit eines Fehlers in jedem Moment und an "
+-"jeder Stelle"
++"Fehler beim Schreiben eines großen Ergebnisses auf eine zu kleine "
++"Platte% s% smit der jederzeitigen Möglichkeit eines Fehlers in jedem Moment "
++"und an jeder Stelle"
+ EOF
+
+ : ${DIFF=diff}
+diff --git a/gettext-tools/tests/msgfilter-sr-latin-1 b/gettext-tools/tests/msgfilter-sr-latin-1
+index c1cc97875..29e68c04f 100755
+--- a/gettext-tools/tests/msgfilter-sr-latin-1
++++ b/gettext-tools/tests/msgfilter-sr-latin-1
+@@ -20,8 +20,8 @@ msgstr ""
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=CP1251\n"
+ "Content-Transfer-Encoding: 8bit\n"
+-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && n"
+-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
++"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && "
++"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+ #: ../gettext-tools/lib/closeout.c:64
+ msgid "write error"
+@@ -332,8 +332,8 @@ msgstr ""
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=UTF-8\n"
+ "Content-Transfer-Encoding: 8bit\n"
+-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && n"
+-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
++"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : (n%10>=2 && "
++"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+ #: ../gettext-tools/lib/closeout.c:64
+ msgid "write error"
+diff --git a/gettext-tools/tests/msgmerge-11 b/gettext-tools/tests/msgmerge-11
+index ed49db95a..888855940 100755
+--- a/gettext-tools/tests/msgmerge-11
++++ b/gettext-tools/tests/msgmerge-11
+@@ -19,8 +19,8 @@ msgstr ""
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=ISO-8859-1\n"
+ "Content-Transfer-Encoding: 8bit\n"
+-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
+-"%100==4 ? 2 : 3);\n"
++"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
++"n%100==4 ? 2 : 3);\n"
+
+ #:foobar.c:29
+ #, c-format
+@@ -72,8 +72,8 @@ msgstr ""
+ "MIME-Version: 1.0\n"
+ "Content-Type: text/plain; charset=ISO-8859-1\n"
+ "Content-Transfer-Encoding: 8bit\n"
+-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
+-"%100==4 ? 2 : 3);\n"
++"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
++"n%100==4 ? 2 : 3);\n"
+
+ #: foobar.c:32
+ #, fuzzy, c-format
+diff --git a/gettext-tools/tests/xgettext-python-1 b/gettext-tools/tests/xgettext-python-1
+index 4901c71e3..9695abda4 100755
+--- a/gettext-tools/tests/xgettext-python-1
++++ b/gettext-tools/tests/xgettext-python-1
+@@ -61,8 +61,8 @@ msgstr ""
+ #. interpret_ansic = false, interpret_unicode = false
+ msgid ""
+ "abc\\\n"
+-"\\\\def\\'ghi\\\"jkl\\a\\b\\f\\n\\r\\t\\v x\\040x\\x7ey"
+-"\\u0142\\U00010123\\N{LATIN SMALL LETTER Z}"
++"\\\\def\\'ghi\\\"jkl\\a\\b\\f\\n\\r\\t\\v "
++"x\\040x\\x7ey\\u0142\\U00010123\\N{LATIN SMALL LETTER Z}"
+ msgstr ""
+
+ #. interpret_ansic = true, interpret_unicode = true
diff --git a/gnu/packages/patches/ghc-9.2-grep-warnings.patch b/gnu/packages/patches/ghc-9.2-grep-warnings.patch
new file mode 100644
index 0000000000..7a3d9c599e
--- /dev/null
+++ b/gnu/packages/patches/ghc-9.2-grep-warnings.patch
@@ -0,0 +1,37 @@
+--- ghc-9.2.5/testsuite/tests/numeric/should_run/T7014.primops.orig 2023-03-12 14:42:11.338540492 +0100
++++ ghc-9.2.5/testsuite/tests/numeric/should_run/T7014.primops 2023-03-12 14:42:13.735608896 +0100
+@@ -1,9 +1,9 @@
+ and#
+ or#
+ uncheckedShift.*#
+++#
++-#
++*#
+-\+#
+-\-#
+-\*#
+ quotInt#
+ remInt#
+ plusFloat#
+--- ghc-9.2.5/testsuite/tests/hsc2hs/Makefile.orig 2023-03-12 14:40:03.825939306 +0100
++++ ghc-9.2.5/testsuite/tests/hsc2hs/Makefile 2023-03-12 14:40:07.961054835 +0100
+@@ -54,7 +54,7 @@
+ ifeq "$(WINDOWS)" "YES"
+ grep '{-# LINE 1 \"T12504\\\\path\\\\to\\\\$@\.hsc\" #-}' T12504/path/to/$@.hs
+ else
++ grep '{-# LINE 1 "T12504/path/to/$@\.hsc" #-}' T12504/path/to/$@.hs
+- grep '{-# LINE 1 \"T12504/path/to/$@\.hsc\" #-}' T12504/path/to/$@.hs
+ endif
+
+ .PHONY: T15758
+--- ghc-9.2.5/testsuite/tests/simplCore/should_compile/Makefile.orig 2023-03-12 14:41:16.204974035 +0100
++++ ghc-9.2.5/testsuite/tests/simplCore/should_compile/Makefile 2023-03-12 14:41:17.832020067 +0100
+@@ -253,7 +253,7 @@
+ # g should have been collapsed into one defininition by CSE.
+ .PHONY: T13340
+ T13340:
++ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '+#'
+- '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '\+#'
+
+
+ # We expect to see all dictionaries specialized away.
diff --git a/gnu/packages/patches/ghc-testsuite-grep-compat.patch b/gnu/packages/patches/ghc-testsuite-grep-compat.patch
new file mode 100644
index 0000000000..a2bd5fcec4
--- /dev/null
+++ b/gnu/packages/patches/ghc-testsuite-grep-compat.patch
@@ -0,0 +1,39 @@
+Remove stray escapes to avoid warnings from grep 3.8 which breaks
+expected test output.
+
+diff --git a/testsuite/tests/hsc2hs/Makefile b/testsuite/tests/hsc2hs/Makefile
+--- a/testsuite/tests/hsc2hs/Makefile
++++ b/testsuite/tests/hsc2hs/Makefile
+@@ -47,5 +47,5 @@ T12504:
+ ifeq "$(WINDOWS)" "YES"
+ grep '{-# LINE 1 \"T12504\\\\path\\\\to\\\\$@\.hsc\" #-}' T12504/path/to/$@.hs
+ else
+- grep '{-# LINE 1 \"T12504/path/to/$@\.hsc\" #-}' T12504/path/to/$@.hs
++ grep '{-# LINE 1 "T12504/path/to/$@\.hsc" #-}' T12504/path/to/$@.hs
+ endif
+diff --git a/testsuite/tests/numeric/should_run/T7014.primops b/testsuite/tests/numeric/should_run/T7014.primops
+--- a/testsuite/tests/numeric/should_run/T7014.primops
++++ b/testsuite/tests/numeric/should_run/T7014.primops
+@@ -1,8 +1,8 @@
+ and#
+ or#
+ uncheckedShift.*#
+-\+#
+-\-#
+++#
++-#
+ \*#
+ quotInt#
+ remInt#
+diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile
+--- a/testsuite/tests/simplCore/should_compile/Makefile
++++ b/testsuite/tests/simplCore/should_compile/Makefile
+@@ -226,7 +226,7 @@ str-rules:
+ # g should have been collapsed into one defininition by CSE.
+ .PHONY: T13340
+ T13340:
+- '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '\+#'
++ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T13340.hs -ddump-simpl -dsuppress-all | grep -c '+#'
+
+
+ # We expect to see all dictionaries specialized away.
diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
index b19f3ab5d9..493693b78d 100644
--- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch
+++ b/gnu/packages/patches/ghostscript-no-header-creationdate.patch
@@ -6,11 +6,11 @@ not write out the "/ID" field (if that's permissible).
Upstream does not want to do this.
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
-diff --git a/orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c b/bb/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
-index 0fb067e..b342e2c 100644
---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
-+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
-@@ -305,6 +305,9 @@ pdf_initialize_ids(gx_device_pdf * pdev)
+diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c
+index cb268f62e..c5abefde2 100644
+--- a/devices/vector/gdevpdf.c
++++ b/devices/vector/gdevpdf.c
+@@ -425,6 +425,9 @@ pdf_initialize_ids(gx_device_pdf * pdev)
* date and time, rather than (for example) %%CreationDate from the
* PostScript file. We think this is wrong, but we do the same.
*/
@@ -20,9 +20,11 @@ index 0fb067e..b342e2c 100644
{
struct tm tms;
time_t t;
---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
-+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
-@@ -692,6 +692,9 @@
+diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c
+index ec011d8ba..f083f1e93 100644
+--- a/devices/vector/gdevpdfe.c
++++ b/devices/vector/gdevpdfe.c
+@@ -696,6 +696,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
pdf_xml_attribute_name(s, "xmlns:xmp");
pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
pdf_xml_tag_end(s);
@@ -32,7 +34,7 @@ index 0fb067e..b342e2c 100644
{
pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
pdf_xml_tag_end(s);
-@@ -700,6 +701,9 @@
+@@ -704,6 +707,9 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
pdf_xml_tag_close(s, "xmp:ModifyDate");
pdf_xml_newline(s);
}
diff --git a/gnu/packages/patches/ghostscript-no-header-id.patch b/gnu/packages/patches/ghostscript-no-header-id.patch
index 45fc95fd6e..ef518b0fb2 100644
--- a/gnu/packages/patches/ghostscript-no-header-id.patch
+++ b/gnu/packages/patches/ghostscript-no-header-id.patch
@@ -6,38 +6,39 @@ not write out the "/ID" field (if that's permissible).
Upstream does not want to do this.
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
-diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c
---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:30:28.960479189 +0200
-+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdf.c 2017-07-09 23:34:34.306524488 +0200
-@@ -1810,8 +1810,11 @@
+diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c
+index c5abefde2..3859fc088 100644
+--- a/devices/vector/gdevpdf.c
++++ b/devices/vector/gdevpdf.c
+@@ -1909,8 +1909,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params
* +1 for the linearisation dict and +1 for the primary hint stream.
*/
linear_params->FirsttrailerOffset = gp_ftell(linear_params->Lin_File.file);
-- gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
+- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, 0);
-+ gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
++ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber);
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
-+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID);
-+ gs_sprintf(LDict, "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0);
++ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID);
++ gs_snprintf(LDict, sizeof(LDict), "/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n", 0);
gp_fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file);
/* Write document catalog (Part 4) */
-@@ -2346,8 +2349,11 @@
+@@ -2445,8 +2448,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params
if (code != 0)
return_error(gs_error_ioerror);
-- gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n",
+- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n",
- linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, mainxref);
-+ gs_sprintf(LDict, "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
++ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R",
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber);
+ if (pdev->OwnerPassword.size > 0 || !(!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))) /* ID is mandatory when encrypting */
-+ gs_sprintf(LDict, "/ID[%s%s]", fileID, fileID);
-+ gs_sprintf(LDict, "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref);
++ gs_snprintf(LDict, sizeof(LDict), "/ID[%s%s]", fileID, fileID);
++ gs_snprintf(LDict, sizeof(LDict), "/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n", mainxref);
gp_fwrite(LDict, strlen(LDict), 1, linear_params->sfile);
code = gp_fseek(linear_params->sfile, pdev->ResourceUsage[HintStreamObj].LinearisedOffset, SEEK_SET);
-@@ -3012,10 +3018,12 @@
+@@ -3139,10 +3145,12 @@ pdf_close(gx_device * dev)
stream_puts(s, "trailer\n");
pprintld3(s, "<< /Size %ld /Root %ld 0 R /Info %ld 0 R\n",
pdev->next_id, Catalog_id, Info_id);
diff --git a/gnu/packages/patches/ghostscript-no-header-uuid.patch b/gnu/packages/patches/ghostscript-no-header-uuid.patch
index f4b55764c8..b277a4bc2e 100644
--- a/gnu/packages/patches/ghostscript-no-header-uuid.patch
+++ b/gnu/packages/patches/ghostscript-no-header-uuid.patch
@@ -8,10 +8,11 @@ field value as "".
Upstream does not want to do this.
See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
-diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c
---- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-09 23:30:28.960479189 +0200
-+++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c 2017-07-10 01:04:12.252478276 +0200
-@@ -620,7 +620,7 @@
+diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c
+index f083f1e93..a19c64ac0 100644
+--- a/devices/vector/gdevpdfe.c
++++ b/devices/vector/gdevpdfe.c
+@@ -624,7 +624,7 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
return code;
/* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */
@@ -20,7 +21,7 @@ diff -ur orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c aa/gnu-ghostscrip
instance_uuid[0] = 0x00;
cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time));
-@@ -720,14 +720,17 @@
+@@ -730,14 +730,17 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
pdf_xml_tag_close(s, "rdf:Description");
pdf_xml_newline(s);
diff --git a/gnu/packages/patches/glib-networking-32-bit-time.patch b/gnu/packages/patches/glib-networking-32-bit-time.patch
deleted file mode 100644
index a437310270..0000000000
--- a/gnu/packages/patches/glib-networking-32-bit-time.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Work around a year-2038 issue when building with a 32-bit 'time_t'
-on 32-bit platforms:
-
- https://gitlab.gnome.org/GNOME/glib-networking/-/issues/172
-
-From 4f8ca86a0e460794188c3355f0c7cc11fdbe4229 Mon Sep 17 00:00:00 2001
-From: Simon McVittie <simon.mcvittie@collabora.co.uk>
-Date: Tue, 21 Sep 2021 17:07:44 +0000
-Subject: [PATCH] tests: Accept GNUTLS' workaround for limited size of time_t
-
----
- tls/tests/certificate.c | 15 +++++++++++++++
- tls/tests/meson.build | 1 +
- 2 files changed, 16 insertions(+)
-
-diff --git a/tls/tests/certificate.c b/tls/tests/certificate.c
-index c0100d30..d216c710 100644
---- a/tls/tests/certificate.c
-+++ b/tls/tests/certificate.c
-@@ -672,6 +672,12 @@ test_certificate_not_valid_before (void)
- g_object_unref (cert);
- }
-
-+/* On 32-bit, GNUTLS caps expiry times at 2037-12-31 23:23:23 to avoid
-+ * overflowing time_t. Hopefully by 2037, either 32-bit will finally have
-+ * died out, or GNUTLS will rethink its approach to
-+ * https://gitlab.com/gnutls/gnutls/-/issues/370 */
-+#define GNUTLS_32_BIT_NOT_VALID_AFTER_MAX 2145914603
-+
- static void
- test_certificate_not_valid_after (void)
- {
-@@ -686,7 +692,16 @@ test_certificate_not_valid_after (void)
- actual = g_tls_certificate_get_not_valid_after (cert);
- g_assert_nonnull (actual);
- actual_str = g_date_time_format_iso8601 (actual);
-+
-+#if SIZEOF_TIME_T <= 4
-+ if (g_date_time_to_unix (actual) == GNUTLS_32_BIT_NOT_VALID_AFTER_MAX)
-+ g_test_incomplete ("not-valid-after date not representable on 32-bit");
-+ else
-+ g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER);
-+#else
- g_assert_cmpstr (actual_str, ==, EXPECTED_NOT_VALID_AFTER);
-+#endif
-+
- g_free (actual_str);
- g_date_time_unref (actual);
- g_object_unref (cert);
-diff --git a/tls/tests/meson.build b/tls/tests/meson.build
-index e9c7d8c6..7415f913 100644
---- a/tls/tests/meson.build
-+++ b/tls/tests/meson.build
-@@ -69,6 +69,7 @@ foreach backend: backends
- test_cflags = cflags + [
- '-DBACKEND="@0@"'.format(backend),
- '-DBACKEND_IS_' + backend.to_upper(),
-+ '-DSIZEOF_TIME_T=@0@'.format(cc.sizeof('time_t', prefix: '#include <time.h>')),
- ]
-
- if backend == 'openssl'
diff --git a/gnu/packages/patches/glibc-dl-cache.patch b/gnu/packages/patches/glibc-dl-cache.patch
index 68c3a94846..647837b983 100644
--- a/gnu/packages/patches/glibc-dl-cache.patch
+++ b/gnu/packages/patches/glibc-dl-cache.patch
@@ -6,7 +6,7 @@ diff --git a/elf/dl-cache.c b/elf/dl-cache.c
index 93d185e788..e0760a1f40 100644
--- a/elf/dl-cache.c
+++ b/elf/dl-cache.c
-@@ -171,6 +171,51 @@ _dl_cache_libcmp (const char *p1, const char *p2)
+@@ -171,6 +171,52 @@ _dl_cache_libcmp (const char *p1, const char *p2)
return *p1 - *p2;
}
@@ -27,7 +27,8 @@ index 93d185e788..e0760a1f40 100644
+ const char *origin = _dl_get_origin ();
+
+ /* Check whether ORIGIN is something like "/gnu/store/…-foo/bin". */
-+ if (strncmp (store, origin, strlen (store)) == 0
++ if (origin != (char *) -1 /* _dl_get_origin reported failure */
++ && strncmp (store, origin, strlen (store)) == 0
+ && origin[sizeof store - 1] == '/')
+ {
+ char *store_item_end = strchr (origin + sizeof store, '/');
diff --git a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
index e31f99a1ce..b02215550d 100644
--- a/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
+++ b/gnu/packages/patches/glibc-hurd-clock_gettime_monotonic.patch
@@ -67,8 +67,8 @@ index fcd79fd554..1dd02aa449 100644
diff --git a/sysdeps/pthread/timer_create.c b/sysdeps/pthread/timer_create.c
index 9d8a9ea8ae..3430582c09 100644
---- a/sysdeps/pthread/timer_create.c
-+++ b/sysdeps/pthread/timer_create.c
+--- a/rt/timer_create.c
++++ b/rt/timer_create.c
@@ -48,7 +48,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
return -1;
}
diff --git a/gnu/packages/patches/glibc-static-nss.patch b/gnu/packages/patches/glibc-static-nss.patch
deleted file mode 100644
index 1a9db616cc..0000000000
--- a/gnu/packages/patches/glibc-static-nss.patch
+++ /dev/null
@@ -1,1244 +0,0 @@
-This patch reinstates support for static NSS, which glibc 2.33 broke:
-
- https://sourceware.org/bugzilla/show_bug.cgi?id=27959
-
-Patch obtained by running:
-
- git diff f0c28504a9877be5da3ed1215f2da2d5914bbb0b..f9c8b11ed7726b858cd7b7cea0d3d7c5233d78cf
- git diff 5e1ce61e3e71fb7ffe53f58fe96e67cb15f94854{^,}
- git diff 135425a1dd50cbe2b9db0628d6c2b36c7889f30b{^,}
-
-It corresponds to these changes:
-
- f9c8b11ed7 * nss: Access nss_files through direct references
- 6212bb67f4 * nss_files: Move into libc
- 36861a968a * nss_files: Add generic code for set*ent, end*ent and file open
- f0c28504a9 * nss_files: Allocate nscd file registration data on the heap
- 5e1ce61e3e * nss: Fix NSS_DECLARE_MODULE_FUNCTIONS handling of _nss_*_endnetgrent
- 135425a1dd * nss: Fix build error with --disable-nscd
-
-... plus a manual fix in 'files-network.c' to address this compilation error:
-
- nss_files/files-network.c: In function ‘_nss_files_parse_netent’:
- nss_files/files-network.c:72:20: error: implicit declaration of function ‘__inet_network’; did you mean ‘inet_network’? [-Werror=implicit-function-declaration]
- 72 | result->n_net = __inet_network (addr);
- | ^~~~~~~~~~~~~~
- nss_files/files-parse.c:106:3: note: in definition of macro ‘LINE_PARSER’
- 106 | BODY; \
- | ^~~~
-
-diff --git a/include/libc-symbols.h b/include/libc-symbols.h
-index 127ea656c2..d41ecf4384 100644
---- a/include/libc-symbols.h
-+++ b/include/libc-symbols.h
-@@ -798,29 +798,6 @@ for linking")
- # define libdl_hidden_data_ver(local, name)
- #endif
-
--#if IS_IN (libnss_files)
--# define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
--# define libnss_files_hidden_tls_proto(name, attrs...) \
-- hidden_tls_proto (name, ##attrs)
--# define libnss_files_hidden_def(name) hidden_def (name)
--# define libnss_files_hidden_weak(name) hidden_weak (name)
--# define libnss_files_hidden_ver(local, name) hidden_ver (local, name)
--# define libnss_files_hidden_data_def(name) hidden_data_def (name)
--# define libnss_files_hidden_tls_def(name) hidden_tls_def (name)
--# define libnss_files_hidden_data_weak(name) hidden_data_weak (name)
--# define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name)
--#else
--# define libnss_files_hidden_proto(name, attrs...)
--# define libnss_files_hidden_tls_proto(name, attrs...)
--# define libnss_files_hidden_def(name)
--# define libnss_files_hidden_weak(name)
--# define libnss_files_hidden_ver(local, name)
--# define libnss_files_hidden_data_def(name)
--# define libnss_files_hidden_tls_def(name)
--# define libnss_files_hidden_data_weak(name)
--# define libnss_files_hidden_data_ver(local, name)
--#endif
--
- #if IS_IN (libnsl)
- # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
- # define libnsl_hidden_tls_proto(name, attrs...) \
-diff --git a/include/netdb.h b/include/netdb.h
-index 82e102ff76..4dcdbb8cd4 100644
---- a/include/netdb.h
-+++ b/include/netdb.h
-@@ -217,7 +217,7 @@ extern enum nss_status _nss_netgroup_parseline (char **cursor,
- struct __netgrent *result,
- char *buffer, size_t buflen,
- int *errnop);
--libnss_files_hidden_proto (_nss_netgroup_parseline)
-+libc_hidden_proto (_nss_netgroup_parseline)
-
- #define DECLARE_NSS_PROTOTYPES(service) \
- extern enum nss_status _nss_ ## service ## _setprotoent (int); \
-diff --git a/include/nss_files.h b/include/nss_files.h
-index 6a0dcdb85b..6190cac6be 100644
---- a/include/nss_files.h
-+++ b/include/nss_files.h
-@@ -19,7 +19,11 @@
- #ifndef _NSS_FILES_H
- #define _NSS_FILES_H
-
-+#include <nss.h>
- #include <stdio.h>
-+#if IS_IN (libc)
-+#include <libc-lock.h>
-+#endif
-
- /* Open PATH for reading, as a data source for nss_files. */
- FILE *__nss_files_fopen (const char *path);
-@@ -47,6 +51,63 @@ int __nss_readline_seek (FILE *fp, off64_t offset) attribute_hidden;
- int __nss_parse_line_result (FILE *fp, off64_t offset, int parse_line_result);
- libc_hidden_proto (__nss_parse_line_result)
-
-+/* Per-file data. Used by the *ent functions that need to preserve
-+ state across calls. */
-+struct nss_files_per_file_data
-+{
-+ FILE *stream;
-+#if IS_IN (libc)
-+ /* The size of locks changes between libc and nss_files, so this
-+ member must be last and is only available in libc. */
-+ __libc_lock_define (, lock);
-+#endif
-+};
-+
-+/* File index for __nss_files_data_get. */
-+enum nss_files_file
-+ {
-+ nss_file_aliasent,
-+ nss_file_etherent,
-+ nss_file_grent,
-+ nss_file_hostent,
-+ nss_file_netent,
-+ nss_file_protoent,
-+ nss_file_pwent,
-+ nss_file_rpcent,
-+ nss_file_servent,
-+ nss_file_sgent,
-+ nss_file_spent,
-+
-+ nss_file_count
-+ };
-+
-+/* Obtains a pointer to the per-file data for FILE, which is written
-+ to *PDATA, and tries to open the file at PATH for it. On success,
-+ returns NSS_STATUS_SUCCESS, and the caller must later call
-+ __nss_files_data_put. On failure, NSS_STATUS_TRYAGAIN is returned,
-+ and *ERRNOP and *HERRNOP are updated if these pointers are not
-+ null. */
-+enum nss_status __nss_files_data_open (struct nss_files_per_file_data **pdata,
-+ enum nss_files_file file,
-+ const char *path,
-+ int *errnop, int *herrnop);
-+libc_hidden_proto (__nss_files_data_open)
-+
-+/* Unlock the per-file data, previously obtained by
-+ __nss_files_data_open. */
-+void __nss_files_data_put (struct nss_files_per_file_data *data);
-+libc_hidden_proto (__nss_files_data_put)
-+
-+/* Performs the set*ent operation for FILE. PATH is the file to
-+ open. */
-+enum nss_status __nss_files_data_setent (enum nss_files_file file,
-+ const char *path);
-+libc_hidden_proto (__nss_files_data_setent)
-+
-+/* Performs the end*ent operation for FILE. */
-+enum nss_status __nss_files_data_endent (enum nss_files_file file);
-+libc_hidden_proto (__nss_files_data_endent)
-+
- struct parser_data;
-
- /* Instances of the parse_line function from
-@@ -64,16 +125,25 @@ extern nss_files_parse_line _nss_files_parse_servent;
- extern nss_files_parse_line _nss_files_parse_sgent;
- extern nss_files_parse_line _nss_files_parse_spent;
-
--libnss_files_hidden_proto (_nss_files_parse_etherent)
-+libc_hidden_proto (_nss_files_parse_etherent)
- libc_hidden_proto (_nss_files_parse_grent)
--libnss_files_hidden_proto (_nss_files_parse_netent)
--libnss_files_hidden_proto (_nss_files_parse_protoent)
-+libc_hidden_proto (_nss_files_parse_netent)
-+libc_hidden_proto (_nss_files_parse_protoent)
- libc_hidden_proto (_nss_files_parse_pwent)
--libnss_files_hidden_proto (_nss_files_parse_rpcent)
--libnss_files_hidden_proto (_nss_files_parse_servent)
-+libc_hidden_proto (_nss_files_parse_rpcent)
-+libc_hidden_proto (_nss_files_parse_servent)
- libc_hidden_proto (_nss_files_parse_sgent)
- libc_hidden_proto (_nss_files_parse_spent)
-
-+NSS_DECLARE_MODULE_FUNCTIONS (files)
-+#undef DEFINE_NSS_FUNCTION
-+#define DEFINE_NSS_FUNCTION(x) libc_hidden_proto (_nss_files_##x)
-+#include <nss/function.def>
-+#undef DEFINE_NSS_FUNCTION
-+
-+void _nss_files_init (void (*cb) (size_t, struct traced_file *));
-+libc_hidden_proto (_nss_files_init)
-+
- /* Generic implementation of fget*ent_r. Reads lines from FP until
- EOF or a successful parse into *RESULT using PARSER. Returns 0 on
- success, ENOENT on EOF, ERANGE on too-small buffer. */
-diff --git a/nss/Makefile b/nss/Makefile
-index 9682a31e20..63a386af18 100644
---- a/nss/Makefile
-+++ b/nss/Makefile
-@@ -31,7 +31,8 @@ routines = nsswitch getnssent getnssent_r digits_dots \
- compat-lookup nss_hash nss_files_fopen \
- nss_readline nss_parse_line_result \
- nss_fgetent_r nss_module nss_action \
-- nss_action_parse nss_database
-+ nss_action_parse nss_database nss_files_data \
-+ nss_files_functions
-
- # These are the databases that go through nss dispatch.
- # Caution: if you add a database here, you must add its real name
-@@ -98,9 +99,11 @@ subdir-dirs = $(services:%=nss_%)
- vpath %.c $(subdir-dirs) ../locale/programs ../intl
-
-
--libnss_files-routines := $(addprefix files-, \
-- $(filter-out key, $(databases))) \
-- files-initgroups files-init
-+routines += \
-+ $(addprefix files-, $(filter-out key, $(databases))) \
-+ files-init \
-+ files-initgroups \
-+ # routines
-
- libnss_db-dbs := $(addprefix db-,\
- $(filter-out hosts network key alias,\
-@@ -116,12 +119,9 @@ libnss_compat-routines := $(addprefix compat-,grp pwd spwd initgroups) \
- install-others += $(inst_vardbdir)/Makefile
-
- # Build static module into libc if requested
--libnss_files-inhibit-o = $(filter-out .os,$(object-suffixes))
- libnss_db-inhibit-o = $(filter-out .os,$(object-suffixes))
- libnss_compat-inhibit-o = $(filter-out .os,$(object-suffixes))
- ifeq ($(build-static-nss),yes)
--routines += $(libnss_files-routines)
--static-only-routines += $(libnss_files-routines)
- tests-static += tst-nss-static
- endif
- extra-test-objs += nss_test1.os nss_test2.os
-@@ -138,8 +138,6 @@ libnss-libc = $(common-objpfx)linkobj/libc.so
- # for new links:
- $(services:%=$(objpfx)libnss_%.so): libc-for-link = $(libnss-libc)
-
--$(objpfx)libnss_db.so: $(objpfx)libnss_files.so
--
- $(libnss_db-dbs:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
- @rm -f $@.new
- (echo '#define EXTERN_PARSER';\
-diff --git a/nss/Versions b/nss/Versions
-index fdddea104c..e551524aa9 100644
---- a/nss/Versions
-+++ b/nss/Versions
-@@ -19,11 +19,12 @@ libc {
- __nss_services_lookup2; __nss_next2; __nss_lookup;
- __nss_hash; __nss_database_get;
- __nss_files_fopen; __nss_readline; __nss_parse_line_result;
-- }
--}
-+ __nss_files_data_endent;
-+ __nss_files_data_open;
-+ __nss_files_data_put;
-+ __nss_files_data_setent;
-
--libnss_files {
-- GLIBC_PRIVATE {
-+ # Routines formerly in libnss_files.so.2.
- _nss_files_setaliasent;
- _nss_files_endaliasent;
- _nss_files_getaliasbyname_r;
-@@ -109,6 +110,14 @@ libnss_files {
- }
- }
-
-+libnss_files {
-+ GLIBC_PRIVATE {
-+ # Keep a version node (with a synthesized local: * directive) so that
-+ # __bss_* symbols are hidden on targets that need it.
-+ __libnss_files_version_placeholder;
-+ }
-+}
-+
- libnss_db {
- GLIBC_PRIVATE {
- _nss_db_setetherent;
-diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
-index b4b989d9bb..c158a891bd 100644
---- a/nss/nss_files/files-XXX.c
-+++ b/nss/nss_files/files-XXX.c
-@@ -45,10 +45,12 @@
- # include <netdb.h>
- # define H_ERRNO_PROTO , int *herrnop
- # define H_ERRNO_ARG , herrnop
-+# define H_ERRNO_ARG_OR_NULL herrnop
- # define H_ERRNO_SET(val) (*herrnop = (val))
- #else
- # define H_ERRNO_PROTO
- # define H_ERRNO_ARG
-+# define H_ERRNO_ARG_OR_NULL NULL
- # define H_ERRNO_SET(val) ((void) 0)
- #endif
-
-@@ -58,15 +60,11 @@
- # define EXTRA_ARGS_VALUE
- #endif
-
--/* Locks the static variables in this file. */
--__libc_lock_define_initialized (static, lock)
-
- /* Maintenance of the stream open on the database file. For getXXent
- operations the stream needs to be held open across calls, the other
- getXXbyYY operations all use their own stream. */
-
--static FILE *stream;
--
- /* Open database file if not already opened. */
- static enum nss_status
- internal_setent (FILE **stream)
-@@ -91,42 +89,16 @@ internal_setent (FILE **stream)
- enum nss_status
- CONCAT(_nss_files_set,ENTNAME) (int stayopen)
- {
-- enum nss_status status;
--
-- __libc_lock_lock (lock);
--
-- status = internal_setent (&stream);
--
-- __libc_lock_unlock (lock);
--
-- return status;
-+ return __nss_files_data_setent (CONCAT (nss_file_, ENTNAME), DATAFILE);
- }
-+libc_hidden_def (CONCAT (_nss_files_set,ENTNAME))
-
--
--/* Close the database file. */
--static void
--internal_endent (FILE **stream)
--{
-- if (*stream != NULL)
-- {
-- fclose (*stream);
-- *stream = NULL;
-- }
--}
--
--
--/* Thread-safe, exported version of that. */
- enum nss_status
- CONCAT(_nss_files_end,ENTNAME) (void)
- {
-- __libc_lock_lock (lock);
--
-- internal_endent (&stream);
--
-- __libc_lock_unlock (lock);
--
-- return NSS_STATUS_SUCCESS;
-+ return __nss_files_data_endent (CONCAT (nss_file_, ENTNAME));
- }
-+libc_hidden_def (CONCAT (_nss_files_end,ENTNAME))
-
-
- /* Parsing the database file into `struct STRUCTURE' data structures. */
-@@ -194,28 +166,22 @@ CONCAT(_nss_files_get,ENTNAME_r) (struct STRUCTURE *result, char *buffer,
- size_t buflen, int *errnop H_ERRNO_PROTO)
- {
- /* Return next entry in host file. */
-- enum nss_status status = NSS_STATUS_SUCCESS;
--
-- __libc_lock_lock (lock);
-
-- /* Be prepared that the set*ent function was not called before. */
-- if (stream == NULL)
-- {
-- int save_errno = errno;
--
-- status = internal_setent (&stream);
--
-- __set_errno (save_errno);
-- }
--
-- if (status == NSS_STATUS_SUCCESS)
-- status = internal_getent (stream, result, buffer, buflen, errnop
-- H_ERRNO_ARG EXTRA_ARGS_VALUE);
-+ struct nss_files_per_file_data *data;
-+ enum nss_status status = __nss_files_data_open (&data,
-+ CONCAT (nss_file_, ENTNAME),
-+ DATAFILE,
-+ errnop, H_ERRNO_ARG_OR_NULL);
-+ if (status != NSS_STATUS_SUCCESS)
-+ return status;
-
-- __libc_lock_unlock (lock);
-+ status = internal_getent (data->stream, result, buffer, buflen, errnop
-+ H_ERRNO_ARG EXTRA_ARGS_VALUE);
-
-+ __nss_files_data_put (data);
- return status;
- }
-+libc_hidden_def (CONCAT (_nss_files_get,ENTNAME_r))
-
- /* Macro for defining lookup functions for this file-based database.
-
-@@ -248,8 +214,9 @@ _nss_files_get##name##_r (proto, \
- == NSS_STATUS_SUCCESS) \
- { break_if_match } \
- \
-- internal_endent (&stream); \
-+ fclose (stream); \
- } \
- \
- return status; \
--}
-+} \
-+libc_hidden_def (_nss_files_get##name##_r)
-diff --git a/nss/nss_files/files-alias.c b/nss/nss_files/files-alias.c
-index 30971bfe56..8c6e176ff6 100644
---- a/nss/nss_files/files-alias.c
-+++ b/nss/nss_files/files-alias.c
-@@ -31,18 +31,11 @@
- #include "nsswitch.h"
- #include <nss_files.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
--/* Locks the static variables in this file. */
--__libc_lock_define_initialized (static, lock)
-
- /* Maintenance of the stream open on the database file. For getXXent
- operations the stream needs to be held open across calls, the other
- getXXbyYY operations all use their own stream. */
-
--static FILE *stream;
--
--
- static enum nss_status
- internal_setent (FILE **stream)
- {
-@@ -66,42 +59,16 @@ internal_setent (FILE **stream)
- enum nss_status
- _nss_files_setaliasent (void)
- {
-- enum nss_status status;
--
-- __libc_lock_lock (lock);
--
-- status = internal_setent (&stream);
--
-- __libc_lock_unlock (lock);
--
-- return status;
-+ return __nss_files_data_setent (nss_file_aliasent, "/etc/aliases");
- }
-+libc_hidden_def (_nss_files_setaliasent)
-
--
--/* Close the database file. */
--static void
--internal_endent (FILE **stream)
--{
-- if (*stream != NULL)
-- {
-- fclose (*stream);
-- *stream = NULL;
-- }
--}
--
--
--/* Thread-safe, exported version of that. */
- enum nss_status
- _nss_files_endaliasent (void)
- {
-- __libc_lock_lock (lock);
--
-- internal_endent (&stream);
--
-- __libc_lock_unlock (lock);
--
-- return NSS_STATUS_SUCCESS;
-+ return __nss_files_data_endent (nss_file_aliasent);
- }
-+libc_hidden_def (_nss_files_endaliasent)
-
- /* Parsing the database file into `struct aliasent' data structures. */
- static enum nss_status
-@@ -131,7 +98,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- /* Read the first line. It must contain the alias name and
- possibly some alias names. */
- first_unused[room_left - 1] = '\xff';
-- line = fgets_unlocked (first_unused, room_left, stream);
-+ line = __fgets_unlocked (first_unused, room_left, stream);
- if (line == NULL)
- /* Nothing to read. */
- break;
-@@ -220,7 +187,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- /* If the file does not exist we simply ignore
- the statement. */
- if (listfile != NULL
-- && (old_line = strdup (line)) != NULL)
-+ && (old_line = __strdup (line)) != NULL)
- {
- while (! feof_unlocked (listfile))
- {
-@@ -232,8 +199,8 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- }
-
- first_unused[room_left - 1] = '\xff';
-- line = fgets_unlocked (first_unused, room_left,
-- listfile);
-+ line = __fgets_unlocked (first_unused, room_left,
-+ listfile);
- if (line == NULL)
- break;
- if (first_unused[room_left - 1] != '\xff')
-@@ -335,7 +302,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
- /* The just read character is a white space and so
- can be ignored. */
- first_unused[room_left - 1] = '\xff';
-- line = fgets_unlocked (first_unused, room_left, stream);
-+ line = __fgets_unlocked (first_unused, room_left, stream);
- if (line == NULL)
- {
- /* Continuation line without any data and
-@@ -369,29 +336,25 @@ _nss_files_getaliasent_r (struct aliasent *result, char *buffer, size_t buflen,
- int *errnop)
- {
- /* Return next entry in host file. */
-- enum nss_status status = NSS_STATUS_SUCCESS;
-
-- __libc_lock_lock (lock);
--
-- /* Be prepared that the set*ent function was not called before. */
-- if (stream == NULL)
-- status = internal_setent (&stream);
--
-- if (status == NSS_STATUS_SUCCESS)
-- {
-- result->alias_local = 1;
-+ struct nss_files_per_file_data *data;
-+ enum nss_status status = __nss_files_data_open (&data, nss_file_aliasent,
-+ "/etc/aliases", errnop, NULL);
-+ if (status != NSS_STATUS_SUCCESS)
-+ return status;
-
-- /* Read lines until we get a definite result. */
-- do
-- status = get_next_alias (stream, NULL, result, buffer, buflen, errnop);
-- while (status == NSS_STATUS_RETURN);
-- }
-+ result->alias_local = 1;
-
-- __libc_lock_unlock (lock);
-+ /* Read lines until we get a definite result. */
-+ do
-+ status = get_next_alias (data->stream, NULL, result, buffer, buflen,
-+ errnop);
-+ while (status == NSS_STATUS_RETURN);
-
-+ __nss_files_data_put (data);
- return status;
- }
--
-+libc_hidden_def (_nss_files_getaliasent_r)
-
- enum nss_status
- _nss_files_getaliasbyname_r (const char *name, struct aliasent *result,
-@@ -418,9 +381,10 @@ _nss_files_getaliasbyname_r (const char *name, struct aliasent *result,
- do
- status = get_next_alias (stream, name, result, buffer, buflen, errnop);
- while (status == NSS_STATUS_RETURN);
-- }
-
-- internal_endent (&stream);
-+ fclose (stream);
-+ }
-
- return status;
- }
-+libc_hidden_def (_nss_files_getaliasbyname_r)
-diff --git a/nss/nss_files/files-ethers.c b/nss/nss_files/files-ethers.c
-index 2fe7f81e4b..7c2c2b9833 100644
---- a/nss/nss_files/files-ethers.c
-+++ b/nss/nss_files/files-ethers.c
-@@ -20,8 +20,6 @@
- #include <netinet/if_ether.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- struct etherent_data {};
-
- #define ENTNAME etherent
-diff --git a/nss/nss_files/files-grp.c b/nss/nss_files/files-grp.c
-index 49be38e8b1..a716d948e2 100644
---- a/nss/nss_files/files-grp.c
-+++ b/nss/nss_files/files-grp.c
-@@ -19,8 +19,6 @@
- #include <grp.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define STRUCTURE group
- #define ENTNAME grent
- #define DATABASE "group"
-diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
-index 2b47ec3e53..d54d91d038 100644
---- a/nss/nss_files/files-hosts.c
-+++ b/nss/nss_files/files-hosts.c
-@@ -26,8 +26,6 @@
- #include <alloc_buffer.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- /* Get implementation for some internal functions. */
- #include "../resolv/res_hconf.h"
-
-@@ -57,12 +55,13 @@ LINE_PARSER
- STRING_FIELD (addr, isspace, 1);
-
- /* Parse address. */
-- if (inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr)
-+ if (__inet_pton (af == AF_UNSPEC ? AF_INET : af, addr, entdata->host_addr)
- > 0)
- af = af == AF_UNSPEC ? AF_INET : af;
- else
- {
-- if (af == AF_INET && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
-+ if (af == AF_INET
-+ && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
- {
- if (IN6_IS_ADDR_V4MAPPED (entdata->host_addr))
- memcpy (entdata->host_addr, entdata->host_addr + 12, INADDRSZ);
-@@ -76,7 +75,7 @@ LINE_PARSER
- return 0;
- }
- else if (af == AF_UNSPEC
-- && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
-+ && __inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
- af = AF_INET6;
- else
- /* Illegal address: ignore line. */
-@@ -349,7 +348,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
- status = gethostbyname3_multi
- (stream, name, af, result, buffer, buflen, errnop, herrnop);
-
-- internal_endent (&stream);
-+ fclose (stream);
- }
-
- if (canonp && status == NSS_STATUS_SUCCESS)
-@@ -357,6 +356,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
-
- return status;
- }
-+libc_hidden_def (_nss_files_gethostbyname3_r)
-
- enum nss_status
- _nss_files_gethostbyname_r (const char *name, struct hostent *result,
-@@ -366,6 +366,7 @@ _nss_files_gethostbyname_r (const char *name, struct hostent *result,
- return _nss_files_gethostbyname3_r (name, AF_INET, result, buffer, buflen,
- errnop, herrnop, NULL, NULL);
- }
-+libc_hidden_def (_nss_files_gethostbyname_r)
-
- enum nss_status
- _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result,
-@@ -375,6 +376,7 @@ _nss_files_gethostbyname2_r (const char *name, int af, struct hostent *result,
- return _nss_files_gethostbyname3_r (name, af, result, buffer, buflen,
- errnop, herrnop, NULL, NULL);
- }
-+libc_hidden_def (_nss_files_gethostbyname2_r)
-
- enum nss_status
- _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
-@@ -475,7 +477,7 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
- status = NSS_STATUS_SUCCESS;
- }
-
-- internal_endent (&stream);
-+ fclose (stream);
- }
- else if (status == NSS_STATUS_TRYAGAIN)
- {
-@@ -490,3 +492,4 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
-
- return status;
- }
-+libc_hidden_def (_nss_files_gethostbyname4_r)
-diff --git a/nss/nss_files/files-init.c b/nss/nss_files/files-init.c
-index 717c9fd334..18ed288d04 100644
---- a/nss/nss_files/files-init.c
-+++ b/nss/nss_files/files-init.c
-@@ -21,8 +21,7 @@
- #include <string.h>
- #include <nscd/nscd.h>
- #include <nss.h>
--
--NSS_DECLARE_MODULE_FUNCTIONS (files)
-+#include <nss_files.h>
-
- static void
- register_file (void (*cb) (size_t, struct traced_file *),
-@@ -49,5 +48,6 @@ _nss_files_init (void (*cb) (size_t, struct traced_file *))
- register_file (cb, servdb, "/etc/services", 0);
- register_file (cb, netgrdb, "/etc/netgroup", 0);
- }
-+libc_hidden_def (_nss_files_init)
-
- #endif
-diff --git a/nss/nss_files/files-initgroups.c b/nss/nss_files/files-initgroups.c
-index 6fcea40b55..b44211e50b 100644
---- a/nss/nss_files/files-initgroups.c
-+++ b/nss/nss_files/files-initgroups.c
-@@ -28,8 +28,6 @@
- #include <nss.h>
- #include <nss_files.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- enum nss_status
- _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
- long int *size, gid_t **groupsp, long int limit,
-@@ -129,3 +127,4 @@ _nss_files_initgroups_dyn (const char *user, gid_t group, long int *start,
-
- return status == NSS_STATUS_SUCCESS && !any ? NSS_STATUS_NOTFOUND : status;
- }
-+libc_hidden_def (_nss_files_initgroups_dyn)
-diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c
-index f8c821c2f0..75bfbd9e44 100644
---- a/nss/nss_files/files-netgrp.c
-+++ b/nss/nss_files/files-netgrp.c
-@@ -28,11 +28,9 @@
- #include "netgroup.h"
- #include <nss_files.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define DATAFILE "/etc/netgroup"
-
--libnss_files_hidden_proto (_nss_files_endnetgrent)
-+libc_hidden_proto (_nss_files_endnetgrent)
-
- #define EXPAND(needed) \
- do \
-@@ -152,7 +150,7 @@ _nss_files_setnetgrent (const char *group, struct __netgrent *result)
-
- return status;
- }
--
-+libc_hidden_def (_nss_files_setnetgrent)
-
- enum nss_status
- _nss_files_endnetgrent (struct __netgrent *result)
-@@ -164,7 +162,7 @@ _nss_files_endnetgrent (struct __netgrent *result)
- result->cursor = NULL;
- return NSS_STATUS_SUCCESS;
- }
--libnss_files_hidden_def (_nss_files_endnetgrent)
-+libc_hidden_def (_nss_files_endnetgrent)
-
- static char *
- strip_whitespace (char *str)
-@@ -279,7 +277,7 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
-
- return status;
- }
--libnss_files_hidden_def (_nss_netgroup_parseline)
-+libc_hidden_def (_nss_netgroup_parseline)
-
-
- enum nss_status
-@@ -293,3 +291,4 @@ _nss_files_getnetgrent_r (struct __netgrent *result, char *buffer,
-
- return status;
- }
-+libc_hidden_def (_nss_files_getnetgrent_r)
-diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c
-index 9cd7d7dc79..217ed78609 100644
---- a/nss/nss_files/files-network.c
-+++ b/nss/nss_files/files-network.c
-@@ -22,8 +22,6 @@
- #include <stdint.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define ENTNAME netent
- #define DATABASE "networks"
- #define NEED_H_ERRNO
-@@ -71,7 +69,7 @@ LINE_PARSER
- *cp = '\0';
- addr = newp;
- }
-- result->n_net = inet_network (addr);
-+ result->n_net = inet_network (addr);
- result->n_addrtype = AF_INET;
-
- })
-diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c
-index 68c51c7cbf..997eac573a 100644
---- a/nss/nss_files/files-parse.c
-+++ b/nss/nss_files/files-parse.c
-@@ -74,13 +74,7 @@ struct parser_data
- /* Export the line parser function so it can be used in nss_db. */
- # define parser_stclass /* Global */
- # define parse_line CONCAT(_nss_files_parse_,ENTNAME)
--# if IS_IN (libc)
--/* We are defining one of the functions that actually lives in libc
-- because it is used to implement fget*ent and suchlike. */
--# define nss_files_parse_hidden_def(name) libc_hidden_def (name)
--# else
--# define nss_files_parse_hidden_def(name) libnss_files_hidden_def (name)
--# endif
-+# define nss_files_parse_hidden_def(name) libc_hidden_def (name)
- #endif
-
-
-diff --git a/nss/nss_files/files-proto.c b/nss/nss_files/files-proto.c
-index 98d082c642..13072692c1 100644
---- a/nss/nss_files/files-proto.c
-+++ b/nss/nss_files/files-proto.c
-@@ -19,8 +19,6 @@
- #include <netdb.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define ENTNAME protoent
- #define DATABASE "protocols"
-
-diff --git a/nss/nss_files/files-pwd.c b/nss/nss_files/files-pwd.c
-index b04165ddde..5c74c6da9b 100644
---- a/nss/nss_files/files-pwd.c
-+++ b/nss/nss_files/files-pwd.c
-@@ -19,8 +19,6 @@
- #include <pwd.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define STRUCTURE passwd
- #define ENTNAME pwent
- #define DATABASE "passwd"
-diff --git a/nss/nss_files/files-rpc.c b/nss/nss_files/files-rpc.c
-index eeb2725d2c..3dea8f18f2 100644
---- a/nss/nss_files/files-rpc.c
-+++ b/nss/nss_files/files-rpc.c
-@@ -19,8 +19,6 @@
- #include <rpc/netdb.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define ENTNAME rpcent
- #define DATABASE "rpc"
-
-diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c
-index f4f0985377..a8d83e094e 100644
---- a/nss/nss_files/files-service.c
-+++ b/nss/nss_files/files-service.c
-@@ -20,8 +20,6 @@
- #include <netdb.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define ENTNAME servent
- #define DATABASE "services"
-
-diff --git a/nss/nss_files/files-sgrp.c b/nss/nss_files/files-sgrp.c
-index 6b1c9eac02..213a408e7b 100644
---- a/nss/nss_files/files-sgrp.c
-+++ b/nss/nss_files/files-sgrp.c
-@@ -19,8 +19,6 @@
- #include <gshadow.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define STRUCTURE sgrp
- #define ENTNAME sgent
- #define DATABASE "gshadow"
-diff --git a/nss/nss_files/files-spwd.c b/nss/nss_files/files-spwd.c
-index 976deaf918..d031257a20 100644
---- a/nss/nss_files/files-spwd.c
-+++ b/nss/nss_files/files-spwd.c
-@@ -19,8 +19,6 @@
- #include <shadow.h>
- #include <nss.h>
-
--NSS_DECLARE_MODULE_FUNCTIONS (files)
--
- #define STRUCTURE spwd
- #define ENTNAME spent
- #define DATABASE "shadow"
-diff --git a/nss/nss_files_data.c b/nss/nss_files_data.c
-new file mode 100644
-index 0000000000..80fbfe5fff
---- /dev/null
-+++ b/nss/nss_files_data.c
-@@ -0,0 +1,161 @@
-+/* Returns a pointer to the global nss_files data structure.
-+ Copyright (C) 2021 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, see
-+ <https://www.gnu.org/licenses/>. */
-+
-+#include <nss_files.h>
-+
-+#include <allocate_once.h>
-+#include <errno.h>
-+#include <netdb.h>
-+#include <nss.h>
-+#include <stdlib.h>
-+
-+/* This collects all per file-data. */
-+struct nss_files_data
-+{
-+ struct nss_files_per_file_data files[nss_file_count];
-+};
-+
-+/* For use with allocate_once. */
-+static void *nss_files_global;
-+static void *
-+nss_files_global_allocate (void *closure)
-+{
-+ struct nss_files_data *result = malloc (sizeof (*result));
-+ if (result != NULL)
-+ {
-+ for (int i = 0; i < nss_file_count; ++i)
-+ {
-+ result->files[i].stream = NULL;
-+ __libc_lock_init (result->files[i].lock);
-+ }
-+ }
-+ return result;
-+}
-+/* Like __nss_files_data_open, but does not perform the open call. */
-+static enum nss_status
-+__nss_files_data_get (struct nss_files_per_file_data **pdata,
-+ enum nss_files_file file, int *errnop, int *herrnop)
-+{
-+ struct nss_files_data *data = allocate_once (&nss_files_global,
-+ nss_files_global_allocate,
-+ NULL, NULL);
-+ if (data == NULL)
-+ {
-+ if (errnop != NULL)
-+ *errnop = errno;
-+ if (herrnop != NULL)
-+ {
-+ __set_h_errno (NETDB_INTERNAL);
-+ *herrnop = NETDB_INTERNAL;
-+ }
-+ return NSS_STATUS_TRYAGAIN;
-+ }
-+
-+ *pdata = &data->files[file];
-+ __libc_lock_lock ((*pdata)->lock);
-+ return NSS_STATUS_SUCCESS;
-+}
-+
-+/* Helper function for opening the backing file at PATH. */
-+static enum nss_status
-+__nss_files_data_internal_open (struct nss_files_per_file_data *data,
-+ const char *path)
-+{
-+ enum nss_status status = NSS_STATUS_SUCCESS;
-+
-+ if (data->stream == NULL)
-+ {
-+ data->stream = __nss_files_fopen (path);
-+
-+ if (data->stream == NULL)
-+ status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
-+ }
-+
-+ return status;
-+}
-+
-+
-+enum nss_status
-+__nss_files_data_open (struct nss_files_per_file_data **pdata,
-+ enum nss_files_file file, const char *path,
-+ int *errnop, int *herrnop)
-+{
-+ enum nss_status status = __nss_files_data_get (pdata, file, errnop, herrnop);
-+ if (status != NSS_STATUS_SUCCESS)
-+ return status;
-+
-+ /* Be prepared that the set*ent function was not called before. */
-+ if ((*pdata)->stream == NULL)
-+ {
-+ int saved_errno = errno;
-+ status = __nss_files_data_internal_open (*pdata, path);
-+ __set_errno (saved_errno);
-+ if (status != NSS_STATUS_SUCCESS)
-+ __nss_files_data_put (*pdata);
-+ }
-+
-+ return status;
-+}
-+
-+libc_hidden_def (__nss_files_data_open)
-+
-+void
-+__nss_files_data_put (struct nss_files_per_file_data *data)
-+{
-+ __libc_lock_unlock (data->lock);
-+}
-+libc_hidden_def (__nss_files_data_put)
-+
-+enum nss_status
-+__nss_files_data_setent (enum nss_files_file file, const char *path)
-+{
-+ struct nss_files_per_file_data *data;
-+ enum nss_status status = __nss_files_data_get (&data, file, NULL, NULL);
-+ if (status != NSS_STATUS_SUCCESS)
-+ return status;
-+
-+ if (data->stream == NULL)
-+ status = __nss_files_data_internal_open (data, path);
-+ else
-+ rewind (data->stream);
-+
-+ __nss_files_data_put (data);
-+ return status;
-+}
-+libc_hidden_def (__nss_files_data_setent)
-+
-+enum nss_status
-+__nss_files_data_endent (enum nss_files_file file)
-+{
-+ /* No cleanup is necessary if not initialized. */
-+ struct nss_files_data *data = atomic_load_acquire (&nss_files_global);
-+ if (data == NULL)
-+ return NSS_STATUS_SUCCESS;
-+
-+ struct nss_files_per_file_data *fdata = &data->files[file];
-+ __libc_lock_lock (fdata->lock);
-+ if (fdata->stream != NULL)
-+ {
-+ fclose (fdata->stream);
-+ fdata->stream = NULL;
-+ }
-+ __libc_lock_unlock (fdata->lock);
-+
-+ return NSS_STATUS_SUCCESS;
-+}
-+libc_hidden_def (__nss_files_data_endent)
-diff --git a/nss/nss_files_functions.c b/nss/nss_files_functions.c
-new file mode 100644
-index 0000000000..85720b4311
---- /dev/null
-+++ b/nss/nss_files_functions.c
-@@ -0,0 +1,43 @@
-+/* Direct access for nss_files functions for NSS module loading.
-+ Copyright (C) 2021 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ The GNU C Library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, see
-+ <https://www.gnu.org/licenses/>. */
-+
-+#include <nss_module.h>
-+#include <nss_files.h>
-+
-+void
-+__nss_files_functions (nss_module_functions_untyped pointers)
-+{
-+ void **fptr = pointers;
-+
-+ /* Functions which are not implemented. */
-+#define _nss_files_getcanonname_r NULL
-+#define _nss_files_gethostbyaddr2_r NULL
-+#define _nss_files_getpublickey NULL
-+#define _nss_files_getsecretkey NULL
-+#define _nss_files_netname2user NULL
-+
-+#undef DEFINE_NSS_FUNCTION
-+#define DEFINE_NSS_FUNCTION(x) *fptr++ = _nss_files_##x;
-+#include "function.def"
-+
-+#ifdef PTR_MANGLE
-+ void **end = fptr;
-+ for (fptr = pointers; fptr != end; ++fptr)
-+ PTR_MANGLE (*fptr);
-+#endif
-+}
-diff --git a/nss/nss_module.c b/nss/nss_module.c
-index 60c070c851..7b42c585a4 100644
---- a/nss/nss_module.c
-+++ b/nss/nss_module.c
-@@ -30,6 +30,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <nss_files.h>
-
- /* Suffix after .so of NSS service modules. This is a bit of magic,
- but we assume LIBNSS_FILES_SO looks like "libnss_files.so.2" and we
-@@ -110,10 +111,45 @@ static const function_name nss_function_name_array[] =
- #include "function.def"
- };
-
-+static bool
-+module_load_nss_files (struct nss_module *module)
-+{
-+ if (is_nscd)
-+ {
-+ void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
-+# ifdef PTR_DEMANGLE
-+ PTR_DEMANGLE (cb);
-+# endif
-+ _nss_files_init (cb);
-+ }
-+
-+ /* Initialize the function pointers, following the double-checked
-+ locking idiom. */
-+ __libc_lock_lock (nss_module_list_lock);
-+ switch ((enum nss_module_state) atomic_load_acquire (&module->state))
-+ {
-+ case nss_module_uninitialized:
-+ case nss_module_failed:
-+ __nss_files_functions (module->functions.untyped);
-+ module->handle = NULL;
-+ /* Synchronizes with unlocked __nss_module_load atomic_load_acquire. */
-+ atomic_store_release (&module->state, nss_module_loaded);
-+ break;
-+ case nss_module_loaded:
-+ /* Nothing to clean up. */
-+ break;
-+ }
-+ __libc_lock_unlock (nss_module_list_lock);
-+ return true;
-+}
-+
- /* Internal implementation of __nss_module_load. */
- static bool
- module_load (struct nss_module *module)
- {
-+ if (strcmp (module->name, "files") == 0)
-+ return module_load_nss_files (module);
-+
- void *handle;
- {
- char *shlib_name;
-@@ -360,7 +396,7 @@ __nss_module_freeres (void)
- struct nss_module *current = nss_module_list;
- while (current != NULL)
- {
-- if (current->state == nss_module_loaded)
-+ if (current->state == nss_module_loaded && current->handle != NULL)
- __libc_dlclose (current->handle);
-
- struct nss_module *next = current->next;
-diff --git a/nss/nss_module.h b/nss/nss_module.h
-index 05c4791d11..c1a1d90b60 100644
---- a/nss/nss_module.h
-+++ b/nss/nss_module.h
-@@ -38,6 +38,10 @@ struct nss_module_functions
- typedef void *nss_module_functions_untyped[sizeof (struct nss_module_functions)
- / sizeof (void *)];
-
-+/* Locate the nss_files functions, as if by dlopen/dlsym. */
-+void __nss_files_functions (nss_module_functions_untyped pointers)
-+ attribute_hidden;
-+
- /* Initialization state of a NSS module. */
- enum nss_module_state
- {
-diff --git a/nss/nss_readline.c b/nss/nss_readline.c
-index 4b3ecbccc8..a2f397a11f 100644
---- a/nss/nss_readline.c
-+++ b/nss/nss_readline.c
-@@ -40,7 +40,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset)
- *poffset = __ftello64 (fp);
-
- buf[len - 1] = '\xff'; /* Marker to recognize truncation. */
-- if (fgets_unlocked (buf, len, fp) == NULL)
-+ if (__fgets_unlocked (buf, len, fp) == NULL)
- {
- if (feof_unlocked (fp))
- {
-@@ -61,7 +61,7 @@ __nss_readline (FILE *fp, char *buf, size_t len, off64_t *poffset)
- line on the next call. */
- return __nss_readline_seek (fp, *poffset);
-
-- /* fgets_unlocked succeeded. */
-+ /* __fgets_unlocked succeeded. */
-
- /* Remove leading whitespace. */
- char *p = buf;
-diff --git a/nss/nss.h b/nss/nss.h
-index ae213f9a6c..c6d62adc0f 100644
---- a/nss/nss.h
-+++ b/nss/nss.h
-@@ -196,7 +196,7 @@ typedef enum nss_status nss_setspent (int);
- extern nss_endgrent _nss_##module##_endgrent; \
- extern nss_endhostent _nss_##module##_endhostent; \
- extern nss_endnetent _nss_##module##_endnetent; \
-- extern nss_endnetgrent _nss_##module##__endnetgrent; \
-+ extern nss_endnetgrent _nss_##module##_endnetgrent; \
- extern nss_endprotoent _nss_##module##_endprotoent; \
- extern nss_endpwent _nss_##module##_endpwent; \
- extern nss_endrpcent _nss_##module##_endrpcent; \
-diff --git a/nss/nss_module.c b/nss/nss_module.c
-index 7b42c585a4..7ea5ad9887 100644
---- a/nss/nss_module.c
-+++ b/nss/nss_module.c
-@@ -114,14 +114,16 @@ static const function_name nss_function_name_array[] =
- static bool
- module_load_nss_files (struct nss_module *module)
- {
-+#ifdef USE_NSCD
- if (is_nscd)
- {
- void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
--# ifdef PTR_DEMANGLE
-+# ifdef PTR_DEMANGLE
- PTR_DEMANGLE (cb);
--# endif
-+# endif
- _nss_files_init (cb);
- }
-+#endif
-
- /* Initialize the function pointers, following the double-checked
- locking idiom. */
diff --git a/gnu/packages/patches/gnumach-add-missing-const_mach_port_name_array_t-type.patch b/gnu/packages/patches/gnumach-add-missing-const_mach_port_name_array_t-type.patch
new file mode 100644
index 0000000000..73c99ade23
--- /dev/null
+++ b/gnu/packages/patches/gnumach-add-missing-const_mach_port_name_array_t-type.patch
@@ -0,0 +1,32 @@
+From 17335d49a3c9e866a81abc051420d73a59d669bf Mon Sep 17 00:00:00 2001
+Message-Id: <17335d49a3c9e866a81abc051420d73a59d669bf.1678745341.git.dev@jpoiret.xyz>
+From: Josselin Poiret <dev@jpoiret.xyz>
+Date: Sun, 28 Aug 2022 01:17:34 +0200
+Subject: [PATCH] Add missing const_mach_port_name_array_t type
+
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+---
+ include/mach/port.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/mach/port.h b/include/mach/port.h
+index 3c226f6c..d25eb0b4 100644
+--- a/include/mach/port.h
++++ b/include/mach/port.h
+@@ -43,6 +43,7 @@
+ */
+ typedef unsigned int mach_port_name_t;
+ typedef mach_port_name_t *mach_port_name_array_t;
++typedef const mach_port_name_t *const_mach_port_name_array_t;
+
+ /*
+ * A port is represented
+
+base-commit: 3e1702a65fb3caf50c8d09a1b383b0056a5efc82
+prerequisite-patch-id: 4688654277aef235ccd1797a72dce27d52b04616
+prerequisite-patch-id: 8f1e7dd6429c15cc8ed1d411dba0a75b6e745236
+prerequisite-patch-id: 605553ee086473ad9bc24e59c91d49a12dbf8631
+--
+2.39.1
+
diff --git a/gnu/packages/patches/gnupg-CVE-2022-34903.patch b/gnu/packages/patches/gnupg-CVE-2022-34903.patch
deleted file mode 100644
index 19c055282a..0000000000
--- a/gnu/packages/patches/gnupg-CVE-2022-34903.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-https://dev.gnupg.org/T6027
-https://www.openwall.com/lists/oss-security/2022/06/30/1
-https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=34c649b3601383cd11dbc76221747ec16fd68e1b
-
-From 34c649b3601383cd11dbc76221747ec16fd68e1b Mon Sep 17 00:00:00 2001
-From: Werner Koch <wk@gnupg.org>
-Date: Tue, 14 Jun 2022 11:33:27 +0200
-Subject: [PATCH] g10: Fix garbled status messages in NOTATION_DATA
-
-* g10/cpr.c (write_status_text_and_buffer): Fix off-by-one
---
-
-Depending on the escaping and line wrapping the computed remaining
-buffer length could be wrong. Fixed by always using a break to
-terminate the escape detection loop. Might have happened for all
-status lines which may wrap.
-
-GnuPG-bug-id: T6027
----
- g10/cpr.c | 13 ++++---------
- 1 file changed, 4 insertions(+), 9 deletions(-)
-
-diff --git a/g10/cpr.c b/g10/cpr.c
-index 9bfdd3c34..fa8005d6f 100644
---- a/g10/cpr.c
-+++ b/g10/cpr.c
-@@ -372,20 +372,15 @@ write_status_text_and_buffer (int no, const char *string,
- }
- first = 0;
- }
-- for (esc=0, s=buffer, n=len; n && !esc; s++, n--)
-+ for (esc=0, s=buffer, n=len; n; s++, n--)
- {
- if (*s == '%' || *(const byte*)s <= lower_limit
- || *(const byte*)s == 127 )
- esc = 1;
- if (wrap && ++count > wrap)
-- {
-- dowrap=1;
-- break;
-- }
-- }
-- if (esc)
-- {
-- s--; n++;
-+ dowrap=1;
-+ if (esc || dowrap)
-+ break;
- }
- if (s != buffer)
- es_fwrite (buffer, s-buffer, 1, statusfp);
---
-2.11.0
-
diff --git a/gnu/packages/patches/gnutls-guile-eintr-eagain.patch b/gnu/packages/patches/gnutls-guile-eintr-eagain.patch
deleted file mode 100644
index e04c945158..0000000000
--- a/gnu/packages/patches/gnutls-guile-eintr-eagain.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Fixes <https://issues.guix.gnu.org/47867>.
-
-This fix was merged upstream
-in <https://gitlab.com/gnutls/gnutls/-/merge_requests/1417> and will
-be in GnuTLS 3.7.3. Upstream commit:
-
-commit 110e2172dbef1fbdf7399dab1e80780847b61c0c
-Author: Ludovic Courtès <ludo@gnu.org>
-Date: Sat Apr 24 22:02:14 2021 +0200
-
- guile: Writes to record ports handle EAGAIN/EINTR transparently.
-
-diff --git a/guile/src/core.c b/guile/src/core.c
-index a13670fc7b..0926dc8a97 100644
---- a/guile/src/core.c
-+++ b/guile/src/core.c
-@@ -985,7 +985,10 @@ write_to_session_record_port (SCM port, const void *data, size_t size)
- c_result = gnutls_record_send (c_session, (char *) data + c_sent,
- size - c_sent);
- if (EXPECT_FALSE (c_result < 0))
-- scm_gnutls_error (c_result, FUNC_NAME);
-+ {
-+ if (c_result != GNUTLS_E_AGAIN && c_result != GNUTLS_E_INTERRUPTED)
-+ scm_gnutls_error (c_result, FUNC_NAME);
-+ }
- else
- c_sent += c_result;
- }
-@@ -1069,7 +1072,8 @@ read_from_session_record_port (SCM port, SCM dst, size_t start, size_t count)
- #undef FUNC_NAME
-
- /* Return the file descriptor that backs PORT. This function is called upon a
-- blocking read--i.e., 'read_from_session_record_port' returned -1. */
-+ blocking read--i.e., 'read_from_session_record_port' or
-+ 'write_to_session_record_port' returned -1. */
- static int
- session_record_port_fd (SCM port)
- {
-@@ -1097,7 +1101,16 @@ write_to_session_record_port (SCM port, SCM src, size_t start, size_t count)
- c_session = scm_to_gnutls_session (session, 1, FUNC_NAME);
- data = (char *) SCM_BYTEVECTOR_CONTENTS (src) + start;
-
-- result = gnutls_record_send (c_session, data, count);
-+ do
-+ result = gnutls_record_send (c_session, data, count);
-+ while (result == GNUTLS_E_INTERRUPTED
-+ || (result == GNUTLS_E_AGAIN
-+ && !SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session)));
-+
-+ if (result == GNUTLS_E_AGAIN
-+ && SCM_GNUTLS_SESSION_TRANSPORT_IS_FD (c_session))
-+ /* Tell Guile that reading would block. */
-+ return (size_t) -1;
-
- if (EXPECT_FALSE (result < 0))
- scm_gnutls_error (result, FUNC_NAME);
diff --git a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch b/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
index 956fa617c3..8bb86467c0 100644
--- a/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
+++ b/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch
@@ -1,11 +1,14 @@
-# Names of libraries included in typelib files are opened by dlopen. Here we
-# add the full path.
-#
-# This patch was provided by Luca Bruno <lucabru@src.gnome.org> for
-# 'gobject-introspection' 1.40.0 in Nix.
-#
-# It has since been updated to work with newer versions of
-# gobject-introspection.
+Names of libraries included in typelib files are opened by dlopen.
+Here we add the full path.
+
+This patch was provided by Luca Bruno <lucabru@src.gnome.org>,
+for 'gobject-introspection' 1.40.0 in Nix.
+
+It has since been updated to work with newer versions of
+gobject-introspection.
+
+diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
+index 1d39ab84..e12ed24e 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -95,6 +95,39 @@ def get_windows_option_group(parser):
@@ -48,10 +51,10 @@
def _get_option_parser():
parser = optparse.OptionParser('%prog [options] sources',
version='%prog ' + giscanner.__version__)
-@@ -205,6 +238,10 @@ match the namespace prefix.""")
- parser.add_option("", "--filelist",
- action="store", dest="filelist", default=[],
- help="file containing headers and sources to be scanned")
+@@ -220,6 +253,10 @@ match the namespace prefix.""")
+ parser.add_option("", "--compiler",
+ action="store", dest="compiler", default=None,
+ help="the C compiler to use internally")
+ parser.add_option("", "--fallback-library-path",
+ action="store", dest="fallback_libpath",
+ default=_get_default_fallback_libpath(),
@@ -59,6 +62,8 @@
group = get_preprocessor_option_group(parser)
parser.add_option_group(group)
+diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
+index 9f8ab5df..8aa37c99 100644
--- a/giscanner/shlibs.py
+++ b/giscanner/shlibs.py
@@ -57,6 +57,14 @@ def _ldd_library_pattern(library_name):
@@ -76,7 +81,7 @@
# This is a what we do for non-la files. We assume that we are on an
# ELF-like system where ldd exists and the soname extracted with ldd is
# a filename that can be opened with dlopen().
-@@ -106,7 +112,8 @@ def _resolve_non_libtool(options, binary, libraries):
+@@ -108,7 +116,8 @@ def _resolve_non_libtool(options, binary, libraries):
output = output.decode("utf-8", "replace")
shlibs = resolve_from_ldd_output(libraries, output)
@@ -86,7 +91,7 @@
def sanitize_shlib_path(lib):
-@@ -115,19 +122,18 @@ def sanitize_shlib_path(lib):
+@@ -117,19 +126,18 @@ def sanitize_shlib_path(lib):
# In case we get relative paths on macOS (like @rpath) then we fall
# back to the basename as well:
# https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
@@ -111,7 +116,7 @@
if len(patterns) == 0:
return []
-@@ -139,8 +145,12 @@ def resolve_from_ldd_output(libraries, output):
+@@ -141,8 +149,12 @@ def resolve_from_ldd_output(libraries, output):
if line.endswith(':'):
continue
for word in line.split():
@@ -126,10 +131,11 @@
if m:
del patterns[library]
shlibs.append(m.group())
-
+diff --git a/giscanner/utils.py b/giscanner/utils.py
+index 31c7ea48..630002a8 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
-@@ -111,17 +111,11 @@ def extract_libtool_shlib(la_file):
+@@ -114,16 +114,11 @@ def extract_libtool_shlib(la_file):
if dlname is None:
return None
@@ -141,8 +147,7 @@
- if libdir is None:
- return dlbasename
- return libdir + '/' + dlbasename
-- # From the comments in extract_libtool(), older libtools had
-- # a path rather than the raw dlname
+- # Older libtools had a path rather than the raw dlname
- return os.path.basename(dlname)
+ dlbasename = os.path.basename(dlname)
+ libdir = _extract_libdir_field(la_file)
@@ -151,10 +156,12 @@
+ return libdir + '/' + dlbasename
- def extract_libtool(la_file):
+ # Returns arguments for invoking libtool, if applicable, otherwise None
+diff --git a/tests/scanner/test_shlibs.py b/tests/scanner/test_shlibs.py
+index a8337c60..7f123103 100644
--- a/tests/scanner/test_shlibs.py
+++ b/tests/scanner/test_shlibs.py
-@@ -40,6 +64,7 @@ class TestLddParser(unittest.TestCase):
+@@ -40,7 +40,8 @@ class TestLddParser(unittest.TestCase):
self.assertEqual(
sanitize_shlib_path('/foo/bar'),
@@ -163,4 +170,4 @@
+ '/foo/bar')
def test_unresolved_library(self):
-output = ''
+ output = ''
diff --git a/gnu/packages/patches/gobject-introspection-cc.patch b/gnu/packages/patches/gobject-introspection-cc.patch
index 6a86b56b44..d3b1df82af 100644
--- a/gnu/packages/patches/gobject-introspection-cc.patch
+++ b/gnu/packages/patches/gobject-introspection-cc.patch
@@ -1,12 +1,13 @@
Use gcc as the default C compiler if CC is not set.
-diff -ru gobject-introspection-1.58.1.orig/giscanner/__init__.py gobject-introspection-1.58.1/giscanner/__init__.py
---- gobject-introspection-1.58.1.orig/giscanner/__init__.py 1970-01-01 01:00:00.000000000 +0100
-+++ gobject-introspection-1.58.1/giscanner/__init__.py 2018-12-03 13:33:28.788971299 +0100
-@@ -22,6 +22,8 @@
+diff --git a/giscanner/__init__.py b/giscanner/__init__.py
+index 7c2f365a..607fe341 100644
+--- a/giscanner/__init__.py
++++ b/giscanner/__init__.py
+@@ -21,6 +21,8 @@ import os
builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR')
if builddir is not None:
- __path__.append(os.path.join(builddir, 'giscanner'))
+ __path__.append(os.path.join(builddir, 'giscanner')) # type: ignore # mypy issue #1422
+if not 'CC' in os.environ:
+ os.environ['CC'] = 'gcc'
try:
diff --git a/gnu/packages/patches/guile-hurd-posix-spawn.patch b/gnu/packages/patches/guile-hurd-posix-spawn.patch
new file mode 100644
index 0000000000..7cf600b4c2
--- /dev/null
+++ b/gnu/packages/patches/guile-hurd-posix-spawn.patch
@@ -0,0 +1,44 @@
+Fix <https://issues.guix.gnu.org/61095>, which affects GNU/Hurd.
+
+diff --git a/libguile/posix.c b/libguile/posix.c
+index 3a8be94e4..f5fdc544c 100644
+--- a/libguile/posix.c
++++ b/libguile/posix.c
+@@ -1326,7 +1326,14 @@ static void
+ close_inherited_fds_slow (posix_spawn_file_actions_t *actions, int max_fd)
+ {
+ while (--max_fd > 2)
+- posix_spawn_file_actions_addclose (actions, max_fd);
++ {
++ /* Adding invalid file descriptors to an 'addclose' action leads
++ to 'posix_spawn' failures on some operating systems:
++ <https://bugs.gnu.org/61095>. Hence the extra check. */
++ int flags = fcntl (max_fd, F_GETFD, NULL);
++ if ((flags >= 0) && ((flags & FD_CLOEXEC) == 0))
++ posix_spawn_file_actions_addclose (actions, max_fd);
++ }
+ }
+
+ static void
+
+Fix <https://issues.guix.gnu.org/62501>.
+
+diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
+index f20e04453..d5cf47cda 100644
+--- a/test-suite/tests/posix.test
++++ b/test-suite/tests/posix.test
+@@ -431,7 +431,13 @@
+ (let ((str (get-string-all (car input+output))))
+ (close-port (car input+output))
+ (waitpid pid)
+- str)))
++
++ ;; On GNU/Hurd, the exec server prepends 'LD_ORIGIN_PATH' for
++ ;; every program: <https://bugs.gnu.org/62501>. Strip it.
++ (if (and (string=? "GNU" (utsname:sysname (uname)))
++ (string-prefix? "LD_ORIGIN_PATH=" str))
++ (string-drop str (+ 1 (string-index str #\newline)))
++ str))))
+
+ (pass-if-equal "ls /proc/self/fd"
+ "0\n1\n2\n3\n" ;fourth FD is for /proc/self/fd
diff --git a/gnu/packages/patches/hurd-add-without-rump-configure-option.patch b/gnu/packages/patches/hurd-add-without-rump-configure-option.patch
new file mode 100644
index 0000000000..14cefdeac1
--- /dev/null
+++ b/gnu/packages/patches/hurd-add-without-rump-configure-option.patch
@@ -0,0 +1,82 @@
+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-cross.patch b/gnu/packages/patches/hurd-cross.patch
deleted file mode 100644
index cc95dddccc..0000000000
--- a/gnu/packages/patches/hurd-cross.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This fixes linking libfstest/test-fcntl (and others).
-
-As discussed with upstream: https://lists.gnu.org/archive/html/bug-hurd/2020-03/msg00018.html
-
-From 96a9f67a8685e713f25259c18306797d54cc27a5 Mon Sep 17 00:00:00 2001
-From: Jan Nieuwenhuizen <janneke@gnu.org>
-Date: Sat, 14 Mar 2020 11:28:31 +0100
-Subject: [PATCH] build: Fix cross build on Guix.
-
-As discussed in https://lists.gnu.org/archive/html/bug-hurd/2020-03/msg00018.html.
-
-* Makeconf (lpath): Add -Wl,-rpath-link=<dir> next to -L<dir>.
----
- Makeconf | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/Makeconf b/Makeconf
-index 67f7ab1c..f68ff6e3 100644
---- a/Makeconf
-+++ b/Makeconf
-@@ -325,7 +325,8 @@ _libsubst=${libsubst$(patsubst %,-override,${libsubst-override})}
-
- # Direct the linker where to find shared objects specified in the
- # dependencies of other shared objects it encounters.
--lpath := -L. $(patsubst %,-L%,$(dir $(wildcard ../lib*/lib*.so)))
-+lib_dirs := $(dir $(wildcard ../lib*/lib*.so))
-+lpath := -L. $(lib_dirs:%=-L%) $(lib_dirs:%=-Wl,-rpath-link=%)
-
- # Main rule to link executables
- #
---
-2.24.0
-
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
new file mode 100644
index 0000000000..dda95fb3d5
--- /dev/null
+++ b/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods-2.patch
@@ -0,0 +1,155 @@
+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
new file mode 100644
index 0000000000..aebe8d6847
--- /dev/null
+++ b/gnu/packages/patches/hurd-fix-types-of-read-write-and-readables-methods.patch
@@ -0,0 +1,891 @@
+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/hurd-xattr.patch b/gnu/packages/patches/hurd-xattr.patch
deleted file mode 100644
index 0a922c91b5..0000000000
--- a/gnu/packages/patches/hurd-xattr.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 75cb948c575fca3962c4cce115d31dd178bc389f Mon Sep 17 00:00:00 2001
-From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
-Date: Tue, 12 May 2020 07:39:59 +0200
-Subject: [PATCH] ext2fs: Update to upstream Hurd-reserved xattr index for
- "gnu.*".
-
-See
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a
-
-This supports setting (and reading) of passive trasnlators from
-GNU/Linux, e.g.
-
- dd if=/dev/zero of=file bs=1k count=1000
- losetup /dev/loop0 file
- mke2fs -t ext2 -o hurd -O ext_attr /dev/loop0
- mount -t ext2 -o x-xattr-translator-records /dev/loop0 /mnt
- mkdir -p /mnt/servers/socket
- touch /mnt/servers/socket/1
- setfattr --name=gnu.translator --value='/hurd/pflocal\0' /mnt/servers/socket/1
- getfattr --name=gnu.translator /mnt/servers/socket/1
- # file: 1
- gnu.translator="/hurd/pflocal"
-
-* ext2fs/xattr.c (struct _xattr_prefix): For "gnu.*", use index for
-the Hurd (10).
----
- ext2fs/xattr.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c
-index f6ea0f39..78458214 100644
---- a/ext2fs/xattr.c
-+++ b/ext2fs/xattr.c
-@@ -1,6 +1,6 @@
- /* Ext2 support for extended attributes
-
-- Copyright (C) 2006, 2016 Free Software Foundation, Inc.
-+ Copyright (C) 2006, 2016, 2020 Free Software Foundation, Inc.
-
- Written by Thadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
- and Shengyu Zhang <lastavengers@outlook.com>
-@@ -39,7 +39,7 @@ xattr_prefixes[] =
- {
- 1, "user.", sizeof "user." - 1},
- {
-- 7, "gnu.", sizeof "gnu." - 1},
-+ 10, "gnu.", sizeof "gnu." - 1},
- {
- 0, NULL, 0}
- };
---
-2.26.0
-
diff --git a/gnu/packages/patches/icedtea-7-hotspot-pointer-comparison.patch b/gnu/packages/patches/icedtea-7-hotspot-pointer-comparison.patch
new file mode 100644
index 0000000000..deb305bd96
--- /dev/null
+++ b/gnu/packages/patches/icedtea-7-hotspot-pointer-comparison.patch
@@ -0,0 +1,36 @@
+Avoid ordered comparison of pointer with integer to prevent compile error
+with GCC 11.
+
+diff --git a/src/share/vm/opto/lcm.cpp b/src/share/vm/opto/lcm.cpp
+--- a/src/share/vm/opto/lcm.cpp
++++ b/src/share/vm/opto/lcm.cpp
+@@ -60,7 +60,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+- if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++ if (Universe::narrow_oop_base() != NULL) { // Implies UseCompressedOops.
+ if (val && val->is_Mach()) {
+ if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+ // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
+diff --git a/src/share/vm/runtime/virtualspace.cpp b/src/share/vm/runtime/virtualspace.cpp
+--- a/src/share/vm/runtime/virtualspace.cpp
++++ b/src/share/vm/runtime/virtualspace.cpp
+@@ -527,7 +527,7 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment,
+ (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+ Universe::narrow_oop_use_implicit_null_checks()) ?
+ lcm(os::vm_page_size(), alignment) : 0) {
+- if (base() > 0) {
++ if (base() != NULL) {
+ MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+ }
+
+@@ -546,7 +546,7 @@ ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size,
+ (UseCompressedOops && (Universe::narrow_oop_base() != NULL) &&
+ Universe::narrow_oop_use_implicit_null_checks()) ?
+ lcm(os::vm_page_size(), prefix_align) : 0) {
+- if (base() > 0) {
++ if (base() != NULL) {
+ MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+ }
+
diff --git a/gnu/packages/patches/inkscape-poppler-compat.patch b/gnu/packages/patches/inkscape-poppler-compat.patch
new file mode 100644
index 0000000000..cb7d1c8eb3
--- /dev/null
+++ b/gnu/packages/patches/inkscape-poppler-compat.patch
@@ -0,0 +1,45 @@
+Fix build with Poppler 22.9.0.
+
+Taken from upstream:
+
+ https://gitlab.com/inkscape/inkscape/-/commit/fb00794923d19cfbb2ca4adca3ae8971553a06be
+
+diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp
+index cca1e840966c7940a1af472025535042b07e3e0f..80d64c9b866d5d3dd095636a9a02571b89061af1 100644
+--- a/src/extension/internal/pdfinput/pdf-parser.cpp
++++ b/src/extension/internal/pdfinput/pdf-parser.cpp
+@@ -697,7 +697,11 @@ void PdfParser::opSetDash(Object args[], int /*numArgs*/)
+ _POPPLER_FREE(obj);
+ }
+ }
++#if POPPLER_CHECK_VERSION(22, 9, 0)
++ state->setLineDash(std::vector<double> (dash, dash + length), args[1].getNum());
++#else
+ state->setLineDash(dash, length, args[1].getNum());
++#endif
+ builder->updateStyle(state);
+ }
+
+diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
+index 12f71dd9214b95dbad6fdf7642a96cdd57f2c64a..9fc56fe63c2feee986ad1ff5018e679a0bacb665 100644
+--- a/src/extension/internal/pdfinput/svg-builder.cpp
++++ b/src/extension/internal/pdfinput/svg-builder.cpp
+@@ -389,10 +389,17 @@ void SvgBuilder::_setStrokeStyle(SPCSSAttr *css, GfxState *state) {
+ sp_repr_css_set_property(css, "stroke-miterlimit", os_ml.str().c_str());
+
+ // Line dash
+- double *dash_pattern;
+ int dash_length;
+ double dash_start;
++#if POPPLER_CHECK_VERSION(22, 9, 0)
++ const double *dash_pattern;
++ const std::vector<double> &dash = state->getLineDash(&dash_start);
++ dash_pattern = dash.data();
++ dash_length = dash.size();
++#else
++ double *dash_pattern;
+ state->getLineDash(&dash_pattern, &dash_length, &dash_start);
++#endif
+ if ( dash_length > 0 ) {
+ Inkscape::CSSOStringStream os_array;
+ for ( int i = 0 ; i < dash_length ; i++ ) {
diff --git a/gnu/packages/patches/jsoncpp-pkg-config-version.patch b/gnu/packages/patches/jsoncpp-pkg-config-version.patch
deleted file mode 100644
index 3983cc300c..0000000000
--- a/gnu/packages/patches/jsoncpp-pkg-config-version.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Taken from upstream: https://github.com/open-source-parsers/jsoncpp/issues/1235.
-
-From ac2870298ed5b5a96a688d9df07461b31f83e906 Mon Sep 17 00:00:00 2001
-From: Derick Vigne <derickvigne@me.com>
-Date: Tue, 26 Jan 2021 14:59:12 -0500
-Subject: [PATCH] Fixed pkg-config Version
-
----
- pkg-config/jsoncpp.pc.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pkg-config/jsoncpp.pc.in b/pkg-config/jsoncpp.pc.in
-index 632a377f5..2a2221069 100644
---- a/pkg-config/jsoncpp.pc.in
-+++ b/pkg-config/jsoncpp.pc.in
-@@ -5,7 +5,7 @@ includedir=@includedir_for_pc_file@
-
- Name: jsoncpp
- Description: A C++ library for interacting with JSON
--Version: @JSONCPP_VERSION@
-+Version: @PROJECT_VERSION@
- URL: https://github.com/open-source-parsers/jsoncpp
- Libs: -L${libdir} -ljsoncpp
- Cflags: -I${includedir}
diff --git a/gnu/packages/patches/julia-Use-MPFR-4.2.patch b/gnu/packages/patches/julia-Use-MPFR-4.2.patch
new file mode 100644
index 0000000000..73a395c89e
--- /dev/null
+++ b/gnu/packages/patches/julia-Use-MPFR-4.2.patch
@@ -0,0 +1,228 @@
+This patch backports part of Julia upstream commit:
+
+ 1e5fdb29f8858f3244f6aff116ee12e4c8247f3a
+ Author: Simon Byrne <simon.byrne@gmail.com>
+ AuthorDate: Tue Jan 10 14:52:36 2023 -0800
+ Commit: GitHub <noreply@github.com>
+ CommitDate: Tue Jan 10 17:52:36 2023 -0500
+
+ update MPFR to 4.2.0 (#48165)
+
+ Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
+
+ 6 files changed, 112 insertions(+), 79 deletions(-)
+ base/mpfr.jl | 34 ++++++++++++++--
+ deps/checksums/mpfr | 68 ++++++++++++++++----------------
+ deps/mpfr.version | 2 +-
+ stdlib/MPFR_jll/Project.toml | 2 +-
+ stdlib/MPFR_jll/test/runtests.jl | 2 +-
+ test/math.jl | 83 +++++++++++++++++++++-------------------
+
+
+diff -ur julia-1.8.3-orig/base/mpfr.jl julia-1.8.3-patch/base/mpfr.jl
+--- julia-1.8.3-orig/base/mpfr.jl 2023-04-13 17:50:58.394891391 +0200
++++ julia-1.8.3-patch/base/mpfr.jl 2023-04-13 20:42:52.551833467 +0200
+@@ -16,7 +16,8 @@
+ cosh, sinh, tanh, sech, csch, coth, acosh, asinh, atanh, lerpi,
+ cbrt, typemax, typemin, unsafe_trunc, floatmin, floatmax, rounding,
+ setrounding, maxintfloat, widen, significand, frexp, tryparse, iszero,
+- isone, big, _string_n, decompose
++ isone, big, _string_n, decompose, minmax,
++ sinpi, cospi, sincospi, sind, cosd, tand, asind, acosd, atand
+
+ import ..Rounding: rounding_raw, setrounding_raw
+
+@@ -745,7 +746,7 @@
+ end
+
+ # Functions for which NaN results are converted to DomainError, following Base
+-for f in (:sin, :cos, :tan, :sec, :csc, :acos, :asin, :atan, :acosh, :asinh, :atanh)
++for f in (:sin, :cos, :tan, :sec, :csc, :acos, :asin, :atan, :acosh, :asinh, :atanh, :sinpi, :cospi)
+ @eval begin
+ function ($f)(x::BigFloat)
+ isnan(x) && return x
+@@ -756,6 +757,7 @@
+ end
+ end
+ end
++sincospi(x::BigFloat) = (sinpi(x), cospi(x))
+
+ function atan(y::BigFloat, x::BigFloat)
+ z = BigFloat()
+@@ -763,6 +765,32 @@
+ return z
+ end
+
++# degree functions
++for f in (:sin, :cos, :tan)
++ @eval begin
++ function ($(Symbol(f,:d)))(x::BigFloat)
++ isnan(x) && return x
++ z = BigFloat()
++ ccall(($(string(:mpfr_,f,:u)), :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Culong, MPFRRoundingMode), z, x, 360, ROUNDING_MODE[])
++ isnan(z) && throw(DomainError(x, "NaN result for non-NaN input."))
++ return z
++ end
++ function ($(Symbol(:a,f,:d)))(x::BigFloat)
++ isnan(x) && return x
++ z = BigFloat()
++ ccall(($(string(:mpfr_a,f,:u)), :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Culong, MPFRRoundingMode), z, x, 360, ROUNDING_MODE[])
++ isnan(z) && throw(DomainError(x, "NaN result for non-NaN input."))
++ return z
++ end
++ end
++end
++function atand(y::BigFloat, x::BigFloat)
++ z = BigFloat()
++ ccall((:mpfr_atan2u, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Ref{BigFloat}, Culong, MPFRRoundingMode), z, y, x, 360, ROUNDING_MODE[])
++ return z
++end
++
++
+ # Utility functions
+ ==(x::BigFloat, y::BigFloat) = ccall((:mpfr_equal_p, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}), x, y) != 0
+ <=(x::BigFloat, y::BigFloat) = ccall((:mpfr_lessequal_p, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}), x, y) != 0
+@@ -1018,7 +1046,7 @@
+ isfinite(x) || return string(Float64(x))
+ _prettify_bigfloat(string_mpfr(x, fmt))
+ end
+-_string(x::BigFloat) = _string(x, "%.Re")
++_string(x::BigFloat) = _string(x, "%Re")
+ _string(x::BigFloat, k::Integer) = _string(x, "%.$(k)Re")
+
+ string(b::BigFloat) = _string(b)
+diff -ur julia-1.8.3-orig/test/math.jl julia-1.8.3-patch/test/math.jl
+--- julia-1.8.3-orig/test/math.jl 2023-04-13 17:50:58.382891276 +0200
++++ julia-1.8.3-patch/test/math.jl 2023-04-13 21:13:55.377279761 +0200
+@@ -411,47 +411,51 @@
+ @test rad2deg(pi + (pi/3)*im) ≈ 180 + 60im
+ end
+
++# ensure zeros are signed the same
++⩲(x,y) = typeof(x) == typeof(y) && x == y && signbit(x) == signbit(y)
++⩲(x::Tuple, y::Tuple) = length(x) == length(y) && all(map(⩲,x,y))
++
+ @testset "degree-based trig functions" begin
+- @testset "$T" for T = (Float32,Float64,Rational{Int})
++ @testset "$T" for T = (Float32,Float64,Rational{Int},BigFloat)
+ fT = typeof(float(one(T)))
+ fTsc = typeof( (float(one(T)), float(one(T))) )
+ for x = -400:40:400
+- @test sind(convert(T,x))::fT ≈ convert(fT,sin(pi/180*x)) atol=eps(deg2rad(convert(fT,x)))
+- @test cosd(convert(T,x))::fT ≈ convert(fT,cos(pi/180*x)) atol=eps(deg2rad(convert(fT,x)))
++ @test sind(convert(T,x))::fT ≈ sin(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x)))
++ @test cosd(convert(T,x))::fT ≈ cos(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x)))
+
+ s,c = sincosd(convert(T,x))
+- @test s::fT ≈ convert(fT,sin(pi/180*x)) atol=eps(deg2rad(convert(fT,x)))
+- @test c::fT ≈ convert(fT,cos(pi/180*x)) atol=eps(deg2rad(convert(fT,x)))
++ @test s::fT ≈ sin(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x)))
++ @test c::fT ≈ cos(pi*convert(fT,x)/180) atol=eps(deg2rad(convert(fT,x)))
+ end
+ @testset "sind" begin
+- @test sind(convert(T,0.0))::fT === zero(fT)
+- @test sind(convert(T,180.0))::fT === zero(fT)
+- @test sind(convert(T,360.0))::fT === zero(fT)
+- T != Rational{Int} && @test sind(convert(T,-0.0))::fT === -zero(fT)
+- @test sind(convert(T,-180.0))::fT === -zero(fT)
+- @test sind(convert(T,-360.0))::fT === -zero(fT)
++ @test sind(convert(T,0.0))::fT ⩲ zero(fT)
++ @test sind(convert(T,180.0))::fT ⩲ zero(fT)
++ @test sind(convert(T,360.0))::fT ⩲ zero(fT)
++ T != Rational{Int} && @test sind(convert(T,-0.0))::fT ⩲ -zero(fT)
++ @test sind(convert(T,-180.0))::fT ⩲ -zero(fT)
++ @test sind(convert(T,-360.0))::fT ⩲ -zero(fT)
+ if T <: AbstractFloat
+ @test isnan(sind(T(NaN)))
+ end
+ end
+ @testset "cosd" begin
+- @test cosd(convert(T,90))::fT === zero(fT)
+- @test cosd(convert(T,270))::fT === zero(fT)
+- @test cosd(convert(T,-90))::fT === zero(fT)
+- @test cosd(convert(T,-270))::fT === zero(fT)
++ @test cosd(convert(T,90))::fT ⩲ zero(fT)
++ @test cosd(convert(T,270))::fT ⩲ zero(fT)
++ @test cosd(convert(T,-90))::fT ⩲ zero(fT)
++ @test cosd(convert(T,-270))::fT ⩲ zero(fT)
+ if T <: AbstractFloat
+ @test isnan(cosd(T(NaN)))
+ end
+ end
+ @testset "sincosd" begin
+- @test sincosd(convert(T,-360))::fTsc === ( -zero(fT), one(fT) )
+- @test sincosd(convert(T,-270))::fTsc === ( one(fT), zero(fT) )
+- @test sincosd(convert(T,-180))::fTsc === ( -zero(fT), -one(fT) )
+- @test sincosd(convert(T, -90))::fTsc === ( -one(fT), zero(fT) )
+- @test sincosd(convert(T, 0))::fTsc === ( zero(fT), one(fT) )
+- @test sincosd(convert(T, 90))::fTsc === ( one(fT), zero(fT) )
+- @test sincosd(convert(T, 180))::fTsc === ( zero(fT), -one(fT) )
+- @test sincosd(convert(T, 270))::fTsc === ( -one(fT), zero(fT) )
++ @test sincosd(convert(T,-360))::fTsc ⩲ ( -zero(fT), one(fT) )
++ @test sincosd(convert(T,-270))::fTsc ⩲ ( one(fT), zero(fT) )
++ @test sincosd(convert(T,-180))::fTsc ⩲ ( -zero(fT), -one(fT) )
++ @test sincosd(convert(T, -90))::fTsc ⩲ ( -one(fT), zero(fT) )
++ @test sincosd(convert(T, 0))::fTsc ⩲ ( zero(fT), one(fT) )
++ @test sincosd(convert(T, 90))::fTsc ⩲ ( one(fT), zero(fT) )
++ @test sincosd(convert(T, 180))::fTsc ⩲ ( zero(fT), -one(fT) )
++ @test sincosd(convert(T, 270))::fTsc ⩲ ( -one(fT), zero(fT) )
+ if T <: AbstractFloat
+ @test_throws DomainError sincosd(T(Inf))
+ @test all(isnan.(sincosd(T(NaN))))
+@@ -463,22 +467,22 @@
+ "sincospi" => (x->sincospi(x)[1], x->sincospi(x)[2])
+ )
+ @testset "pi * $x" for x = -3:0.3:3
+- @test sinpi(convert(T,x))::fT ≈ convert(fT,sin(pi*x)) atol=eps(pi*convert(fT,x))
+- @test cospi(convert(T,x))::fT ≈ convert(fT,cos(pi*x)) atol=eps(pi*convert(fT,x))
++ @test sinpi(convert(T,x))::fT ≈ sin(pi*convert(fT,x)) atol=eps(pi*convert(fT,x))
++ @test cospi(convert(T,x))::fT ≈ cos(pi*convert(fT,x)) atol=eps(pi*convert(fT,x))
+ end
+
+- @test sinpi(convert(T,0.0))::fT === zero(fT)
+- @test sinpi(convert(T,1.0))::fT === zero(fT)
+- @test sinpi(convert(T,2.0))::fT === zero(fT)
+- T != Rational{Int} && @test sinpi(convert(T,-0.0))::fT === -zero(fT)
+- @test sinpi(convert(T,-1.0))::fT === -zero(fT)
+- @test sinpi(convert(T,-2.0))::fT === -zero(fT)
++ @test sinpi(convert(T,0.0))::fT ⩲ zero(fT)
++ @test sinpi(convert(T,1.0))::fT ⩲ zero(fT)
++ @test sinpi(convert(T,2.0))::fT ⩲ zero(fT)
++ T != Rational{Int} && @test sinpi(convert(T,-0.0))::fT ⩲ -zero(fT)
++ @test sinpi(convert(T,-1.0))::fT ⩲ -zero(fT)
++ @test sinpi(convert(T,-2.0))::fT ⩲ -zero(fT)
+ @test_throws DomainError sinpi(convert(T,Inf))
+
+- @test cospi(convert(T,0.5))::fT === zero(fT)
+- @test cospi(convert(T,1.5))::fT === zero(fT)
+- @test cospi(convert(T,-0.5))::fT === zero(fT)
+- @test cospi(convert(T,-1.5))::fT === zero(fT)
++ @test cospi(convert(T,0.5))::fT ⩲ zero(fT)
++ @test cospi(convert(T,1.5))::fT ⩲ zero(fT)
++ @test cospi(convert(T,-0.5))::fT ⩲ zero(fT)
++ @test cospi(convert(T,-1.5))::fT ⩲ zero(fT)
+ @test_throws DomainError cospi(convert(T,Inf))
+ end
+ @testset "Check exact values" begin
+@@ -489,8 +493,8 @@
+ @test sincospi(one(T)/convert(T,6))[1] == 0.5
+ @test_throws DomainError sind(convert(T,Inf))
+ @test_throws DomainError cosd(convert(T,Inf))
+- T != Float32 && @test cospi(one(T)/convert(T,3)) == 0.5
+- T != Float32 && @test sincospi(one(T)/convert(T,3))[2] == 0.5
++ fT == Float64 && @test isapprox(cospi(one(T)/convert(T,3)), 0.5)
++ fT == Float64 && @test isapprox(sincospi(one(T)/convert(T,3))[2], 0.5)
+ T == Rational{Int} && @test sinpi(5//6) == 0.5
+ T == Rational{Int} && @test sincospi(5//6)[1] == 0.5
+ end
+@@ -538,8 +542,8 @@
+ end
+ end
+ end
+- @test @inferred(sinc(0//1)) === 1.0
+- @test @inferred(cosc(0//1)) === -0.0
++ @test @inferred(sinc(0//1)) ⩲ 1.0
++ @test @inferred(cosc(0//1)) ⩲ -0.0
+
+ # test right before/after thresholds of Taylor series
+ @test sinc(0.001) ≈ 0.999998355066745 rtol=1e-15
diff --git a/gnu/packages/patches/libaio-32bit-test.patch b/gnu/packages/patches/libaio-32bit-test.patch
new file mode 100644
index 0000000000..0da8e25c69
--- /dev/null
+++ b/gnu/packages/patches/libaio-32bit-test.patch
@@ -0,0 +1,26 @@
+This fix comes from an upstream pull request, see
+https://pagure.io/libaio/pull-request/22#commit_list
+
+diff --git a/harness/cases/23.t b/harness/cases/23.t
+index cc5a8a1..9bbb05c 100644
+--- a/harness/cases/23.t
++++ b/harness/cases/23.t
+@@ -72,7 +72,7 @@ static void fail_errno(const char *format, ...)
+ static void *thrproc2(void *arg)
+ {
+ for (;;) {
+- off_t offset = 0;
++ off64_t offset = 0;
+
+ pthread_barrier_wait(&barrier);
+ if (exiting)
+@@ -92,7 +92,7 @@ static void *thrproc3(void *arg)
+ {
+ for (;;) {
+ char c;
+- off_t offset = 0;
++ off64_t offset = 0;
+
+ pthread_barrier_wait(&barrier);
+ if (exiting)
+
diff --git a/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch b/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch
deleted file mode 100644
index 971ed26180..0000000000
--- a/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-This is a combination of the following 4 commits:
-https://github.com/libffi/libffi/commit/01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.patch
-https://github.com/libffi/libffi/commit/6663047f56c2932a6b10a790f4ac6666dd181326.patch
-https://github.com/libffi/libffi/commit/e50b9ef8b910fa642ef158f6642e60d54d7ad740.patch
-https://github.com/libffi/libffi/commit/4d6d2866ae43e55325e8ee96561221804602cd7a.patch
-
-From 2dbfa92a95e3bacabca431b89d2a5925e48a0e40 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu, 28 Nov 2019 12:42:41 +0000
-
-powerpc: fix build failure on power7 and older (#532)
-
-Build failure looks as:
-```
-libtool: compile: powerpc-unknown-linux-gnu-gcc \
- -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ...
-In file included from src/powerpc/ffi.c:33:
-src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target
- 65 | typedef __int128 float128;
- | ^~~~~~~~
-```
-
-The fix avoids using __int128 in favour of aligned char[16].
-
-Closes: https://github.com/libffi/libffi/issues/531
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-
-Address platforms with no __int128.
-
-powerpc64: Use memcpy to help platforms with no __int128. (#534)
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
-Update powerpc sysv assembly for ffi_powerpc.h changes (#541)
-
-Some of the flag bits were moved when adding powerpc64 vector support.
-
-Fixes #536
----
- src/powerpc/ffi_linux64.c | 12 ++++++------
- src/powerpc/ffi_powerpc.h | 2 +-
- src/powerpc/sysv.S | 12 +++++-------
- 3 files changed, 12 insertions(+), 14 deletions(-)
-
-diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c
-index de0d033..4d50878 100644
---- a/src/powerpc/ffi_linux64.c
-+++ b/src/powerpc/ffi_linux64.c
-@@ -547,9 +547,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
- if (next_arg.ul == gpr_end.ul)
- next_arg.ul = rest.ul;
- if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs)
-- *vec_base.f128++ = **p_argv.f128;
-+ memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128));
- else
-- *next_arg.f128 = **p_argv.f128;
-+ memcpy (next_arg.f128, *p_argv.f128, sizeof (float128));
- if (++next_arg.f128 == gpr_end.f128)
- next_arg.f128 = rest.f128;
- vecarg_count++;
-@@ -680,9 +680,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
- {
- if (vecarg_count < NUM_VEC_ARG_REGISTERS64
- && i < nfixedargs)
-- *vec_base.f128++ = *arg.f128++;
-+ memcpy (vec_base.f128++, arg.f128, sizeof (float128));
- else
-- *next_arg.f128 = *arg.f128++;
-+ memcpy (next_arg.f128, arg.f128++, sizeof (float128));
- if (++next_arg.f128 == gpr_end.f128)
- next_arg.f128 = rest.f128;
- vecarg_count++;
-@@ -986,9 +986,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
- do
- {
- if (pvec < end_pvec && i < nfixedargs)
-- *to.f128 = *pvec++;
-+ memcpy (to.f128, pvec++, sizeof (float128));
- else
-- *to.f128 = *from.f128;
-+ memcpy (to.f128, from.f128, sizeof (float128));
- to.f128++;
- from.f128++;
- }
-diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h
-index 5ee2a70..8e2f2f0 100644
---- a/src/powerpc/ffi_powerpc.h
-+++ b/src/powerpc/ffi_powerpc.h
-@@ -62,7 +62,7 @@ typedef _Float128 float128;
- #elif defined(__FLOAT128__)
- typedef __float128 float128;
- #else
--typedef __int128 float128;
-+typedef char float128[16] __attribute__((aligned(16)));
- #endif
-
- void FFI_HIDDEN ffi_closure_SYSV (void);
-diff --git a/src/powerpc/sysv.S b/src/powerpc/sysv.S
-index 1474ce7..df97734 100644
---- a/src/powerpc/sysv.S
-+++ b/src/powerpc/sysv.S
-@@ -104,17 +104,16 @@ ENTRY(ffi_call_SYSV)
- bctrl
-
- /* Now, deal with the return value. */
-- mtcrf 0x01,%r31 /* cr7 */
-+ mtcrf 0x03,%r31 /* cr6-cr7 */
- bt- 31,L(small_struct_return_value)
- bt- 30,L(done_return_value)
- #ifndef __NO_FPRS__
- bt- 29,L(fp_return_value)
- #endif
- stw %r3,0(%r30)
-- bf+ 28,L(done_return_value)
-+ bf+ 27,L(done_return_value)
- stw %r4,4(%r30)
-- mtcrf 0x02,%r31 /* cr6 */
-- bf 27,L(done_return_value)
-+ bf 26,L(done_return_value)
- stw %r5,8(%r30)
- stw %r6,12(%r30)
- /* Fall through... */
-@@ -145,10 +144,9 @@ L(done_return_value):
- #ifndef __NO_FPRS__
- L(fp_return_value):
- .cfi_restore_state
-- bf 28,L(float_return_value)
-+ bf 27,L(float_return_value)
- stfd %f1,0(%r30)
-- mtcrf 0x02,%r31 /* cr6 */
-- bf 27,L(done_return_value)
-+ bf 26,L(done_return_value)
- stfd %f2,8(%r30)
- b L(done_return_value)
- L(float_return_value):
---
-2.26.0
-
diff --git a/gnu/packages/patches/libffi-float128-powerpc64le.patch b/gnu/packages/patches/libffi-float128-powerpc64le.patch
deleted file mode 100644
index 4fd32b0102..0000000000
--- a/gnu/packages/patches/libffi-float128-powerpc64le.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From de93adfb6f48100946bba2c3abad2a77a0cfde0b Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Date: Sun, 24 Nov 2019 09:52:01 +0100
-Subject: [PATCH] ffi_powerpc.h: fix build failure with powerpc7
-
-This is a patch pulled down from the following:
-https://github.com/buildroot/buildroot/blob/78926f610b1411b03464152472fd430012deb9ac/package/libffi/0004-ffi_powerpc.h-fix-build-failure-with-powerpc7.patch
-
-This issue is being hit on OpenBMC code when pulling the latest
-libffi tag and building on a P8 ppc64le machine. I verified this
-patch fixes the issue we are seeing.
-
-Below is the original commit message:
-
-Sicne commit 73dd43afc8a447ba98ea02e9aad4c6898dc77fb0, build on powerpc7
-fails on:
-
-In file included from ../src/powerpc/ffi.c:33:0:
-../src/powerpc/ffi_powerpc.h:61:9: error: '_Float128' is not supported on this target
- typedef _Float128 float128;
- ^~~~~~~~~
-
-Fix this build failure by checking for __HAVE_FLOAT128 before using
-_Float128, as _Float128 is enabled only on specific conditions, see
-output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/bits/floatn.h:
-
- /* Defined to 1 if the current compiler invocation provides a
- floating-point type with the IEEE 754 binary128 format, and this glibc
- includes corresponding *f128 interfaces for it. */
- #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \
- && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH
- # define __HAVE_FLOAT128 1
- #else
- # define __HAVE_FLOAT128 0
- #endif
-
-Fixes:
- - http://autobuild.buildroot.org/results/5c9dd8fb3b6a128882b6250f197c80232d8a3b53
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
----
- src/powerpc/ffi_powerpc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h
-index 8e2f2f0e..960a5c42 100644
---- a/src/powerpc/ffi_powerpc.h
-+++ b/src/powerpc/ffi_powerpc.h
-@@ -57,7 +57,7 @@ typedef union
- double d;
- } ffi_dblfl;
-
--#if defined(__FLOAT128_TYPE__)
-+#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128)
- typedef _Float128 float128;
- #elif defined(__FLOAT128__)
- typedef __float128 float128;
diff --git a/gnu/packages/patches/libssh2-CVE-2019-17498.patch b/gnu/packages/patches/libssh2-CVE-2019-17498.patch
deleted file mode 100644
index 6f69e562e2..0000000000
--- a/gnu/packages/patches/libssh2-CVE-2019-17498.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-https://github.com/libssh2/libssh2/commit/dedcbd106f8e52d5586b0205bc7677e4c9868f9c.patch
-
-From dedcbd106f8e52d5586b0205bc7677e4c9868f9c Mon Sep 17 00:00:00 2001
-From: Will Cosgrove <will@panic.com>
-Date: Fri, 30 Aug 2019 09:57:38 -0700
-Subject: [PATCH] packet.c: improve message parsing (#402)
-
-* packet.c: improve parsing of packets
-
-file: packet.c
-
-notes:
-Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST.
----
- src/packet.c | 68 ++++++++++++++++++++++------------------------------
- 1 file changed, 29 insertions(+), 39 deletions(-)
-
-diff --git a/src/packet.c b/src/packet.c
-index 38ab62944..2e01bfc5d 100644
---- a/src/packet.c
-+++ b/src/packet.c
-@@ -419,8 +419,8 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
- size_t datalen, int macstate)
- {
- int rc = 0;
-- char *message = NULL;
-- char *language = NULL;
-+ unsigned char *message = NULL;
-+ unsigned char *language = NULL;
- size_t message_len = 0;
- size_t language_len = 0;
- LIBSSH2_CHANNEL *channelp = NULL;
-@@ -472,33 +472,23 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
-
- case SSH_MSG_DISCONNECT:
- if(datalen >= 5) {
-- size_t reason = _libssh2_ntohu32(data + 1);
-+ uint32_t reason = 0;
-+ struct string_buf buf;
-+ buf.data = (unsigned char *)data;
-+ buf.dataptr = buf.data;
-+ buf.len = datalen;
-+ buf.dataptr++; /* advance past type */
-
-- if(datalen >= 9) {
-- message_len = _libssh2_ntohu32(data + 5);
-+ _libssh2_get_u32(&buf, &reason);
-+ _libssh2_get_string(&buf, &message, &message_len);
-+ _libssh2_get_string(&buf, &language, &language_len);
-
-- if(message_len < datalen-13) {
-- /* 9 = packet_type(1) + reason(4) + message_len(4) */
-- message = (char *) data + 9;
--
-- language_len =
-- _libssh2_ntohu32(data + 9 + message_len);
-- language = (char *) data + 9 + message_len + 4;
--
-- if(language_len > (datalen-13-message_len)) {
-- /* bad input, clear info */
-- language = message = NULL;
-- language_len = message_len = 0;
-- }
-- }
-- else
-- /* bad size, clear it */
-- message_len = 0;
-- }
- if(session->ssh_msg_disconnect) {
-- LIBSSH2_DISCONNECT(session, reason, message,
-- message_len, language, language_len);
-+ LIBSSH2_DISCONNECT(session, reason, (const char *)message,
-+ message_len, (const char *)language,
-+ language_len);
- }
-+
- _libssh2_debug(session, LIBSSH2_TRACE_TRANS,
- "Disconnect(%d): %s(%s)", reason,
- message, language);
-@@ -539,24 +529,24 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
- int always_display = data[1];
-
- if(datalen >= 6) {
-- message_len = _libssh2_ntohu32(data + 2);
--
-- if(message_len <= (datalen - 10)) {
-- /* 6 = packet_type(1) + display(1) + message_len(4) */
-- message = (char *) data + 6;
-- language_len = _libssh2_ntohu32(data + 6 +
-- message_len);
--
-- if(language_len <= (datalen - 10 - message_len))
-- language = (char *) data + 10 + message_len;
-- }
-+ struct string_buf buf;
-+ buf.data = (unsigned char *)data;
-+ buf.dataptr = buf.data;
-+ buf.len = datalen;
-+ buf.dataptr += 2; /* advance past type & always display */
-+
-+ _libssh2_get_string(&buf, &message, &message_len);
-+ _libssh2_get_string(&buf, &language, &language_len);
- }
-
- if(session->ssh_msg_debug) {
-- LIBSSH2_DEBUG(session, always_display, message,
-- message_len, language, language_len);
-+ LIBSSH2_DEBUG(session, always_display,
-+ (const char *)message,
-+ message_len, (const char *)language,
-+ language_len);
- }
- }
-+
- /*
- * _libssh2_debug will actually truncate this for us so
- * that it's not an inordinate about of data
-@@ -579,7 +569,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
- uint32_t len = 0;
- unsigned char want_reply = 0;
- len = _libssh2_ntohu32(data + 1);
-- if(datalen >= (6 + len)) {
-+ if((len <= (UINT_MAX - 6)) && (datalen >= (6 + len))) {
- want_reply = data[5 + len];
- _libssh2_debug(session,
- LIBSSH2_TRACE_CONN,
diff --git a/gnu/packages/patches/libtiff-CVE-2022-34526.patch b/gnu/packages/patches/libtiff-CVE-2022-34526.patch
new file mode 100644
index 0000000000..a5ad9d79a5
--- /dev/null
+++ b/gnu/packages/patches/libtiff-CVE-2022-34526.patch
@@ -0,0 +1,22 @@
+Fix CVE-2022-34526:
+
+ https://nvd.nist.gov/vuln/detail/CVE-2022-34526
+ https://gitlab.com/libtiff/libtiff/-/issues/433
+
+Patch taken from upstream source repository:
+
+ https://gitlab.com/libtiff/libtiff/-/commit/275735d0354e39c0ac1dc3c0db2120d6f31d1990
+
+diff --git a/libtiff/tif_dirinfo.c b/libtiff/tif_dirinfo.c
+--- a/libtiff/tif_dirinfo.c
++++ b/libtiff/tif_dirinfo.c
+@@ -1191,6 +1191,9 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
+ default:
+ return 1;
+ }
++ if( !TIFFIsCODECConfigured(tif->tif_dir.td_compression) ) {
++ return 0;
++ }
+ /* Check if codec specific tags are allowed for the current
+ * compression scheme (codec) */
+ switch (tif->tif_dir.td_compression) {
diff --git a/gnu/packages/patches/libtool-grep-compat.patch b/gnu/packages/patches/libtool-grep-compat.patch
new file mode 100644
index 0000000000..46e5c6873d
--- /dev/null
+++ b/gnu/packages/patches/libtool-grep-compat.patch
@@ -0,0 +1,51 @@
+Don't escape forward slashes to prevent a warning from grep 3.8.
+
+diff --git a/tests/link-order.at b/tests/link-order.at
+--- a/tests/link-order.at
++++ b/tests/link-order.at
+@@ -99,12 +99,12 @@ aix* | interix*) ;; # These systems have different path syntax
+ case $hardcode_direct$hardcode_direct_absolute in
+ yesno)
+ AT_CHECK([if $EGREP relinking stderr; then
+- $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout
++ $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout
+ else :; fi], [0], [ignore], [], [echo "wrong link order"])
+ ;;
+ *)
+ AT_CHECK([if $EGREP relinking stderr; then
+- $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout
++ $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout
+ else :; fi], [0], [ignore], [], [echo "wrong link order"])
+ ;;
+ esac
+diff --git a/tests/testsuite b/tests/testsuite
+--- a/tests/testsuite
++++ b/tests/testsuite
+@@ -20611,11 +20611,11 @@ aix* | interix*) ;; # These systems have different path syntax
+ yesno)
+ { set +x
+ $as_echo "$at_srcdir/link-order.at:101: if \$EGREP relinking stderr; then
+- \$EGREP \" .*\\/new\\/lib/libb\$shared_ext .*\\/old\\/lib/libcee\$shared_ext\" stdout
++ \$EGREP \" .*/new/lib/libb\$shared_ext .*/old/lib/libcee\$shared_ext\" stdout
+ else :; fi"
+ at_fn_check_prepare_notrace 'an embedded newline' "link-order.at:101"
+ ( $at_check_trace; if $EGREP relinking stderr; then
+- $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout
++ $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout
+ else :; fi
+ ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+ at_status=$? at_failed=false
+@@ -20633,11 +20633,11 @@ $at_traceon; }
+ *)
+ { set +x
+ $as_echo "$at_srcdir/link-order.at:106: if \$EGREP relinking stderr; then
+- \$EGREP \" -L.*\\/new\\/lib -lb -L.*\\/old\\/lib -lcee\" stdout
++ \$EGREP \" -L.*/new\\/lib -lb -L.*/old/lib -lcee\" stdout
+ else :; fi"
+ at_fn_check_prepare_notrace 'an embedded newline' "link-order.at:106"
+ ( $at_check_trace; if $EGREP relinking stderr; then
+- $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout
++ $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout
+ else :; fi
+ ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+ at_status=$? at_failed=false
diff --git a/gnu/packages/patches/libtool-skip-tests2.patch b/gnu/packages/patches/libtool-skip-tests2.patch
index 3f86191b4f..91beaa903e 100644
--- a/gnu/packages/patches/libtool-skip-tests2.patch
+++ b/gnu/packages/patches/libtool-skip-tests2.patch
@@ -16,7 +16,7 @@ Skip the nopic test on ARM, MIPS and RISC-V systems.
@@ -8741,7 +8741,7 @@
{ set +x
- $as_echo "$at_srcdir/demo.at:535: case \$host in
+ $as_echo "$at_srcdir/demo.at:513: case \$host in
-hppa*|x86_64*|s390*)
+hppa*|x86_64*|s390*|arm*|mips*|riscv*)
# These hosts cannot use non-PIC shared libs
@@ -24,7 +24,7 @@ Skip the nopic test on ARM, MIPS and RISC-V systems.
*-solaris*|*-sunos*)
@@ -8766,7 +8766,7 @@
"
- at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:535"
+ at_fn_check_prepare_notrace 'a `...` command substitution' "demo.at:513"
( $at_check_trace; case $host in
-hppa*|x86_64*|s390*)
+hppa*|x86_64*|s390*|arm*|mips*|riscv*)
diff --git a/gnu/packages/patches/libwpd-gcc-compat.patch b/gnu/packages/patches/libwpd-gcc-compat.patch
new file mode 100644
index 0000000000..ee206beafe
--- /dev/null
+++ b/gnu/packages/patches/libwpd-gcc-compat.patch
@@ -0,0 +1,17 @@
+Fix build with newer GCC.
+
+Taken from upstream:
+
+ https://sourceforge.net/p/libwpd/code/ci/333c8a26f231bea26ec3d56245315041bbf5577f/
+
+--- a/src/lib/WPXTable.h
++++ b/src/lib/WPXTable.h
+@@ -53,7 +53,7 @@
+ ~WPXTable();
+ void insertRow();
+ void insertCell(unsigned char colSpan, unsigned char rowSpan, unsigned char borderBits);
+- const WPXTableCell *getCell(size_t i, size_t j)
++ const WPXTableCell *getCell(std::size_t i, std::size_t j)
+ {
+ return &(m_tableRows[i])[j];
+ }
diff --git a/gnu/packages/patches/libxml2-parent-pointers.patch b/gnu/packages/patches/libxml2-parent-pointers.patch
deleted file mode 100644
index 1f0615c512..0000000000
--- a/gnu/packages/patches/libxml2-parent-pointers.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-Fix a regression in 2.9.12 where some corrupt XML structures were handled
-incorrectly:
-
- https://gitlab.gnome.org/GNOME/libxml2/-/issues/255
-
-This is an amalgamation of these upstream commits:
-
- https://gitlab.gnome.org/GNOME/libxml2/-/commit/85b1792e37b131e7a51af98a37f92472e8de5f3f
- https://gitlab.gnome.org/GNOME/libxml2/-/commit/13ad8736d294536da4cbcd70a96b0a2fbf47070c
-
-diff --git a/HTMLtree.c b/HTMLtree.c
---- a/HTMLtree.c
-+++ b/HTMLtree.c
-@@ -744,7 +744,7 @@ void
- htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
- int format) {
-- xmlNodePtr root;
-+ xmlNodePtr root, parent;
- xmlAttrPtr attr;
- const htmlElemDesc * info;
-
-@@ -755,6 +755,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- }
-
- root = cur;
-+ parent = cur->parent;
- while (1) {
- switch (cur->type) {
- case XML_HTML_DOCUMENT_NODE:
-@@ -762,13 +763,25 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- if (((xmlDocPtr) cur)->intSubset != NULL) {
- htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
- }
-- if (cur->children != NULL) {
-+ /* Always validate cur->parent when descending. */
-+ if ((cur->parent == parent) && (cur->children != NULL)) {
-+ parent = cur;
- cur = cur->children;
- continue;
- }
- break;
-
- case XML_ELEMENT_NODE:
-+ /*
-+ * Some users like lxml are known to pass nodes with a corrupted
-+ * tree structure. Fall back to a recursive call to handle this
-+ * case.
-+ */
-+ if ((cur->parent != parent) && (cur->children != NULL)) {
-+ htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
-+ break;
-+ }
-+
- /*
- * Get specific HTML info for that node.
- */
-@@ -817,6 +830,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- (cur->name != NULL) &&
- (cur->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
-+ parent = cur;
- cur = cur->children;
- continue;
- }
-@@ -825,9 +839,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- (info != NULL) && (!info->isinline)) {
- if ((cur->next->type != HTML_TEXT_NODE) &&
- (cur->next->type != HTML_ENTITY_REF_NODE) &&
-- (cur->parent != NULL) &&
-- (cur->parent->name != NULL) &&
-- (cur->parent->name[0] != 'p')) /* p, pre, param */
-+ (parent != NULL) &&
-+ (parent->name != NULL) &&
-+ (parent->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
- }
-
-@@ -842,9 +856,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- break;
- if (((cur->name == (const xmlChar *)xmlStringText) ||
- (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
-- ((cur->parent == NULL) ||
-- ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
-- (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
-+ ((parent == NULL) ||
-+ ((xmlStrcasecmp(parent->name, BAD_CAST "script")) &&
-+ (xmlStrcasecmp(parent->name, BAD_CAST "style"))))) {
- xmlChar *buffer;
-
- buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
-@@ -902,13 +916,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- break;
- }
-
-- /*
-- * The parent should never be NULL here but we want to handle
-- * corrupted documents gracefully.
-- */
-- if (cur->parent == NULL)
-- return;
-- cur = cur->parent;
-+ cur = parent;
-+ /* cur->parent was validated when descending. */
-+ parent = cur->parent;
-
- if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
- (cur->type == XML_DOCUMENT_NODE)) {
-@@ -939,9 +949,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- (cur->next != NULL)) {
- if ((cur->next->type != HTML_TEXT_NODE) &&
- (cur->next->type != HTML_ENTITY_REF_NODE) &&
-- (cur->parent != NULL) &&
-- (cur->parent->name != NULL) &&
-- (cur->parent->name[0] != 'p')) /* p, pre, param */
-+ (parent != NULL) &&
-+ (parent->name != NULL) &&
-+ (parent->name[0] != 'p')) /* p, pre, param */
- xmlOutputBufferWriteString(buf, "\n");
- }
- }
-diff --git a/xmlsave.c b/xmlsave.c
---- a/xmlsave.c
-+++ b/xmlsave.c
-@@ -847,7 +847,7 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- static void
- xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- int format = ctxt->format;
-- xmlNodePtr tmp, root, unformattedNode = NULL;
-+ xmlNodePtr tmp, root, unformattedNode = NULL, parent;
- xmlAttrPtr attr;
- xmlChar *start, *end;
- xmlOutputBufferPtr buf;
-@@ -856,6 +856,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- buf = ctxt->buf;
-
- root = cur;
-+ parent = cur->parent;
- while (1) {
- switch (cur->type) {
- case XML_DOCUMENT_NODE:
-@@ -868,7 +869,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- break;
-
- case XML_DOCUMENT_FRAG_NODE:
-- if (cur->children != NULL) {
-+ /* Always validate cur->parent when descending. */
-+ if ((cur->parent == parent) && (cur->children != NULL)) {
-+ parent = cur;
- cur = cur->children;
- continue;
- }
-@@ -887,7 +890,18 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- break;
-
- case XML_ELEMENT_NODE:
-- if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
-+ /*
-+ * Some users like lxml are known to pass nodes with a corrupted
-+ * tree structure. Fall back to a recursive call to handle this
-+ * case.
-+ */
-+ if ((cur->parent != parent) && (cur->children != NULL)) {
-+ xmlNodeDumpOutputInternal(ctxt, cur);
-+ break;
-+ }
-+
-+ if ((ctxt->level > 0) && (ctxt->format == 1) &&
-+ (xmlIndentTreeOutput))
- xmlOutputBufferWrite(buf, ctxt->indent_size *
- (ctxt->level > ctxt->indent_nr ?
- ctxt->indent_nr : ctxt->level),
-@@ -942,6 +956,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- xmlOutputBufferWrite(buf, 1, ">");
- if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
- if (ctxt->level >= 0) ctxt->level++;
-+ parent = cur;
- cur = cur->children;
- continue;
- }
-@@ -1058,13 +1073,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- break;
- }
-
-- /*
-- * The parent should never be NULL here but we want to handle
-- * corrupted documents gracefully.
-- */
-- if (cur->parent == NULL)
-- return;
-- cur = cur->parent;
-+ cur = parent;
-+ /* cur->parent was validated when descending. */
-+ parent = cur->parent;
-
- if (cur->type == XML_ELEMENT_NODE) {
- if (ctxt->level > 0) ctxt->level--;
-diff --git a/xmlsave.c b/xmlsave.c
---- a/xmlsave.c
-+++ b/xmlsave.c
-@@ -890,6 +890,13 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- break;
-
- case XML_ELEMENT_NODE:
-+ if ((cur != root) && (ctxt->format == 1) &&
-+ (xmlIndentTreeOutput))
-+ xmlOutputBufferWrite(buf, ctxt->indent_size *
-+ (ctxt->level > ctxt->indent_nr ?
-+ ctxt->indent_nr : ctxt->level),
-+ ctxt->indent);
-+
- /*
- * Some users like lxml are known to pass nodes with a corrupted
- * tree structure. Fall back to a recursive call to handle this
-@@ -900,13 +907,6 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
- break;
- }
-
-- if ((ctxt->level > 0) && (ctxt->format == 1) &&
-- (xmlIndentTreeOutput))
-- xmlOutputBufferWrite(buf, ctxt->indent_size *
-- (ctxt->level > ctxt->indent_nr ?
-- ctxt->indent_nr : ctxt->level),
-- ctxt->indent);
--
- xmlOutputBufferWrite(buf, 1, "<");
- if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
- xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
diff --git a/gnu/packages/patches/libxml2-terminating-newline.patch b/gnu/packages/patches/libxml2-terminating-newline.patch
deleted file mode 100644
index 3f5c88dd4e..0000000000
--- a/gnu/packages/patches/libxml2-terminating-newline.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Fix a regression in 2.9.12 where serializing empty HTML documents would
-not add a terminating newline.
-
- https://gitlab.gnome.org/GNOME/libxml2/-/issues/266
-
-Taken from upstream:
-
- https://gitlab.gnome.org/GNOME/libxml2/-/commit/92d9ab4c28842a09ca2b76d3ff2f933e01b6cd6f
-
-diff --git a/HTMLtree.c b/HTMLtree.c
---- a/HTMLtree.c
-+++ b/HTMLtree.c
-@@ -763,11 +763,15 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
- if (((xmlDocPtr) cur)->intSubset != NULL) {
- htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
- }
-- /* Always validate cur->parent when descending. */
-- if ((cur->parent == parent) && (cur->children != NULL)) {
-- parent = cur;
-- cur = cur->children;
-- continue;
-+ if (cur->children != NULL) {
-+ /* Always validate cur->parent when descending. */
-+ if (cur->parent == parent) {
-+ parent = cur;
-+ cur = cur->children;
-+ continue;
-+ }
-+ } else {
-+ xmlOutputBufferWriteString(buf, "\n");
- }
- break;
-
diff --git a/gnu/packages/patches/libxml2-xpath-recursion-limit.patch b/gnu/packages/patches/libxml2-xpath-recursion-limit.patch
deleted file mode 100644
index 051196c635..0000000000
--- a/gnu/packages/patches/libxml2-xpath-recursion-limit.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Fix recursion accounting in XPath expressions:
-
- https://gitlab.gnome.org/GNOME/libxml2/-/issues/264
-
-Taken from upstream:
-
- https://gitlab.gnome.org/GNOME/libxml2/-/commit/3e1aad4fe584747fd7d17cc7b2863a78e2d21a77
-
-diff --git a/xpath.c b/xpath.c
---- a/xpath.c
-+++ b/xpath.c
-@@ -10983,7 +10983,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
- }
-
- if (xpctxt != NULL)
-- xpctxt->depth -= 1;
-+ xpctxt->depth -= 10;
- }
-
- /**
diff --git a/gnu/packages/patches/linphone-desktop-without-sdk.patch b/gnu/packages/patches/linphone-desktop-without-sdk.patch
index 63e9808bf4..ef61b86707 100644
--- a/gnu/packages/patches/linphone-desktop-without-sdk.patch
+++ b/gnu/packages/patches/linphone-desktop-without-sdk.patch
@@ -13,13 +13,12 @@ Subject: [PATCH] [PATCH]: Fix building from git.
6 files changed, 6 insertions(+), 121 deletions(-)
create mode 100644 linphone-app/linphoneqt_version.cmake
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index f7eb05f2..3e853bdd 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -48,16 +48,6 @@ project(linphoneqt)
- include(GNUInstallDirs)
- include(CheckCXXCompilerFlag)
+diff -ru a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100
++++ b/CMakeLists.txt 2023-04-08 16:00:45.487927870 +0200
+@@ -51,23 +51,6 @@
+
+ set(CMAKE_CXX_STANDARD 11)
-# Prepare gobal CMAKE configuration specific to the current project
-set(SDK_BUILD_DIR "${CMAKE_BINARY_DIR}/WORK") # SDK build in WORK. Keep all in it.
@@ -27,30 +26,43 @@ index f7eb05f2..3e853bdd 100644
-
-set(APPLICATION_OUTPUT_DIR "${CMAKE_BINARY_DIR}/OUTPUT")
-
--set(CMAKE_PREFIX_PATH "${LINPHONE_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR}${PREFIX_PATH}")
+-set(CMAKE_PREFIX_PATH "${LINPHONE_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR}/include${PREFIX_PATH}")
+-if(WIN32)
+- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}")
+-elseif(APPLE)
+- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_NAME}.app/Contents/Frameworks")
+-else()
+- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}")
+-endif()
-string(REPLACE ";" "|" PREFIX_PATH "${CMAKE_PREFIX_PATH}")
-#set(PREFIX_PATH "${LINPHONE_OUTPUT_DIR}|${APPLICATION_OUTPUT_DIR}${PREFIX_PATH}")
-
# Avoid cmake warning if CMP0071 is not set.
if (POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
-@@ -116,9 +106,6 @@ if(ENABLE_V4L)
+@@ -177,10 +160,8 @@
endif()
list(APPEND APP_OPTIONS "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}")
-list(APPEND APP_OPTIONS "-DLINPHONE_OUTPUT_DIR=${LINPHONE_OUTPUT_DIR}")
--
+ list(APPEND APP_OPTIONS "-DENABLE_QT_GL=${ENABLE_VIDEO}")#Activate on video
+
-include(ExternalProject)
set(PROJECT_BUILD_COMMAND "")
if(CMAKE_BUILD_PARALLEL_LEVEL)
list(APPEND APP_OPTIONS "-DCMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}")
-@@ -133,32 +120,10 @@ if(CMAKE_VERBOSE_MAKEFILE)
+@@ -195,7 +176,6 @@
endif()
endif()
if(UNIX AND NOT APPLE)
- set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib:${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}")
list(APPEND APP_OPTIONS "-DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}")
- endif()
+ elseif(APPLE)
+ list(APPEND APP_OPTIONS "-DENABLE_FAT_BINARY=ON") #Disable XCFrameworks as it is not supported.
+@@ -222,28 +202,9 @@
+
+
+ if(NOT LINPHONE_QT_ONLY)
-ExternalProject_Add(sdk PREFIX "${CMAKE_BINARY_DIR}/sdk"
- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-sdk"
- INSTALL_DIR "${LINPHONE_OUTPUT_DIR}"
@@ -61,7 +73,7 @@ index f7eb05f2..3e853bdd 100644
- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
- LIST_SEPARATOR | # Use the alternate list separator
- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
-- #BUILD_ALWAYS NO #${DO_BUILD}
+- BUILD_ALWAYS NO #${DO_BUILD}
-)
-ExternalProject_Add_Step(sdk force_build
- COMMENT "Forcing build for 'desktop'"
@@ -69,18 +81,17 @@ index f7eb05f2..3e853bdd 100644
- DEPENDERS build
- ALWAYS 1
-)
+ endif()
include(FindPkgConfig)
-set(APP_DEPENDS sdk)
--
--
- find_package(Qt5 5.12 COMPONENTS Core REQUIRED)
+ find_package(Qt5 5.10 COMPONENTS Core REQUIRED)
if ( NOT Qt5_FOUND )
-@@ -173,39 +138,5 @@ find_package(Mediastreamer2 CONFIG QUIET)
+@@ -257,62 +218,5 @@
+ find_package(Mediastreamer2 CONFIG QUIET)
find_package(ortp CONFIG QUIET)
-
-if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) OR FORCE_APP_EXTERNAL_PROJECTS)
- message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target install")
- ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphone-app"
@@ -89,22 +100,45 @@ index f7eb05f2..3e853bdd 100644
- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app"
- DEPENDS ${APP_DEPENDS}
- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
-- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step will not be done by external project"
+- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
- LIST_SEPARATOR | # Use the alternate list separator
- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
- # ${APP_OPTIONS}
- BUILD_ALWAYS ON
- )
+- if( ENABLE_BUILD_APP_PLUGINS)
+- ExternalProject_Add(app-plugins PREFIX "${CMAKE_BINARY_DIR}/plugins-app"
+- SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins"
+- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}"
+- BINARY_DIR "${CMAKE_BINARY_DIR}/plugins-app"
+- DEPENDS linphone-qt
+- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND}
+- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time."
+- LIST_SEPARATOR | # Use the alternate list separator
+- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
+- )
+- endif()
- install(CODE "message(STATUS Running install)")
- set(AUTO_REGENERATION auto_regeneration)
-- add_custom_target(${AUTO_REGENERATION} ALL
-- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}
-- DEPENDS linphone-qt)
+- if( ENABLE_BUILD_APP_PLUGINS)
+- add_custom_target(${AUTO_REGENERATION} ALL
+- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}
+- DEPENDS app-plugins)
+- else()
+- add_custom_target(${AUTO_REGENERATION} ALL
+- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}
+- DEPENDS linphone-qt)
+- endif()
-else()
- message("Adding Linphone Desktop in an IDE-friendly state")
- set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}")
- add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app)
-- add_dependencies(app-library ${APP_DEPENDS})
+- if(NOT LINPHONE_QT_ONLY)
+- add_dependencies(app-library ${APP_DEPENDS})
+- endif()
+- if( ENABLE_BUILD_APP_PLUGINS)
+- add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app")
+- endif()
-endif()
-ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app"
- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app"
@@ -115,14 +149,25 @@ index f7eb05f2..3e853bdd 100644
- LIST_SEPARATOR | # Use the alternate list separator
- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH}
- EXCLUDE_FROM_ALL ON
-- BUILD_ALWAYS ON
+- #BUILD_ALWAYS ON
-)
+message("Adding Linphone Desktop in an IDE-friendly state")
+add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app)
-diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt
-index 3bc9420a..5267cd4a 100644
---- a/linphone-app/CMakeLists.txt
-+++ b/linphone-app/CMakeLists.txt
+diff -ru a/linphone-app/cmake_builder/additional_steps.cmake ./linphone-app/cmake_builder/additional_steps.cmake
+--- a/linphone-app/cmake_builder/additional_steps.cmake 1970-01-01 01:00:01.000000000 +0100
++++ ./linphone-app/cmake_builder/additional_steps.cmake 2023-04-08 16:02:33.005843116 +0200
+@@ -61,7 +61,7 @@
+ SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package"
+ DOWNLOAD_COMMAND ""
+ CMAKE_GENERATOR ${CMAKE_GENERATOR}
+- CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
++ CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
+ )
+ endif ()
+ endif ()
+diff -ru a/linphone-app/CMakeLists.txt ./linphone-app/CMakeLists.txt
+--- a/linphone-app/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100
++++ ./linphone-app/CMakeLists.txt 2023-04-08 16:01:32.699012115 +0200
@@ -21,17 +21,8 @@
################################################################################
cmake_minimum_required(VERSION 3.1)
@@ -140,96 +185,30 @@ index 3bc9420a..5267cd4a 100644
-
-project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}")
+
if(ENABLE_BUILD_VERBOSE)
- #message("CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}")
-@@ -49,7 +40,6 @@ if(UNIX AND NOT APPLE)
- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+@@ -51,7 +42,6 @@
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
-list(APPEND CMAKE_MODULE_PATH "${LINPHONE_OUTPUT_DIR}/cmake")
set(APP_LIBRARY app-library)
- include(application_info.cmake)
-diff --git a/linphone-app/cmake_builder/additional_steps.cmake b/linphone-app/cmake_builder/additional_steps.cmake
-index 7f7fd573..48e3c716 100644
---- a/linphone-app/cmake_builder/additional_steps.cmake
-+++ b/linphone-app/cmake_builder/additional_steps.cmake
-@@ -61,7 +61,7 @@ if (ENABLE_PACKAGING)
- SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package"
- DOWNLOAD_COMMAND ""
- CMAKE_GENERATOR ${CMAKE_GENERATOR}
-- CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
-+ CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY}
- )
- endif ()
- endif ()
-diff --git a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt
-index baea03cf..d06dcb74 100644
---- a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt
-+++ b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt
-@@ -200,44 +200,6 @@ elseif (APPLE)
- endif ()
- # install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app" DESTINATION "." USE_SOURCE_PERMISSIONS)
- else()# Not Windows and Apple
-- foreach (LIBRARY ${SHARED_LIBRARIES})
-- get_filename_component(LIBRARY_FILENAME ${LIBRARY} NAME)
-- message("Changing RPATH of ${LIBRARY_FILENAME} from '${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}' to '$ORIGIN/../${CMAKE_INSTALL_LIBDIR}'")
-- execute_process(COMMAND install_name_tool -rpath "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}" "$ORIGIN/../lib" "${LIBRARY}")
-- execute_process(COMMAND install_name_tool -addrpath "$ORIGIN/../lib64" "${LIBRARY}")
-- endforeach ()
-- install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}/" DESTINATION "${CMAKE_INSTALL_BINDIR}" USE_SOURCE_PERMISSIONS)
--#Just in case. This is useless because we have to use CMAKE_INSTALL_LIBDIR
-- if( EXISTS "${LINPHONE_OUTPUT_DIR}/lib/")
-- file(GLOB SHARED_LIBRARIES "${LINPHONE_OUTPUT_DIR}/lib/*.so*")
-- if( ENABLE_OPENH264 )# Remove openH264 lib from the installation. this codec will be download by user
-- foreach(item ${SHARED_LIBRARIES})
-- get_filename_component(LIBRARY_FILENAME ${item} NAME)
-- if("${LIBRARY_FILENAME}" MATCHES "^libopenh264.*$")
-- list(REMOVE_ITEM SHARED_LIBRARIES ${item})
-- endif()
-- endforeach(item)
-- endif()
-- install(FILES ${SHARED_LIBRARIES} DESTINATION "lib")
-- endif()
-- if( EXISTS "${LINPHONE_OUTPUT_DIR}/lib64/")
-- file(GLOB SHARED_LIBRARIES "${LINPHONE_OUTPUT_DIR}/lib64/*.so*")
-- if( ENABLE_OPENH264 )# Remove openH264 lib from the installation. this codec will be download by user
-- foreach(item ${SHARED_LIBRARIES})
-- get_filename_component(LIBRARY_FILENAME ${item} NAME)
-- if("${LIBRARY_FILENAME}" MATCHES "^libopenh264.*$")
-- list(REMOVE_ITEM SHARED_LIBRARIES ${item})
-- endif()
-- endforeach(item)
-- endif()
-- install(FILES ${SHARED_LIBRARIES} DESTINATION "lib64")
-- endif()
-- install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS)
-- if(ENABLE_BUILD_VERBOSE)
-- message("INSTALLATION : ${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/" )
-- endif()
-- file(GLOB PLUGINS_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins/*")
-- install(FILES ${PLUGINS_FILES} DESTINATION "plugins/mediastreamer/" )
- # Install desktop/icon files.
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../assets/linphone.desktop.cmake" "${CMAKE_CURRENT_BINARY_DIR}/../../${EXECUTABLE_NAME}.desktop" @ONLY)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/../../${EXECUTABLE_NAME}.desktop" DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
+ set(APP_PLUGIN app-plugin)
diff --git a/linphone-app/linphoneqt_version.cmake b/linphone-app/linphoneqt_version.cmake
new file mode 100644
index 00000000..a85d3455
--- /dev/null
+++ b/linphone-app/linphoneqt_version.cmake
-@@ -0,0 +1 @@
+@@ -0,0 +1,1 @@
+project(linphoneqt VERSION ${GUIX-SET-VERSION})
\ No newline at end of file
-diff --git a/linphone-app/src/config.h.cmake b/linphone-app/src/config.h.cmake
-index 093539e0..5a238c70 100644
---- a/linphone-app/src/config.h.cmake
-+++ b/linphone-app/src/config.h.cmake
-@@ -28,3 +28,4 @@
- #cmakedefine ENABLE_UPDATE_CHECK 1
+diff -ru a/linphone-app/src/config.h.cmake b/linphone-app/src/config.h.cmake
+--- a/linphone-app/src/config.h.cmake 1970-01-01 01:00:01.000000000 +0100
++++ b/linphone-app/src/config.h.cmake 2023-04-08 16:05:33.458349986 +0200
+@@ -32,3 +32,4 @@
#cmakedefine EXECUTABLE_NAME "${EXECUTABLE_NAME}"
#cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}"
+ #cmakedefine ENABLE_APP_WEBVIEW "${ENABLE_APP_WEBVIEW}"
+#define LINPHONE_QT_GIT_VERSION "${PROJECT_VERSION}"
\ No newline at end of file
---
-2.31.0
-
diff --git a/gnu/packages/patches/linux-pam-unix_chkpwd.patch b/gnu/packages/patches/linux-pam-unix_chkpwd.patch
new file mode 100644
index 0000000000..0e865ff18c
--- /dev/null
+++ b/gnu/packages/patches/linux-pam-unix_chkpwd.patch
@@ -0,0 +1,9 @@
+unix_chkpwd is designed to have a suid bit, but it's not possible to set it
+for files in the store. This patch tells unix_pam.so to look for
+unix_chkpwd in setuid program directory on Guix System.
+
+--- a/modules/pam_unix/Makefile.in
++++ b/modules/pam_unix/Makefile.in
+@@ -651,1 +651,1 @@
+- -DCHKPWD_HELPER=\"$(sbindir)/unix_chkpwd\" \
++ -DCHKPWD_HELPER=\"/run/setuid-programs/unix_chkpwd\" \
diff --git a/gnu/packages/patches/llvm-8-missing-include.patch b/gnu/packages/patches/llvm-8-missing-include.patch
new file mode 100644
index 0000000000..4d7ca6d332
--- /dev/null
+++ b/gnu/packages/patches/llvm-8-missing-include.patch
@@ -0,0 +1,17 @@
+Add missing include statement for compatibility with libstdc++ 11.
+
+Taken from upstream:
+
+ https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1
+
+diff --git a/utils/benchmark/src/benchmark_register.h b/utils/benchmark/src/benchmark_register.h
+--- a/utils/benchmark/src/benchmark_register.h
++++ b/utils/benchmark/src/benchmark_register.h
+@@ -1,6 +1,7 @@
+ #ifndef BENCHMARK_REGISTER_H
+ #define BENCHMARK_REGISTER_H
+
++#include <limits>
+ #include <vector>
+
+ #include "check.h"
diff --git a/gnu/packages/patches/lxqt-session-procps-4.patch b/gnu/packages/patches/lxqt-session-procps-4.patch
new file mode 100644
index 0000000000..d10e310723
--- /dev/null
+++ b/gnu/packages/patches/lxqt-session-procps-4.patch
@@ -0,0 +1,82 @@
+From d1db1c791195f3c0cf148e2be8bd46c5a51ca535 Mon Sep 17 00:00:00 2001
+From: Palo Kisa <palo.kisa@gmail.com>
+Date: Tue, 7 Mar 2023 14:21:40 +0100
+Subject: [PATCH 978/978] reaper: Build/Run on systems with procps-ng >= 4.0.0
+ (#456)
+
+On Linux, make it possible to use libproc2 or libprocps whichever is
+available.
+---
+ CMakeLists.txt | 6 +++++-
+ lxqt-session/src/procreaper.cpp | 24 +++++++++++++++++++++++-
+ 2 files changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a3c5e0d..f208600 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -35,7 +35,11 @@ find_package(X11 REQUIRED)
+ message(STATUS "Building with Qt${Qt5Core_VERSION}")
+ find_package(PkgConfig REQUIRED)
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+- pkg_search_module(PROCPS REQUIRED libprocps)
++ pkg_search_module(PROCPS REQUIRED libproc2 libprocps)
++ message(STATUS "Using PROCPS -> ${PROCPS_MODULE_NAME} v${PROCPS_VERSION}")
++ if (PROCPS_VERSION VERSION_GREATER_EQUAL 4.0.0)
++ add_definitions("-DUSING_LIBPROC2")
++ endif()
+ endif()
+
+ # Please don't move, must be after lxqt
+diff --git a/lxqt-session/src/procreaper.cpp b/lxqt-session/src/procreaper.cpp
+index 2acd030..1ea4bdc 100644
+--- a/lxqt-session/src/procreaper.cpp
++++ b/lxqt-session/src/procreaper.cpp
+@@ -29,7 +29,11 @@
+ #include "log.h"
+ #if defined(Q_OS_LINUX)
+ #include <sys/prctl.h>
+-#include <proc/readproc.h>
++# if defined(USING_LIBPROC2)
++# include <libproc2/pids.h>
++# else
++# include <proc/readproc.h>
++# endif
+ #elif defined(Q_OS_FREEBSD)
+ #include <sys/procctl.h>
+ #include <libutil.h>
+@@ -109,6 +113,23 @@ void ProcReaper::stop(const std::set<int64_t> & excludedPids)
+ const pid_t my_pid = ::getpid();
+ std::vector<pid_t> children;
+ #if defined(Q_OS_LINUX)
++# if defined(USING_LIBPROC2)
++ constexpr pids_item items[] = { PIDS_ID_PPID, PIDS_ID_TGID };
++ enum rel_items { rel_ppid, rel_tgid };
++ pids_info * info = nullptr;
++ procps_pids_new(&info, const_cast<pids_item *>(items), sizeof(items) / sizeof(pids_item));
++ pids_stack * stack = nullptr;
++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY)))
++ {
++ const int ppid = PIDS_VAL(rel_ppid, s_int, stack, info);
++ if (ppid == my_pid)
++ {
++ const int tgid = PIDS_VAL(rel_tgid, s_int, stack, info);
++ children.push_back(tgid);
++ }
++ }
++ procps_pids_unref(&info);
++# else
+ PROCTAB * proc_dir = ::openproc(PROC_FILLSTAT);
+ while (proc_t * proc = ::readproc(proc_dir, nullptr))
+ {
+@@ -119,6 +140,7 @@ void ProcReaper::stop(const std::set<int64_t> & excludedPids)
+ ::freeproc(proc);
+ }
+ ::closeproc(proc_dir);
++# endif
+ #elif defined(Q_OS_FREEBSD)
+ int cnt = 0;
+ if (kinfo_proc *proc_info = kinfo_getallproc(&cnt))
+--
+2.39.2
+
diff --git a/gnu/packages/patches/m4-gnulib-libio.patch b/gnu/packages/patches/m4-gnulib-libio.patch
deleted file mode 100644
index a26622ccf3..0000000000
--- a/gnu/packages/patches/m4-gnulib-libio.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-Adjust the bundled gnulib to cope with removal of libio interface in
-glibc 2.28.
-
-Based on this upstream patch, without hunks that do not apply to m4:
-https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
-
-diff --git a/lib/fflush.c b/lib/fflush.c
-index 983ade0..a6edfa1 100644
---- a/lib/fflush.c
-+++ b/lib/fflush.c
-@@ -33,7 +33,7 @@
- #undef fflush
-
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
- static void
-@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
-
- #endif
-
--#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
-
- # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
- if (stream == NULL || ! freading (stream))
- return fflush (stream);
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-
- clear_ungetc_buffer_preserving_position (stream);
-
-diff --git a/lib/fpending.c b/lib/fpending.c
-index c84e3a5..789f50e 100644
---- a/lib/fpending.c
-+++ b/lib/fpending.c
-@@ -32,7 +32,7 @@ __fpending (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- return fp->_IO_write_ptr - fp->_IO_write_base;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
-diff --git a/lib/fpurge.c b/lib/fpurge.c
-index b1d417c..3aedcc3 100644
---- a/lib/fpurge.c
-+++ b/lib/fpurge.c
-@@ -62,7 +62,7 @@ fpurge (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_IO_read_end = fp->_IO_read_ptr;
- fp->_IO_write_ptr = fp->_IO_write_base;
- /* Avoid memory leak when there is an active ungetc buffer. */
-diff --git a/lib/freadahead.c b/lib/freadahead.c
-index c2ecb5b..23ec76e 100644
---- a/lib/freadahead.c
-+++ b/lib/freadahead.c
-@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
- size_t
- freadahead (FILE *fp)
- {
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_write_ptr > fp->_IO_write_base)
- return 0;
- return (fp->_IO_read_end - fp->_IO_read_ptr)
-diff --git a/lib/freading.c b/lib/freading.c
-index 73c28ac..c24d0c8 100644
---- a/lib/freading.c
-+++ b/lib/freading.c
-@@ -31,7 +31,7 @@ freading (FILE *fp)
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
--# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- return ((fp->_flags & _IO_NO_WRITES) != 0
- || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
- && fp->_IO_read_base != NULL));
-diff --git a/lib/fseeko.c b/lib/fseeko.c
-index 0101ab5..193f4e8 100644
---- a/lib/fseeko.c
-+++ b/lib/fseeko.c
-@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- #endif
-
- /* These tests are based on fpurge.c. */
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_read_end == fp->_IO_read_ptr
- && fp->_IO_write_ptr == fp->_IO_write_base
- && fp->_IO_save_base == NULL)
-@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
- return -1;
- }
-
--#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_flags &= ~_IO_EOF_SEEN;
- fp->_offset = pos;
- #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
-index 78d896e..05c5752 100644
---- a/lib/stdio-impl.h
-+++ b/lib/stdio-impl.h
-@@ -18,6 +18,12 @@
- the same implementation of stdio extension API, except that some fields
- have different naming conventions, or their access requires some casts. */
-
-+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
-+ problem by defining it ourselves. FIXME: Do not rely on glibc
-+ internals. */
-+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
-+# define _IO_IN_BACKUP 0x100
-+#endif
-
- /* BSD stdio derived implementations. */
-
diff --git a/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch b/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch
new file mode 100644
index 0000000000..50ac5530a2
--- /dev/null
+++ b/gnu/packages/patches/mesa-fix-sporadic-test-failures.patch
@@ -0,0 +1,27 @@
+commit 7749599d737d205a88bbb6fa755ba095d9b581fa
+Author: Gert Wollny <gert.wollny@collabora.com>
+Date: Mon Aug 15 17:15:43 2022 +0200
+
+ r600/sfn: Initialize out buffer when printing op
+
+ 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
+ r600/sfn: rewrite NIR backend
+
+ Closes: #7021
+
+ Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
+ Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18130>
+
+diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
+index 3d40ea1796a..00826ed6457 100644
+--- a/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
++++ b/src/gallium/drivers/r600/sfn/sfn_instr_export.cpp
+@@ -206,7 +206,7 @@ bool WriteScratchInstr::do_ready() const
+
+ void WriteScratchInstr::do_print(std::ostream& os) const
+ {
+- char buf[6];
++ char buf[6] = {0};
+
+ os << "WRITE_SCRATCH ";
+ if (m_address)
diff --git a/gnu/packages/patches/mesa-skip-tests.patch b/gnu/packages/patches/mesa-skip-tests.patch
deleted file mode 100644
index 7ff571dcf5..0000000000
--- a/gnu/packages/patches/mesa-skip-tests.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-This test fails on i686-linux. I couldn't come up with a regex that
-could be used to disable it just on i686-linux, so we disable it
-completely with this patch:
-
-https://gitlab.freedesktop.org/mesa/mesa/-/issues/4091
-
-diff --git a/src/util/meson.build b/src/util/meson.build
-index 319b22d9bf7..93790c72675 100644
---- a/src/util/meson.build
-+++ b/src/util/meson.build
-@@ -344,7 +344,7 @@ if with_tests
- )
- endif
-
-- foreach t: ['bitset', 'register_allocate', 'u_debug_stack', 'u_qsort']
-+ foreach t: ['bitset', 'register_allocate', 'u_qsort']
- test(
- t,
- executable(
diff --git a/gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch b/gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch
deleted file mode 100644
index f16daa8009..0000000000
--- a/gnu/packages/patches/meson-allow-dirs-outside-of-prefix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Source: https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch
---- a/mesonbuild/coredata.py
-+++ b/mesonbuild/coredata.py
-@@ -506,7 +506,6 @@ class CoreData:
- return value
- if option.name.endswith('dir') and value.is_absolute() and \
- option not in BULITIN_DIR_NOPREFIX_OPTIONS:
-- # Value must be a subdir of the prefix
- # commonpath will always return a path in the native format, so we
- # must use pathlib.PurePath to do the same conversion before
- # comparing.
-@@ -518,7 +517,7 @@ class CoreData:
- try:
- value = value.relative_to(prefix)
- except ValueError:
-- raise MesonException(msg.format(option, value, prefix))
-+ pass
- if '..' in str(value):
- raise MesonException(msg.format(option, value, prefix))
- return value.as_posix()
diff --git a/gnu/packages/patches/mig-cpu.h-generation.patch b/gnu/packages/patches/mig-cpu.h-generation.patch
new file mode 100644
index 0000000000..3030eaeaa6
--- /dev/null
+++ b/gnu/packages/patches/mig-cpu.h-generation.patch
@@ -0,0 +1,16 @@
+Backport MiG commit 73fbf2504ae606dda81372701a67dad6fee0865e:
+
+ From: Flavio Cruz <flaviocruz@gmail.com>
+ Subject: Generate cpu.h with -ffreestanding
+
+--- a/Makefile.in 2023-03-26 23:02:51.384318331 +0200
++++ b/Makefile.in 2023-03-26 23:03:03.300329369 +0200
+@@ -1051,7 +1051,7 @@ uninstall-am: uninstall-binSCRIPTS unins
+ .sym.symc:
+ $(AWK_V) $(AWK) -f $(srcdir)/gensym.awk $< > $@
+ .symc.symo:
+- $(AM_V_CC) $(TARGET_CC) -S $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -x c -o $@ $<
++ $(AM_V_CC) $(TARGET_CC) -S $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -ffreestanding -x c -o $@ $<
+ .symo.h:
+ $(AM_V_GEN) sed -e '/^[^*].*$$/d' -e 's/^[*]/#define/' -e 's/mAgIc[^-0-9]*//' \
+ $< > $@
diff --git a/gnu/packages/patches/mm-common-reproducible-tarball.patch b/gnu/packages/patches/mm-common-reproducible-tarball.patch
new file mode 100644
index 0000000000..f0890aaf57
--- /dev/null
+++ b/gnu/packages/patches/mm-common-reproducible-tarball.patch
@@ -0,0 +1,40 @@
+From 024c121c844a4ec920133eb3f7e6b6ee8044c0b6 Mon Sep 17 00:00:00 2001
+From: Vagrant Cascadian <vagrant@reproducible-builds.org>
+Date: Sat, 12 Dec 2020 04:05:56 +0000
+Original-Patch: https://bugs.debian.org/977177
+Subject: [PATCH] Set uid, username, gid, and group name on files in
+ generated tarball.
+
+The user and group may otherwise vary between builds on different systems.
+
+---
+ util/meson_aux/skeletonmm-tarball.py | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/util/meson_aux/skeletonmm-tarball.py b/util/meson_aux/skeletonmm-tarball.py
+index db9e650..89049b6 100755
+--- a/util/meson_aux/skeletonmm-tarball.py
++++ b/util/meson_aux/skeletonmm-tarball.py
+@@ -39,10 +39,18 @@ elif output_file.endswith('.gz'):
+ else:
+ mode = 'w'
+
++def reproducible(tarinfo):
++ # Set consistent user and group on files in the tar archive
++ tarinfo.uid = 0
++ tarinfo.uname = 'root'
++ tarinfo.gid = 0
++ tarinfo.gname = 'root'
++ return tarinfo
++
+ with tarfile.open(output_file, mode=mode) as tar_file:
+ os.chdir(source_dir) # Input filenames are relative to source_dir.
+ for file in sys.argv[3:]:
+- tar_file.add(file)
++ tar_file.add(file, filter=reproducible)
+ # Errors raise exceptions. If an exception is raised, Meson+ninja will notice
+ # that the command failed, despite exit(0).
+ sys.exit(0)
+--
+2.29.2
+
diff --git a/gnu/packages/patches/ocaml-4.07-dynamically-allocate-signal-stack.patch b/gnu/packages/patches/ocaml-4.07-dynamically-allocate-signal-stack.patch
new file mode 100644
index 0000000000..a8144b85e6
--- /dev/null
+++ b/gnu/packages/patches/ocaml-4.07-dynamically-allocate-signal-stack.patch
@@ -0,0 +1,52 @@
+From 5a224b981ee32d7cf59aaa9e2c101af65a275edc Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Mon, 20 Feb 2023 19:14:12 +0100
+Subject: [PATCH] Dynamically allocate the alternate signal stack.
+
+This patch is a backport of https://github.com/ocaml/ocaml/pull/10266.
+---
+ asmrun/signals_asm.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/asmrun/signals_asm.c b/asmrun/signals_asm.c
+index 3895d75..7e2abe8 100644
+--- a/asmrun/signals_asm.c
++++ b/asmrun/signals_asm.c
+@@ -182,7 +182,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+
+ static char * system_stack_top;
+-static char sig_alt_stack[SIGSTKSZ];
+
+ #if defined(SYS_linux)
+ /* PR#4746: recent Linux kernels with support for stack randomization
+@@ -274,15 +273,19 @@ void caml_init_signals(void)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+ {
+ stack_t stk;
+- struct sigaction act;
+- stk.ss_sp = sig_alt_stack;
++ stk.ss_sp = malloc(SIGSTKSZ);
+ stk.ss_size = SIGSTKSZ;
+ stk.ss_flags = 0;
+- SET_SIGACT(act, segv_handler);
+- act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+- sigemptyset(&act.sa_mask);
+- system_stack_top = (char *) &act;
+- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
++ if (stk.ss_sp != NULL) {
++ if (sigaltstack(&stk, NULL) != -1) {
++ struct sigaction act;
++ SET_SIGACT(act, segv_handler);
++ act.sa_flags |= SA_ONSTACK | SA_NODEFER;
++ sigemptyset(&act.sa_mask);
++ system_stack_top = (char *) &act;
++ sigaction(SIGSEGV, &act, NULL);
++ }
++ }
+ }
+ #endif
+ }
+--
+2.38.1
+
diff --git a/gnu/packages/patches/ocaml-4.09-dynamically-allocate-signal-stack.patch b/gnu/packages/patches/ocaml-4.09-dynamically-allocate-signal-stack.patch
new file mode 100644
index 0000000000..2af1582976
--- /dev/null
+++ b/gnu/packages/patches/ocaml-4.09-dynamically-allocate-signal-stack.patch
@@ -0,0 +1,52 @@
+From 95f5016955e519c392c746e38e0c9460f2c1aa0c Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sun, 19 Feb 2023 09:58:57 +0100
+Subject: [PATCH] Dynamically allocate the alternate signal stack.
+
+This patch is a backport of https://github.com/ocaml/ocaml/pull/10266.
+---
+ runtime/signals_nat.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/runtime/signals_nat.c b/runtime/signals_nat.c
+index 29a5f49..a193fc2 100644
+--- a/runtime/signals_nat.c
++++ b/runtime/signals_nat.c
+@@ -182,7 +182,6 @@ DECLARE_SIGNAL_HANDLER(trap_handler)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+
+ static char * system_stack_top;
+-static char sig_alt_stack[SIGSTKSZ];
+
+ #if defined(SYS_linux)
+ /* PR#4746: recent Linux kernels with support for stack randomization
+@@ -274,15 +273,19 @@ void caml_init_signals(void)
+ #ifdef HAS_STACK_OVERFLOW_DETECTION
+ {
+ stack_t stk;
+- struct sigaction act;
+- stk.ss_sp = sig_alt_stack;
++ stk.ss_sp = malloc(SIGSTKSZ);
+ stk.ss_size = SIGSTKSZ;
+ stk.ss_flags = 0;
+- SET_SIGACT(act, segv_handler);
+- act.sa_flags |= SA_ONSTACK | SA_NODEFER;
+- sigemptyset(&act.sa_mask);
+- system_stack_top = (char *) &act;
+- if (sigaltstack(&stk, NULL) == 0) { sigaction(SIGSEGV, &act, NULL); }
++ if (stk.ss_sp != NULL) {
++ if (sigaltstack(&stk, NULL) != -1) {
++ struct sigaction act;
++ SET_SIGACT(act, segv_handler);
++ act.sa_flags |= SA_ONSTACK | SA_NODEFER;
++ sigemptyset(&act.sa_mask);
++ system_stack_top = (char *) &act;
++ sigaction(SIGSEGV, &act, NULL);
++ }
++ }
+ }
+ #endif
+ }
+--
+2.38.1
+
diff --git a/gnu/packages/patches/opencolorio-fix-build-with-gcc11.patch b/gnu/packages/patches/opencolorio-fix-build-with-gcc11.patch
new file mode 100644
index 0000000000..06507db206
--- /dev/null
+++ b/gnu/packages/patches/opencolorio-fix-build-with-gcc11.patch
@@ -0,0 +1,37 @@
+Fix build failure with GCC 11:
+
+------
+[...]
+/tmp/guix-build-opencolorio-1.1.1.drv-0/source/src/core/ImageDesc.cpp:60:51: error: ‘this’ pointer is null [-Werror=nonnull]
+ 60 | os << "width=" << packedImg->getWidth() << ", ";
+ | ^
+/tmp/guix-build-opencolorio-1.1.1.drv-0/source/src/core/ImageDesc.cpp:274:10: note: in a call to non-static member function ‘long int OpenColorIO::v1::PackedImageDesc::getWidth() const’
+ 274 | long PackedImageDesc::getWidth() const
+ | ^~~~~~~~~~~~~~~
+/tmp/guix-build-opencolorio-1.1.1.drv-0/source/src/core/ImageDesc.cpp:61:53: error: ‘this’ pointer is null [-Werror=nonnull]
+ 61 | os << "height=" << packedImg->getHeight() << ", ";
+ | ^
+/tmp/guix-build-opencolorio-1.1.1.drv-0/source/src/core/ImageDesc.cpp:279:10: note: in a call to non-static member function ‘long int OpenColorIO::v1::PackedImageDesc::getHeight() const’
+ 279 | long PackedImageDesc::getHeight() const
+ | ^~~~~~~~~~~~~~~
+cc1plus: all warnings being treated as errors
+[...]
+------
+
+Patch copied from Gentoo:
+
+https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e726d850502018b6760da78dbd4a419603016b8
+
+diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
+index 1eb691b6..cff9bd83 100644
+--- a/src/core/CMakeLists.txt
++++ b/src/core/CMakeLists.txt
+@@ -23,8 +23,6 @@ if(WIN32)
+ if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+ set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} /WX")
+ endif()
+-else()
+- set(EXTERNAL_COMPILE_FLAGS "${EXTERNAL_COMPILE_FLAGS} -Werror")
+ endif()
+
+ # SHARED
diff --git a/gnu/packages/patches/openjdk-10-pointer-comparison.patch b/gnu/packages/patches/openjdk-10-pointer-comparison.patch
new file mode 100644
index 0000000000..9c09f8e391
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-pointer-comparison.patch
@@ -0,0 +1,14 @@
+Patch inspired by file comparison with openjdk@19.
+
+diff -u -r openjdk-10.alt/src/hotspot/os/linux/os_linux.cpp openjdk-10/src/hotspot/os/linux/os_linux.cpp
+--- openjdk-10.alt/src/hotspot/os/linux/os_linux.cpp 2023-04-05 15:02:56.994779480 +0200
++++ openjdk-10/src/hotspot/os/linux/os_linux.cpp 2023-04-05 15:07:47.267537301 +0200
+@@ -2155,7 +2155,7 @@
+ }
+
+ p = OSContainer::cpu_cpuset_memory_nodes();
+- if (p < 0)
++ if (p == NULL)
+ st->print("cpu_memory_nodes() failed\n");
+ else {
+ st->print("cpu_memory_nodes: %s\n", p);
diff --git a/gnu/packages/patches/openjdk-10-setsignalhandler.patch b/gnu/packages/patches/openjdk-10-setsignalhandler.patch
new file mode 100644
index 0000000000..c91ae6b318
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-setsignalhandler.patch
@@ -0,0 +1,25 @@
+Patch inspired by file comparison with openjdk@19.
+
+diff -u -r openjdk-10.alt/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c openjdk-10/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+--- openjdk-10.alt/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2023-04-05 15:03:00.070787628 +0200
++++ openjdk-10/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2023-04-05 15:29:51.379824348 +0200
+@@ -67,8 +67,17 @@
+ longjmp(context, 1);
+ }
+
+-void set_signal_handler() {
+- static char altstack[SIGSTKSZ];
++static char* altstack = NULL;
++
++ void set_signal_handler() {
++ if (altstack == NULL) {
++ // Dynamically allocated in case SIGSTKSZ is not constant
++ altstack = (char*)malloc(SIGSTKSZ);
++ if (altstack == NULL) {
++ fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n");
++ exit(7);
++ }
++ }
+
+ stack_t ss = {
+ .ss_size = SIGSTKSZ,
diff --git a/gnu/packages/patches/openjdk-9-pointer-comparison.patch b/gnu/packages/patches/openjdk-9-pointer-comparison.patch
new file mode 100644
index 0000000000..dd443ae817
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-pointer-comparison.patch
@@ -0,0 +1,27 @@
+The following patch prevents build failures due to comparisons between
+a pointer and an integer. It has been adapted from openjdk@10.
+
+diff -u -r openjdk-9.alt/hotspot/src/share/vm/memory/virtualspace.cpp openjdk-9/hotspot/src/share/vm/memory/virtualspace.cpp
+--- openjdk-9.alt/hotspot/src/share/vm/memory/virtualspace.cpp 2023-04-05 13:46:58.841965513 +0200
++++ openjdk-9/hotspot/src/share/vm/memory/virtualspace.cpp 2023-04-05 13:48:43.902387837 +0200
+@@ -581,7 +581,7 @@
+ assert(markOopDesc::encode_pointer_as_mark(&_base[size])->decode_pointer() == &_base[size],
+ "area must be distinguishable from marks for mark-sweep");
+
+- if (base() > 0) {
++ if (base() != NULL) {
+ MemTracker::record_virtual_memory_type((address)base(), mtJavaHeap);
+ }
+ }
+diff -u -r openjdk-9.alt/hotspot/src/share/vm/opto/lcm.cpp openjdk-9/hotspot/src/share/vm/opto/lcm.cpp
+--- openjdk-9.alt/hotspot/src/share/vm/opto/lcm.cpp 2023-04-05 13:46:58.849965545 +0200
++++ openjdk-9/hotspot/src/share/vm/opto/lcm.cpp 2023-04-05 13:47:53.566187260 +0200
+@@ -39,7 +39,7 @@
+ // Check whether val is not-null-decoded compressed oop,
+ // i.e. will grab into the base of the heap if it represents NULL.
+ static bool accesses_heap_base_zone(Node *val) {
+- if (Universe::narrow_oop_base() > 0) { // Implies UseCompressedOops.
++ if (Universe::narrow_oop_base() != NULL) { // Implies UseCompressedOops.
+ if (val && val->is_Mach()) {
+ if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
+ // This assumes all Decodes with TypePtr::NotNull are matched to nodes that
diff --git a/gnu/packages/patches/openjdk-9-setsignalhandler.patch b/gnu/packages/patches/openjdk-9-setsignalhandler.patch
new file mode 100644
index 0000000000..500bf2360b
--- /dev/null
+++ b/gnu/packages/patches/openjdk-9-setsignalhandler.patch
@@ -0,0 +1,24 @@
+Patch taken from file comparison with openjdk@19.
+
+diff -u -r openjdk-9.alt/hotspot/test/runtime/StackGuardPages/exeinvoke.c openjdk-9/hotspot/test/runtime/StackGuardPages/exeinvoke.c
+--- openjdk-9.alt/hotspot/test/runtime/StackGuardPages/exeinvoke.c 2023-04-05 13:46:58.689964892 +0200
++++ openjdk-9/hotspot/test/runtime/StackGuardPages/exeinvoke.c 2023-04-05 14:15:52.435613325 +0200
+@@ -67,8 +67,17 @@
+ longjmp(context, 1);
+ }
+
++static char* altstack = NULL;
++
+ void set_signal_handler() {
+- static char altstack[SIGSTKSZ];
++ if (altstack == NULL) {
++ // Dynamically allocated in case SIGSTKSZ is not constant
++ altstack = (char*)malloc(SIGSTKSZ);
++ if (altstack == NULL) {
++ fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n");
++ exit(7);
++ }
++ }
+
+ stack_t ss = {
+ .ss_size = SIGSTKSZ,
diff --git a/gnu/packages/patches/p7zip-fix-build-with-gcc-11.patch b/gnu/packages/patches/p7zip-fix-build-with-gcc-11.patch
new file mode 100644
index 0000000000..20a40488d8
--- /dev/null
+++ b/gnu/packages/patches/p7zip-fix-build-with-gcc-11.patch
@@ -0,0 +1,49 @@
+Building p7zip with GCC 11 or newer normally fails with error messages like
+
+ ../../../../CPP/7zip/Archive/Wim/WimHandler.cpp:308:11: error: use of an
+ operand of type ‘bool’ in ‘operator++’ is forbidden in C++17
+ 308 | numMethods++;
+ | ^~~~~~~~~~
+
+This patch causes GCC to interpret the code using the GNU dialect of the C++14
+standard, as GCC 10 did by default, and reduces these errors to warnings.
+
+diff --git a/makefile.linux_amd64_asm b/makefile.linux_amd64_asm
+index 075c6a8..b7d73ee 100644
+--- a/makefile.linux_amd64_asm
++++ b/makefile.linux_amd64_asm
+@@ -11,6 +11,8 @@ ALLFLAGS=-m64 ${OPTFLAGS} -pipe \
+ -D_7ZIP_ASM \
+ $(LOCAL_FLAGS)
+
++ALLFLAGS_CPP=-std=gnu++14
++
+ CXX=g++
+ CC=gcc
+ CC_SHARED=-fPIC
+diff --git a/makefile.linux_any_cpu_gcc_4.X b/makefile.linux_any_cpu_gcc_4.X
+index be093b5..c0f3120 100644
+--- a/makefile.linux_any_cpu_gcc_4.X
++++ b/makefile.linux_any_cpu_gcc_4.X
+@@ -10,7 +10,7 @@ ALLFLAGS=${OPTFLAGS} -pipe \
+ -D_7ZIP_LARGE_PAGES \
+ $(LOCAL_FLAGS)
+
+-ALLFLAGS_CPP=-DENV_HAVE_GCCVISIBILITYPATCH -fvisibility=hidden -fvisibility-inlines-hidden
++ALLFLAGS_CPP=-DENV_HAVE_GCCVISIBILITYPATCH -std=gnu++14 -fvisibility=hidden -fvisibility-inlines-hidden
+
+ CXX=g++
+ CC=gcc
+diff --git a/makefile.linux_x86_asm_gcc_4.X b/makefile.linux_x86_asm_gcc_4.X
+index 1ac339b..6e736d9 100644
+--- a/makefile.linux_x86_asm_gcc_4.X
++++ b/makefile.linux_x86_asm_gcc_4.X
+@@ -12,7 +12,7 @@ ALLFLAGS=${OPTFLAGS} -pipe -m32 \
+ -D_7ZIP_ASM \
+ $(LOCAL_FLAGS)
+
+-ALLFLAGS_CPP=-DENV_HAVE_GCCVISIBILITYPATCH -fvisibility=hidden -fvisibility-inlines-hidden
++ALLFLAGS_CPP=-DENV_HAVE_GCCVISIBILITYPATCH -std=gnu++14 -fvisibility=hidden -fvisibility-inlines-hidden
+
+ CXX=g++
+ CC=gcc
diff --git a/gnu/packages/patches/pciutils-hurd-configure.patch b/gnu/packages/patches/pciutils-hurd-configure.patch
deleted file mode 100644
index 226891a995..0000000000
--- a/gnu/packages/patches/pciutils-hurd-configure.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-Add ability to detect GNU/Hurd when configuring.
-
-Adapted from https://git.hadrons.org/cgit/debian/pkgs/pciutils.git/tree/debian/patches/00-configure-hurd.patch
-
-From e39a3af22501234a91cf28e8c57b45f9379f9101 Mon Sep 17 00:00:00 2001
-From: Damien Zammit <damien@zamaudio.com>
-Date: Fri, 26 Oct 2018 09:24:04 -0400
-Subject: [PATCH 2/2] Add ability to detect GNU/Hurd when configuring
-
----
- lib/configure | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
---- a/lib/configure
-+++ b/lib/configure
-@@ -25,7 +25,7 @@ if [ -z "$HOST" ] ; then
- proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
- cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
- else
-- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
-+ cpu=`uname -m | sed 's/^i.86-AT386/i386/;s/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
- fi
- if [ "$sys" = "DragonFly" ]
- then
-@@ -39,6 +39,10 @@ if [ -z "$HOST" ] ; then
- then
- sys=cygwin
- fi
-+ if [ "$sys" = "GNU" ]
-+ then
-+ sys=gnu
-+ fi
- HOST=${3:-$cpu-$sys}
- fi
- [ -n "$RELEASE" ] && rel="${RELEASE}"
diff --git a/gnu/packages/patches/pciutils-hurd-fix.patch b/gnu/packages/patches/pciutils-hurd-fix.patch
deleted file mode 100644
index f1979d4352..0000000000
--- a/gnu/packages/patches/pciutils-hurd-fix.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Fix a build error on GNU/Hurd for pciutils 3.7.0.
-
-commit 053cf6c8b2acafadf828912828336d90fe9b8696
-Author: Martin Mares <mj@ucw.cz>
-Date: Sun May 31 11:53:28 2020 +0200
-
- HURD backend should compile again
-
- Fixes a bug introduced by commit 82c06b47dea5a38075ce9d56f743360bc47b4c78.
-
-diff --git a/lib/hurd.c b/lib/hurd.c
-index 7b3b2ae..ccd92f6 100644
---- a/lib/hurd.c
-+++ b/lib/hurd.c
-@@ -307,7 +307,6 @@ hurd_fill_regions(struct pci_dev *d)
- d->base_addr[i] |= regions[i].is_64 << 2;
- d->base_addr[i] |= regions[i].is_prefetchable << 3;
-
-- if (flags & PCI_FILL_SIZES)
-- d->size[i] = regions[i].size;
-+ d->size[i] = regions[i].size;
- }
- }
diff --git a/gnu/packages/patches/procps-strtod-test.patch b/gnu/packages/patches/procps-strtod-test.patch
new file mode 100644
index 0000000000..db1cee320e
--- /dev/null
+++ b/gnu/packages/patches/procps-strtod-test.patch
@@ -0,0 +1,36 @@
+See https://gitlab.com/procps-ng/procps/-/issues/271
+
+diff -u -r procps-ng-4.0.3.alt/src/tests/test_strtod_nol.c procps-ng-4.0.3/src/tests/test_strtod_nol.c
+--- procps-ng-4.0.3.alt/src/tests/test_strtod_nol.c 2022-12-18 23:44:18.383960834 +0100
++++ procps-ng-4.0.3/src/tests/test_strtod_nol.c 2023-03-20 16:52:26.680032658 +0100
+@@ -1,6 +1,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <math.h>
+ #include "strutils.h"
+
+ struct strtod_tests {
+@@ -25,6 +26,11 @@
+ {NULL, 0.0}
+ };
+
++#define EPSILON 1.0 // Really not trying for precision here
++int dequal(const double d1, const double d2)
++{
++ return fabs(d1-d2) < EPSILON;
++}
+
+
+ int main(int argc, char *argv[])
+@@ -33,8 +39,8 @@
+ double val;
+
+ for(i=0; tests[i].string != NULL; i++) {
+- if(strtod_nol_or_err(tests[i].string, "Cannot parse number") !=
+- tests[i].result) {
++ if(!dequal (strtod_nol_or_err(tests[i].string, "Cannot parse number"),
++ tests[i].result)) {
+ fprintf(stderr, "FAIL: strtod_nol_or_err(\"%s\") != %f\n",
+ tests[i].string, tests[i].result);
+ return EXIT_FAILURE;
diff --git a/gnu/packages/patches/prusa-slicer-boost-fixes.patch b/gnu/packages/patches/prusa-slicer-boost-fixes.patch
new file mode 100644
index 0000000000..5bca271625
--- /dev/null
+++ b/gnu/packages/patches/prusa-slicer-boost-fixes.patch
@@ -0,0 +1,97 @@
+Fixes for Boost compatibility.
+This patch comes from Gentoo:
+ portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_alpha2-boost-fixes.patch
+
+--- a/src/hints/HintsToPot.cpp
++++ b/src/hints/HintsToPot.cpp
+@@ -1,6 +1,7 @@
+ #include <iostream>
+ #include <vector>
+ #include <string>
++#include <boost/nowide/fstream.hpp>
+ #include <boost/filesystem.hpp>
+ #include <boost/dll.hpp>
+ #include <boost/property_tree/ini_parser.hpp>
+@@ -9,7 +10,7 @@
+
+ bool write_to_pot(boost::filesystem::path path, const std::vector<std::pair<std::string, std::string>>& data)
+ {
+- boost::filesystem::ofstream file(std::move(path), std::ios_base::app);
++ boost::nowide::ofstream file(std::move(path), std::ios_base::app);
+ for (const auto& element : data)
+ {
+ //Example of .pot element
+--- a/src/libslic3r/Preset.cpp
++++ b/src/libslic3r/Preset.cpp
+@@ -25,6 +25,7 @@
+ #include <stdexcept>
+ #include <unordered_map>
+ #include <boost/format.hpp>
++#include <boost/nowide/fstream.hpp>
+ #include <boost/filesystem.hpp>
+ #include <boost/filesystem/fstream.hpp>
+ #include <boost/algorithm/string.hpp>
+@@ -84,7 +85,7 @@ ConfigFileType guess_config_file_type(const ptree &tree)
+ VendorProfile VendorProfile::from_ini(const boost::filesystem::path &path, bool load_all)
+ {
+ ptree tree;
+- boost::filesystem::ifstream ifs(path);
++ boost::nowide::ifstream ifs(path);
+ boost::property_tree::read_ini(ifs, tree);
+ return VendorProfile::from_ini(tree, path, load_all);
+ }
+--- a/src/slic3r/GUI/DesktopIntegrationDialog.cpp
++++ b/src/slic3r/GUI/DesktopIntegrationDialog.cpp
+@@ -10,6 +10,7 @@
+ #include "libslic3r/Platform.hpp"
+ #include "libslic3r/Config.hpp"
+
++#include <boost/nowide/fstream.hpp>
+ #include <boost/filesystem.hpp>
+ #include <boost/log/trivial.hpp>
+ #include <boost/dll/runtime_symbol_info.hpp>
+@@ -503,4 +504,4 @@ DesktopIntegrationDialog::~DesktopIntegrationDialog()
+
+ } // namespace GUI
+ } // namespace Slic3r
+-#endif // __linux__
+\ No newline at end of file
++#endif // __linux__
+--- a/src/slic3r/GUI/GUI_App.cpp
++++ b/src/slic3r/GUI/GUI_App.cpp
+@@ -13,6 +13,7 @@
+ #include <cstdlib>
+ #include <regex>
+ #include <string_view>
++#include <boost/nowide/fstream.hpp>
+ #include <boost/algorithm/string/predicate.hpp>
+ #include <boost/algorithm/string.hpp>
+ #include <boost/format.hpp>
+--- a/src/slic3r/GUI/HintNotification.cpp
++++ b/src/slic3r/GUI/HintNotification.cpp
+@@ -15,6 +15,7 @@
+ #include "libslic3r/PrintConfig.hpp"
+
+ #include <boost/algorithm/string/replace.hpp>
++#include <boost/nowide/fstream.hpp>
+ #include <boost/filesystem.hpp>
+ #include <boost/nowide/fstream.hpp>
+ #include <boost/log/trivial.hpp>
+@@ -65,7 +66,7 @@ inline void push_style_color(ImGuiCol idx, const ImVec4& col, bool fading_out, f
+
+ void write_used_binary(const std::vector<std::string>& ids)
+ {
+- boost::filesystem::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal"), std::ios::binary);
++ boost::nowide::ofstream file((boost::filesystem::path(data_dir()) / "cache" / "hints.cereal"), std::ios::binary);
+ cereal::BinaryOutputArchive archive(file);
+ HintsCerealData cd { ids };
+ try
+@@ -84,7 +85,7 @@ void read_used_binary(std::vector<std::string>& ids)
+ BOOST_LOG_TRIVIAL(warning) << "Failed to load to hints.cereal. File does not exists. " << path.string();
+ return;
+ }
+- boost::filesystem::ifstream file(path);
++ boost::nowide::ifstream file(path);
+ cereal::BinaryInputArchive archive(file);
+ HintsCerealData cd;
+ try
diff --git a/gnu/packages/patches/prusa-slicer-fix-tests.patch b/gnu/packages/patches/prusa-slicer-fix-tests.patch
new file mode 100644
index 0000000000..da9a5307f9
--- /dev/null
+++ b/gnu/packages/patches/prusa-slicer-fix-tests.patch
@@ -0,0 +1,17 @@
+This patch comes from Gentoo:
+ portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_rc1-fix-tests.patch
+
+--- a/tests/fff_print/test_data.cpp
++++ b/tests/fff_print/test_data.cpp
+@@ -4,10 +4,9 @@
+ #include "libslic3r/GCodeReader.hpp"
+ #include "libslic3r/Config.hpp"
+ #include "libslic3r/Print.hpp"
+-#include "libslic3r/Format/OBJ.hpp"
+-#include "libslic3r/Format/STL.hpp"
+
+ #include <cstdlib>
++#include <fstream>
+ #include <string>
+
+ #include <boost/nowide/cstdio.hpp>
diff --git a/gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch b/gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch
new file mode 100644
index 0000000000..affa506b1c
--- /dev/null
+++ b/gnu/packages/patches/prusa-slicer-with-cereal-1.3.1.patch
@@ -0,0 +1,52 @@
+Fix for building with cereal>=1.3.1.
+This patch comes from Gentoo:
+ portage/media-gfx/prusaslicer/files/prusaslicer-2.5.0_rc1-cereal-1.3.1.patch
+
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -127,7 +127,7 @@
+ set_target_properties(PrusaSlicer PROPERTIES OUTPUT_NAME "prusa-slicer")
+ endif ()
+
+-target_link_libraries(PrusaSlicer libslic3r cereal)
++target_link_libraries(PrusaSlicer libslic3r libcereal)
+
+ if (APPLE)
+ # add_compile_options(-stdlib=libc++)
+--- a/src/slic3r/CMakeLists.txt
++++ b/src/slic3r/CMakeLists.txt
+@@ -260,7 +260,7 @@
+
+ encoding_check(libslic3r_gui)
+
+-target_link_libraries(libslic3r_gui libslic3r avrdude cereal imgui GLEW::GLEW OpenGL::GL hidapi libcurl ${wxWidgets_LIBRARIES})
++target_link_libraries(libslic3r_gui libslic3r avrdude libcereal imgui GLEW::GLEW OpenGL::GL hidapi libcurl ${wxWidgets_LIBRARIES})
+
+ if (MSVC)
+ target_link_libraries(libslic3r_gui Setupapi.lib)
+--- a/src/libslic3r/CMakeLists.txt
++++ b/src/libslic3r/CMakeLists.txt
+@@ -395,7 +395,7 @@
+ target_link_libraries(libslic3r
+ libnest2d
+ admesh
+- cereal
++ libcereal
+ libigl
+ miniz
+ boost_libs
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -446,6 +446,12 @@
+
+ # Find the Cereal serialization library
+ find_package(cereal REQUIRED)
++add_library(libcereal INTERFACE)
++if (NOT TARGET cereal::cereal)
++ target_link_libraries(libcereal INTERFACE cereal)
++else()
++ target_link_libraries(libcereal INTERFACE cereal::cereal)
++endif()
+
+ # l10n
+ set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization")
diff --git a/gnu/packages/patches/pytest-fix-unstrable-exception-test.patch b/gnu/packages/patches/pytest-fix-unstrable-exception-test.patch
new file mode 100644
index 0000000000..4d77786b77
--- /dev/null
+++ b/gnu/packages/patches/pytest-fix-unstrable-exception-test.patch
@@ -0,0 +1,34 @@
+From b55e264a675f7621b8351e227b93742f19e01c7d Mon Sep 17 00:00:00 2001
+From: Daniel Valenzuela <dsvalenzuela@uc.cl>
+Date: Wed, 9 Nov 2022 19:43:10 -0300
+Subject: [PATCH] Fix test_raising_repr test
+
+Closes #10473
+
+Python <3.11 versions depend on `exceptiongroup>=1.0.0rc8`, and they released version `1.0.1`
+6 days ago (2022/11/03) that as a side-effect changed the output of exceptions.
+---
+ testing/test_assertion.py | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/testing/test_assertion.py b/testing/test_assertion.py
+index d8844f2e41..7574592210 100644
+--- a/testing/test_assertion.py
++++ b/testing/test_assertion.py
+@@ -1664,15 +1664,7 @@ def test_raising_repr():
+ """
+ )
+ result = pytester.runpytest()
+- if sys.version_info >= (3, 11):
+- # python 3.11 has native support for un-str-able exceptions
+- result.stdout.fnmatch_lines(
+- ["E AssertionError: <exception str() failed>"]
+- )
+- else:
+- result.stdout.fnmatch_lines(
+- ["E AssertionError: <unprintable AssertionError object>"]
+- )
++ result.stdout.fnmatch_lines(["E AssertionError: <exception str() failed>"])
+
+
+ def test_issue_1944(pytester: Pytester) -> None:
diff --git a/gnu/packages/patches/python-2.7-expat-compat.patch b/gnu/packages/patches/python-2.7-expat-compat.patch
new file mode 100644
index 0000000000..9cbdf8bd6a
--- /dev/null
+++ b/gnu/packages/patches/python-2.7-expat-compat.patch
@@ -0,0 +1,59 @@
+Fix test failure with newer Expat:
+
+ https://bugs.python.org/issue46811
+
+This is a backport of this upstream commit:
+
+ https://github.com/python/cpython/commit/2cae93832f46b245847bdc252456ddf7742ef45e
+
+diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
+index 2eb642395b..1793f9365d 100644
+--- a/Lib/test/test_minidom.py
++++ b/Lib/test/test_minidom.py
+@@ -6,12 +6,14 @@ from StringIO import StringIO
+ from test import support
+ import unittest
+
++import pyexpat
+ import xml.dom
+ import xml.dom.minidom
+ import xml.parsers.expat
+
+ from xml.dom.minidom import parse, Node, Document, parseString
+ from xml.dom.minidom import getDOMImplementation
++from xml.parsers.expat import ExpatError
+
+
+ tstfile = support.findfile("test.xml", subdir="xmltestdata")
+@@ -1051,7 +1053,13 @@ class MinidomTest(unittest.TestCase):
+
+ # Verify that character decoding errors raise exceptions instead
+ # of crashing
+- self.assertRaises(UnicodeDecodeError, parseString,
++ if pyexpat.version_info >= (2, 4, 5):
++ self.assertRaises(ExpatError, parseString,
++ b'<fran\xe7ais></fran\xe7ais>')
++ self.assertRaises(ExpatError, parseString,
++ b'<franais>Comment \xe7a va ? Tr\xe8s bien ?</franais>')
++ else:
++ self.assertRaises(UnicodeDecodeError, parseString,
+ '<fran\xe7ais>Comment \xe7a va ? Tr\xe8s bien ?</fran\xe7ais>')
+
+ doc.unlink()
+diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
+index c75d55f05c..0855bc07ca 100644
+--- a/Lib/test/test_xml_etree.py
++++ b/Lib/test/test_xml_etree.py
+@@ -1482,12 +1482,6 @@ class BugsTest(unittest.TestCase):
+ b"<?xml version='1.0' encoding='ascii'?>\n"
+ b'<body>t&#227;g</body>')
+
+- def test_issue3151(self):
+- e = ET.XML('<prefix:localname xmlns:prefix="${stuff}"/>')
+- self.assertEqual(e.tag, '{${stuff}}localname')
+- t = ET.ElementTree(e)
+- self.assertEqual(ET.tostring(e), b'<ns0:localname xmlns:ns0="${stuff}" />')
+-
+ def test_issue6565(self):
+ elem = ET.XML("<body><tag/></body>")
+ self.assertEqual(summarize_list(elem), ['tag'])
diff --git a/gnu/packages/patches/python-3-fix-tests.patch b/gnu/packages/patches/python-3-fix-tests.patch
index b44e743c71..d31af35630 100644
--- a/gnu/packages/patches/python-3-fix-tests.patch
+++ b/gnu/packages/patches/python-3-fix-tests.patch
@@ -6,34 +6,12 @@ Subject: [PATCH] Skip problematic Python 3 tests in Guix.
A subset of the hunks in this patch is tracked upstream at
https://bugs.python.org/issue38845, which was contributed by Tanguy Le
Carrour <tanguy@bioneland.org>.
----
- Lib/ctypes/test/test_callbacks.py | 3 +++
- Lib/ctypes/test/test_find.py | 1 +
- Lib/ctypes/test/test_libc.py | 3 +++
- Lib/distutils/tests/test_archive_util.py | 2 ++
- Lib/distutils/tests/test_sdist.py | 1 +
- Lib/test/_test_multiprocessing.py | 2 ++
- Lib/test/test_asyncio/test_base_events.py | 2 ++
- Lib/test/test_generators.py | 1 +
- Lib/test/test_pathlib.py | 3 +--
- Lib/test/test_pdb.py | 4 ++--
- Lib/test/test_regrtest.py | 2 ++
- Lib/test/test_resource.py | 1 +
- Lib/test/test_shutil.py | 2 ++
- Lib/test/test_signal.py | 4 ++++
- Lib/test/test_socket.py | 8 ++++++++
- Lib/test/test_spwd.py | 6 ++----
- Lib/test/test_tarfile.py | 9 ++++++---
- Lib/test/test_threading.py | 3 +++
- Lib/test/test_unicodedata.py | 1 +
- Tools/scripts/run_tests.py | 2 +-
- 20 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
index d8e9c5a760..94fc5929c9 100644
--- a/Lib/ctypes/test/test_callbacks.py
+++ b/Lib/ctypes/test/test_callbacks.py
-@@ -5,6 +5,7 @@ from test import support
+@@ -5,6 +5,7 @@
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test
@@ -41,7 +19,7 @@ index d8e9c5a760..94fc5929c9 100644
class Callbacks(unittest.TestCase):
functype = CFUNCTYPE
-@@ -178,6 +179,8 @@ class SampleCallbacksTestCase(unittest.TestCase):
+@@ -178,6 +179,8 @@ def func(x):
self.assertLess(diff, 0.01, "%s not less than 0.01" % diff)
@@ -51,10 +29,10 @@ index d8e9c5a760..94fc5929c9 100644
from ctypes.util import find_library
libc_path = find_library("c")
diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py
-index 92ac1840ad..c8eb75dedd 100644
+index 1ff9d019b1..5194954914 100644
--- a/Lib/ctypes/test/test_find.py
+++ b/Lib/ctypes/test/test_find.py
-@@ -116,6 +116,7 @@ class FindLibraryLinux(unittest.TestCase):
+@@ -117,6 +117,7 @@ def test_find_library_with_gcc(self):
with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
self.assertNotEqual(find_library('c'), None)
@@ -66,7 +44,7 @@ diff --git a/Lib/ctypes/test/test_libc.py b/Lib/ctypes/test/test_libc.py
index 56285b5ff8..c088ab3db8 100644
--- a/Lib/ctypes/test/test_libc.py
+++ b/Lib/ctypes/test/test_libc.py
-@@ -2,6 +2,7 @@ import unittest
+@@ -2,6 +2,7 @@
from ctypes import *
import _ctypes_test
@@ -74,7 +52,7 @@ index 56285b5ff8..c088ab3db8 100644
lib = CDLL(_ctypes_test.__file__)
-@@ -17,6 +18,8 @@ class LibTest(unittest.TestCase):
+@@ -17,6 +18,8 @@ def test_sqrt(self):
import math
self.assertEqual(lib.my_sqrt(2.0), math.sqrt(2.0))
@@ -84,10 +62,10 @@ index 56285b5ff8..c088ab3db8 100644
comparefunc = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_char))
lib.my_qsort.argtypes = c_void_p, c_size_t, c_size_t, comparefunc
diff --git a/Lib/distutils/tests/test_archive_util.py b/Lib/distutils/tests/test_archive_util.py
-index e9aad0e40f..8bbaa51ee5 100644
+index edcec2513e..a716150763 100644
--- a/Lib/distutils/tests/test_archive_util.py
+++ b/Lib/distutils/tests/test_archive_util.py
-@@ -333,6 +333,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
+@@ -335,6 +335,7 @@ def test_make_archive_xztar(self):
self.assertEqual(os.path.basename(res), 'archive.tar.xz')
self.assertEqual(self._tarinfo(res), self._created_files)
@@ -95,7 +73,7 @@ index e9aad0e40f..8bbaa51ee5 100644
def test_make_archive_owner_group(self):
# testing make_archive with owner and group, with various combinations
# this works even if there's not gid/uid support
-@@ -362,6 +363,7 @@ class ArchiveUtilTestCase(support.TempdirManager,
+@@ -364,6 +365,7 @@ def test_make_archive_owner_group(self):
@unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
@unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
@@ -104,10 +82,10 @@ index e9aad0e40f..8bbaa51ee5 100644
tmpdir = self._create_files()
base_name = os.path.join(self.mkdtemp(), 'archive')
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
-index 23db126959..6e2329df7d 100644
+index 752e9db5ba..c66b6323e4 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
-@@ -443,6 +443,7 @@ class SDistTestCase(BasePyPIRCCommandTestCase):
+@@ -444,6 +444,7 @@ def test_manual_manifest(self):
"The tar command is not found")
@unittest.skipIf(find_executable('gzip') is None,
"The gzip command is not found")
@@ -116,10 +94,10 @@ index 23db126959..6e2329df7d 100644
# now building a sdist
dist, cmd = self.get_cmd()
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
-index e47905c863..31a5a9c308 100644
+index 8dced90c53..59947e3023 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
-@@ -1577,6 +1577,7 @@ class _TestCondition(BaseTestCase):
+@@ -1589,6 +1589,7 @@ def _test_wait_result(cls, c, pid):
if pid is not None:
os.kill(pid, signal.SIGINT)
@@ -127,7 +105,7 @@ index e47905c863..31a5a9c308 100644
def test_wait_result(self):
if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
pid = os.getpid()
-@@ -3905,6 +3906,7 @@ class _TestSharedMemory(BaseTestCase):
+@@ -4008,6 +4009,7 @@ def test_shared_memory_across_processes(self):
sms.close()
@unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
@@ -136,10 +114,10 @@ index e47905c863..31a5a9c308 100644
# bpo-36368: protect SharedMemoryManager server process from
# KeyboardInterrupt signals.
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
-index 533d5cc7f5..c4f860cc3b 100644
+index d77bf95a7b..79912c8230 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
-@@ -1341,6 +1341,8 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
+@@ -1359,6 +1359,8 @@ def test_create_connection_no_inet_pton(self, m_socket):
self._test_create_connection_ip_addr(m_socket, False)
@patch_socket
@@ -149,10 +127,10 @@ index 533d5cc7f5..c4f860cc3b 100644
m_socket.getaddrinfo = socket.getaddrinfo
sock = m_socket.socket.return_value
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
-index 3bf1522808..04bac8a7db 100644
+index 3bf5f3b743..23368c8d8b 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
-@@ -33,6 +33,7 @@ class SignalAndYieldFromTest(unittest.TestCase):
+@@ -33,6 +33,7 @@ def generator2(self):
else:
return "FAILED"
@@ -161,42 +139,40 @@ index 3bf1522808..04bac8a7db 100644
gen = self.generator1()
gen.send(None)
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
-index 3da35710b9..5404f9193d 100644
+index bf3fc5fb24..21015403f3 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
-@@ -2408,8 +2408,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
- self.assertEqual(given, expect)
- self.assertEqual(set(p.rglob("FILEd*")), set())
-
-- @unittest.skipUnless(hasattr(pwd, 'getpwall'),
-- 'pwd module does not expose getpwall()')
+@@ -2546,6 +2546,7 @@ def test_rglob(self):
+ 'pwd module does not expose getpwall()')
+ @unittest.skipIf(sys.platform == "vxworks",
+ "no home directory on VxWorks")
+ @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
def test_expanduser(self):
P = self.cls
- support.import_module('pwd')
+ import_helper.import_module('pwd')
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
-index 8016f81e5a..10190486b4 100644
+index 6ac1a4a3c3..4f58cf9b40 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
-@@ -1219,11 +1219,11 @@ def test_pdb_issue_20766():
+@@ -1315,11 +1315,11 @@ def test_pdb_issue_20766():
> <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
-> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
(Pdb) continue
- pdb 1: <built-in function default_int_handler>
+ pdb 1: Handlers.SIG_IGN
- > <doctest test.test_pdb.test_pdb_issue_20766[0]>(5)test_function()
- -> sess.set_trace(sys._getframe())
+ > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+ -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
(Pdb) continue
- pdb 2: <built-in function default_int_handler>
+ pdb 2: Handlers.SIG_IGN
"""
-
+ def test_pdb_issue_43318():
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
-index a77638b10a..2069b349a8 100644
+index 62e6c28280..7ffee56635 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
-@@ -811,6 +811,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -810,6 +810,7 @@ def test_fromfile(self):
output = self.run_tests('--fromfile', filename)
self.check_executed_tests(output, tests)
@@ -204,7 +180,7 @@ index a77638b10a..2069b349a8 100644
def test_interrupted(self):
code = TEST_INTERRUPTED
test = self.create_test('sigint', code=code)
-@@ -828,6 +829,7 @@ class ArgsTestCase(BaseTestCase):
+@@ -827,6 +828,7 @@ def test_slowest(self):
% (self.TESTNAME_REGEX, len(tests)))
self.check_line(output, regex)
@@ -213,10 +189,10 @@ index a77638b10a..2069b349a8 100644
# Issue #25373: test --slowest with an interrupted test
code = TEST_INTERRUPTED
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
-index e5ece5284c..5299e54507 100644
+index f2642c6ba1..4358a20dae 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
-@@ -148,6 +148,7 @@ class ResourceTest(unittest.TestCase):
+@@ -150,6 +150,7 @@ def test_freebsd_contants(self):
@unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
@support.requires_linux_version(2, 6, 36)
@@ -225,10 +201,10 @@ index e5ece5284c..5299e54507 100644
self.assertRaises(TypeError, resource.prlimit)
self.assertRaises(ProcessLookupError, resource.prlimit,
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
-index e19af64be0..1b893df6fa 100644
+index 62e9180375..3eda176fa3 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
-@@ -1427,6 +1427,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+@@ -1497,6 +1497,7 @@ def test_make_archive(self):
base_name = os.path.join(tmpdir, 'archive')
self.assertRaises(ValueError, make_archive, base_name, 'xxx')
@@ -236,7 +212,7 @@ index e19af64be0..1b893df6fa 100644
@support.requires_zlib()
def test_make_archive_owner_group(self):
# testing make_archive with owner and group, with various combinations
-@@ -1455,6 +1456,7 @@ class TestArchives(BaseTest, unittest.TestCase):
+@@ -1525,6 +1526,7 @@ def test_make_archive_owner_group(self):
self.assertTrue(os.path.isfile(res))
@@ -245,10 +221,10 @@ index e19af64be0..1b893df6fa 100644
@unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
def test_tarfile_root_owner(self):
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
-index 45553a6a42..55623f01a3 100644
+index c2b5861fc3..3c7a9c42cb 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
-@@ -78,6 +78,7 @@ class PosixTests(unittest.TestCase):
+@@ -89,6 +89,7 @@ def test_valid_signals(self):
self.assertLess(len(s), signal.NSIG)
@unittest.skipUnless(sys.executable, "sys.executable required.")
@@ -256,7 +232,7 @@ index 45553a6a42..55623f01a3 100644
def test_keyboard_interrupt_exit_code(self):
"""KeyboardInterrupt triggers exit via SIGINT."""
process = subprocess.run(
-@@ -128,6 +129,7 @@ class WindowsSignalTests(unittest.TestCase):
+@@ -139,6 +140,7 @@ def test_issue9324(self):
signal.signal(7, handler)
@unittest.skipUnless(sys.executable, "sys.executable required.")
@@ -264,7 +240,7 @@ index 45553a6a42..55623f01a3 100644
def test_keyboard_interrupt_exit_code(self):
"""KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
# We don't test via os.kill(os.getpid(), signal.CTRL_C_EVENT) here
-@@ -1245,6 +1247,7 @@ class StressTest(unittest.TestCase):
+@@ -1322,6 +1324,7 @@ def cycle_handlers():
class RaiseSignalTest(unittest.TestCase):
@@ -272,7 +248,7 @@ index 45553a6a42..55623f01a3 100644
def test_sigint(self):
with self.assertRaises(KeyboardInterrupt):
signal.raise_signal(signal.SIGINT)
-@@ -1275,6 +1278,7 @@ class RaiseSignalTest(unittest.TestCase):
+@@ -1352,6 +1355,7 @@ def handler(a, b):
class PidfdSignalTest(unittest.TestCase):
@@ -281,10 +257,10 @@ index 45553a6a42..55623f01a3 100644
hasattr(signal, "pidfd_send_signal"),
"pidfd support not built in",
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
-index aefba4f397..6c89f558d5 100755
+index 9c5f6d3dc9..ef74fc5694 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
-@@ -1009,6 +1009,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1006,6 +1006,8 @@ def testHostnameRes(self):
if not fqhn in all_host_names:
self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
@@ -293,16 +269,16 @@ index aefba4f397..6c89f558d5 100755
def test_host_resolution(self):
for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
self.assertEqual(socket.gethostbyname(addr), addr)
-@@ -1140,6 +1142,8 @@ class GeneralModuleTests(unittest.TestCase):
- self.assertWarns(DeprecationWarning, socket.ntohs, k)
- self.assertWarns(DeprecationWarning, socket.htons, k)
+@@ -1136,6 +1138,8 @@ def testNtoHErrors(self):
+ self.assertRaises(OverflowError, socket.ntohl, k)
+ self.assertRaises(OverflowError, socket.htonl, k)
+ @unittest.skipUnless(os.path.exists("/etc/services"),
+ "getservbyname uses /etc/services, which is not in the chroot")
def testGetServBy(self):
eq = self.assertEqual
# Find one service that exists, then check all the related interfaces.
-@@ -1489,6 +1493,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1485,6 +1489,8 @@ def test_sio_loopback_fast_path(self):
raise
self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
@@ -311,7 +287,7 @@ index aefba4f397..6c89f558d5 100755
def testGetaddrinfo(self):
try:
socket.getaddrinfo('localhost', 80)
-@@ -1571,6 +1577,8 @@ class GeneralModuleTests(unittest.TestCase):
+@@ -1567,6 +1573,8 @@ def test_getnameinfo(self):
# only IP addresses are allowed
self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
@@ -321,11 +297,11 @@ index aefba4f397..6c89f558d5 100755
'network is not enabled')
def test_idna(self):
diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
-index 07793c84c8..fec672bcbe 100644
+index a143acc659..f7207887c0 100644
--- a/Lib/test/test_spwd.py
+++ b/Lib/test/test_spwd.py
-@@ -5,8 +5,7 @@ from test import support
- spwd = support.import_module('spwd')
+@@ -6,8 +6,7 @@
+ spwd = import_helper.import_module('spwd')
-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
@@ -334,7 +310,7 @@ index 07793c84c8..fec672bcbe 100644
class TestSpwdRoot(unittest.TestCase):
def test_getspall(self):
-@@ -56,8 +55,7 @@ class TestSpwdRoot(unittest.TestCase):
+@@ -57,8 +56,7 @@ def test_getspnam(self):
self.assertRaises(TypeError, spwd.getspnam, bytes_name)
@@ -345,10 +321,10 @@ index 07793c84c8..fec672bcbe 100644
def test_getspnam_exception(self):
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
-index 29cde91bf7..8d0f20e8bf 100644
+index c658cca7a7..b7188e411e 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
-@@ -2607,9 +2607,12 @@ def root_is_uid_gid_0():
+@@ -2737,9 +2737,12 @@ def root_is_uid_gid_0():
import pwd, grp
except ImportError:
return False
@@ -365,18 +341,18 @@ index 29cde91bf7..8d0f20e8bf 100644
return True
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
-index c21cdf8eb7..6c9d575032 100644
+index c54806e594..d9bbca4e6a 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
-@@ -1398,6 +1398,7 @@ class MiscTestCase(unittest.TestCase):
-
+@@ -1620,6 +1620,7 @@ def check_interrupt_main_noerror(self, signum):
+ # Restore original handler
+ signal.signal(signum, handler)
- class InterruptMainTests(unittest.TestCase):
+ @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
def test_interrupt_main_subthread(self):
# Calling start_new_thread with a function that executes interrupt_main
# should raise KeyboardInterrupt upon completion.
-@@ -1409,6 +1410,8 @@ class InterruptMainTests(unittest.TestCase):
+@@ -1631,6 +1632,8 @@ def call_interrupt():
t.join()
t.join()
@@ -386,10 +362,10 @@ index c21cdf8eb7..6c9d575032 100644
# Make sure that if interrupt_main is called in main thread that
# KeyboardInterrupt is raised instantly.
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
-index b552d2bd17..28b1144e15 100644
+index 213b3cf252..a5edd4a119 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
-@@ -309,6 +309,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
+@@ -315,6 +315,7 @@ def test_linebreak_7643(self):
self.assertEqual(len(lines), 1,
r"\u%.4x should not be a linebreak" % i)
@@ -398,10 +374,10 @@ index b552d2bd17..28b1144e15 100644
@staticmethod
def check_version(testfile):
diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
-index bcfa5e943b..1f2484971b 100644
+index 48feb3f778..e82cafc88a 100644
--- a/Tools/scripts/run_tests.py
+++ b/Tools/scripts/run_tests.py
-@@ -41,7 +41,7 @@ def main(regrtest_args):
+@@ -40,7 +40,7 @@ def main(regrtest_args):
if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
args.extend(['-j', '0']) # Use all CPU cores
if not any(is_resource_use_flag(arg) for arg in regrtest_args):
@@ -410,6 +386,3 @@ index bcfa5e943b..1f2484971b 100644
args.extend(regrtest_args)
print(' '.join(args))
if sys.platform == 'win32':
---
-2.29.2
-
diff --git a/gnu/packages/patches/python-3-no-static-lib.patch b/gnu/packages/patches/python-3-no-static-lib.patch
deleted file mode 100644
index b44dbc976c..0000000000
--- a/gnu/packages/patches/python-3-no-static-lib.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: David Malcolm <dmalcolm@redhat.com>
-Date: Mon, 18 Jan 2010 17:59:07 +0000
-Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downstream only: not appropriate for upstream.
-
-See https://bugzilla.redhat.com/show_bug.cgi?id=556092
-
-Co-authored-by: David Malcolm <dmalcolm@redhat.com>
-Co-authored-by: Bohuslav Kabrda <bkabrda@redhat.com>
-Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
-Co-authored-by: Robert Kuska <rkuska@redhat.com>
-Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
-Co-authored-by: Miro Hrončok <miro@hroncok.cz>
----
- Makefile.pre.in | 21 ++-------------------
- 1 file changed, 2 insertions(+), 19 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 0c3981c132..5587422ec7 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -589,7 +589,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
- $(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)
-
- # Build the interpreter
--$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
-+$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
-
- platform: $(BUILDPYTHON) pybuilddir.txt
-@@ -637,12 +637,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
- _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-
--
--# Build static library
--$(LIBRARY): $(LIBRARY_OBJS)
-- -rm -f $@
-- $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS)
--
- libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
-@@ -724,7 +718,7 @@ Makefile Modules/config.c: Makefile.pre \
- @echo "The Makefile was updated, you may need to re-run make."
-
-
--Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
-+Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS)
- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)
-
- ############################################################################
-@@ -1652,17 +1646,6 @@ libainstall: @DEF_MAKE_RULE@ python-config
- else true; \
- fi; \
- done
-- @if test -d $(LIBRARY); then :; else \
-- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
-- if test "$(SHLIB_SUFFIX)" = .dll; then \
-- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
-- else \
-- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
-- fi; \
-- else \
-- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
-- fi; \
-- fi
- $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
- $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
- $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/gnu/packages/patches/python-execnet-read-only-fix.patch b/gnu/packages/patches/python-execnet-read-only-fix.patch
deleted file mode 100644
index 58a4b129a7..0000000000
--- a/gnu/packages/patches/python-execnet-read-only-fix.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 0d6562a20b0610c5a83d1c66ac879223b84a2746 Mon Sep 17 00:00:00 2001
-From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
-Date: Thu, 26 Aug 2021 00:43:26 -0400
-Subject: [PATCH] rsync_remote: Fix a problem when receiving read-only
- directories.
-
-Before this change, when the source directories hierarchy was
-read-only, the read-only mode would be preserved at the destination,
-preventing child directories to be recreated by a normal user (a
-permission denied error, EACCES would be raised).
-
-* execnet/rsync_remote.py (serve_rsync.receive_directory_structure):
-Bitwise OR to ensure the write bit is set on received directories.
-* testing/test_rsync.py (TestRSync)
-<test_read_only_directories>: New test.
----
- execnet/rsync_remote.py | 8 ++++++--
- testing/test_rsync.py | 17 +++++++++++++++++
- 2 files changed, 23 insertions(+), 2 deletions(-)
-
-diff --git a/execnet/rsync_remote.py b/execnet/rsync_remote.py
-index cd5e765..55d154c 100644
---- a/execnet/rsync_remote.py
-+++ b/execnet/rsync_remote.py
-@@ -35,7 +35,11 @@ def serve_rsync(channel):
- os.makedirs(path)
- mode = msg.pop(0)
- if mode:
-- os.chmod(path, mode)
-+ # Ensure directories are writable, otherwise a
-+ # permission denied error (EACCES) would be raised
-+ # when attempting to receive read-only directory
-+ # structures.
-+ os.chmod(path, mode | 0o700)
- entrynames = {}
- for entryname in msg:
- destpath = os.path.join(path, entryname)
-@@ -59,7 +63,7 @@ def serve_rsync(channel):
- checksum = md5(f.read()).digest()
- f.close()
- elif msg_mode and msg_mode != st.st_mode:
-- os.chmod(path, msg_mode)
-+ os.chmod(path, msg_mode | 0o700)
- return
- else:
- return # already fine
-diff --git a/testing/test_rsync.py b/testing/test_rsync.py
-index 995f229..1d6c30c 100644
---- a/testing/test_rsync.py
-+++ b/testing/test_rsync.py
-@@ -157,6 +157,23 @@ class TestRSync:
- mode = destdir.stat().mode
- assert mode & 511 == 504
-
-+ @py.test.mark.skipif("sys.platform == 'win32' or getattr(os, '_name', '') == 'nt'")
-+ def test_read_only_directories(self, dirs, gw1):
-+ source = dirs.source
-+ dest = dirs.dest1
-+ source.ensure("sub", "subsub", dir=True)
-+ source.join("sub").chmod(0o500)
-+ source.join("sub", "subsub").chmod(0o500)
-+
-+ # The destination directories should be created with the write
-+ # permission forced, to avoid raising an EACCES error.
-+ rsync = RSync(source)
-+ rsync.add_target(gw1, dest)
-+ rsync.send()
-+
-+ assert dest.join("sub").stat().mode & 0o700
-+ assert dest.join("sub").join("subsub").stat().mode & 0o700
-+
- @needssymlink
- def test_symlink_rsync(self, dirs, gw1):
- source = dirs.source
---
-2.32.0
-
diff --git a/gnu/packages/patches/python-feedparser-missing-import.patch b/gnu/packages/patches/python-feedparser-missing-import.patch
new file mode 100644
index 0000000000..6ed504c1d2
--- /dev/null
+++ b/gnu/packages/patches/python-feedparser-missing-import.patch
@@ -0,0 +1,34 @@
+Since feedparser messes with Python’s internals by assigning
+to __code__ it needs to import SGMLParseError too. It also
+expects SGMLParseError, which was turned into AssertionError by
+https://github.com/python/cpython/commit/e34bbfd61f405eef89e8aa50672b0b25022de320
+
+--- feedparser-6.0.10/feedparser/sgml.py.orig 2023-03-18 09:24:50.976316932 +0100
++++ feedparser-6.0.10/feedparser/sgml.py 2023-03-18 09:26:32.971928811 +0100
+@@ -28,6 +28,7 @@
+ import re
+
+ import sgmllib
++from sgmllib import SGMLParseError
+
+ __all__ = [
+ 'sgmllib',
+@@ -41,6 +42,7 @@
+ 'shorttagopen',
+ 'starttagopen',
+ 'endbracket',
++ 'SGMLParseError',
+ ]
+
+ # sgmllib defines a number of module-level regular expressions that are
+--- feedparser-6.0.10/feedparser/html.py.orig 2023-03-18 09:32:03.647114745 +0100
++++ feedparser-6.0.10/feedparser/html.py 2023-03-18 09:46:05.021142671 +0100
+@@ -349,7 +349,7 @@
+
+ try:
+ return sgmllib.SGMLParser.parse_declaration(self, i)
+- except sgmllib.SGMLParseError:
++ except AssertionError:
+ # Escape the doctype declaration and continue parsing.
+ self.handle_data('&lt;')
+ return i+1
diff --git a/gnu/packages/patches/python-magic-python-bytecode.patch b/gnu/packages/patches/python-magic-python-bytecode.patch
deleted file mode 100644
index 997fb4ee5a..0000000000
--- a/gnu/packages/patches/python-magic-python-bytecode.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-File 5.41 changed the MIME type of Python bytecode; adjust accordingly.
-
-Taken from upstream:
-
- https://github.com/ahupp/python-magic/commit/0ae7e7ceac0e80e03adc75c858bb378c0427331a
-
-diff --git a/test/test.py b/test/test.py
-index 0c4621c..e443b84 100755
---- a/test/test.py
-+++ b/test/test.py
-@@ -90,7 +90,7 @@ def test_mime_types(self):
- try:
- m = magic.Magic(mime=True)
- self.assert_values(m, {
-- 'magic._pyc_': ('application/octet-stream', 'text/x-bytecode.python'),
-+ 'magic._pyc_': ('application/octet-stream', 'text/x-bytecode.python', 'application/x-bytecode.python'),
- 'test.pdf': 'application/pdf',
- 'test.gz': ('application/gzip', 'application/x-gzip'),
- 'test.snappy.parquet': 'application/octet-stream',
diff --git a/gnu/packages/patches/python-parso-unit-tests-in-3.10.patch b/gnu/packages/patches/python-parso-unit-tests-in-3.10.patch
new file mode 100644
index 0000000000..1fc7fb701b
--- /dev/null
+++ b/gnu/packages/patches/python-parso-unit-tests-in-3.10.patch
@@ -0,0 +1,186 @@
+Patch from python-parso upstream.
+
+From cf5969d7a109798adbf9538d70e92138f077d700 Mon Sep 17 00:00:00 2001
+From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
+Date: Sun, 4 Dec 2022 13:29:25 +0100
+Subject: [PATCH 1/7] Fix unit tests in Python 3.10 (Closes: #192)
+
+---
+ parso/python/errors.py | 51 ++++++++++++++++++++++++++++++--------
+ test/test_python_errors.py | 23 +++++++++++++++++
+ 2 files changed, 64 insertions(+), 10 deletions(-)
+
+diff --git a/parso/python/errors.py b/parso/python/errors.py
+index 5da046a..09c5047 100644
+--- a/parso/python/errors.py
++++ b/parso/python/errors.py
+@@ -1,5 +1,6 @@
+ # -*- coding: utf-8 -*-
+ import codecs
++import sys
+ import warnings
+ import re
+ from contextlib import contextmanager
+@@ -33,7 +34,10 @@ def _get_rhs_name(node, version):
+ return "literal"
+ else:
+ if second.children[1] == ":" or second.children[0] == "**":
+- return "dict display"
++ if version < (3, 10):
++ return "dict display"
++ else:
++ return "dict literal"
+ else:
+ return "set display"
+ elif (
+@@ -47,7 +51,10 @@ def _get_rhs_name(node, version):
+ elif first == "[":
+ return "list"
+ elif first == "{" and second == "}":
+- return "dict display"
++ if version < (3, 10):
++ return "dict display"
++ else:
++ return "dict literal"
+ elif first == "{" and len(node.children) > 2:
+ return "set display"
+ elif type_ == "keyword":
+@@ -58,7 +65,10 @@ def _get_rhs_name(node, version):
+ else:
+ return str(node.value)
+ elif type_ == "operator" and node.value == "...":
+- return "Ellipsis"
++ if version < (3, 10):
++ return "Ellipsis"
++ else:
++ return "ellipsis"
+ elif type_ == "comparison":
+ return "comparison"
+ elif type_ in ("string", "number", "strings"):
+@@ -83,7 +93,10 @@ def _get_rhs_name(node, version):
+ or "_test" in type_
+ or type_ in ("term", "factor")
+ ):
+- return "operator"
++ if version < (3, 10):
++ return "operator"
++ else:
++ return "expression"
+ elif type_ == "star_expr":
+ return "starred"
+ elif type_ == "testlist_star_expr":
+@@ -610,7 +623,10 @@ class _NameChecks(SyntaxRule):
+
+ @ErrorFinder.register_rule(type='string')
+ class _StringChecks(SyntaxRule):
+- message = "bytes can only contain ASCII literal characters."
++ if sys.version_info < (3, 10):
++ message = "bytes can only contain ASCII literal characters."
++ else:
++ message = "bytes can only contain ASCII literal characters"
+
+ def is_issue(self, leaf):
+ string_prefix = leaf.string_prefix.lower()
+@@ -1043,14 +1059,20 @@ class _CheckAssignmentRule(SyntaxRule):
+ error = 'literal'
+ else:
+ if second.children[1] == ':':
+- error = 'dict display'
++ if self._normalizer.version < (3, 10):
++ error = 'dict display'
++ else:
++ error = 'dict literal'
+ else:
+ error = 'set display'
+ elif first == "{" and second == "}":
+ if self._normalizer.version < (3, 8):
+ error = 'literal'
+ else:
+- error = "dict display"
++ if self._normalizer.version < (3, 10):
++ error = "dict display"
++ else:
++ error = "dict literal"
+ elif first == "{" and len(node.children) > 2:
+ if self._normalizer.version < (3, 8):
+ error = 'literal'
+@@ -1083,7 +1105,10 @@ class _CheckAssignmentRule(SyntaxRule):
+ error = str(node.value)
+ elif type_ == 'operator':
+ if node.value == '...':
+- error = 'Ellipsis'
++ if self._normalizer.version < (3, 10):
++ error = 'Ellipsis'
++ else:
++ error = 'ellipsis'
+ elif type_ == 'comparison':
+ error = 'comparison'
+ elif type_ in ('string', 'number', 'strings'):
+@@ -1098,7 +1123,10 @@ class _CheckAssignmentRule(SyntaxRule):
+ if node.children[0] == 'await':
+ error = 'await expression'
+ elif node.children[-2] == '**':
+- error = 'operator'
++ if self._normalizer.version < (3, 10):
++ error = 'operator'
++ else:
++ error = 'expression'
+ else:
+ # Has a trailer
+ trailer = node.children[-1]
+@@ -1120,7 +1148,10 @@ class _CheckAssignmentRule(SyntaxRule):
+ elif ('expr' in type_ and type_ != 'star_expr' # is a substring
+ or '_test' in type_
+ or type_ in ('term', 'factor')):
+- error = 'operator'
++ if self._normalizer.version < (3, 10):
++ error = 'operator'
++ else:
++ error = 'expression'
+ elif type_ == "star_expr":
+ if is_deletion:
+ if self._normalizer.version >= (3, 9):
+diff --git a/test/test_python_errors.py b/test/test_python_errors.py
+index adf5f06..9686d14 100644
+--- a/test/test_python_errors.py
++++ b/test/test_python_errors.py
+@@ -1,6 +1,7 @@
+ """
+ Testing if parso finds syntax errors and indentation errors.
+ """
++import re
+ import sys
+ import warnings
+
+@@ -136,6 +137,28 @@ def _get_actual_exception(code):
+ wanted = 'SyntaxError: invalid syntax'
+ elif wanted == "SyntaxError: f-string: single '}' is not allowed":
+ wanted = 'SyntaxError: invalid syntax'
++ elif "Maybe you meant '==' instead of '='?" in wanted:
++ wanted = wanted.removesuffix(" here. Maybe you meant '==' instead of '='?")
++ elif re.match(
++ r"SyntaxError: unterminated string literal \(detected at line \d+\)", wanted
++ ):
++ wanted = "SyntaxError: EOL while scanning string literal"
++ elif re.match(
++ r"SyntaxError: unterminated triple-quoted string literal \(detected at line \d+\)",
++ wanted,
++ ):
++ wanted = 'SyntaxError: EOF while scanning triple-quoted string literal'
++ elif wanted == 'SyntaxError: cannot use starred expression here':
++ wanted = "SyntaxError: can't use starred expression here"
++ elif wanted == 'SyntaxError: f-string: cannot use starred expression here':
++ wanted = "SyntaxError: f-string: can't use starred expression here"
++ elif re.match(
++ r"IndentationError: expected an indented block after '[^']*' statement on line \d",
++ wanted,
++ ):
++ wanted = 'IndentationError: expected an indented block'
++ elif wanted == 'SyntaxError: unterminated string literal':
++ wanted = 'SyntaxError: EOL while scanning string literal'
+ return [wanted], line_nr
+
+
+--
+2.39.1
+
diff --git a/gnu/packages/patches/python-sgmllib3k-assertions.patch b/gnu/packages/patches/python-sgmllib3k-assertions.patch
new file mode 100644
index 0000000000..872f1c62c9
--- /dev/null
+++ b/gnu/packages/patches/python-sgmllib3k-assertions.patch
@@ -0,0 +1,221 @@
+Restores compatibility with Python >=3.9,
+which removed the custom .error() method in
+https://github.com/python/cpython/commit/e34bbfd61f405eef89e8aa50672b0b25022de320
+
+Despite the big diff, only a try…except clause is added.
+
+--- source/sgmllib.py 2023-03-18 08:57:58.726240606 +0100
++++ source/sgmllib.py 2023-03-18 09:02:01.667568916 +0100
+@@ -101,113 +101,116 @@
+ """Handle the remaining data."""
+ self.goahead(1)
+
+- def error(self, message):
+- raise SGMLParseError(message)
+-
+ # Internal -- handle data as far as reasonable. May leave state
+ # and data to be processed by a subsequent call. If 'end' is
+ # true, force handling all data as if followed by EOF marker.
+ def goahead(self, end):
+- rawdata = self.rawdata
+- i = 0
+- n = len(rawdata)
+- while i < n:
+- if self.nomoretags:
+- self.handle_data(rawdata[i:n])
+- i = n
+- break
+- match = interesting.search(rawdata, i)
+- if match: j = match.start()
+- else: j = n
+- if i < j:
+- self.handle_data(rawdata[i:j])
+- i = j
+- if i == n: break
+- if rawdata[i] == '<':
+- if starttagopen.match(rawdata, i):
++ try:
++ rawdata = self.rawdata
++ i = 0
++ n = len(rawdata)
++ while i < n:
++ if self.nomoretags:
++ self.handle_data(rawdata[i:n])
++ i = n
++ break
++ match = interesting.search(rawdata, i)
++ if match: j = match.start()
++ else: j = n
++ if i < j:
++ self.handle_data(rawdata[i:j])
++ i = j
++ if i == n: break
++ if rawdata[i] == '<':
++ if starttagopen.match(rawdata, i):
++ if self.literal:
++ self.handle_data(rawdata[i])
++ i = i+1
++ continue
++ k = self.parse_starttag(i)
++ if k < 0: break
++ i = k
++ continue
++ if rawdata.startswith("</", i):
++ k = self.parse_endtag(i)
++ if k < 0: break
++ i = k
++ self.literal = 0
++ continue
++ if self.literal:
++ if n > (i + 1):
++ self.handle_data("<")
++ i = i+1
++ else:
++ # incomplete
++ break
++ continue
++ if rawdata.startswith("<!--", i):
++ # Strictly speaking, a comment is --.*--
++ # within a declaration tag <!...>.
++ # This should be removed,
++ # and comments handled only in parse_declaration.
++ k = self.parse_comment(i)
++ if k < 0: break
++ i = k
++ continue
++ if rawdata.startswith("<?", i):
++ k = self.parse_pi(i)
++ if k < 0: break
++ i = i+k
++ continue
++ if rawdata.startswith("<!", i):
++ # This is some sort of declaration; in "HTML as
++ # deployed," this should only be the document type
++ # declaration ("<!DOCTYPE html...>").
++ k = self.parse_declaration(i)
++ if k < 0: break
++ i = k
++ continue
++ elif rawdata[i] == '&':
+ if self.literal:
+ self.handle_data(rawdata[i])
+ i = i+1
+ continue
+- k = self.parse_starttag(i)
+- if k < 0: break
+- i = k
+- continue
+- if rawdata.startswith("</", i):
+- k = self.parse_endtag(i)
+- if k < 0: break
+- i = k
+- self.literal = 0
+- continue
+- if self.literal:
+- if n > (i + 1):
+- self.handle_data("<")
+- i = i+1
+- else:
+- # incomplete
+- break
+- continue
+- if rawdata.startswith("<!--", i):
+- # Strictly speaking, a comment is --.*--
+- # within a declaration tag <!...>.
+- # This should be removed,
+- # and comments handled only in parse_declaration.
+- k = self.parse_comment(i)
+- if k < 0: break
+- i = k
+- continue
+- if rawdata.startswith("<?", i):
+- k = self.parse_pi(i)
+- if k < 0: break
+- i = i+k
+- continue
+- if rawdata.startswith("<!", i):
+- # This is some sort of declaration; in "HTML as
+- # deployed," this should only be the document type
+- # declaration ("<!DOCTYPE html...>").
+- k = self.parse_declaration(i)
+- if k < 0: break
+- i = k
+- continue
+- elif rawdata[i] == '&':
+- if self.literal:
++ match = charref.match(rawdata, i)
++ if match:
++ name = match.group(1)
++ self.handle_charref(name)
++ i = match.end(0)
++ if rawdata[i-1] != ';': i = i-1
++ continue
++ match = entityref.match(rawdata, i)
++ if match:
++ name = match.group(1)
++ self.handle_entityref(name)
++ i = match.end(0)
++ if rawdata[i-1] != ';': i = i-1
++ continue
++ else:
++ self.error('neither < nor & ??')
++ # We get here only if incomplete matches but
++ # nothing else
++ match = incomplete.match(rawdata, i)
++ if not match:
+ self.handle_data(rawdata[i])
+ i = i+1
+ continue
+- match = charref.match(rawdata, i)
+- if match:
+- name = match.group(1)
+- self.handle_charref(name)
+- i = match.end(0)
+- if rawdata[i-1] != ';': i = i-1
+- continue
+- match = entityref.match(rawdata, i)
+- if match:
+- name = match.group(1)
+- self.handle_entityref(name)
+- i = match.end(0)
+- if rawdata[i-1] != ';': i = i-1
+- continue
+- else:
+- self.error('neither < nor & ??')
+- # We get here only if incomplete matches but
+- # nothing else
+- match = incomplete.match(rawdata, i)
+- if not match:
+- self.handle_data(rawdata[i])
+- i = i+1
+- continue
+- j = match.end(0)
+- if j == n:
+- break # Really incomplete
+- self.handle_data(rawdata[i:j])
+- i = j
+- # end while
+- if end and i < n:
+- self.handle_data(rawdata[i:n])
+- i = n
+- self.rawdata = rawdata[i:]
+- # XXX if end: check for empty stack
++ j = match.end(0)
++ if j == n:
++ break # Really incomplete
++ self.handle_data(rawdata[i:j])
++ i = j
++ # end while
++ if end and i < n:
++ self.handle_data(rawdata[i:n])
++ i = n
++ self.rawdata = rawdata[i:]
++ # XXX if end: check for empty stack
++ except AssertionError as e:
++ # The .error() method, which threw the custom SGMLParseError was removed
++ # by https://github.com/python/cpython/issues/76025. So we have to catch
++ # _markupbase’s AssertionError and translate it into the old one.
++ raise SGMLParseError (e.args[0]) from e
+
+ # Extensions for the DOCTYPE scanner:
+ _decl_otherchars = '='
diff --git a/gnu/packages/patches/python-shiboken-2-compat.patch b/gnu/packages/patches/python-shiboken-2-compat.patch
new file mode 100644
index 0000000000..48aa74173b
--- /dev/null
+++ b/gnu/packages/patches/python-shiboken-2-compat.patch
@@ -0,0 +1,15 @@
+Backport a fix from 5.15.9, mentioned in [1].
+
+[1] https://bugreports.qt.io/browse/PYSIDE-2176
+
+--- pyside-setup-opensource-src-5.15.8/sources/shiboken2/libshiboken/pep384impl.cpp 2023-04-24 11:05:48.770934499 +0200
++++ pyside-setup-opensource-src-5.15.8/sources/shiboken2/libshiboken/pep384impl.cpp 2023-04-24 11:04:51.566943936 +0200
+@@ -751,7 +751,7 @@
+ #endif // IS_PY2
+ Shiboken::AutoDecRef privateobj(PyObject_GetAttr(
+ reinterpret_cast<PyObject *>(Py_TYPE(self)), Shiboken::PyMagicName::name()));
+-#ifndef Py_LIMITED_API
++#ifdef IS_PY2
+ return _Py_Mangle(privateobj, name);
+ #else
+ // PYSIDE-1436: _Py_Mangle is no longer exposed; implement it always.
diff --git a/gnu/packages/patches/python-sip-include-dirs.patch b/gnu/packages/patches/python-sip-include-dirs.patch
new file mode 100644
index 0000000000..f2ef8fc1b2
--- /dev/null
+++ b/gnu/packages/patches/python-sip-include-dirs.patch
@@ -0,0 +1,20 @@
+Add an environment variable to python-sip that extends its search
+directories for .sip files.
+
+It seems that we cannot easily change the destination folder of these
+files though, so this variable must be set on a per-package basis (and
+non through search-path).
+
+--- sip/sipbuild/builder.py 2023-03-22 09:06:37.588792878 +0100
++++ sip/sipbuild/builder.py 2023-03-22 09:10:35.830181134 +0100
+@@ -254,6 +254,10 @@
+ os.path.join(project.target_dir,
+ project.get_bindings_dir()))
+
++ # Add extra bindings from environment for GNU Guix.
++ if 'SIP_INCLUDE_DIRS' in os.environ:
++ sip_include_dirs.extend(os.environ['SIP_INCLUDE_DIRS'].split(os.pathsep))
++
+ # Generate the sip.h file for the shared sip module.
+ copy_sip_h(abi_major_version, project.build_dir,
+ project.sip_module, version_info=project.version_info)
diff --git a/gnu/packages/patches/python-typeguard-python3.10.patch b/gnu/packages/patches/python-typeguard-python3.10.patch
new file mode 100644
index 0000000000..29321d8918
--- /dev/null
+++ b/gnu/packages/patches/python-typeguard-python3.10.patch
@@ -0,0 +1,47 @@
+Taken from Gentoo, which adapted
+https://github.com/agronholm/typeguard/commit/e0db07a777d5a481eaba6162354adf32286ce21b
+
+diff --git a/src/typeguard/__init__.py b/src/typeguard/__init__.py
+index 5684d63..27fa30b 100644
+--- a/src/typeguard/__init__.py
++++ b/src/typeguard/__init__.py
+@@ -61,22 +61,25 @@ except ImportError:
+ from typing import _ForwardRef as ForwardRef
+ evaluate_forwardref = ForwardRef._eval_type
+
+-if sys.version_info >= (3, 10):
+- from typing import is_typeddict
+-else:
+- _typed_dict_meta_types = ()
+- if sys.version_info >= (3, 8):
+- from typing import _TypedDictMeta
+- _typed_dict_meta_types += (_TypedDictMeta,)
++try:
++ from typing_extensions import is_typeddict
++except ImportError:
++ if sys.version_info >= (3, 10):
++ from typing import is_typeddict
++ else:
++ _typed_dict_meta_types = ()
++ if sys.version_info >= (3, 8):
++ from typing import _TypedDictMeta
++ _typed_dict_meta_types += (_TypedDictMeta,)
+
+- try:
+- from typing_extensions import _TypedDictMeta
+- _typed_dict_meta_types += (_TypedDictMeta,)
+- except ImportError:
+- pass
++ try:
++ from typing_extensions import _TypedDictMeta
++ _typed_dict_meta_types += (_TypedDictMeta,)
++ except ImportError:
++ pass
+
+- def is_typeddict(tp) -> bool:
+- return isinstance(tp, _typed_dict_meta_types)
++ def is_typeddict(tp) -> bool:
++ return isinstance(tp, _typed_dict_meta_types)
+
+
+ if TYPE_CHECKING:
diff --git a/gnu/packages/patches/python-unittest2-python3-compat.patch b/gnu/packages/patches/python-unittest2-python3-compat.patch
index fe0afe559a..68fbccacd0 100644
--- a/gnu/packages/patches/python-unittest2-python3-compat.patch
+++ b/gnu/packages/patches/python-unittest2-python3-compat.patch
@@ -32,3 +32,15 @@ index 683f662..347eea5 100644
def test_loadTestsFromNames__relative_malformed_name(self):
loader = unittest.TestLoader()
+diff --git a/unittest2/compatibility.py b/unittest2/compatibility.py
+index 9e5f1a5..2d20c19 100644
+--- a/unittest2/compatibility.py
++++ b/unittest2/compatibility.py
+@@ -140,6 +140,6 @@ except ImportError:
+ ### ChainMap (helper for configparser and string.Template)
+ ########################################################################
+
+-class ChainMap(collections.MutableMapping):
++class ChainMap(collections.abc.MutableMapping):
+ ''' A ChainMap groups multiple dicts (or other mappings) together
+ to create a single, updateable view.
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch
new file mode 100644
index 0000000000..f7a0c03fdd
--- /dev/null
+++ b/gnu/packages/patches/scribus-1.5.8-poppler-22.03.0.patch
@@ -0,0 +1,52 @@
+From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:22:53 +0000
+Subject: [PATCH] #16764: Build break with poppler 22.03.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
+index 154e58a3f0..392dcd9e64 100644
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
+ #endif
+ globalParams->setErrQuiet(gTrue);
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++ PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++#else
+ PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
++#endif
+ if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+ return QImage();
+
+@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
+ globalParams->setErrQuiet(gTrue);
+ // globalParams->setPrintCommands(gTrue);
+ QList<OptionalContentGroup*> ocgGroups;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++ auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++#else
+ auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++#endif
+ if (pdfDoc)
+ {
+ if (pdfDoc->getErrorCode() == errEncrypted)
+@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
+ #else
+ auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++ std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
++ pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++#else
+ auto userPW = new GooString(text.toLocal8Bit().data());
+ pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
++#endif
+ qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+ }
+ if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch
new file mode 100644
index 0000000000..290484e7e8
--- /dev/null
+++ b/gnu/packages/patches/scribus-1.5.8-poppler-22.04.0.patch
@@ -0,0 +1,291 @@
+https://bugs.gentoo.org/843287
+https://github.com/scribusproject/scribus/commit/f2237b8f0b5cf7690e864a22ef7a63a6d769fa36.patch
+
+From f2237b8f0b5cf7690e864a22ef7a63a6d769fa36 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Fri, 1 Apr 2022 23:52:32 +0000
+Subject: [PATCH] Fix build with poppler 22.04.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25074 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 123 ++++++++++++++---------
+ 1 file changed, 78 insertions(+), 45 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index e20a81f99e..5626fe3477 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
+ int shade = 100;
+ currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
+ fontSize = state->getFontSize();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ if (state->getFont() && state->getFont()->getName())
++ fontName = new GooString(state->getFont()->getName().value());
++#else
+ if (state->getFont())
+ fontName = state->getFont()->getName()->copy();
++#endif
+ itemText = s->copy();
+ }
+
+@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
+ GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
+ {
+ SlaOutputDev *dev = (SlaOutputDev*)user_data;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ const PDFRectangle& annotRect = annota->getRect();;
++ const PDFRectangle* box = &annotRect;
++#else
+ PDFRectangle *box = annota->getRect();
++#endif
+ double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
+ double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
+ double width = box->x2 - box->x1;
+@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
+ if (apa || !achar)
+ {
+ AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ const PDFRectangle& annotaRect = annota->getRect();
++ Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
++#else
+ Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++#endif
+ ano->draw(gfx, false);
+ if (!bgFound)
+ m_currColorFill = annotOutDev->currColorFill;
+@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+- GfxFont *gfxFont;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ std::optional<GfxFontLoc> fontLoc;
++ std::string fileName;
++ std::unique_ptr<FoFiTrueType> ff;
++ std::optional<std::vector<unsigned char>> tmpBuf;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ std::optional<GfxFontLoc> fontLoc;
+ const GooString * fileName = nullptr;
+ std::unique_ptr<FoFiTrueType> ff;
++ char* tmpBuf = nullptr;
+ #else
+ GfxFontLoc * fontLoc = nullptr;
+ GooString * fileName = nullptr;
+ FoFiTrueType * ff = nullptr;
++ char* tmpBuf = nullptr;
+ #endif
+ GfxFontType fontType;
+ SlaOutFontFileID *id;
+ SplashFontFile *fontFile;
+ SplashFontSrc *fontsrc = nullptr;
+ Object refObj, strObj;
+- char *tmpBuf = nullptr;
+ int tmpBufLen = 0;
+ int *codeToGID = nullptr;
+ const double *textMat = nullptr;
+@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+
+ m_font = nullptr;
+
+- gfxFont = state->getFont();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ GfxFont* gfxFont = state->getFont().get();
++#else
++ GfxFont* gfxFont = state->getFont();
++#endif
+ if (!gfxFont)
+ goto err1;
+
+@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
+ if (fontLoc->locType == gfxFontLocEmbedded)
+ {
+ // if there is an embedded font, read it to memory
+- tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
+ if (! tmpBuf)
+ goto err2;
++#else
++ tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++ if (!tmpBuf)
++ goto err2;
++#endif
+
+ // external font
+ }
+ else
+ { // gfxFontLocExternal
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ fileName = fontLoc->path;
++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+ fileName = fontLoc->pathAsGooString();
+ #else
+ fileName = fontLoc->path;
+@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
+ }
+
+ fontsrc = new SplashFontSrc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ if (!fileName.empty())
++ fontsrc->setFile(fileName);
++ else
++ fontsrc->setBuf(std::move(tmpBuf.value()));
++#else
+ if (fileName)
+ fontsrc->setFile(fileName, gFalse);
+ else
+ fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++#endif
+
+ // load the font file
+ switch (fontType) {
+ case fontType1:
+- if (!(fontFile = m_fontEngine->loadType1Font(
+- id,
+- fontsrc,
+- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++ if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ {
+- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontType1C:
+- if (!(fontFile = m_fontEngine->loadType1CFont(
+- id,
+- fontsrc,
+- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++ if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ {
+- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontType1COT:
+- if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
+- id,
+- fontsrc,
+- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++ if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
+ {
+- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontTrueType:
+ case fontTrueTypeOT:
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ if (!fileName.empty())
++ ff = FoFiTrueType::load(fileName.c_str());
++ else
++ ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ if (fileName)
+ ff = FoFiTrueType::load(fileName->getCString());
+ else
+ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ if (ff)
+ {
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ codeToGID = nullptr;
+ n = 0;
+ }
+- if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+- id,
+- fontsrc,
+- codeToGID, n)))
++ if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
+ {
+- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ goto err2;
+ }
+ break;
+ case fontCIDType0:
+ case fontCIDType0C:
+- if (!(fontFile = m_fontEngine->loadCIDFont(
+- id,
+- fontsrc)))
++ if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
+ {
+- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ goto err2;
+ }
+ break;
+@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
+ codeToGID = nullptr;
+ n = 0;
+ }
+- if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
+- id,
+- fontsrc,
+- codeToGID, n)))
++ if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
+ {
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
+ }
+ else
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
++ if (!fileName.empty())
++ ff = FoFiTrueType::load(fileName.c_str());
++ else
++ ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
++#else
+ if (fileName)
+ ff = FoFiTrueType::load(fileName->getCString());
+ else
+ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++#endif
+ if (! ff)
+ goto err2;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
+@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
+ delete ff;
+ #endif
+ }
+- if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+- id,
+- fontsrc,
+- codeToGID, n, faceIndex)))
++ if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
+ {
+- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
+- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ goto err2;
+ }
+ break;
+@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
+ GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
+ {
+ // qDebug() << "beginType3Char";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
+ GfxFont *gfxFont;
++ if (!(gfxFont = state->getFont().get()))
++ return gTrue;
++#else
++ GfxFont* gfxFont;
+ if (!(gfxFont = state->getFont()))
+ return gTrue;
++#endif
+ if (gfxFont->getType() != fontType3)
+ return gTrue;
+ F3Entry f3e;
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch
new file mode 100644
index 0000000000..106a6f5162
--- /dev/null
+++ b/gnu/packages/patches/scribus-1.5.8-poppler-22.09.0.patch
@@ -0,0 +1,20 @@
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -3741,9 +3741,16 @@ void SlaOutputDev::getPenState(GfxState *state)
+ break;
+ }
+ double lw = state->getLineWidth();
+- double *dashPattern;
+ int dashLength;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 9, 0)
++ const double *dashPattern;
++ const std::vector<double> &dash = state->getLineDash(&DashOffset);
++ dashPattern = dash.data();
++ dashLength = dash.size();
++#else
++ double *dashPattern;
+ state->getLineDash(&dashPattern, &dashLength, &DashOffset);
++#endif
+ QVector<double> pattern(dashLength);
+ for (int i = 0; i < dashLength; ++i)
+ {
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch
new file mode 100644
index 0000000000..4e0f607c6a
--- /dev/null
+++ b/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-1.patch
@@ -0,0 +1,129 @@
+From 85c0dff3422fa3c26fbc2e8d8561f597ec24bd92 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Feb 2022 23:12:52 +0000
+Subject: [PATCH] #16734: Build break with poppler 22.2.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24884 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 47 +++++++++++++++++++-----
+ 1 file changed, 37 insertions(+), 10 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 5894bf2ad6..3650c96f52 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
+
+ #include "slaoutput.h"
+
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++#include <memory>
++#include <optional>
++#endif
++
+ #include <poppler/GlobalParams.h>
+ #include <poppler/poppler-config.h>
+ #include <poppler/FileSpec.h>
+@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
+ void SlaOutputDev::updateFont(GfxState *state)
+ {
+ GfxFont *gfxFont;
+- GfxFontLoc *fontLoc;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++ std::optional<GfxFontLoc> fontLoc;
++ const GooString * fileName = nullptr;
++ std::unique_ptr<FoFiTrueType> ff;
++#else
++ GfxFontLoc * fontLoc = nullptr;
++ GooString * fileName = nullptr;
++ FoFiTrueType * ff = nullptr;
++#endif
+ GfxFontType fontType;
+ SlaOutFontFileID *id;
+ SplashFontFile *fontFile;
+ SplashFontSrc *fontsrc = nullptr;
+- FoFiTrueType *ff;
+ Object refObj, strObj;
+- GooString *fileName;
+- char *tmpBuf;
++ char *tmpBuf = nullptr;
+ int tmpBufLen = 0;
+- int *codeToGID;
+- const double *textMat;
++ int *codeToGID = nullptr;
++ const double *textMat = nullptr;
+ double m11, m12, m21, m22, fontSize;
+ SplashCoord mat[4];
+ int n = 0;
+@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
+ SplashCoord matrix[6];
+
+ m_font = nullptr;
+- fileName = nullptr;
+- tmpBuf = nullptr;
+- fontLoc = nullptr;
+
+ gfxFont = state->getFont();
+ if (!gfxFont)
+@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
+ }
+ else
+ { // gfxFontLocExternal
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++ fileName = fontLoc->pathAsGooString();
++#else
+ fileName = fontLoc->path;
++#endif
+ fontType = fontLoc->fontType;
+ }
+
+@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
+ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ if (ff)
+ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++ codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
++ ff.reset();
++#else
+ codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
+- n = 256;
+ delete ff;
++#endif
++ n = 256;
+ }
+ else
+ {
+@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
+ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
+ if (! ff)
+ goto err2;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
++ codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
++ ff.reset();
++#else
+ codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
+ delete ff;
++#endif
+ }
+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(
+ id,
+@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
+ mat[3] = -m22;
+ m_font = m_fontEngine->getFont(fontFile, mat, matrix);
+
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ delete fontLoc;
++#endif
+ if (fontsrc && !fontsrc->isFile)
+ fontsrc->unref();
+ return;
+
+ err2:
+ delete id;
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
+ delete fontLoc;
++#endif
++
+ err1:
+ if (fontsrc && !fontsrc->isFile)
+ fontsrc->unref();
diff --git a/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch b/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch
new file mode 100644
index 0000000000..73beac2d70
--- /dev/null
+++ b/gnu/packages/patches/scribus-1.5.8-poppler-22.2.0-2.patch
@@ -0,0 +1,28 @@
+From f75c1613db67f4067643d0218a2db3235e42ec9f Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Thu, 3 Feb 2022 19:46:13 +0000
+Subject: [PATCH] Small update vs latest code in poppler
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24885 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/slaoutput.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
+index 3650c96f52..a6f4e00fa9 100644
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -3072,10 +3072,10 @@ void SlaOutputDev::updateFont(GfxState *state)
+ delete id;
+ else
+ {
+- if (!(fontLoc = gfxFont->locateFont(xref, nullptr)))
++ fontLoc = gfxFont->locateFont((xref) ? xref : pdfDoc->getXRef(), nullptr);
++ if (!fontLoc)
+ {
+- error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'",
+- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
+ goto err2;
+ }
+
diff --git a/gnu/packages/patches/softhsm-fix-openssl3-tests.patch b/gnu/packages/patches/softhsm-fix-openssl3-tests.patch
new file mode 100644
index 0000000000..f2d9ce3f5d
--- /dev/null
+++ b/gnu/packages/patches/softhsm-fix-openssl3-tests.patch
@@ -0,0 +1,1107 @@
+Copied from Debian:
+
+https://sources.debian.org/patches/softhsm2/2.6.1-2.1/0003-fix-ftbfs-with-opensslv3.patch/
+
+From 643f061e6fbe04552a2c49bd00528e61a9a77064 Mon Sep 17 00:00:00 2001
+From: Alexander Bokovoy <abokovoy@redhat.com>
+Date: Wed, 26 May 2021 20:03:25 +0300
+Subject: [PATCH 1/4] openssl 3.0: Run DES tests only if OpenSSL allows it
+
+OpenSSL 3.0 moves DES into a legacy provider which has to be loaded
+explicitly. By default, it will not be loaded and DES methods in tests
+will fail. Nest test blocks under successful initialization.
+
+Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
+---
+ src/lib/crypto/test/DESTests.cpp | 350 ++++++++++++++++---------------
+ 1 file changed, 182 insertions(+), 168 deletions(-)
+
+Index: softhsm2-2.6.1/src/lib/crypto/test/DESTests.cpp
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/crypto/test/DESTests.cpp
++++ softhsm2-2.6.1/src/lib/crypto/test/DESTests.cpp
+@@ -259,54 +259,58 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::CBC, IV));
++ if (des->encryptInit(&desKey56, SymMode::CBC, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CBC, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CBC, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++
++ }
+
+ // Test 112-bit key
+ cipherText = ByteString(testResult[i][j][1]);
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::CBC, IV));
++ if (des->encryptInit(&desKey112, SymMode::CBC, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CBC, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CBC, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
++
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
+ #endif
+
+ // Test 168-bit key
+@@ -314,27 +318,28 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::CBC, IV));
++ if (des->encryptInit(&desKey168, SymMode::CBC, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CBC, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CBC, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+ }
+ }
+ }
+@@ -534,54 +539,56 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::ECB, IV));
++ if (des->encryptInit(&desKey56, SymMode::ECB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::ECB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::ECB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+
+ // Test 112-bit key
+ cipherText = ByteString(testResult[i][j][1]);
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::ECB, IV));
++ if (des->encryptInit(&desKey112, SymMode::ECB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::ECB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::ECB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+ #endif
+
+ // Test 168-bit key
+@@ -589,27 +596,28 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::ECB, IV));
++ if (des->encryptInit(&desKey168, SymMode::ECB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::ECB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::ECB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+ }
+ }
+ }
+@@ -809,54 +817,56 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::OFB, IV));
++ if (des->encryptInit(&desKey56, SymMode::OFB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::OFB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::OFB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+
+ // Test 112-bit key
+ cipherText = ByteString(testResult[i][j][1]);
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::OFB, IV));
++ if (des->encryptInit(&desKey112, SymMode::OFB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::OFB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::OFB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+ #endif
+
+ // Test 168-bit key
+@@ -864,27 +874,28 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::OFB, IV));
++ if (des->encryptInit(&desKey168, SymMode::OFB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::OFB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::OFB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+ }
+ }
+ }
+@@ -1083,54 +1094,56 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::CFB, IV));
++ if (des->encryptInit(&desKey56, SymMode::CFB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CFB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CFB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+
+ // Test 112-bit key
+ cipherText = ByteString(testResult[i][j][1]);
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::CFB, IV));
++ if (des->encryptInit(&desKey112, SymMode::CFB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CFB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CFB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+ #endif
+
+ // Test 168-bit key
+@@ -1138,27 +1151,28 @@
+
+ // Now, do the same thing using our DES implementation
+ shsmCipherText.wipe();
+- CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::CFB, IV));
++ if (des->encryptInit(&desKey168, SymMode::CFB, IV)) {
+
+- CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(des->encryptFinal(OB));
+- shsmCipherText += OB;
++ CPPUNIT_ASSERT(des->encryptFinal(OB));
++ shsmCipherText += OB;
+
+- CPPUNIT_ASSERT(shsmCipherText == cipherText);
++ CPPUNIT_ASSERT(shsmCipherText == cipherText);
+
+- // Check that we can get the plain text
+- shsmPlainText.wipe();
+- CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CFB, IV));
++ // Check that we can get the plain text
++ shsmPlainText.wipe();
++ CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CFB, IV));
+
+- CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(des->decryptFinal(OB));
+- shsmPlainText += OB;
++ CPPUNIT_ASSERT(des->decryptFinal(OB));
++ shsmPlainText += OB;
+
+- CPPUNIT_ASSERT(shsmPlainText == plainText);
++ CPPUNIT_ASSERT(shsmPlainText == plainText);
++ }
+ }
+ }
+ }
+Index: softhsm2-2.6.1/src/lib/crypto/test/RSATests.cpp
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/crypto/test/RSATests.cpp
++++ softhsm2-2.6.1/src/lib/crypto/test/RSATests.cpp
+@@ -78,7 +78,6 @@
+
+ // Key sizes to test
+ std::vector<size_t> keySizes;
+- keySizes.push_back(1024);
+ #ifndef WITH_FIPS
+ keySizes.push_back(1025);
+ #endif
+@@ -93,30 +92,31 @@
+ p.setE(*e);
+ p.setBitLength(*k);
+
+- // Generate key-pair
+- CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p));
++ // Generate key-pair but skip test if key size is unsupported in OpenSSL 3.0.0
++ if (rsa->generateKeyPair(&kp, &p)) {
+
+- RSAPublicKey* pub = (RSAPublicKey*) kp->getPublicKey();
+- RSAPrivateKey* priv = (RSAPrivateKey*) kp->getPrivateKey();
++ RSAPublicKey* pub = (RSAPublicKey*) kp->getPublicKey();
++ RSAPrivateKey* priv = (RSAPrivateKey*) kp->getPrivateKey();
+
+- CPPUNIT_ASSERT(pub->getBitLength() == *k);
+- CPPUNIT_ASSERT(priv->getBitLength() == *k);
+- CPPUNIT_ASSERT(pub->getE() == *e);
+- CPPUNIT_ASSERT(priv->getE() == *e);
++ CPPUNIT_ASSERT(pub->getBitLength() == *k);
++ CPPUNIT_ASSERT(priv->getBitLength() == *k);
++ CPPUNIT_ASSERT(pub->getE() == *e);
++ CPPUNIT_ASSERT(priv->getE() == *e);
+
+- rsa->recycleKeyPair(kp);
++ rsa->recycleKeyPair(kp);
++ }
+ }
+ }
+ }
+
+ void RSATests::testSerialisation()
+ {
+- // Generate a 1024-bit key-pair for testing
++ // Generate a 2048-bit key-pair for testing
+ AsymmetricKeyPair* kp;
+ RSAParameters p;
+
+ p.setE("010001");
+- p.setBitLength(1024);
++ p.setBitLength(2048);
+
+ CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p));
+ CPPUNIT_ASSERT(kp != NULL);
+@@ -204,12 +204,12 @@
+
+ void RSATests::testPKCS8()
+ {
+- // Generate a 1024-bit key-pair for testing
++ // Generate a 2048-bit key-pair for testing
+ AsymmetricKeyPair* kp;
+ RSAParameters p;
+
+ p.setE("010001");
+- p.setBitLength(1024);
++ p.setBitLength(2048);
+
+ CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p));
+ CPPUNIT_ASSERT(kp != NULL);
+@@ -253,7 +253,6 @@
+
+ // Key sizes to test
+ std::vector<size_t> keySizes;
+- keySizes.push_back(1024);
+ keySizes.push_back(1280);
+ keySizes.push_back(2048);
+ //keySizes.push_back(4096);
+@@ -293,8 +292,10 @@
+ p.setE(*e);
+ p.setBitLength(*k);
+
+- // Generate key-pair
+- CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p));
++ // Generate key-pair but skip those that unsupported in OpenSSL 3.0.0
++ if (!rsa->generateKeyPair(&kp, &p)) {
++ continue;
++ }
+
+ // Generate some data to sign
+ ByteString dataToSign;
+@@ -611,7 +612,6 @@
+
+ // Key sizes to test
+ std::vector<size_t> keySizes;
+- keySizes.push_back(1024);
+ keySizes.push_back(1280);
+ keySizes.push_back(2048);
+ //keySizes.push_back(4096);
+@@ -629,8 +629,10 @@
+ p.setE(*e);
+ p.setBitLength(*k);
+
+- // Generate key-pair
+- CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p));
++ // Generate key-pair but skip those that unsupported in OpenSSL 3.0.0
++ if (!rsa->generateKeyPair(&kp, &p)) {
++ continue;
++ }
+
+ RNG* rng = CryptoFactory::i()->getRNG();
+
+Index: softhsm2-2.6.1/src/lib/test/DeriveTests.cpp
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/DeriveTests.cpp
++++ softhsm2-2.6.1/src/lib/test/DeriveTests.cpp
+@@ -642,11 +642,14 @@
+ 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32
+ };
+ CK_ULONG secLen = 0;
++ CK_BBOOL oldMechs = CK_FALSE;
+
+ switch (mechType)
+ {
+ case CKM_DES_ECB_ENCRYPT_DATA:
+ case CKM_DES3_ECB_ENCRYPT_DATA:
++ oldMechs = CK_TRUE;
++ /* fall-through */
+ case CKM_AES_ECB_ENCRYPT_DATA:
+ param1.pData = &data[0];
+ param1.ulLen = sizeof(data);
+@@ -655,6 +658,7 @@
+ break;
+ case CKM_DES_CBC_ENCRYPT_DATA:
+ case CKM_DES3_CBC_ENCRYPT_DATA:
++ oldMechs = CK_TRUE;
+ memcpy(param2.iv, "12345678", 8);
+ param2.pData = &data[0];
+ param2.length = sizeof(data);
+@@ -679,10 +683,12 @@
+ break;
+ case CKK_DES:
+ mechEncrypt.mechanism = CKM_DES_ECB;
++ oldMechs = CK_TRUE;
+ break;
+ case CKK_DES2:
+ case CKK_DES3:
+ mechEncrypt.mechanism = CKM_DES3_ECB;
++ oldMechs = CK_TRUE;
+ break;
+ case CKK_AES:
+ mechEncrypt.mechanism = CKM_AES_ECB;
+@@ -719,7 +725,11 @@
+ keyAttribs, sizeof(keyAttribs)/sizeof(CK_ATTRIBUTE) - 1,
+ &hDerive) );
+ }
+- CPPUNIT_ASSERT(rv == CKR_OK);
++ if (rv != CKR_OK && oldMechs == CK_TRUE) {
++ // Skip old mechanisms, they don't work under this crypto library
++ return;
++ }
++ CPPUNIT_ASSERT(rv==CKR_OK);
+
+ // Check that KCV has been set
+ CK_ATTRIBUTE checkAttribs[] = {
+@@ -740,6 +750,10 @@
+ CK_ULONG ulRecoveredTextLen;
+
+ rv = CRYPTOKI_F_PTR( C_EncryptInit(hSession,&mechEncrypt,hDerive) );
++ if (rv != CKR_OK && oldMechs == CK_TRUE) {
++ // Skip old mechanisms, they don't work under this crypto library
++ return;
++ }
+ CPPUNIT_ASSERT(rv==CKR_OK);
+
+ ulCipherTextLen = sizeof(cipherText);
+Index: softhsm2-2.6.1/src/lib/test/ObjectTests.cpp
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/ObjectTests.cpp
++++ softhsm2-2.6.1/src/lib/test/ObjectTests.cpp
+@@ -2370,8 +2370,10 @@
+ CPPUNIT_ASSERT(rv == CKR_OK);
+ rv = CRYPTOKI_F_PTR( C_GetAttributeValue(hSession, hObject, attribKCV, 1) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+- CPPUNIT_ASSERT(attribKCV[0].ulValueLen == 3);
+- CPPUNIT_ASSERT(memcmp(pCheckValue, desKCV, 3) == 0);
++ // If DES key is not supported, skip it
++ if (attribKCV[0].ulValueLen == 3) {
++ CPPUNIT_ASSERT(memcmp(pCheckValue, desKCV, 3) == 0);
++ }
+ rv = CRYPTOKI_F_PTR( C_DestroyObject(hSession,hObject) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+
+@@ -2381,9 +2383,12 @@
+ rv = CRYPTOKI_F_PTR( C_CreateObject(hSession, attribs, sizeof(attribs)/sizeof(CK_ATTRIBUTE), &hObject) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+ rv = CRYPTOKI_F_PTR( C_GetAttributeValue(hSession, hObject, attribKCV, 1) );
+- CPPUNIT_ASSERT(rv == CKR_OK);
+- CPPUNIT_ASSERT(attribKCV[0].ulValueLen == 3);
+- CPPUNIT_ASSERT(memcmp(pCheckValue, des2KCV, 3) == 0);
++ // If DES2 key is not supported, skip it
++ if (rv == CKR_OK) {
++ if (attribKCV[0].ulValueLen == 3) {
++ CPPUNIT_ASSERT(memcmp(pCheckValue, des2KCV, 3) == 0);
++ }
++ }
+ rv = CRYPTOKI_F_PTR( C_DestroyObject(hSession,hObject) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+
+@@ -2394,8 +2399,10 @@
+ CPPUNIT_ASSERT(rv == CKR_OK);
+ rv = CRYPTOKI_F_PTR( C_GetAttributeValue(hSession, hObject, attribKCV, 1) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+- CPPUNIT_ASSERT(attribKCV[0].ulValueLen == 3);
+- CPPUNIT_ASSERT(memcmp(pCheckValue, des3KCV, 3) == 0);
++ // If DES3 key is not supported, skip it
++ if (attribKCV[0].ulValueLen == 3) {
++ CPPUNIT_ASSERT(memcmp(pCheckValue, des3KCV, 3) == 0);
++ }
+ rv = CRYPTOKI_F_PTR( C_DestroyObject(hSession,hObject) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+ }
+Index: softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.cpp
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/SymmetricAlgorithmTests.cpp
++++ softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.cpp
+@@ -195,6 +195,8 @@
+ std::vector<CK_BYTE> vEncryptedData;
+ std::vector<CK_BYTE> vEncryptedDataParted;
+ PartSize partSize(blockSize, &vData);
++ CK_BBOOL oldMechs = CK_FALSE;
++ CK_RV rv = CKR_OK;
+
+ CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_GenerateRandom(hSession, (CK_BYTE_PTR)&vData.front(), messageSize) ) );
+
+@@ -233,6 +235,8 @@
+ case CKM_DES_CBC_PAD:
+ case CKM_DES3_CBC:
+ case CKM_DES3_CBC_PAD:
++ oldMechs = CK_TRUE;
++ /* fall-through */
+ case CKM_AES_CBC:
+ case CKM_AES_CBC_PAD:
+ pMechanism->pParameter = (CK_VOID_PTR)&vData.front();
+@@ -246,12 +250,18 @@
+ pMechanism->pParameter = &gcmParams;
+ pMechanism->ulParameterLen = sizeof(gcmParams);
+ break;
++ case CKM_DES_ECB:
++ case CKM_DES3_ECB:
++ oldMechs = CK_TRUE;
++ break;
+ default:
+ break;
+ }
+
+ // Single-part encryption
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) ) );
++ rv = CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) );
++ CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) );
++ if (oldMechs == CK_FALSE)
+ {
+ CK_ULONG ulEncryptedDataLen;
+ const CK_RV rv( CRYPTOKI_F_PTR( C_Encrypt(hSession,(CK_BYTE_PTR)&vData.front(),messageSize,NULL_PTR,&ulEncryptedDataLen) ) );
+@@ -267,40 +277,42 @@
+ }
+
+ // Multi-part encryption
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) ) );
+-
+- for ( std::vector<CK_BYTE>::const_iterator i(vData.begin()); i<vData.end(); i+=partSize.getCurrent() ) {
+- const CK_ULONG lPartLen( i+partSize.getNext()<vData.end() ? partSize.getCurrent() : vData.end()-i );
+- CK_ULONG ulEncryptedPartLen;
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,NULL_PTR,&ulEncryptedPartLen) ) );
+- const size_t oldSize( vEncryptedDataParted.size() );
+- vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen);
+- CK_BYTE dummy;
+- const CK_BYTE_PTR pEncryptedPart( ulEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy );
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,pEncryptedPart,&ulEncryptedPartLen) ) );
+- vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen);
+- }
+- {
+- CK_ULONG ulLastEncryptedPartLen;
+- const CK_RV rv( CRYPTOKI_F_PTR( C_EncryptFinal(hSession,NULL_PTR,&ulLastEncryptedPartLen) ) );
+- if ( isSizeOK ) {
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, rv );
++ rv = CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) );
++ CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) );
++ if (oldMechs == CK_FALSE) {
++ for ( std::vector<CK_BYTE>::const_iterator i(vData.begin()); i<vData.end(); i+=partSize.getCurrent() ) {
++ const CK_ULONG lPartLen( i+partSize.getNext()<vData.end() ? partSize.getCurrent() : vData.end()-i );
++ CK_ULONG ulEncryptedPartLen;
++ CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,NULL_PTR,&ulEncryptedPartLen) ) );
+ const size_t oldSize( vEncryptedDataParted.size() );
++ vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen);
+ CK_BYTE dummy;
+- vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen);
+- const CK_BYTE_PTR pLastEncryptedPart( ulLastEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy );
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptFinal(hSession,pLastEncryptedPart,&ulLastEncryptedPartLen) ) );
+- vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen);
+- } else {
+- CPPUNIT_ASSERT_EQUAL_MESSAGE("C_EncryptFinal should fail with C_CKR_DATA_LEN_RANGE", (CK_RV)CKR_DATA_LEN_RANGE, rv);
+- vEncryptedDataParted = vData;
++ const CK_BYTE_PTR pEncryptedPart( ulEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy );
++ CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,pEncryptedPart,&ulEncryptedPartLen) ) );
++ vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen);
++ }
++ {
++ CK_ULONG ulLastEncryptedPartLen;
++ const CK_RV rv( CRYPTOKI_F_PTR( C_EncryptFinal(hSession,NULL_PTR,&ulLastEncryptedPartLen) ) );
++ if ( isSizeOK ) {
++ CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, rv );
++ const size_t oldSize( vEncryptedDataParted.size() );
++ CK_BYTE dummy;
++ vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen);
++ const CK_BYTE_PTR pLastEncryptedPart( ulLastEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy );
++ CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptFinal(hSession,pLastEncryptedPart,&ulLastEncryptedPartLen) ) );
++ vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen);
++ } else {
++ CPPUNIT_ASSERT_EQUAL_MESSAGE("C_EncryptFinal should fail with C_CKR_DATA_LEN_RANGE", (CK_RV)CKR_DATA_LEN_RANGE, rv);
++ vEncryptedDataParted = vData;
++ }
+ }
+ }
+
+ // Single-part decryption
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) ) );
+-
+- {
++ rv = CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) );
++ CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) );
++ if (oldMechs == CK_FALSE) {
+ CK_ULONG ulDataLen;
+ const CK_RV rv( CRYPTOKI_F_PTR( C_Decrypt(hSession,&vEncryptedData.front(),vEncryptedData.size(),NULL_PTR,&ulDataLen) ) );
+ if ( isSizeOK ) {
+@@ -315,8 +327,9 @@
+ }
+
+ // Multi-part decryption
+- CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) ) );
+- {
++ rv = CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) );
++ CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) );
++ if (oldMechs == CK_FALSE) {
+ std::vector<CK_BYTE> vDecryptedData;
+ CK_BYTE dummy;
+ for ( std::vector<CK_BYTE>::iterator i(vEncryptedDataParted.begin()); i<vEncryptedDataParted.end(); i+=partSize.getCurrent()) {
+@@ -836,44 +849,44 @@
+
+ // Generate all combinations of session/token keys.
+ rv = generateDesKey(hSessionRW,IN_SESSION,IS_PUBLIC,hKey);
+- CPPUNIT_ASSERT(rv == CKR_OK);
+-
+- encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST-1);
+- encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1);
+- encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
+- encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ if (rv == CKR_OK) {
++ encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST-1);
++ encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1);
++ encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ }
+
+ CK_OBJECT_HANDLE hKey2 = CK_INVALID_HANDLE;
+
+ // Generate all combinations of session/token keys.
+ rv = generateDes2Key(hSessionRW,IN_SESSION,IS_PUBLIC,hKey2);
+- CPPUNIT_ASSERT(rv == CKR_OK);
+-
+- encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST-1);
+- encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1);
+- encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
+- encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ if (rv == CKR_OK) {
++ encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST-1);
++ encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1);
++ encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ }
+ #endif
+
+ CK_OBJECT_HANDLE hKey3 = CK_INVALID_HANDLE;
+
+ // Generate all combinations of session/token keys.
+ rv = generateDes3Key(hSessionRW,IN_SESSION,IS_PUBLIC,hKey3);
+- CPPUNIT_ASSERT(rv == CKR_OK);
+-
+- encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST-1);
+- encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1);
+- encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
+- encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST);
+- encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ if (rv == CKR_OK) {
++ encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST-1);
++ encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1);
++ encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST);
++ encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false);
++ }
+ }
+
+ void SymmetricAlgorithmTests::testNullTemplate()
+Index: softhsm2-2.6.1/src/lib/test/InfoTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/InfoTests.h
++++ softhsm2-2.6.1/src/lib/test/InfoTests.h
+@@ -42,13 +42,13 @@
+ CPPUNIT_TEST_SUITE(InfoTests);
+ CPPUNIT_TEST(testGetInfo);
+ CPPUNIT_TEST(testGetFunctionList);
+- CPPUNIT_TEST(testGetSlotList);
+- CPPUNIT_TEST(testGetSlotInfo);
+- CPPUNIT_TEST(testGetTokenInfo);
+- CPPUNIT_TEST(testGetMechanismList);
+- CPPUNIT_TEST(testGetMechanismInfo);
+- CPPUNIT_TEST(testGetSlotInfoAlt);
+- CPPUNIT_TEST(testGetMechanismListConfig);
++ //CPPUNIT_TEST(testGetSlotList);
++ //CPPUNIT_TEST(testGetSlotInfo);
++ //CPPUNIT_TEST(testGetTokenInfo);
++ //CPPUNIT_TEST(testGetMechanismList);
++ //CPPUNIT_TEST(testGetMechanismInfo);
++ //CPPUNIT_TEST(testGetSlotInfoAlt);
++ //CPPUNIT_TEST(testGetMechanismListConfig);
+ CPPUNIT_TEST(testWaitForSlotEvent);
+ CPPUNIT_TEST_SUITE_END();
+
+Index: softhsm2-2.6.1/src/lib/test/ObjectTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/ObjectTests.h
++++ softhsm2-2.6.1/src/lib/test/ObjectTests.h
+@@ -41,7 +41,7 @@
+ class ObjectTests : public TestsBase
+ {
+ CPPUNIT_TEST_SUITE(ObjectTests);
+- CPPUNIT_TEST(testCreateObject);
++ /*CPPUNIT_TEST(testCreateObject);
+ CPPUNIT_TEST(testCopyObject);
+ CPPUNIT_TEST(testDestroyObject);
+ CPPUNIT_TEST(testGetObjectSize);
+@@ -60,7 +60,7 @@
+ CPPUNIT_TEST(testAllowedMechanisms);
+ CPPUNIT_TEST(testReAuthentication);
+ CPPUNIT_TEST(testTemplateAttribute);
+- CPPUNIT_TEST(testCreateSecretKey);
++ CPPUNIT_TEST(testCreateSecretKey);*/
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+Index: softhsm2-2.6.1/src/lib/test/UserTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/UserTests.h
++++ softhsm2-2.6.1/src/lib/test/UserTests.h
+@@ -39,10 +39,10 @@
+ class UserTests : public TestsNoPINInitBase
+ {
+ CPPUNIT_TEST_SUITE(UserTests);
+- CPPUNIT_TEST(testInitPIN);
++ /*CPPUNIT_TEST(testInitPIN);
+ CPPUNIT_TEST(testLogin);
+ CPPUNIT_TEST(testLogout);
+- CPPUNIT_TEST(testSetPIN);
++ CPPUNIT_TEST(testSetPIN);*/
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+Index: softhsm2-2.6.1/src/lib/test/SignVerifyTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/SignVerifyTests.h
++++ softhsm2-2.6.1/src/lib/test/SignVerifyTests.h
+@@ -41,14 +41,14 @@
+ class SignVerifyTests : public TestsBase
+ {
+ CPPUNIT_TEST_SUITE(SignVerifyTests);
+- CPPUNIT_TEST(testRsaSignVerify);
++ /*CPPUNIT_TEST(testRsaSignVerify);
+ #ifdef WITH_ECC
+ CPPUNIT_TEST(testEcSignVerify);
+ #endif
+ #ifdef WITH_EDDSA
+ CPPUNIT_TEST_PARAMETERIZED(testEdSignVerify, {"Ed25519", "Ed448"});
+ #endif
+- CPPUNIT_TEST(testMacSignVerify);
++ CPPUNIT_TEST(testMacSignVerify);*/
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+Index: softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/SymmetricAlgorithmTests.h
++++ softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.h
+@@ -39,7 +39,7 @@
+ class SymmetricAlgorithmTests : public TestsBase
+ {
+ CPPUNIT_TEST_SUITE(SymmetricAlgorithmTests);
+- CPPUNIT_TEST(testAesEncryptDecrypt);
++ /*CPPUNIT_TEST(testAesEncryptDecrypt);
+ CPPUNIT_TEST(testDesEncryptDecrypt);
+ #ifdef HAVE_AES_KEY_WRAP
+ CPPUNIT_TEST(testAesWrapUnwrap);
+@@ -49,7 +49,7 @@
+ CPPUNIT_TEST(testCheckValue);
+ CPPUNIT_TEST(testAesCtrOverflow);
+ CPPUNIT_TEST(testGenericKey);
+- CPPUNIT_TEST(testEncDecFinalNULLValidation);
++ CPPUNIT_TEST(testEncDecFinalNULLValidation);*/
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+Index: softhsm2-2.6.1/src/lib/test/RandomTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/RandomTests.h
++++ softhsm2-2.6.1/src/lib/test/RandomTests.h
+@@ -39,8 +39,8 @@
+ class RandomTests : public TestsNoPINInitBase
+ {
+ CPPUNIT_TEST_SUITE(RandomTests);
+- CPPUNIT_TEST(testSeedRandom);
+- CPPUNIT_TEST(testGenerateRandom);
++ //CPPUNIT_TEST(testSeedRandom);
++ //CPPUNIT_TEST(testGenerateRandom);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+Index: softhsm2-2.6.1/src/lib/test/SessionTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/SessionTests.h
++++ softhsm2-2.6.1/src/lib/test/SessionTests.h
+@@ -40,10 +40,10 @@
+ class SessionTests : public TestsNoPINInitBase
+ {
+ CPPUNIT_TEST_SUITE(SessionTests);
+- CPPUNIT_TEST(testOpenSession);
++ /*CPPUNIT_TEST(testOpenSession);
+ CPPUNIT_TEST(testCloseSession);
+ CPPUNIT_TEST(testCloseAllSessions);
+- CPPUNIT_TEST(testGetSessionInfo);
++ CPPUNIT_TEST(testGetSessionInfo);*/
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+Index: softhsm2-2.6.1/src/lib/test/TokenTests.h
+===================================================================
+--- softhsm2-2.6.1.orig/src/lib/test/TokenTests.h
++++ softhsm2-2.6.1/src/lib/test/TokenTests.h
+@@ -39,7 +39,7 @@
+ class TokenTests : public TestsNoPINInitBase
+ {
+ CPPUNIT_TEST_SUITE(TokenTests);
+- CPPUNIT_TEST(testInitToken);
++ //CPPUNIT_TEST(testInitToken);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
diff --git a/gnu/packages/patches/source-highlight-gcc-compat.patch b/gnu/packages/patches/source-highlight-gcc-compat.patch
new file mode 100644
index 0000000000..7b543dcf32
--- /dev/null
+++ b/gnu/packages/patches/source-highlight-gcc-compat.patch
@@ -0,0 +1,74 @@
+Fix various compatibility problems with newer GCC.
+
+This is an amalgamation of these upstream commits:
+
+ https://git.savannah.gnu.org/cgit/src-highlite.git/commit/?id=904949c9026cb772dc93fbe0947a252ef47127f4
+ https://git.savannah.gnu.org/cgit/src-highlite.git/commit/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9
+
+diff --git a/lib/srchilite/fileutil.cc b/lib/srchilite/fileutil.cc
+index 59a6d64..963178c 100644
+--- a/lib/srchilite/fileutil.cc
++++ b/lib/srchilite/fileutil.cc
+@@ -48,7 +48,7 @@ void set_file_util_verbose(bool b) {
+ // FIXME avoid using a global variable
+ std::string start_path;
+
+-string readFile(const string &fileName) throw (IOException) {
++string readFile(const string &fileName) {
+ ifstream file(fileName.c_str());
+
+ if (!file.is_open()) {
+diff --git a/lib/srchilite/fileutil.h b/lib/srchilite/fileutil.h
+index 7335a9b..042eb56 100644
+--- a/lib/srchilite/fileutil.h
++++ b/lib/srchilite/fileutil.h
+@@ -27,7 +27,7 @@ extern std::string start_path;
+ * @return the contents of the file
+ * @throw IOException
+ */
+-string readFile(const string &fileName) throw (IOException);
++string readFile(const string &fileName);
+
+ //char *read_file(const string &fileName);
+
+diff --git a/lib/tests/stdboosterror.h b/lib/tests/stdboosterror.h
+index 568545b..d59bfa6 100644
+--- a/lib/tests/stdboosterror.h
++++ b/lib/tests/stdboosterror.h
+@@ -4,7 +4,7 @@
+ #include <boost/regex/pattern_except.hpp>
+
+ static boost::regex_error
+- std_boost_exception(boost::regex_error(boost::regex_constants::error_bad_pattern));
++ std_boost_exception = boost::regex_error(boost::regex_constants::error_bad_pattern);
+
+ /**
+ * returns the string representing a standard exception (which
+diff --git a/lib/tests/test_wordtokenizer_main.cpp b/lib/tests/test_wordtokenizer_main.cpp
+index 40e23b1..11ba389 100644
+--- a/lib/tests/test_wordtokenizer_main.cpp
++++ b/lib/tests/test_wordtokenizer_main.cpp
+@@ -11,6 +11,14 @@
+ using namespace std;
+ using namespace srchilite;
+
++/*
++ * We have to use 'std' namespaces because 'WordTokenizer::WordTokenizerResults::value_type'
++ * is an std::pair<std::string, std::string> in disguise. We have to place 'operator<<()'
++ * into the same namespace for ADL to work. Otherwise gcc-12 or clang-13 can't find the
++ * overload.
++ */
++namespace std {
++
+ static ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::value_type &);
+
+ ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::value_type &token) {
+@@ -23,6 +31,8 @@ ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::val
+ return os;
+ }
+
++}
++
+ int main() {
+ WordTokenizer::WordTokenizerResults tokens;
+ \ No newline at end of file
diff --git a/gnu/packages/patches/swig-support-gcc-12.patch b/gnu/packages/patches/swig-support-gcc-12.patch
new file mode 100644
index 0000000000..ece7928aa2
--- /dev/null
+++ b/gnu/packages/patches/swig-support-gcc-12.patch
@@ -0,0 +1,16 @@
+Fix for https://github.com/swig/swig/issues/2145 made in unreleased upstream commit
+https://github.com/swig/swig/commit/76d5a9ec270a763c892ae28070e391cf99e0b7cd
+
+diff --git a/Examples/test-suite/nested_class.i b/Examples/test-suite/nested_class.i
+index b10c339493e..c778a12cf7c 100644
+--- a/Examples/test-suite/nested_class.i
++++ b/Examples/test-suite/nested_class.i
+@@ -201,7 +201,7 @@ struct Outer {
+ Integer xx;
+ } MultipleInstanceAnonDerived1, MultipleInstanceAnonDerived2, *MultipleInstanceAnonDerived3, MultipleInstanceAnonDerived4[2];
+
+-#if defined(__GNUC__) || defined(_MSC_VER) || defined(SWIG)
++#if (defined(__GNUC__) && __GNUC__ < 12) || defined(_MSC_VER) || defined(SWIG)
+ /* some compilers do not accept these */
+ struct : public InnerMultiple {
+ Integer xx;
diff --git a/gnu/packages/patches/texinfo-headings-single.patch b/gnu/packages/patches/texinfo-headings-single.patch
new file mode 100644
index 0000000000..5147449ddc
--- /dev/null
+++ b/gnu/packages/patches/texinfo-headings-single.patch
@@ -0,0 +1,21 @@
+Fix a regression in 6.8 where the 'single' headings option was not recognized.
+
+Taken from upstream:
+
+ https://git.savannah.gnu.org/cgit/texinfo.git/commit/?id=13a8894fe2faa45b04033d7122a8fe7939ce6aa2
+
+diff --git a/tp/Texinfo/XS/parsetexi/end_line.c b/tp/Texinfo/XS/parsetexi/end_line.c
+index 4556780052..3fc2065616 100644
+--- a/tp/Texinfo/XS/parsetexi/end_line.c
++++ b/tp/Texinfo/XS/parsetexi/end_line.c
+@@ -778,8 +778,8 @@ kdbinputstyle_invalid:
+ case CM_headings:
+ {
+ if (!strcmp (line, "off") || !strcmp (line, "on")
+- || !strcmp (line, "double") || !strcmp (line, "singleafter")
+- || !strcmp (line, "doubleafter"))
++ || !strcmp (line, "single") || !strcmp (line, "double")
++ || !strcmp (line, "singleafter") || !strcmp (line, "doubleafter"))
+ {
+ ADD_ARG(line);
+ }
diff --git a/gnu/packages/patches/u-boot-fix-build-python-3.10.patch b/gnu/packages/patches/u-boot-fix-build-python-3.10.patch
new file mode 100644
index 0000000000..7e5d6ba656
--- /dev/null
+++ b/gnu/packages/patches/u-boot-fix-build-python-3.10.patch
@@ -0,0 +1,37 @@
+This patch is backported from U-Boot 2023.01; remove when updating.
+
+From 7d01bb1c5a1daef0187c9ea276bde19a8d0e7fde Mon Sep 17 00:00:00 2001
+From: Michal Suchanek <msuchanek@suse.de>
+Date: Thu, 13 Oct 2022 22:43:41 +0200
+Subject: [PATCH] libfdt: Fix build with python 3.10
+
+Python 3.10 requires defining PY_SSIZE_T_CLEAN. This will be fixed in
+swig 4.10 but it is not clear when it will be released. There was a
+warning since python 3.8.
+
+Link: https://github.com/swig/swig/pull/2277
+
+Signed-off-by: Michal Suchanek <msuchanek@suse.de>
+Reviewed-by: Simon Glass <sjg@chromium.org>
+---
+ scripts/dtc/pylibfdt/libfdt.i_shipped | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
+index 27c29ea260..56cc5d48f4 100644
+--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
+@@ -7,6 +7,10 @@
+
+ %module libfdt
+
++%begin %{
++#define PY_SSIZE_T_CLEAN
++%}
++
+ %include <stdint.i>
+
+ %{
+--
+GitLab
+
diff --git a/gnu/packages/patches/ucx-tcp-iface-ioctl.patch b/gnu/packages/patches/ucx-tcp-iface-ioctl.patch
index 56f06fc920..c441a0861a 100644
--- a/gnu/packages/patches/ucx-tcp-iface-ioctl.patch
+++ b/gnu/packages/patches/ucx-tcp-iface-ioctl.patch
@@ -54,7 +54,7 @@ index cad4a2709..7c1d2c9de 100644
+ for (i = 0; i < conf.ifc_len / sizeof(struct ifreq); i++) {
+ const char *name = reqs[i].ifr_name;
+
-+ if (!ucs_netif_is_active(name)) {
++ if (!ucs_netif_is_active(name, AF_INET)) {
+ continue;
+ }
+
@@ -87,9 +87,9 @@ index cad4a2709..7c1d2c9de 100644
unsigned *num_devices_p)
@@ -599,9 +663,9 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md,
- dir = opendir(netdev_dir);
+ dir = opendir(UCT_TCP_IFACE_NETDEV_DIR);
if (dir == NULL) {
-- ucs_error("opendir(%s) failed: %m", netdev_dir);
+- ucs_error("opendir(%s) failed: %m", UCT_TCP_IFACE_NETDEV_DIR);
- status = UCS_ERR_IO_ERROR;
- goto out;
+ /* When /sys is unavailable, as can be the case in a container,
diff --git a/gnu/packages/patches/util-linux-CVE-2021-3995.patch b/gnu/packages/patches/util-linux-CVE-2021-3995.patch
deleted file mode 100644
index 7faea83801..0000000000
--- a/gnu/packages/patches/util-linux-CVE-2021-3995.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-Fix CVE-2021-3995:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3995
-https://seclists.org/oss-sec/2022/q1/66
-
-Patch copied from upstream source repository:
-
-https://github.com/util-linux/util-linux/commit/f3db9bd609494099f0c1b95231c5dfe383346929
-
-From f3db9bd609494099f0c1b95231c5dfe383346929 Mon Sep 17 00:00:00 2001
-From: Karel Zak <kzak@redhat.com>
-Date: Wed, 24 Nov 2021 13:53:25 +0100
-Subject: [PATCH] libmount: fix UID check for FUSE umount [CVE-2021-3995]
-
-Improper UID check allows an unprivileged user to unmount FUSE
-filesystems of users with similar UID.
-
-Signed-off-by: Karel Zak <kzak@redhat.com>
----
- include/strutils.h | 2 +-
- libmount/src/context_umount.c | 14 +++---------
- libmount/src/mountP.h | 1 +
- libmount/src/optstr.c | 42 +++++++++++++++++++++++++++++++++++
- 4 files changed, 47 insertions(+), 12 deletions(-)
-
-diff --git a/include/strutils.h b/include/strutils.h
-index 6e95707ea..a84d29594 100644
---- a/include/strutils.h
-+++ b/include/strutils.h
-@@ -106,8 +106,8 @@ static inline char *mem2strcpy(char *dest, const void *src, size_t n, size_t nma
- if (n + 1 > nmax)
- n = nmax - 1;
-
-+ memset(dest, '\0', nmax);
- memcpy(dest, src, n);
-- dest[nmax-1] = '\0';
- return dest;
- }
-
-diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
-index 173637a15..8773c65ff 100644
---- a/libmount/src/context_umount.c
-+++ b/libmount/src/context_umount.c
-@@ -453,10 +453,7 @@ static int is_fuse_usermount(struct libmnt_context *cxt, int *errsv)
- struct libmnt_ns *ns_old;
- const char *type = mnt_fs_get_fstype(cxt->fs);
- const char *optstr;
-- char *user_id = NULL;
-- size_t sz;
-- uid_t uid;
-- char uidstr[sizeof(stringify_value(ULONG_MAX))];
-+ uid_t uid, entry_uid;
-
- *errsv = 0;
-
-@@ -473,11 +470,7 @@ static int is_fuse_usermount(struct libmnt_context *cxt, int *errsv)
- optstr = mnt_fs_get_fs_options(cxt->fs);
- if (!optstr)
- return 0;
--
-- if (mnt_optstr_get_option(optstr, "user_id", &user_id, &sz) != 0)
-- return 0;
--
-- if (sz == 0 || user_id == NULL)
-+ if (mnt_optstr_get_uid(optstr, "user_id", &entry_uid) != 0)
- return 0;
-
- /* get current user */
-@@ -494,8 +487,7 @@ static int is_fuse_usermount(struct libmnt_context *cxt, int *errsv)
- return 0;
- }
-
-- snprintf(uidstr, sizeof(uidstr), "%lu", (unsigned long) uid);
-- return strncmp(user_id, uidstr, sz) == 0;
-+ return uid == entry_uid;
- }
-
- /*
-diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h
-index d43a83541..22442ec55 100644
---- a/libmount/src/mountP.h
-+++ b/libmount/src/mountP.h
-@@ -399,6 +399,7 @@ extern const struct libmnt_optmap *mnt_optmap_get_entry(
- const struct libmnt_optmap **mapent);
-
- /* optstr.c */
-+extern int mnt_optstr_get_uid(const char *optstr, const char *name, uid_t *uid);
- extern int mnt_optstr_remove_option_at(char **optstr, char *begin, char *end);
- extern int mnt_optstr_fix_gid(char **optstr, char *value, size_t valsz, char **next);
- extern int mnt_optstr_fix_uid(char **optstr, char *value, size_t valsz, char **next);
-diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
-index 921b9318e..16800f571 100644
---- a/libmount/src/optstr.c
-+++ b/libmount/src/optstr.c
-@@ -1076,6 +1076,48 @@ int mnt_optstr_fix_user(char **optstr)
- return rc;
- }
-
-+/*
-+ * Converts value from @optstr addressed by @name to uid.
-+ *
-+ * Returns: 0 on success, 1 if not found, <0 on error
-+ */
-+int mnt_optstr_get_uid(const char *optstr, const char *name, uid_t *uid)
-+{
-+ char *value = NULL;
-+ size_t valsz = 0;
-+ char buf[sizeof(stringify_value(UINT64_MAX))];
-+ int rc;
-+ uint64_t num;
-+
-+ assert(optstr);
-+ assert(name);
-+ assert(uid);
-+
-+ rc = mnt_optstr_get_option(optstr, name, &value, &valsz);
-+ if (rc != 0)
-+ goto fail;
-+
-+ if (valsz > sizeof(buf) - 1) {
-+ rc = -ERANGE;
-+ goto fail;
-+ }
-+ mem2strcpy(buf, value, valsz, sizeof(buf));
-+
-+ rc = ul_strtou64(buf, &num, 10);
-+ if (rc != 0)
-+ goto fail;
-+ if (num > ULONG_MAX || (uid_t) num != num) {
-+ rc = -ERANGE;
-+ goto fail;
-+ }
-+ *uid = (uid_t) num;
-+
-+ return 0;
-+fail:
-+ DBG(UTILS, ul_debug("failed to convert '%s'= to number [rc=%d]", name, rc));
-+ return rc;
-+}
-+
- /**
- * mnt_match_options:
- * @optstr: options string
---
-2.34.0
-
diff --git a/gnu/packages/patches/util-linux-CVE-2021-3996.patch b/gnu/packages/patches/util-linux-CVE-2021-3996.patch
deleted file mode 100644
index 59edf5c7cf..0000000000
--- a/gnu/packages/patches/util-linux-CVE-2021-3996.patch
+++ /dev/null
@@ -1,233 +0,0 @@
-Fix CVE-2021-3996:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3996
-https://seclists.org/oss-sec/2022/q1/66
-
-Patch copied from upstream source repository:
-
-https://github.com/util-linux/util-linux/commit/018a10907fa9885093f6d87401556932c2d8bd2b
-
-From 018a10907fa9885093f6d87401556932c2d8bd2b Mon Sep 17 00:00:00 2001
-From: Karel Zak <kzak@redhat.com>
-Date: Tue, 4 Jan 2022 10:54:20 +0100
-Subject: [PATCH] libmount: fix (deleted) suffix issue [CVE-2021-3996]
-
-This issue is related to parsing the /proc/self/mountinfo file allows an
-unprivileged user to unmount other user's filesystems that are either
-world-writable themselves or mounted in a world-writable directory.
-
-The support for "(deleted)" is no more necessary as the Linux kernel does
-not use it in /proc/self/mountinfo and /proc/self/mount files anymore.
-
-Signed-off-by: Karel Zak <kzak@redhat.com>
----
- libmount/src/tab_parse.c | 5 -----
- tests/expected/findmnt/filter-options | 1 -
- tests/expected/findmnt/filter-options-nameval-neg | 3 +--
- tests/expected/findmnt/filter-types-neg | 1 -
- tests/expected/findmnt/outputs-default | 3 +--
- tests/expected/findmnt/outputs-force-tree | 3 +--
- tests/expected/findmnt/outputs-kernel | 3 +--
- tests/expected/libmount/tabdiff-mount | 1 -
- tests/expected/libmount/tabdiff-move | 1 -
- tests/expected/libmount/tabdiff-remount | 1 -
- tests/expected/libmount/tabdiff-umount | 1 -
- tests/expected/libmount/tabfiles-parse-mountinfo | 11 -----------
- tests/expected/libmount/tabfiles-py-parse-mountinfo | 11 -----------
- tests/ts/findmnt/files/mountinfo | 1 -
- tests/ts/findmnt/files/mountinfo-nonroot | 1 -
- tests/ts/libmount/files/mountinfo | 1 -
- 16 files changed, 4 insertions(+), 44 deletions(-)
-
-diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
-index 917779ab6..4407f9c9c 100644
---- a/libmount/src/tab_parse.c
-+++ b/libmount/src/tab_parse.c
-@@ -227,11 +227,6 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s)
- goto fail;
- }
-
-- /* remove "\040(deleted)" suffix */
-- p = (char *) endswith(fs->target, PATH_DELETED_SUFFIX);
-- if (p && *p)
-- *p = '\0';
--
- s = skip_separator(s);
-
- /* (6) vfs options (fs-independent) */
-diff --git a/tests/expected/findmnt/filter-options b/tests/expected/findmnt/filter-options
-index 2606bce76..97b0ead0a 100644
---- a/tests/expected/findmnt/filter-options
-+++ b/tests/expected/findmnt/filter-options
-@@ -28,5 +28,4 @@ TARGET SOURCE FSTYPE OPTIONS
- /home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500
- /var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
- /mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--/mnt/foo /fooooo bar rw,relatime
- rc=0
-diff --git a/tests/expected/findmnt/filter-options-nameval-neg b/tests/expected/findmnt/filter-options-nameval-neg
-index 5471d65af..f0467ef75 100644
---- a/tests/expected/findmnt/filter-options-nameval-neg
-+++ b/tests/expected/findmnt/filter-options-nameval-neg
-@@ -29,6 +29,5 @@ TARGET SOURCE FSTYPE OPTIO
- |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered
- | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500
- |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
--|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--`-/mnt/foo /fooooo bar rw,relatime
-+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
- rc=0
-diff --git a/tests/expected/findmnt/filter-types-neg b/tests/expected/findmnt/filter-types-neg
-index 2606bce76..97b0ead0a 100644
---- a/tests/expected/findmnt/filter-types-neg
-+++ b/tests/expected/findmnt/filter-types-neg
-@@ -28,5 +28,4 @@ TARGET SOURCE FSTYPE OPTIONS
- /home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500
- /var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
- /mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--/mnt/foo /fooooo bar rw,relatime
- rc=0
-diff --git a/tests/expected/findmnt/outputs-default b/tests/expected/findmnt/outputs-default
-index 59495797b..01599355e 100644
---- a/tests/expected/findmnt/outputs-default
-+++ b/tests/expected/findmnt/outputs-default
-@@ -30,6 +30,5 @@ TARGET SOURCE FSTYPE OPTIO
- |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered
- | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500
- |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
--|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--`-/mnt/foo /fooooo bar rw,relatime
-+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
- rc=0
-diff --git a/tests/expected/findmnt/outputs-force-tree b/tests/expected/findmnt/outputs-force-tree
-index 59495797b..01599355e 100644
---- a/tests/expected/findmnt/outputs-force-tree
-+++ b/tests/expected/findmnt/outputs-force-tree
-@@ -30,6 +30,5 @@ TARGET SOURCE FSTYPE OPTIO
- |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered
- | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500
- |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
--|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--`-/mnt/foo /fooooo bar rw,relatime
-+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
- rc=0
-diff --git a/tests/expected/findmnt/outputs-kernel b/tests/expected/findmnt/outputs-kernel
-index 59495797b..01599355e 100644
---- a/tests/expected/findmnt/outputs-kernel
-+++ b/tests/expected/findmnt/outputs-kernel
-@@ -30,6 +30,5 @@ TARGET SOURCE FSTYPE OPTIO
- |-/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered
- | `-/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500
- |-/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
--|-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--`-/mnt/foo /fooooo bar rw,relatime
-+`-/mnt/sounds //foo.home/bar/ cifs rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
- rc=0
-diff --git a/tests/expected/libmount/tabdiff-mount b/tests/expected/libmount/tabdiff-mount
-index 420aeacd5..3c18f8dc4 100644
---- a/tests/expected/libmount/tabdiff-mount
-+++ b/tests/expected/libmount/tabdiff-mount
-@@ -1,3 +1,2 @@
- /dev/mapper/kzak-home on /home/kzak: MOUNTED
--/fooooo on /mnt/foo: MOUNTED
- tmpfs on /mnt/test/foo bar: MOUNTED
-diff --git a/tests/expected/libmount/tabdiff-move b/tests/expected/libmount/tabdiff-move
-index 24f9bc791..95820d93e 100644
---- a/tests/expected/libmount/tabdiff-move
-+++ b/tests/expected/libmount/tabdiff-move
-@@ -1,3 +1,2 @@
- //foo.home/bar/ on /mnt/music: MOVED to /mnt/music
--/fooooo on /mnt/foo: UMOUNTED
- tmpfs on /mnt/test/foo bar: UMOUNTED
-diff --git a/tests/expected/libmount/tabdiff-remount b/tests/expected/libmount/tabdiff-remount
-index 82ebeab39..876bfd953 100644
---- a/tests/expected/libmount/tabdiff-remount
-+++ b/tests/expected/libmount/tabdiff-remount
-@@ -1,4 +1,3 @@
- /dev/mapper/kzak-home on /home/kzak: REMOUNTED from 'rw,noatime,barrier=1,data=ordered' to 'ro,noatime,barrier=1,data=ordered'
- //foo.home/bar/ on /mnt/sounds: REMOUNTED from 'rw,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344' to 'ro,relatime,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344'
--/fooooo on /mnt/foo: UMOUNTED
- tmpfs on /mnt/test/foo bar: UMOUNTED
-diff --git a/tests/expected/libmount/tabdiff-umount b/tests/expected/libmount/tabdiff-umount
-index a3e0fe48a..c7be725b9 100644
---- a/tests/expected/libmount/tabdiff-umount
-+++ b/tests/expected/libmount/tabdiff-umount
-@@ -1,3 +1,2 @@
- /dev/mapper/kzak-home on /home/kzak: UMOUNTED
--/fooooo on /mnt/foo: UMOUNTED
- tmpfs on /mnt/test/foo bar: UMOUNTED
-diff --git a/tests/expected/libmount/tabfiles-parse-mountinfo b/tests/expected/libmount/tabfiles-parse-mountinfo
-index 47eb77006..d5ba5248e 100644
---- a/tests/expected/libmount/tabfiles-parse-mountinfo
-+++ b/tests/expected/libmount/tabfiles-parse-mountinfo
-@@ -351,17 +351,6 @@ id: 47
- parent: 20
- devno: 0:38
- ------ fs:
--source: /fooooo
--target: /mnt/foo
--fstype: bar
--optstr: rw,relatime
--VFS-optstr: rw,relatime
--FS-opstr: rw
--root: /
--id: 48
--parent: 20
--devno: 0:39
-------- fs:
- source: tmpfs
- target: /mnt/test/foo bar
- fstype: tmpfs
-diff --git a/tests/expected/libmount/tabfiles-py-parse-mountinfo b/tests/expected/libmount/tabfiles-py-parse-mountinfo
-index 47eb77006..d5ba5248e 100644
---- a/tests/expected/libmount/tabfiles-py-parse-mountinfo
-+++ b/tests/expected/libmount/tabfiles-py-parse-mountinfo
-@@ -351,17 +351,6 @@ id: 47
- parent: 20
- devno: 0:38
- ------ fs:
--source: /fooooo
--target: /mnt/foo
--fstype: bar
--optstr: rw,relatime
--VFS-optstr: rw,relatime
--FS-opstr: rw
--root: /
--id: 48
--parent: 20
--devno: 0:39
-------- fs:
- source: tmpfs
- target: /mnt/test/foo bar
- fstype: tmpfs
-diff --git a/tests/ts/findmnt/files/mountinfo b/tests/ts/findmnt/files/mountinfo
-index 475ea1a33..ff1e664a8 100644
---- a/tests/ts/findmnt/files/mountinfo
-+++ b/tests/ts/findmnt/files/mountinfo
-@@ -30,4 +30,3 @@
- 44 41 0:36 / /home/kzak/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=500
- 45 20 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs sunrpc rw
- 47 20 0:38 / /mnt/sounds rw,relatime - cifs //foo.home/bar/ rw,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--48 20 0:39 / /mnt/foo\040(deleted) rw,relatime - bar /fooooo rw
-diff --git a/tests/ts/findmnt/files/mountinfo-nonroot b/tests/ts/findmnt/files/mountinfo-nonroot
-index e15b46701..87b421d2e 100644
---- a/tests/ts/findmnt/files/mountinfo-nonroot
-+++ b/tests/ts/findmnt/files/mountinfo-nonroot
-@@ -29,4 +29,3 @@
- 44 41 0:36 / /home/kzak/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=500
- 45 20 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs sunrpc rw
- 47 20 0:38 / /mnt/sounds rw,relatime - cifs //foo.home/bar/ rw,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--48 20 0:39 / /mnt/foo\040(deleted) rw,relatime - bar /fooooo rw
-diff --git a/tests/ts/libmount/files/mountinfo b/tests/ts/libmount/files/mountinfo
-index c06307183..2b0174048 100644
---- a/tests/ts/libmount/files/mountinfo
-+++ b/tests/ts/libmount/files/mountinfo
-@@ -30,5 +30,4 @@
- 44 41 0:36 / /home/kzak/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=500
- 45 20 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs sunrpc rw
- 47 20 0:38 / /mnt/sounds rw,relatime - cifs //foo.home/bar/ rw,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344
--48 20 0:39 / /mnt/foo\040(deleted) rw,relatime - bar /fooooo rw
- 49 20 0:56 / /mnt/test/foo bar rw,relatime shared:323 - tmpfs tmpfs rw
---
-2.34.0
-
diff --git a/gnu/packages/patches/valgrind-fix-default-debuginfo-path.patch b/gnu/packages/patches/valgrind-fix-default-debuginfo-path.patch
deleted file mode 100644
index f78dec02dc..0000000000
--- a/gnu/packages/patches/valgrind-fix-default-debuginfo-path.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From a7f17b57a94e9cde6d7fa96ac86be5c4fc4f9211 Mon Sep 17 00:00:00 2001
-From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-Date: Sun, 24 Apr 2022 22:20:50 +0200
-Subject: [PATCH] valgrind: fix default debuginfo path
-
-Description: Workaround for missing symbol in Guix's ld.so. The
- correct fix (not stripping all the ld.so symbols) will be done in the
- next Guix release as it requires to recompile a lot of packages.
-
-Forwarded: not-needed
-Bug-Guix: https://issues.guix.gnu.org/54728
-Author: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
----
- coregrind/m_debuginfo/readelf.c | 11 ++++++-----
- docs/xml/manual-core-adv.xml | 4 ++--
- docs/xml/manual-core.xml | 2 +-
- 3 files changed, 9 insertions(+), 8 deletions(-)
-
-diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
-index c586e3f33..947fcc500 100644
---- a/coregrind/m_debuginfo/readelf.c
-+++ b/coregrind/m_debuginfo/readelf.c
-@@ -1509,9 +1509,9 @@ DiImage* find_debug_file( struct _DebugInfo* di,
-
- if (buildid != NULL) {
- debugpath = ML_(dinfo_zalloc)("di.fdf.1",
-- VG_(strlen)(buildid) + 33);
-+ VG_(strlen)(buildid) + DEBUGPATH_EXTRA_BYTES_1);
-
-- VG_(sprintf)(debugpath, "/usr/lib/debug/.build-id/%c%c/%s.debug",
-+ VG_(sprintf)(debugpath, "DEFAULT_DEBUGINFO_PATH/.build-id/%c%c/%s.debug",
- buildid[0], buildid[1], buildid + 2);
-
- dimg = open_debug_file(debugpath, buildid, 0, rel_ok, NULL);
-@@ -1536,7 +1536,8 @@ DiImage* find_debug_file( struct _DebugInfo* di,
-
- debugpath = ML_(dinfo_zalloc)(
- "di.fdf.3",
-- VG_(strlen)(objdir) + VG_(strlen)(debugname) + 64
-+ VG_(strlen)(objdir) + VG_(strlen)(debugname)
-+ + VG_(strlen)("DEFAULT_DEBUGINFO_PATH/") + 1
- + (extrapath ? VG_(strlen)(extrapath) : 0)
- + (serverpath ? VG_(strlen)(serverpath) : 0));
-
-@@ -1561,7 +1562,7 @@ DiImage* find_debug_file( struct _DebugInfo* di,
-
- TRY_OBJDIR_USRMERGE_OBJDIR("%s/%s");
- TRY_OBJDIR_USRMERGE_OBJDIR("%s/.debug/%s");
-- TRY_OBJDIR_USRMERGE_OBJDIR("/usr/lib/debug%s/%s");
-+ TRY_OBJDIR_USRMERGE_OBJDIR("DEFAULT_DEBUGINFO_PATH%s/%s");
-
- if (extrapath) {
- TRY_OBJDIR("%s%s/%s", extrapath, objdir, debugname);
-@@ -1631,7 +1632,7 @@ DiImage* find_debug_file_ad_hoc( const DebugInfo* di,
-
- debugpath = ML_(dinfo_zalloc)(
- "di.fdfah.3",
-- VG_(strlen)(objdir) + 64
-+ VG_(strlen)(objdir) + DEBUGPATH_EXTRA_BYTES_2
- + (extrapath ? VG_(strlen)(extrapath) : 0)
- + (serverpath ? VG_(strlen)(serverpath) : 0));
-
-diff --git a/docs/xml/manual-core-adv.xml b/docs/xml/manual-core-adv.xml
-index 1fa801edc..a7c01d5e6 100644
---- a/docs/xml/manual-core-adv.xml
-+++ b/docs/xml/manual-core-adv.xml
-@@ -447,7 +447,7 @@ Valgrind embedded gdbserver:</para>
- Remote debugging using | vgdb
- relaying data between gdb and process 2418
- Reading symbols from /lib/ld-linux.so.2...done.
--Reading symbols from /usr/lib/debug/lib/ld-2.11.2.so.debug...done.
-+Reading symbols from DEFAULT_DEBUGINFO_PATH/lib/ld-2.11.2.so.debug...done.
- Loaded symbols for /lib/ld-linux.so.2
- [Switching to Thread 2418]
- 0x001f2850 in _start () from /lib/ld-linux.so.2
-@@ -475,7 +475,7 @@ Remote communication error: Resource temporarily unavailable.
- Remote debugging using | vgdb --pid=2479
- relaying data between gdb and process 2479
- Reading symbols from /lib/ld-linux.so.2...done.
--Reading symbols from /usr/lib/debug/lib/ld-2.11.2.so.debug...done.
-+Reading symbols from DEFAULT_DEBUGINFO_PATH/lib/ld-2.11.2.so.debug...done.
- Loaded symbols for /lib/ld-linux.so.2
- [Switching to Thread 2479]
- 0x001f2850 in _start () from /lib/ld-linux.so.2
-diff --git a/docs/xml/manual-core.xml b/docs/xml/manual-core.xml
-index dc33e1269..f6eb60086 100644
---- a/docs/xml/manual-core.xml
-+++ b/docs/xml/manual-core.xml
-@@ -1409,7 +1409,7 @@ that can report errors, e.g. Memcheck, but not Cachegrind.</para>
- <listitem>
- <para>By default Valgrind searches in several well-known paths
- for debug objects, such
-- as <computeroutput>/usr/lib/debug/</computeroutput>.</para>
-+ as <computeroutput>DEFAULT_DEBUGINFO_PATH/</computeroutput>.</para>
-
- <para>However, there may be scenarios where you may wish to put
- debug objects at an arbitrary location, such as external storage
---
-2.35.1
-
diff --git a/gnu/packages/patches/zig-do-not-link-against-librt.patch b/gnu/packages/patches/zig-do-not-link-against-librt.patch
new file mode 100644
index 0000000000..3239efbdd4
--- /dev/null
+++ b/gnu/packages/patches/zig-do-not-link-against-librt.patch
@@ -0,0 +1,10 @@
+--- 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",
+ },
+ },
diff --git a/gnu/packages/patches/zsh-egrep-failing-test.patch b/gnu/packages/patches/zsh-egrep-failing-test.patch
new file mode 100644
index 0000000000..10828ca6bb
--- /dev/null
+++ b/gnu/packages/patches/zsh-egrep-failing-test.patch
@@ -0,0 +1,11 @@
+--- a/Test/E01options.ztst 2023-03-30 21:34:12.372309112 +0200
++++ b/Test/E01options.ztst 2023-03-30 21:34:33.212335339 +0200
+@@ -649,7 +649,7 @@
+ >noktarg1
+ >0 1
+
+- showopt() { setopt | egrep 'localoptions|ksharrays'; }
++ showopt() { setopt | grep -E 'localoptions|ksharrays'; }
+ f1() { setopt localoptions ksharrays; showopt }
+ f2() { setopt ksharrays; showopt }
+ setopt kshoptionprint