aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/clamav-system-tomsfastmath.patch53
-rw-r--r--gnu/packages/patches/clang-11.0-libc-search-path.patch89
-rw-r--r--gnu/packages/patches/dconf-meson-0.52.patch19
-rw-r--r--gnu/packages/patches/fplll-std-fenv.patch18
-rw-r--r--gnu/packages/patches/gnome-settings-daemon-gc.patch43
-rw-r--r--gnu/packages/patches/grim-revert-output-rotation.patch27
-rw-r--r--gnu/packages/patches/hplip-fix-bug-1898438.patch19
-rw-r--r--gnu/packages/patches/icecat-makeicecat.patch14
-rw-r--r--gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch572
-rw-r--r--gnu/packages/patches/jamvm-1.5.1-armv7-support.patch (renamed from gnu/packages/patches/jamvm-arm.patch)0
-rw-r--r--gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch645
-rw-r--r--gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch35
-rw-r--r--gnu/packages/patches/java-antlr4-Add-standalone-generator.patch52
-rw-r--r--gnu/packages/patches/java-antlr4-fix-code-too-large.java90
-rw-r--r--gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch87
-rw-r--r--gnu/packages/patches/konversation-Fix-build-with-Qt-5.11.patch24
-rw-r--r--gnu/packages/patches/libcanberra-wayland-crash.patch55
-rw-r--r--gnu/packages/patches/libcyaml-libyaml-compat.patch51
-rw-r--r--gnu/packages/patches/libdrm-realpath-virtio.patch42
-rw-r--r--gnu/packages/patches/liblouisutdml-fix-tests.patch33
-rw-r--r--gnu/packages/patches/libsndfile-CVE-2017-12562.patch97
-rw-r--r--gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch77
-rw-r--r--gnu/packages/patches/libsndfile-CVE-2017-8362.patch61
-rw-r--r--gnu/packages/patches/libsndfile-armhf-type-checks.patch42
-rw-r--r--gnu/packages/patches/lsh-fix-x11-forwarding.patch20
-rw-r--r--gnu/packages/patches/mailutils-fix-uninitialized-variable.patch26
-rw-r--r--gnu/packages/patches/mariadb-client-test-32bit.patch37
-rw-r--r--gnu/packages/patches/nginx-socket-cloexec.patch185
-rw-r--r--gnu/packages/patches/nss-3.56-pkgconfig.patch (renamed from gnu/packages/patches/nss-pkgconfig.patch)11
-rw-r--r--gnu/packages/patches/picard-fix-id3-rename-test.patch11
-rw-r--r--gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch36
-rw-r--r--gnu/packages/patches/qemu-build-info-manual.patch139
-rw-r--r--gnu/packages/patches/samba-fix-fcntl-hint-detection.patch55
-rw-r--r--gnu/packages/patches/sbcl-graph-asdf-definitions.patch70
-rw-r--r--gnu/packages/patches/sunxi-tools-remove-sys-io.patch52
-rw-r--r--gnu/packages/patches/unison-fix-ocaml-4.08.patch81
-rw-r--r--gnu/packages/patches/xpra-4.0.4-norequests.patch39
37 files changed, 2432 insertions, 575 deletions
diff --git a/gnu/packages/patches/clamav-system-tomsfastmath.patch b/gnu/packages/patches/clamav-system-tomsfastmath.patch
index 2153723a76..99fbf9c6dc 100644
--- a/gnu/packages/patches/clamav-system-tomsfastmath.patch
+++ b/gnu/packages/patches/clamav-system-tomsfastmath.patch
@@ -1,8 +1,8 @@
From: Tobias Geerinckx-Rice <me@tobias.gr>
-Date: Sun, 24 Feb 2019 15:50:37 +0100
+Date: Sat, 03 Oct 2020 22:10:20 +0200
Subject: gnu: clamav: Add support for system tomsfastmath.
-Adjusted from the original for clamav 0.101.1:
+Adjusted from the original for clamav 0.103.0:
From 756ff89526b5ffaa7a4f49b1bbecf2ecbd6f85f9 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
@@ -19,9 +19,10 @@ Patch-Name: add-support-for-system-tomsfastmath.patch
5 files changed, 28 insertions(+), 4 deletions(-)
create mode 100644 m4/reorganization/libs/tomsfastmath.m4
---- a/configure.ac 1970-01-01 01:00:00.000000000 +0100
-+++ b/configure.ac 2019-02-24 15:47:14.076992864 +0100
-@@ -89,6 +89,7 @@
+diff -Naur a/configure.ac b/configure.ac
+--- a/configure.ac 1970-01-01 01:00:01.000000000 +0100
++++ b/configure.ac 2020-10-03 22:04:00.535448352 +0200
+@@ -94,6 +94,7 @@
m4_include([m4/reorganization/libs/json.m4])
m4_include([m4/reorganization/libs/pcre.m4])
m4_include([m4/reorganization/libs/libmspack.m4])
@@ -29,7 +30,7 @@ Patch-Name: add-support-for-system-tomsfastmath.patch
if test "x$use_internal_mspack" = "xno"; then
mspack_msg="External, $LIBMSPACK_CFLAGS $LIBMSPACK_LIBS"
-@@ -297,6 +298,7 @@
+@@ -361,6 +362,7 @@
fi
CL_MSG_STATUS([yara ],[$enable_yara],[$enable_yara])
CL_MSG_STATUS([fts ],[yes],[$lfs_fts_msg])
@@ -37,9 +38,9 @@ Patch-Name: add-support-for-system-tomsfastmath.patch
# Yep, downgrading the compiler avoids the bug too:
-diff -Naur clamav-0.101.1/libclamav/bignum.h clamav-0.101.1b/libclamav/bignum.h
---- a/libclamav/bignum.h 1970-01-01 01:00:00.000000000 +0100
-+++ b/libclamav/bignum.h 2019-02-24 15:46:36.216998323 +0100
+diff -Naur a/libclamav/bignum.h b/libclamav/bignum.h
+--- a/libclamav/bignum.h 1970-01-01 01:00:01.000000000 +0100
++++ b/libclamav/bignum.h 2020-10-03 22:04:00.535448352 +0200
@@ -1,9 +1,13 @@
#ifndef BIGNUM_H_
#define BIGNUM_H_
@@ -54,11 +55,11 @@ diff -Naur clamav-0.101.1/libclamav/bignum.h clamav-0.101.1b/libclamav/bignum.h
+
typedef fp_int mp_int;
#define mp_cmp fp_cmp
- #define mp_toradix_n(a,b,c,d) fp_toradix_n(a,b,c,d)
-diff -Naur clamav-0.101.1/libclamav/Makefile.am clamav-0.101.1b/libclamav/Makefile.am
---- a/libclamav/Makefile.am 1970-01-01 01:00:00.000000000 +0100
-+++ b/libclamav/Makefile.am 2019-02-24 15:46:36.216998323 +0100
-@@ -597,8 +597,10 @@
+ #define mp_toradix_n(a, b, c, d) fp_toradix_n(a, b, c, d)
+diff -Naur a/libclamav/Makefile.am b/libclamav/Makefile.am
+--- a/libclamav/Makefile.am 1970-01-01 01:00:01.000000000 +0100
++++ b/libclamav/Makefile.am 2020-10-03 22:06:42.705447754 +0200
+@@ -588,8 +588,10 @@
yara_clam.h
endif
@@ -68,23 +69,23 @@ diff -Naur clamav-0.101.1/libclamav/Makefile.am clamav-0.101.1b/libclamav/Makefi
+
+if !SYSTEM_TOMSFASTMATH
+libclamav_la_SOURCES += bignum_fast.h\
- tomsfastmath/addsub/fp_add.c\
- tomsfastmath/addsub/fp_add_d.c\
- tomsfastmath/addsub/fp_addmod.c\
-@@ -680,6 +682,10 @@
- tomsfastmath/sqr/fp_sqr_comba_generic.c\
- tomsfastmath/sqr/fp_sqr_comba_small_set.c\
+ tomsfastmath/addsub/fp_add.c\
+ tomsfastmath/addsub/fp_add_d.c\
+ tomsfastmath/addsub/fp_addmod.c\
+@@ -671,6 +673,10 @@
+ tomsfastmath/sqr/fp_sqr_comba_generic.c\
+ tomsfastmath/sqr/fp_sqr_comba_small_set.c\
tomsfastmath/sqr/fp_sqrmod.c
+else
+libclamav_la_CFLAGS += $(TOMSFASTMATH_CFLAGS)
+libclamav_la_LIBADD += $(TOMSFASTMATH_LIBS)
+endif
- .PHONY: version.h.tmp
+ .PHONY2: version.h.tmp
version.c: version.h
-diff -Naur clamav-0.101.1/libclamav/xdp.c clamav-0.101.1b/libclamav/xdp.c
---- a/libclamav/xdp.c 1970-01-01 01:00:00.000000000 +0100
-+++ b/libclamav/xdp.c 2019-02-24 15:46:36.216998323 +0100
+diff -Naur a/libclamav/xdp.c b/libclamav/xdp.c
+--- a/libclamav/xdp.c 1970-01-01 01:00:01.000000000 +0100
++++ b/libclamav/xdp.c 2020-10-03 22:04:00.535448352 +0200
@@ -52,7 +52,7 @@
#include "scanners.h"
#include "conv.h"
@@ -94,9 +95,9 @@ diff -Naur clamav-0.101.1/libclamav/xdp.c clamav-0.101.1b/libclamav/xdp.c
#include "filetypes.h"
static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz);
-diff -Naur clamav-0.101.1/m4/reorganization/libs/tomsfastmath.m4 clamav-0.101.1b/m4/reorganization/libs/tomsfastmath.m4
+diff -Naur a/m4/reorganization/libs/tomsfastmath.m4 b/m4/reorganization/libs/tomsfastmath.m4
--- a/m4/reorganization/libs/tomsfastmath.m4 1970-01-01 01:00:00.000000000 +0100
-+++ b/m4/reorganization/libs/tomsfastmath.m4 2019-02-24 15:46:36.216998323 +0100
++++ b/m4/reorganization/libs/tomsfastmath.m4 2020-10-03 22:04:00.535448352 +0200
@@ -0,0 +1,12 @@
+dnl Check for system tomsfastmath
+PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastmath=yes], [have_system_tomsfastmath=no])
diff --git a/gnu/packages/patches/clang-11.0-libc-search-path.patch b/gnu/packages/patches/clang-11.0-libc-search-path.patch
new file mode 100644
index 0000000000..c014de179d
--- /dev/null
+++ b/gnu/packages/patches/clang-11.0-libc-search-path.patch
@@ -0,0 +1,89 @@
+Clang attempts to guess file names based on the OS and distro (yes!),
+but unfortunately, that doesn't work for us.
+
+This patch makes it easy to insert libc's $libdir so that Clang passes the
+correct absolute file name of crt1.o etc. to 'ld'. It also disables all
+the distro-specific stuff and removes the hard-coded FHS directory names
+to make sure Clang also works on non-Guix systems.
+
+diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
+--- a/lib/Driver/ToolChains/Gnu.cpp
++++ b/lib/Driver/ToolChains/Gnu.cpp
+@@ -2797,7 +2797,7 @@ void Generic_GCC::AddMultilibPaths(const Driver &D,
+ // the cross. Note that GCC does include some of these directories in some
+ // configurations but this seems somewhere between questionable and simply
+ // a bug.
+- if (StringRef(LibPath).startswith(SysRoot)) {
++ if (0) {
+ addPathIfExists(D, LibPath + "/" + MultiarchTriple, Paths);
+ addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths);
+ }
+@@ -2811,6 +2811,10 @@ void Generic_GCC::AddMultiarchPaths(const Driver &D,
+ // Try walking via the GCC triple path in case of biarch or multiarch GCC
+ // installations with strange symlinks.
+ if (GCCInstallation.isValid()) {
++
++// The following code would end up adding things like
++// "/usr/lib/x86_64-unknown-linux-gnu/../../lib64" to the search path.
++#if 0
+ addPathIfExists(D,
+ SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
+ "/../../" + OSLibDir,
+@@ -2823,6 +2827,7 @@ void Generic_GCC::AddMultiarchPaths(const Driver &D,
+ D, GCCInstallation.getInstallPath() + BiarchSibling.gccSuffix(),
+ Paths);
+ }
++#endif // Guix
+
+ // See comments above on the multilib variant for details of why this is
+ // included even from outside the sysroot.
+diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
+--- a/lib/Driver/ToolChains/Linux.cpp
++++ b/lib/Driver/ToolChains/Linux.cpp
+@@ -219,6 +219,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+
+ Generic_GCC::PushPPaths(PPaths);
+
++// Comment out the distro-specific tweaks so that they don't bite when
++// using Guix on a foreign distro.
++#if 0
+ Distro Distro(D.getVFS(), Triple);
+
+ if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
+@@ -284,6 +287,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+
+ if (IsAndroid || Distro.IsOpenSUSE())
+ ExtraOpts.push_back("--enable-new-dtags");
++#endif // Guix
+
+ // The selection of paths to try here is designed to match the patterns which
+ // the GCC driver itself uses, as this is part of the GCC-compatible driver.
+@@ -310,6 +314,8 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths);
+ addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths);
+
++// This requires the commented distro tweaks above.
++#if 0
+ if (IsAndroid) {
+ // Android sysroots contain a library directory for each supported OS
+ // version as well as some unversioned libraries in the usual multiarch
+@@ -338,6 +344,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths);
+ addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths);
+ }
++#endif // Guix
+
+ Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths);
+
+@@ -349,8 +356,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ if (StringRef(D.Dir).startswith(SysRoot))
+ addPathIfExists(D, D.Dir + "/../lib", Paths);
+
+- addPathIfExists(D, SysRoot + "/lib", Paths);
+- addPathIfExists(D, SysRoot + "/usr/lib", Paths);
++ // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
++ // and friends can be found.
++ addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
+ }
+
+ ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {
diff --git a/gnu/packages/patches/dconf-meson-0.52.patch b/gnu/packages/patches/dconf-meson-0.52.patch
deleted file mode 100644
index c636edc108..0000000000
--- a/gnu/packages/patches/dconf-meson-0.52.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Fix build failure with Meson 0.52.
-
-Taken from upstream:
-https://gitlab.gnome.org/GNOME/dconf/commit/7ad890fb7a2ec90a777a756a1fa20a615ec7245e
-https://gitlab.gnome.org/GNOME/dconf/merge_requests/54
-
-diff --git a/client/meson.build b/client/meson.build
-index f3b7122cb05bfa7bb481c487e3cd052aa1ad58e5..de6387e2cac2aba12b83f2614c277bada434fd16 100644
---- a/client/meson.build
-+++ b/client/meson.build
-@@ -28,7 +28,7 @@ libdconf_client = static_library(
-
- libdconf_client_dep = declare_dependency(
- dependencies: gio_dep,
-- link_whole: libdconf_client,
-+ link_with: libdconf_client,
- )
-
- libdconf = shared_library(
diff --git a/gnu/packages/patches/fplll-std-fenv.patch b/gnu/packages/patches/fplll-std-fenv.patch
new file mode 100644
index 0000000000..aa2438f0c9
--- /dev/null
+++ b/gnu/packages/patches/fplll-std-fenv.patch
@@ -0,0 +1,18 @@
+See https://github.com/fplll/fplll/issues/444
+
+--- fplll-5.3.3-checkout.old/fplll/enum/enumerate_base.h 2020-09-23 13:55:27.833769823 +0200
++++ fplll-5.3.3-checkout/fplll/enum/enumerate_base.h 2020-09-23 13:56:14.313771769 +0200
+@@ -127,10 +127,10 @@
+ int rounding_backup;
+ void save_rounding()
+ {
+- rounding_backup = std::fegetround();
+- std::fesetround(FE_TONEAREST);
++ rounding_backup = fegetround();
++ fesetround(FE_TONEAREST);
+ }
+- void restore_rounding() { std::fesetround(rounding_backup); }
++ void restore_rounding() { fesetround(rounding_backup); }
+
+ inline bool next_pos_up()
+ {
diff --git a/gnu/packages/patches/gnome-settings-daemon-gc.patch b/gnu/packages/patches/gnome-settings-daemon-gc.patch
new file mode 100644
index 0000000000..688544b418
--- /dev/null
+++ b/gnu/packages/patches/gnome-settings-daemon-gc.patch
@@ -0,0 +1,43 @@
+This patch adds a "guix gc" button to the low disk space notification
+that 'gsd-housekeeping' emits.
+
+diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
+index bd3437e..89027d8 100644
+--- a/plugins/housekeeping/gsd-disk-space.c
++++ b/plugins/housekeeping/gsd-disk-space.c
+@@ -546,6 +546,21 @@ empty_trash_callback (NotifyNotification *n,
+ notify_notification_close (n, NULL);
+ }
+
++static void
++guix_gc_callback (NotifyNotification *n,
++ const char *action)
++{
++ const gchar *argv[] = { "guix", "gc", NULL };
++
++ g_assert (action != NULL);
++ g_assert (strcmp (action, "run-guix-gc") == 0);
++
++ g_spawn_async (NULL, (gchar **) argv, NULL, G_SPAWN_SEARCH_PATH,
++ NULL, NULL, NULL, NULL);
++
++ notify_notification_close (n, NULL);
++}
++
+ static void
+ on_notification_closed (NotifyNotification *n)
+ {
+@@ -591,6 +606,13 @@ ldsm_notify (const char *summary,
+ g_free);
+ }
+
++ notify_notification_add_action (notification,
++ "run-guix-gc",
++ _("Collect Unused Guix Items"),
++ (NotifyActionCallback) guix_gc_callback,
++ NULL,
++ NULL);
++
+ has_trash = ldsm_mount_has_trash (mount_path);
+
+ if (has_trash) {
diff --git a/gnu/packages/patches/grim-revert-output-rotation.patch b/gnu/packages/patches/grim-revert-output-rotation.patch
new file mode 100644
index 0000000000..cbf0a86502
--- /dev/null
+++ b/gnu/packages/patches/grim-revert-output-rotation.patch
@@ -0,0 +1,27 @@
+From 80b17ceaff90b81b28b44004d2aca4cc40f365be Mon Sep 17 00:00:00 2001
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Fri, 2 Oct 2020 00:07:30 +0200
+Subject: [PATCH] Revert "Correct interpretation of output rotation"
+
+This reverts commit 8f9d60885ce2f9bd66cd93d3378dcb6866d4588a.
+It is incompatible with the current Sway version (1.4) in Guix.
+---
+ render.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/render.c b/render.c
+index 8f31e7e..a6b0b12 100644
+--- a/render.c
++++ b/render.c
+@@ -104,7 +104,7 @@ cairo_surface_t *render(struct grim_state *state, struct grim_box *geometry,
+ cairo_matrix_translate(&matrix,
+ (double)output->geometry.width / 2,
+ (double)output->geometry.height / 2);
+- cairo_matrix_rotate(&matrix, get_output_rotation(output->transform));
++ cairo_matrix_rotate(&matrix, -get_output_rotation(output->transform));
+ cairo_matrix_scale(&matrix,
+ (double)raw_output_width / output_width * output_flipped_x,
+ (double)raw_output_height / output_height * output_flipped_y);
+--
+2.28.0
+
diff --git a/gnu/packages/patches/hplip-fix-bug-1898438.patch b/gnu/packages/patches/hplip-fix-bug-1898438.patch
new file mode 100644
index 0000000000..7c095f9b2a
--- /dev/null
+++ b/gnu/packages/patches/hplip-fix-bug-1898438.patch
@@ -0,0 +1,19 @@
+From: Tobias Geerinckx-Rice <me@tobias.gr>
+Date: Sun, 04 Oct 2020 13:28:49 +0200
+Subject: [PATCH] gnu: hplip: Fix non-network builds (bug #1898438)
+
+Reported as <https://bugs.launchpad.net/hplip/+bug/1898438>.
+
+diff -Naur a/scan/sane/hpaio.c b/scan/sane/hpaio.c
+--- a/scan/sane/hpaio.c 1970-01-01 01:00:01.000000000 +0100
++++ b/scan/sane/hpaio.c 2020-10-04 13:26:34.665244052 +0200
+@@ -36,7 +36,9 @@
+ #include <string.h>
+ #include <cups/cups.h>
+ #include "hpmud.h"
++#ifdef HAVE_LIBNETSNMP
+ #include "avahiDiscovery.h"
++#endif
+ #include "hp_ipp.h"
+ #include "soap.h"
+ #include "soapht.h"
diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch
index 265725ce36..c90950d5ef 100644
--- a/gnu/packages/patches/icecat-makeicecat.patch
+++ b/gnu/packages/patches/icecat-makeicecat.patch
@@ -25,7 +25,7 @@ index 8be2362..48716f2 100755
-wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc
-gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353
-gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc
--echo -n ae692bf2a15908cacbb9d4c7ccf78525a87410ff3f13befedc1926f849bc27cc firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
+-echo -n 5fd27d67689fe60803022035e556146d2dbce5e53d21c14d026fc31dd2e45be9 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
-
-echo Extracting Firefox tarball
-tar -xf firefox-${FFVERSION}esr.source.tar.xz
@@ -37,7 +37,7 @@ index 8be2362..48716f2 100755
+# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc
+# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353
+# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc
-+# echo -n ae692bf2a15908cacbb9d4c7ccf78525a87410ff3f13befedc1926f849bc27cc firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
++# echo -n 5fd27d67689fe60803022035e556146d2dbce5e53d21c14d026fc31dd2e45be9 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
+#
+# echo Extracting Firefox tarball
+# tar -xf firefox-${FFVERSION}esr.source.tar.xz
@@ -63,9 +63,9 @@ index 8be2362..48716f2 100755
-
-mv l10n $SOURCEDIR
-
--hg clone http://hg.mozilla.org/l10n/compare-locales/
+-hg clone https://hg.mozilla.org/l10n/compare-locales/
-cd compare-locales/
--hg checkout RELEASE_3_3_0
+-hg checkout RELEASE_8_0_0
-cd ..
-rm compare-locales/.hg* compare-locales/.git* -rf
-mv compare-locales $SOURCEDIR/l10n
@@ -84,9 +84,9 @@ index 8be2362..48716f2 100755
+#
+# mv l10n $SOURCEDIR
+#
-+# hg clone http://hg.mozilla.org/l10n/compare-locales/
++# hg clone https://hg.mozilla.org/l10n/compare-locales/
+# cd compare-locales/
-+# hg checkout RELEASE_3_3_0
++# hg checkout RELEASE_8_0_0
+# cd ..
+# rm compare-locales/.hg* compare-locales/.git* -rf
+# mv compare-locales $SOURCEDIR/l10n
@@ -98,7 +98,7 @@ index 8be2362..48716f2 100755
shopt -s nullglob
for patch in $DATA/patches/*.patch; do
-@@ -603,6 +603,6 @@ sed 's/777/755/;' -i toolkit/crashreporter/google-breakpad/Makefile.in
+@@ -598,6 +598,6 @@ sed 's/777/755/;' -i toolkit/crashreporter/google-breakpad/Makefile.in
# Fix CVE-2012-3386
/bin/sed 's/chmod a+w/chmod u+w/' -i ./js/src/ctypes/libffi/Makefile.in ./toolkit/crashreporter/google-breakpad/Makefile.in ./toolkit/crashreporter/google-breakpad/src/third_party/glog/Makefile.in || true
diff --git a/gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch b/gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch
new file mode 100644
index 0000000000..8867d4f191
--- /dev/null
+++ b/gnu/packages/patches/jamvm-1.5.1-aarch64-support.patch
@@ -0,0 +1,572 @@
+From 9c83c3d3f443eb92f87dc87c7dcfe95577b95621 Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Thu, 28 May 2020 14:29:55 -0400
+Subject: [PATCH] Add support for aarch64 on GNU/Linux
+
+---
+ configure.ac | 10 +-
+ src/arch/Makefile.am | 2 +-
+ src/arch/aarch64.h | 110 ++++++++++++++++
+ src/os/linux/Makefile.am | 2 +-
+ src/os/linux/aarch64/Makefile.am | 28 ++++
+ src/os/linux/aarch64/callNative.S | 212 ++++++++++++++++++++++++++++++
+ src/os/linux/aarch64/dll_md.c | 59 +++++++++
+ src/os/linux/aarch64/init.c | 51 +++++++
+ 8 files changed, 469 insertions(+), 5 deletions(-)
+ create mode 100644 src/arch/aarch64.h
+ create mode 100644 src/os/linux/aarch64/Makefile.am
+ create mode 100644 src/os/linux/aarch64/callNative.S
+ create mode 100644 src/os/linux/aarch64/dll_md.c
+ create mode 100644 src/os/linux/aarch64/init.c
+
+diff --git a/configure.ac b/configure.ac
+index ccd530f..707f281 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -43,6 +43,7 @@ amd64-*-freebsd*) host_os=bsd libdl_needed=no ;;
+ arm*-*-linux*) host_cpu=arm host_os=linux ;;
+ arm*-*-openbsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
+ arm*-*-freebsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
++aarch64*-*-linux*) host_cpu=aarch64 host_os=linux ;;
+ powerpc*-*-linux*) host_cpu=powerpc host_os=linux ;;
+ powerpc*-*-openbsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+ powerpc*-*-freebsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+@@ -149,9 +150,11 @@ AC_ARG_ENABLE(runtime-reloc-checks,
+
+ AC_ARG_ENABLE(int-inlining,
+ [AS_HELP_STRING(--enable-int-inlining,enable inline threaded version of the interpreter
+- (by default enabled on x86_64, i386 and powerpc, disabled otherwise))],,
+- [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = powerpc && \
+- test "$cross_compiling" = no -o "$enable_runtime_reloc_checks" != no; then
++ (by default enabled on x86_64, i386, powerpc and aarch64,
++ disabled otherwise))],,
++ [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = powerpc -o \
++ "$host_cpu" = aarch64 && test "$cross_compiling" = no -o \
++ "$enable_runtime_reloc_checks" != no; then
+ enable_int_inlining=yes
+ else
+ enable_int_inlining=no
+@@ -298,6 +301,7 @@ AC_CONFIG_FILES(
+ src/os/linux/x86_64/Makefile \
+ src/os/linux/parisc/Makefile \
+ src/os/linux/mips/Makefile \
++ src/os/linux/aarch64/Makefile \
+ src/os/darwin/i386/Makefile \
+ src/os/darwin/arm/Makefile \
+ src/os/darwin/powerpc/Makefile \
+diff --git a/src/arch/Makefile.am b/src/arch/Makefile.am
+index 078c1de..afb26d1 100644
+--- a/src/arch/Makefile.am
++++ b/src/arch/Makefile.am
+@@ -19,4 +19,4 @@
+ ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ##
+
+-EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h
++EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h aarch64.h
+diff --git a/src/arch/aarch64.h b/src/arch/aarch64.h
+new file mode 100644
+index 0000000..c96aa9f
+--- /dev/null
++++ b/src/arch/aarch64.h
+@@ -0,0 +1,110 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
++ * Robert Lougher <rob@lougher.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include <stdint.h>
++
++#define OS_ARCH "aarch64"
++
++#define HANDLER_TABLE_T static const void
++#define DOUBLE_1_BITS 0x3ff0000000000000LL
++
++#define READ_DBL(v,p,l) v = ((u8)p[0]<<56)|((u8)p[1]<<48)|((u8)p[2]<<40) \
++ |((u8)p[3]<<32)|((u8)p[4]<<24)|((u8)p[5]<<16) \
++ |((u8)p[6]<<8)|(u8)p[7]; p+=8
++
++/* Needed for i386 -- empty here */
++#define FPU_HACK
++
++#define COMPARE_AND_SWAP_64(addr, old_val, new_val) \
++({ \
++ int result, read_val; \
++ __asm__ __volatile__ (" \
++ 1: ldaxr %2, %1; \
++ cmp %2, %3; \
++ b.ne 2f; \
++ stlxr %w0, %4, %1; \
++ cmp %w0, wzr; \
++ b.ne 1b; \
++ 2: cset %w0, eq;" \
++ : "=&r" (result), "+Q" (*addr), "=&r" (read_val) \
++ : "r" (old_val), "r" (new_val) \
++ : "cc"); \
++ result; \
++})
++
++#define COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define LOCKWORD_READ(addr) \
++({ \
++ uintptr_t result; \
++ __asm__ __volatile__ (" \
++ ldar %0, %1;" \
++ : "=r" (result) \
++ : "Q" (*addr) \
++ : "cc"); \
++ result; \
++})
++
++#define LOCKWORD_WRITE(addr, value) \
++({ \
++ __asm__ __volatile__ (" \
++ stlr %1, %0;" \
++ : "=Q" (*addr) \
++ : "r" (value) \
++ : "cc"); \
++})
++
++#define LOCKWORD_COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define FLUSH_CACHE(addr, length) \
++{ \
++ uintptr_t start = (uintptr_t) (addr); \
++ uintptr_t end = start + length; \
++ uintptr_t i; \
++ \
++ for(i = start & aarch64_data_cache_line_mask; \
++ i < end; \
++ i += aarch64_data_cache_line_len) \
++ __asm__ ("dc cvau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish"); \
++ \
++ for(i = start & aarch64_instruction_cache_line_mask; \
++ i < end; \
++ i += aarch64_instruction_cache_line_len) \
++ __asm__ ("ic ivau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish; isb"); \
++}
++
++#define MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define UNLOCK_MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define JMM_LOCK_MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define JMM_UNLOCK_MBARRIER() JMM_LOCK_MBARRIER()
++
++/* Defined in src/os/linux/aarch64/init.c */
++extern unsigned char aarch64_data_cache_line_len;
++extern uintptr_t aarch64_data_cache_line_mask;
++extern unsigned char aarch64_instruction_cache_line_len;
++extern uintptr_t aarch64_instruction_cache_line_mask;
+diff --git a/src/os/linux/Makefile.am b/src/os/linux/Makefile.am
+index aa29be1..d582b97 100644
+--- a/src/os/linux/Makefile.am
++++ b/src/os/linux/Makefile.am
+@@ -20,7 +20,7 @@
+ ##
+
+ SUBDIRS = @arch@
+-DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips
++DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips aarch64
+
+ noinst_LTLIBRARIES = libos.la
+ libos_la_SOURCES = os.c
+diff --git a/src/os/linux/aarch64/Makefile.am b/src/os/linux/aarch64/Makefile.am
+new file mode 100644
+index 0000000..1024c3a
+--- /dev/null
++++ b/src/os/linux/aarch64/Makefile.am
+@@ -0,0 +1,28 @@
++##
++## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012
++## Robert Lougher <rob@lougher.org.uk>.
++##
++## File added by Simon South <simon@simonsouth.net>.
++##
++## This file is part of JamVM.
++##
++## This program is free software; you can redistribute it and/or
++## modify it under the terms of the GNU General Public License
++## as published by the Free Software Foundation; either version 2,
++## or (at your option) any later version.
++##
++## This program is distributed in the hope that it will be useful,
++## but WITHOUT ANY WARRANTY; without even the implied warranty of
++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++## GNU General Public License for more details.
++##
++## You should have received a copy of the GNU General Public License
++## along with this program; if not, write to the Free Software
++## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++##
++
++noinst_LTLIBRARIES = libnative.la
++libnative_la_SOURCES = init.c dll_md.c callNative.S
++
++AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
++AM_CCASFLAGS = -I$(top_builddir)/src
+diff --git a/src/os/linux/aarch64/callNative.S b/src/os/linux/aarch64/callNative.S
+new file mode 100644
+index 0000000..e067c4f
+--- /dev/null
++++ b/src/os/linux/aarch64/callNative.S
+@@ -0,0 +1,212 @@
++/*
++ * Copyright (C) 2008, 2009, 2011, 2012 Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "config.h"
++
++#ifndef USE_FFI
++ .text
++ .arch armv8-a
++ .align 2
++ .global callJNIMethod
++ .type callJNIMethod,function
++
++/*
++ * Arguments passed in:
++ *
++ * x0 JNIEnv
++ * x1 class or NULL
++ * x2 sig
++ * w3 extra arg
++ * x4 ostack
++ * x5 function pntr
++ * w6 args count
++ */
++
++/* Register usage:
++ *
++ * x20 ostack
++ * x19 sig pntr
++ * x16 function pntr
++ * x15 ostack pntr
++ * x14 args pntr
++ * x13 float/double handler
++ * x12 int/long handler
++ * w11 fp regs remaining
++ * w10 int regs remaining
++ * x9 scratch
++ * x2-x7 outgoing int args
++ * x1 outgoing class or this pntr
++ * x0 outgoing JNIEnv (as passed in)
++ *
++ * d0 - d7 outgoing float args
++ */
++
++callJNIMethod:
++ stp x29, x30, [sp, #-32]!
++ mov x29, sp
++ stp x19, x20, [x29, #16]
++
++ sub sp, sp, w3 /* allocate room for stacked args */
++ mov x14, sp
++
++ mov x20, x4 /* preserve ostack */
++ add x19, x2, #1 /* init sig pntr -- skipping '(' */
++
++ mov x16, x5 /* save function pntr */
++ mov x15, x20 /* init ostack pntr */
++
++ adr x13, fp_reg_handlers-8
++ adr x12, int_reg_handlers-8
++
++ mov w11, #8 /* fp regs remaining */
++ mov w10, #6 /* int regs remaining */
++
++ cbnz x1, scan_sig /* is method non-static? */
++ ldr x1, [x15], #8 /* yes, load x1 with "this" */
++
++scan_sig:
++ ldrb w9, [x19], #1 /* get next sig char */
++
++ cmp w9, #41 /* ')' */
++ b.eq done
++
++ cmp w9, #74 /* 'J' */
++ b.eq long
++
++ cmp w9, #70 /* 'F' */
++ b.eq float
++
++ cmp w9, #68 /* 'D' */
++ b.eq double
++
++skip_brackets:
++ cmp w9, #91 /* '[' */
++ b.ne 1f
++ ldrb w9, [x19], #1
++ b skip_brackets
++1:
++ cmp w9, #76 /* 'L' */
++ b.ne int
++
++skip_ref:
++ ldrb w9, [x19], #1
++ cmp w9, #59 /* ';' */
++ b.ne skip_ref
++
++int:
++ ldr x9, [x15], #8
++ cbz w10, stack_push
++
++load_int_reg:
++ sub w10, w10, #1
++ add x12, x12, #8
++ br x12
++
++int_reg_handlers:
++ mov x2, x9
++ b scan_sig
++ mov x3, x9
++ b scan_sig
++ mov x4, x9
++ b scan_sig
++ mov x5, x9
++ b scan_sig
++ mov x6, x9
++ b scan_sig
++ mov x7, x9
++ b scan_sig
++
++long:
++ ldr x9, [x15], #16
++ cbz w10, stack_push
++ b load_int_reg
++
++float:
++ ldr w9, [x15], #8
++ cbz w11, stack_push
++ b load_fp_reg
++
++double:
++ ldr x9, [x15], #16
++ cbz w11, stack_push
++
++load_fp_reg:
++ sub w11, w11, #1
++ add x13, x13, #8
++ br x13
++
++fp_reg_handlers:
++ fmov d0, x9
++ b scan_sig
++ fmov d1, x9
++ b scan_sig
++ fmov d2, x9
++ b scan_sig
++ fmov d3, x9
++ b scan_sig
++ fmov d4, x9
++ b scan_sig
++ fmov d5, x9
++ b scan_sig
++ fmov d6, x9
++ b scan_sig
++ fmov d7, x9
++ b scan_sig
++
++stack_push:
++ str x9, [x14], #8
++ b scan_sig
++
++done:
++ /* Call the function */
++ blr x16
++
++ mov sp, x29 /* Pop argument area */
++
++ ldrb w9, [x19] /* Return type */
++
++ cmp w9, #86 /* 'V' */
++ b.eq return
++
++ cmp w9, #68 /* 'D' */
++ b.ne 2f
++ str d0, [x20], #16
++ b return
++2:
++ cmp w9, #70 /* 'F' */
++ b.ne 3f
++ str s0, [x20], #8
++ b return
++3:
++ cmp w9, #74 /* 'J' */
++ b.ne 4f
++ str x0, [x20], #16
++ b return
++4:
++ str x0, [x20], #8
++
++return:
++ mov x0, x20 /* return ostack */
++
++ ldp x19, x20, [x29, #16]
++ ldp x29, x30, [sp], #32
++ ret
++#endif
+diff --git a/src/os/linux/aarch64/dll_md.c b/src/os/linux/aarch64/dll_md.c
+new file mode 100644
+index 0000000..189f8a8
+--- /dev/null
++++ b/src/os/linux/aarch64/dll_md.c
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "jam.h"
++
++#ifndef USE_FFI
++
++int nativeExtraArg(MethodBlock *mb) {
++ char *sig = mb->type;
++ int stack_args = 0;
++ int int_args = 6;
++ int fp_args = 8;
++
++ while(*++sig != ')')
++ switch(*sig) {
++ case 'F':
++ case 'D':
++ if(fp_args == 0)
++ stack_args += 8;
++ else
++ fp_args--;
++
++ default:
++ if(int_args == 0)
++ stack_args += 8;
++ else
++ int_args--;
++
++ if(*sig == '[')
++ while(*++sig == '[');
++ if(*sig == 'L')
++ while(*++sig != ';');
++ break;
++ }
++
++ /* Ensure the stack remains 16 byte aligned. */
++ return (stack_args + 15) & ~15;
++}
++
++#endif
+diff --git a/src/os/linux/aarch64/init.c b/src/os/linux/aarch64/init.c
+new file mode 100644
+index 0000000..e03b446
+--- /dev/null
++++ b/src/os/linux/aarch64/init.c
+@@ -0,0 +1,51 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007
++ * Robert Lougher <rob@lougher.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "arch/aarch64.h"
++
++/* Length in bytes of the smallest line in the host system's data cache */
++unsigned char aarch64_data_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the data cache */
++uintptr_t aarch64_data_cache_line_mask;
++
++/* Length in bytes of the smallest line in the host system's instruction
++ cache */
++unsigned char aarch64_instruction_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the instruction cache */
++uintptr_t aarch64_instruction_cache_line_mask;
++
++void initialisePlatform() {
++ unsigned int cache_type;
++
++ /* Extract information from the cache-type register, which describes aspects
++ of the host's cache configuration */
++ __asm__ ("mrs %0, ctr_el0" : "=r" (cache_type));
++
++ aarch64_data_cache_line_len = 4 << ((cache_type >> 16) & 0x0f);
++ aarch64_data_cache_line_mask = ~(aarch64_data_cache_line_len - 1);
++
++ aarch64_instruction_cache_line_len = 4 << (cache_type & 0x0f);
++ aarch64_instruction_cache_line_mask =
++ ~(aarch64_instruction_cache_line_len - 1);
++}
+--
+2.26.2
+
diff --git a/gnu/packages/patches/jamvm-arm.patch b/gnu/packages/patches/jamvm-1.5.1-armv7-support.patch
index 9e998e18db..9e998e18db 100644
--- a/gnu/packages/patches/jamvm-arm.patch
+++ b/gnu/packages/patches/jamvm-1.5.1-armv7-support.patch
diff --git a/gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch b/gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch
new file mode 100644
index 0000000000..b67d8b4584
--- /dev/null
+++ b/gnu/packages/patches/jamvm-2.0.0-aarch64-support.patch
@@ -0,0 +1,645 @@
+From a44154f7a18496cc3e5fc0b1b2ea69523ebc623a Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Mon, 1 Jun 2020 07:09:34 -0400
+Subject: [PATCH] Add support for aarch64 on GNU/Linux
+
+---
+ AUTHORS | 1 +
+ README | 2 +-
+ configure.ac | 7 +-
+ src/arch/Makefile.am | 2 +-
+ src/arch/aarch64.h | 147 +++++++++++++++++++++
+ src/jam.c | 3 +-
+ src/os/linux/Makefile.am | 2 +-
+ src/os/linux/aarch64/Makefile.am | 28 ++++
+ src/os/linux/aarch64/callNative.S | 212 ++++++++++++++++++++++++++++++
+ src/os/linux/aarch64/dll_md.c | 59 +++++++++
+ src/os/linux/aarch64/init.c | 51 +++++++
+ 11 files changed, 508 insertions(+), 6 deletions(-)
+ create mode 100644 src/arch/aarch64.h
+ create mode 100644 src/os/linux/aarch64/Makefile.am
+ create mode 100644 src/os/linux/aarch64/callNative.S
+ create mode 100644 src/os/linux/aarch64/dll_md.c
+ create mode 100644 src/os/linux/aarch64/init.c
+
+diff --git a/AUTHORS b/AUTHORS
+index e1334fe..6fd0eeb 100644
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -1 +1,2 @@
+ Robert Lougher <rob@jamvm.org.uk>
++Simon South <simon@simonsouth.net>
+diff --git a/README b/README
+index c9d80bb..0e93d00 100644
+--- a/README
++++ b/README
+@@ -77,7 +77,7 @@ versions of JamVM also includes stubs for common method signatures.
+ The following platforms/architectures are recognised by configure. Those
+ marked with * must be configured to use libffi.
+
+-- Linux: x86, x86_64, ARM, PowerPC, PowerPC64(*), MIPS, HPPA
++- Linux: x86, x86_64, ARM, ARM64, PowerPC, PowerPC64(*), MIPS, HPPA
+ - FreeBSD: x86, x86_64, ARM, PowerPC, PowerPC64(*), SPARC(*)
+ - OpenBSD: x86, x86_64, ARM, PowerPC, PowerPC64(*), SPARC(*)
+ - Mac OS X/Darwin: x86, x86_64, ARM, PowerPC, PowerPC64
+diff --git a/configure.ac b/configure.ac
+index 138b7e6..e7051d7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -46,6 +46,7 @@ x86_64-*-freebsd*) host_os=bsd libdl_needed=no ;;
+ arm*-*-linux*) host_cpu=arm host_os=linux interp_cflags=-marm ;;
+ arm*-*-openbsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
+ arm*-*-freebsd*) host_cpu=arm host_os=bsd libdl_needed=no ;;
++aarch64*-*-linux*) host_cpu=aarch64 host_os=linux ;;
+ powerpc*-*-linux*) host_cpu=powerpc host_os=linux ;;
+ powerpc*-*-openbsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+ powerpc*-*-freebsd*) host_cpu=powerpc host_os=bsd libdl_needed=no ;;
+@@ -155,10 +156,11 @@ AC_ARG_ENABLE(runtime-reloc-checks,
+
+ AC_ARG_ENABLE(int-inlining,
+ [AS_HELP_STRING(--enable-int-inlining,enable inline threaded version of the interpreter
+- (by default enabled on x86_64, i386, powerpc, mips and arm,
++ (by default enabled on x86_64, i386, powerpc, mips, arm and aarch64,
+ disabled otherwise))],,
+ [if test "$host_cpu" = x86_64 -o "$host_cpu" = i386 -o "$host_cpu" = x86 -o \
+- "$host_cpu" = powerpc -o "$host_cpu" = arm -o "$host_cpu" = mips; then
++ "$host_cpu" = powerpc -o "$host_cpu" = arm -o "$host_cpu" = mips -o \
++ "$host_cpu" = aarch64; then
+ enable_int_inlining=yes
+ else
+ enable_int_inlining=no
+@@ -407,6 +409,7 @@ AC_CONFIG_FILES(
+ src/os/linux/x86_64/Makefile \
+ src/os/linux/parisc/Makefile \
+ src/os/linux/mips/Makefile \
++ src/os/linux/aarch64/Makefile \
+ src/os/darwin/i386/Makefile \
+ src/os/darwin/arm/Makefile \
+ src/os/darwin/powerpc/Makefile \
+diff --git a/src/arch/Makefile.am b/src/arch/Makefile.am
+index 7580a1b..4e2a4f9 100644
+--- a/src/arch/Makefile.am
++++ b/src/arch/Makefile.am
+@@ -19,4 +19,4 @@
+ ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ##
+
+-EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h sparc.h
++EXTRA_DIST = powerpc.h arm.h i386.h x86_64.h parisc.h mips.h sparc.h aarch64.h
+diff --git a/src/arch/aarch64.h b/src/arch/aarch64.h
+new file mode 100644
+index 0000000..1912e79
+--- /dev/null
++++ b/src/arch/aarch64.h
+@@ -0,0 +1,147 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include <stdint.h>
++
++#define OS_ARCH "aarch64"
++
++#define HANDLER_TABLE_T static const void
++#define DOUBLE_1_BITS 0x3ff0000000000000LL
++
++#define READ_DBL(v,p,l) v = ((u8)p[0]<<56)|((u8)p[1]<<48)|((u8)p[2]<<40) \
++ |((u8)p[3]<<32)|((u8)p[4]<<24)|((u8)p[5]<<16) \
++ |((u8)p[6]<<8)|(u8)p[7]; p+=8
++
++/* Needed for i386 -- empty here */
++#define FPU_HACK
++
++#define COMPARE_AND_SWAP_64(addr, old_val, new_val) \
++({ \
++ int result, read_val; \
++ __asm__ __volatile__ (" \
++ 1: ldaxr %2, %1; \
++ cmp %2, %3; \
++ b.ne 2f; \
++ stlxr %w0, %4, %1; \
++ cmp %w0, wzr; \
++ b.ne 1b; \
++ 2: cset %w0, eq;" \
++ : "=&r" (result), "+Q" (*addr), "=&r" (read_val) \
++ : "r" (old_val), "r" (new_val) \
++ : "cc"); \
++ result; \
++})
++
++#define COMPARE_AND_SWAP_32(addr, old_val, new_val) \
++({ \
++ int result, read_val; \
++ __asm__ __volatile__ (" \
++ 1: ldaxr %w2, %1; \
++ cmp %w2, %w3; \
++ b.ne 2f; \
++ stlxr %w0, %w4, %1; \
++ cmp %w0, wzr; \
++ b.ne 1b; \
++ 2: cset %w0, eq;" \
++ : "=&r" (result), "+Q" (*addr), "=&r" (read_val) \
++ : "r" (old_val), "r" (new_val) \
++ : "cc"); \
++ result; \
++})
++
++#define COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define LOCKWORD_READ(addr) \
++({ \
++ uintptr_t result; \
++ __asm__ __volatile__ (" \
++ ldar %0, %1;" \
++ : "=r" (result) \
++ : "Q" (*addr) \
++ : "cc"); \
++ result; \
++})
++
++#define LOCKWORD_WRITE(addr, value) \
++({ \
++ __asm__ __volatile__ (" \
++ stlr %1, %0;" \
++ : "=Q" (*addr) \
++ : "r" (value) \
++ : "cc"); \
++})
++
++#define LOCKWORD_COMPARE_AND_SWAP(addr, old_val, new_val) \
++ COMPARE_AND_SWAP_64(addr, old_val, new_val)
++
++#define FLUSH_CACHE(addr, length) \
++{ \
++ uintptr_t start = (uintptr_t) (addr); \
++ uintptr_t end = start + length; \
++ uintptr_t i; \
++ \
++ for(i = start & aarch64_data_cache_line_mask; \
++ i < end; \
++ i += aarch64_data_cache_line_len) \
++ __asm__ ("dc cvau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish"); \
++ \
++ for(i = start & aarch64_instruction_cache_line_mask; \
++ i < end; \
++ i += aarch64_instruction_cache_line_len) \
++ __asm__ ("ic ivau, %0" :: "r" (i)); \
++ \
++ __asm__ ("dsb ish; isb"); \
++}
++
++#define GEN_REL_JMP(target_addr, patch_addr, patch_size) \
++({ \
++ int patched = FALSE; \
++ \
++ if(patch_size >= 4) { \
++ /* Guard against the pointer difference being \
++ larger than the signed range */ \
++ long long offset = (uintptr_t)(target_addr) - \
++ (uintptr_t)(patch_addr); \
++ \
++ if(offset >= -1<<28 && offset < 1<<28) { \
++ *(uint32_t*)(patch_addr) = offset>>2 & 0x03ffffff \
++ | 0x14000000; \
++ patched = TRUE; \
++ } \
++ } \
++ patched; \
++})
++
++#define MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define RMBARRIER() __asm__ ("dmb ishld" ::: "memory")
++#define WMBARRIER() __asm__ ("dmb ishst" ::: "memory")
++#define JMM_LOCK_MBARRIER() __asm__ ("dmb ish" ::: "memory")
++#define JMM_UNLOCK_MBARRIER() JMM_LOCK_MBARRIER()
++
++/* Defined in src/os/linux/aarch64/init.c */
++extern unsigned char aarch64_data_cache_line_len;
++extern uintptr_t aarch64_data_cache_line_mask;
++extern unsigned char aarch64_instruction_cache_line_len;
++extern uintptr_t aarch64_instruction_cache_line_mask;
+diff --git a/src/jam.c b/src/jam.c
+index 052f84a..c97524a 100644
+--- a/src/jam.c
++++ b/src/jam.c
+@@ -98,7 +98,8 @@ void showUsage(char *name) {
+ void showVersionAndCopyright() {
+ printf("java version \"%s\"\n", JAVA_COMPAT_VERSION);
+ printf("JamVM version %s\n", VERSION);
+- printf("Copyright (C) 2003-2014 Robert Lougher <rob@jamvm.org.uk>\n\n");
++ printf("Copyright (C) 2003-2014 Robert Lougher <rob@jamvm.org.uk>\n");
++ printf("Portions Copyright (C) 2020 Simon South <simon@simonsouth.net>\n\n");
+ printf("This program is free software; you can redistribute it and/or\n");
+ printf("modify it under the terms of the GNU General Public License\n");
+ printf("as published by the Free Software Foundation; either version 2,\n");
+diff --git a/src/os/linux/Makefile.am b/src/os/linux/Makefile.am
+index 542094e..83e7dfe 100644
+--- a/src/os/linux/Makefile.am
++++ b/src/os/linux/Makefile.am
+@@ -20,7 +20,7 @@
+ ##
+
+ SUBDIRS = @arch@
+-DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips
++DIST_SUBDIRS = powerpc arm i386 x86_64 parisc mips aarch64
+
+ noinst_LTLIBRARIES = libos.la
+ libos_la_SOURCES = os.c
+diff --git a/src/os/linux/aarch64/Makefile.am b/src/os/linux/aarch64/Makefile.am
+new file mode 100644
+index 0000000..0e5134f
+--- /dev/null
++++ b/src/os/linux/aarch64/Makefile.am
+@@ -0,0 +1,28 @@
++##
++## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012
++## Robert Lougher <rob@jamvm.org.uk>.
++##
++## File added by Simon South <simon@simonsouth.net>.
++##
++## This file is part of JamVM.
++##
++## This program is free software; you can redistribute it and/or
++## modify it under the terms of the GNU General Public License
++## as published by the Free Software Foundation; either version 2,
++## or (at your option) any later version.
++##
++## This program is distributed in the hope that it will be useful,
++## but WITHOUT ANY WARRANTY; without even the implied warranty of
++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++## GNU General Public License for more details.
++##
++## You should have received a copy of the GNU General Public License
++## along with this program; if not, write to the Free Software
++## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++##
++
++noinst_LTLIBRARIES = libnative.la
++libnative_la_SOURCES = init.c dll_md.c callNative.S
++
++AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
++AM_CCASFLAGS = -I$(top_builddir)/src
+diff --git a/src/os/linux/aarch64/callNative.S b/src/os/linux/aarch64/callNative.S
+new file mode 100644
+index 0000000..e067c4f
+--- /dev/null
++++ b/src/os/linux/aarch64/callNative.S
+@@ -0,0 +1,212 @@
++/*
++ * Copyright (C) 2008, 2009, 2011, 2012 Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "config.h"
++
++#ifndef USE_FFI
++ .text
++ .arch armv8-a
++ .align 2
++ .global callJNIMethod
++ .type callJNIMethod,function
++
++/*
++ * Arguments passed in:
++ *
++ * x0 JNIEnv
++ * x1 class or NULL
++ * x2 sig
++ * w3 extra arg
++ * x4 ostack
++ * x5 function pntr
++ * w6 args count
++ */
++
++/* Register usage:
++ *
++ * x20 ostack
++ * x19 sig pntr
++ * x16 function pntr
++ * x15 ostack pntr
++ * x14 args pntr
++ * x13 float/double handler
++ * x12 int/long handler
++ * w11 fp regs remaining
++ * w10 int regs remaining
++ * x9 scratch
++ * x2-x7 outgoing int args
++ * x1 outgoing class or this pntr
++ * x0 outgoing JNIEnv (as passed in)
++ *
++ * d0 - d7 outgoing float args
++ */
++
++callJNIMethod:
++ stp x29, x30, [sp, #-32]!
++ mov x29, sp
++ stp x19, x20, [x29, #16]
++
++ sub sp, sp, w3 /* allocate room for stacked args */
++ mov x14, sp
++
++ mov x20, x4 /* preserve ostack */
++ add x19, x2, #1 /* init sig pntr -- skipping '(' */
++
++ mov x16, x5 /* save function pntr */
++ mov x15, x20 /* init ostack pntr */
++
++ adr x13, fp_reg_handlers-8
++ adr x12, int_reg_handlers-8
++
++ mov w11, #8 /* fp regs remaining */
++ mov w10, #6 /* int regs remaining */
++
++ cbnz x1, scan_sig /* is method non-static? */
++ ldr x1, [x15], #8 /* yes, load x1 with "this" */
++
++scan_sig:
++ ldrb w9, [x19], #1 /* get next sig char */
++
++ cmp w9, #41 /* ')' */
++ b.eq done
++
++ cmp w9, #74 /* 'J' */
++ b.eq long
++
++ cmp w9, #70 /* 'F' */
++ b.eq float
++
++ cmp w9, #68 /* 'D' */
++ b.eq double
++
++skip_brackets:
++ cmp w9, #91 /* '[' */
++ b.ne 1f
++ ldrb w9, [x19], #1
++ b skip_brackets
++1:
++ cmp w9, #76 /* 'L' */
++ b.ne int
++
++skip_ref:
++ ldrb w9, [x19], #1
++ cmp w9, #59 /* ';' */
++ b.ne skip_ref
++
++int:
++ ldr x9, [x15], #8
++ cbz w10, stack_push
++
++load_int_reg:
++ sub w10, w10, #1
++ add x12, x12, #8
++ br x12
++
++int_reg_handlers:
++ mov x2, x9
++ b scan_sig
++ mov x3, x9
++ b scan_sig
++ mov x4, x9
++ b scan_sig
++ mov x5, x9
++ b scan_sig
++ mov x6, x9
++ b scan_sig
++ mov x7, x9
++ b scan_sig
++
++long:
++ ldr x9, [x15], #16
++ cbz w10, stack_push
++ b load_int_reg
++
++float:
++ ldr w9, [x15], #8
++ cbz w11, stack_push
++ b load_fp_reg
++
++double:
++ ldr x9, [x15], #16
++ cbz w11, stack_push
++
++load_fp_reg:
++ sub w11, w11, #1
++ add x13, x13, #8
++ br x13
++
++fp_reg_handlers:
++ fmov d0, x9
++ b scan_sig
++ fmov d1, x9
++ b scan_sig
++ fmov d2, x9
++ b scan_sig
++ fmov d3, x9
++ b scan_sig
++ fmov d4, x9
++ b scan_sig
++ fmov d5, x9
++ b scan_sig
++ fmov d6, x9
++ b scan_sig
++ fmov d7, x9
++ b scan_sig
++
++stack_push:
++ str x9, [x14], #8
++ b scan_sig
++
++done:
++ /* Call the function */
++ blr x16
++
++ mov sp, x29 /* Pop argument area */
++
++ ldrb w9, [x19] /* Return type */
++
++ cmp w9, #86 /* 'V' */
++ b.eq return
++
++ cmp w9, #68 /* 'D' */
++ b.ne 2f
++ str d0, [x20], #16
++ b return
++2:
++ cmp w9, #70 /* 'F' */
++ b.ne 3f
++ str s0, [x20], #8
++ b return
++3:
++ cmp w9, #74 /* 'J' */
++ b.ne 4f
++ str x0, [x20], #16
++ b return
++4:
++ str x0, [x20], #8
++
++return:
++ mov x0, x20 /* return ostack */
++
++ ldp x19, x20, [x29, #16]
++ ldp x29, x30, [sp], #32
++ ret
++#endif
+diff --git a/src/os/linux/aarch64/dll_md.c b/src/os/linux/aarch64/dll_md.c
+new file mode 100644
+index 0000000..189f8a8
+--- /dev/null
++++ b/src/os/linux/aarch64/dll_md.c
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "jam.h"
++
++#ifndef USE_FFI
++
++int nativeExtraArg(MethodBlock *mb) {
++ char *sig = mb->type;
++ int stack_args = 0;
++ int int_args = 6;
++ int fp_args = 8;
++
++ while(*++sig != ')')
++ switch(*sig) {
++ case 'F':
++ case 'D':
++ if(fp_args == 0)
++ stack_args += 8;
++ else
++ fp_args--;
++
++ default:
++ if(int_args == 0)
++ stack_args += 8;
++ else
++ int_args--;
++
++ if(*sig == '[')
++ while(*++sig == '[');
++ if(*sig == 'L')
++ while(*++sig != ';');
++ break;
++ }
++
++ /* Ensure the stack remains 16 byte aligned. */
++ return (stack_args + 15) & ~15;
++}
++
++#endif
+diff --git a/src/os/linux/aarch64/init.c b/src/os/linux/aarch64/init.c
+new file mode 100644
+index 0000000..b21dc55
+--- /dev/null
++++ b/src/os/linux/aarch64/init.c
+@@ -0,0 +1,51 @@
++/*
++ * Copyright (C) 2003, 2004, 2005, 2006, 2007
++ * Robert Lougher <rob@jamvm.org.uk>.
++ * Copyright (C) 2020 Simon South <simon@simonsouth.net>.
++ *
++ * This file is part of JamVM.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ */
++
++#include "arch/aarch64.h"
++
++/* Length in bytes of the smallest line in the host system's data cache */
++unsigned char aarch64_data_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the data cache */
++uintptr_t aarch64_data_cache_line_mask;
++
++/* Length in bytes of the smallest line in the host system's instruction
++ cache */
++unsigned char aarch64_instruction_cache_line_len;
++
++/* Mask used to align a virtual address to a line in the instruction cache */
++uintptr_t aarch64_instruction_cache_line_mask;
++
++void initialisePlatform() {
++ unsigned int cache_type;
++
++ /* Extract information from the cache-type register, which describes aspects
++ of the host's cache configuration */
++ __asm__ ("mrs %0, ctr_el0" : "=r" (cache_type));
++
++ aarch64_data_cache_line_len = 4 << ((cache_type >> 16) & 0x0f);
++ aarch64_data_cache_line_mask = ~(aarch64_data_cache_line_len - 1);
++
++ aarch64_instruction_cache_line_len = 4 << (cache_type & 0x0f);
++ aarch64_instruction_cache_line_mask =
++ ~(aarch64_instruction_cache_line_len - 1);
++}
+--
+2.26.2
+
diff --git a/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch b/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch
new file mode 100644
index 0000000000..5415c27a62
--- /dev/null
+++ b/gnu/packages/patches/jamvm-2.0.0-opcode-guard.patch
@@ -0,0 +1,35 @@
+From ca11b53896365c948426974cb90e8f71c70d123b Mon Sep 17 00:00:00 2001
+From: Simon South <simon@simonsouth.net>
+Date: Sun, 31 May 2020 20:36:43 -0400
+Subject: [PATCH] Guard floating-point opcodes with explicit memory barrier
+
+---
+ src/interp/engine/interp-inlining.h | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/src/interp/engine/interp-inlining.h b/src/interp/engine/interp-inlining.h
+index 3339b0e..4ee5c5a 100644
+--- a/src/interp/engine/interp-inlining.h
++++ b/src/interp/engine/interp-inlining.h
+@@ -78,8 +78,17 @@
+ 4.3, we need to insert a label, and ensure its address
+ is taken (to stop it being optimised out). However,
+ this reduces performance on PowerPC by approx 1 - 2%.
++
++ With gcc 5 and newer an asm statement with a "memory"
++ clobber argument explicitly sets a memory barrier for the
++ compiler, preventing it from reordering memory accesses
++ in a way that breaks decaching.
+ */
+-#if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)
++#if (__GNUC__ > 4)
++#define DEF_GUARD_TABLE(level) /* none */
++#define GUARD(opcode, level) __asm__("" ::: "memory");
++#define GUARD_TBLS /* none */
++#elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)
+ #define DEF_GUARD_TABLE(level) DEF_HANDLER_TABLE(level, GUARD)
+ #define GUARD(opcode, level) label(opcode, level, GUARD)
+ #define GUARD_TBLS , HNDLR_TBLS(GUARD)
+--
+2.26.2
+
diff --git a/gnu/packages/patches/java-antlr4-Add-standalone-generator.patch b/gnu/packages/patches/java-antlr4-Add-standalone-generator.patch
new file mode 100644
index 0000000000..75b6dce39f
--- /dev/null
+++ b/gnu/packages/patches/java-antlr4-Add-standalone-generator.patch
@@ -0,0 +1,52 @@
+From 3b43b79da15be994348f13035474925ba592fe1f Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Fri, 15 Sep 2017 10:06:42 +0200
+Subject: [PATCH] Add standalone template generator
+
+---
+ tool/src/org/antlr/v4/unicode/UnicodeRenderer.java | 33 ++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+ create mode 100644 tool/src/org/antlr/v4/unicode/UnicodeRenderer.java
+
+diff --git a/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java b/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java
+new file mode 100644
+index 0000000..9e53213
+--- /dev/null
++++ b/tool/src/org/antlr/v4/unicode/UnicodeRenderer.java
+@@ -0,0 +1,33 @@
++package org.antlr.v4.unicode;
++
++import org.stringtemplate.v4.*;
++import org.stringtemplate.v4.misc.ErrorBuffer;
++import org.antlr.v4.unicode.UnicodeDataTemplateController;
++
++import java.io.File;
++import java.io.FileWriter;
++import java.io.IOException;
++import java.util.Map;
++import java.util.Map.Entry;
++
++public class UnicodeRenderer extends UnicodeDataTemplateController {
++ public static void main(String[] arg)
++ throws IOException {
++ String inputdir = arg[0];
++ String input = arg[1];
++ String output = arg[2];
++
++ FileWriter fileWriter = new FileWriter(new File(output));
++ ErrorBuffer listener = new ErrorBuffer();
++
++ STGroupDir group = new STGroupDir(inputdir);
++ ST st = group.getInstanceOf(input);
++
++ for(Entry<String, Object> entry : getProperties().entrySet())
++ st.add(entry.getKey(), entry.getValue());
++
++ st.write(new AutoIndentWriter(fileWriter), listener);
++ fileWriter.flush();
++ fileWriter.close();
++ }
++}
+--
+2.13.5
+
diff --git a/gnu/packages/patches/java-antlr4-fix-code-too-large.java b/gnu/packages/patches/java-antlr4-fix-code-too-large.java
new file mode 100644
index 0000000000..9e9f92349d
--- /dev/null
+++ b/gnu/packages/patches/java-antlr4-fix-code-too-large.java
@@ -0,0 +1,90 @@
+From d22db2048534bdf3d9615117291f9d86564ff10d Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sat, 19 Sep 2020 21:05:48 +0200
+Subject: [PATCH] Separate addPropertyAliases in two methods
+
+The quantity of data used to generate addPropertyAliases creates a big
+method, that is too big for java and results in "error: code too large".
+This is most likely due to added data between the expected version of
+icu and the actual version of icu in Guix.
+---
+ .../org/antlr/v4/tool/templates/unicodedata.st | 17 ++++++++++++++---
+ .../unicode/UnicodeDataTemplateController.java | 18 ++++++++++--------
+ 2 files changed, 24 insertions(+), 11 deletions(-)
+
+diff --git a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+index 0f22c73..3573873 100644
+--- a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
++++ b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+@@ -1,4 +1,4 @@
+-unicodedata(propertyCodePointRanges, propertyAliases) ::= <<
++unicodedata(propertyCodePointRanges, propertyAliasesA, propertyAliasesB) ::= <<
+ package org.antlr.v4.unicode;
+
+ import java.util.Arrays;
+@@ -15,7 +15,7 @@ import org.antlr.v4.runtime.misc.Interval;
+ */
+ public abstract class UnicodeData {
+ private static final Map\<String, IntervalSet\> propertyCodePointRanges = new HashMap\<\>(<length(propertyCodePointRanges)>);
+- private static final Map\<String, String\> propertyAliases = new HashMap\<\>(<length(propertyAliases)>);
++ private static final Map\<String, String\> propertyAliases = new HashMap\<\>(<length(propertyAliasesA)> + <length(propertyAliasesB)>);
+
+ // Work around Java 64k bytecode method limit by splitting up static
+ // initialization into one method per Unicode property
+@@ -30,9 +30,20 @@ static private void addProperty<i>() {
+ propertyCodePointRanges.put("<k>".toLowerCase(Locale.US), codePointRanges);
+ \}}; separator="\n\n">
+
++ // Property aliases
++ static private void addPropertyAliases1() {
++ <propertyAliasesA.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesA.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ }
++
++ // Property aliases
++ static private void addPropertyAliases2() {
++ <propertyAliasesB.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesB.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ }
++
+ // Property aliases
+ static private void addPropertyAliases() {
+- <propertyAliases.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliases.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ addPropertyAliases1();
++ addPropertyAliases2();
+ }
+
+ // Put it all together
+diff --git a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+index da244a3..dc591cb 100644
+--- a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
++++ b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+@@ -78,17 +78,19 @@ public abstract class UnicodeDataTemplateController {
+ addTR35ExtendedPictographicPropertyCodesToCodePointRanges(propertyCodePointRanges);
+ addEmojiPresentationPropertyCodesToCodePointRanges(propertyCodePointRanges);
+
+- Map<String, String> propertyAliases = new LinkedHashMap<>();
+- addUnicodeCategoryCodesToNames(propertyAliases);
+- addUnicodeBinaryPropertyCodesToNames(propertyAliases);
+- addUnicodeScriptCodesToNames(propertyAliases);
+- addUnicodeBlocksToNames(propertyAliases);
+- addUnicodeIntPropertyCodesToNames(propertyAliases);
+- propertyAliases.put("EP", "Extended_Pictographic");
++ Map<String, String> propertyAliases1 = new LinkedHashMap<>();
++ Map<String, String> propertyAliases2 = new LinkedHashMap<>();
++ addUnicodeCategoryCodesToNames(propertyAliases1);
++ addUnicodeBinaryPropertyCodesToNames(propertyAliases1);
++ addUnicodeScriptCodesToNames(propertyAliases1);
++ addUnicodeBlocksToNames(propertyAliases2);
++ addUnicodeIntPropertyCodesToNames(propertyAliases2);
++ propertyAliases2.put("EP", "Extended_Pictographic");
+
+ Map<String, Object> properties = new LinkedHashMap<>();
+ properties.put("propertyCodePointRanges", propertyCodePointRanges);
+- properties.put("propertyAliases", propertyAliases);
++ properties.put("propertyAliasesA", propertyAliases1);
++ properties.put("propertyAliasesB", propertyAliases2);
+ return properties;
+ }
+
+--
+2.28.0
+
diff --git a/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch b/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch
new file mode 100644
index 0000000000..7bdf05eb9c
--- /dev/null
+++ b/gnu/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch
@@ -0,0 +1,87 @@
+From 56ae699a27eca52cc0bb14cbc9944b62136be52b Mon Sep 17 00:00:00 2001
+From: Julien Lepiller <julien@lepiller.eu>
+Date: Sun, 20 Sep 2020 21:07:29 +0200
+Subject: [PATCH] Separate addPropertyAliases in two methods
+
+The quantity of data used to generate addPropertyAliases creates a big
+method, that is too big for java and results in "error: code too large".
+This is most likely due to added data between the expected version of
+icu and the actual version of icu in Guix.
+---
+ .../org/antlr/v4/tool/templates/unicodedata.st | 15 ++++++++++++---
+ .../unicode/UnicodeDataTemplateController.java | 18 ++++++++++--------
+ 2 files changed, 22 insertions(+), 11 deletions(-)
+
+diff --git a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+index f5052b7..125d15b 100644
+--- a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
++++ b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st
+@@ -1,4 +1,4 @@
+-unicodedata(propertyCodePointRanges, propertyAliases) ::= <<
++unicodedata(propertyCodePointRanges, propertyAliasesA, propertyAliasesB) ::= <<
+ package org.antlr.v4.unicode;
+
+ import java.util.Arrays;
+@@ -17,7 +17,7 @@ public enum UnicodeData {
+ ;
+
+ private static final Map\<String, IntervalSet\> propertyCodePointRanges = new HashMap\<String, IntervalSet\>(<length(propertyCodePointRanges)>);
+- private static final Map\<String, String\> propertyAliases = new HashMap\<String, String\>(<length(propertyAliases)>);
++ private static final Map\<String, String\> propertyAliases = new HashMap\<String, String\>(<length(propertyAliasesA)> + <length(propertyAliasesB)>);
+
+ // Work around Java 64k bytecode method limit by splitting up static
+ // initialization into one method per Unicode property
+@@ -33,8 +33,17 @@ static private void addProperty<i>() {
+ \}}; separator="\n\n">
+
+ // Property aliases
++ static private void addPropertyAliasesA() {
++ <propertyAliasesA.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesA.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ }
++
++ static private void addPropertyAliasesB() {
++ <propertyAliasesB.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliasesB.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ }
++
+ static private void addPropertyAliases() {
+- <propertyAliases.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliases.(k)>".toLowerCase(Locale.US)); }; separator="\n">
++ addPropertyAliasesA();
++ addPropertyAliasesB();
+ }
+
+ // Put it all together
+diff --git a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+index 570190c..692cee0 100644
+--- a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
++++ b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java
+@@ -74,17 +74,19 @@ public abstract class UnicodeDataTemplateController {
+ addTR35ExtendedPictographicPropertyCodesToCodePointRanges(propertyCodePointRanges);
+ addEmojiPresentationPropertyCodesToCodePointRanges(propertyCodePointRanges);
+
+- Map<String, String> propertyAliases = new LinkedHashMap<String, String>();
+- addUnicodeCategoryCodesToNames(propertyAliases);
+- addUnicodeBinaryPropertyCodesToNames(propertyAliases);
+- addUnicodeScriptCodesToNames(propertyAliases);
+- addUnicodeBlocksToNames(propertyAliases);
+- addUnicodeIntPropertyCodesToNames(propertyAliases);
+- propertyAliases.put("EP", "Extended_Pictographic");
++ Map<String, String> propertyAliasesA = new LinkedHashMap<String, String>();
++ Map<String, String> propertyAliasesB = new LinkedHashMap<String, String>();
++ addUnicodeCategoryCodesToNames(propertyAliasesA);
++ addUnicodeBinaryPropertyCodesToNames(propertyAliasesA);
++ addUnicodeScriptCodesToNames(propertyAliasesA);
++ addUnicodeBlocksToNames(propertyAliasesB);
++ addUnicodeIntPropertyCodesToNames(propertyAliasesB);
++ propertyAliasesB.put("EP", "Extended_Pictographic");
+
+ Map<String, Object> properties = new LinkedHashMap<String, Object>();
+ properties.put("propertyCodePointRanges", propertyCodePointRanges);
+- properties.put("propertyAliases", propertyAliases);
++ properties.put("propertyAliasesA", propertyAliasesA);
++ properties.put("propertyAliasesB", propertyAliasesB);
+ return properties;
+ }
+
+--
+2.28.0
+
diff --git a/gnu/packages/patches/konversation-Fix-build-with-Qt-5.11.patch b/gnu/packages/patches/konversation-Fix-build-with-Qt-5.11.patch
deleted file mode 100644
index d9d29bbd1a..0000000000
--- a/gnu/packages/patches/konversation-Fix-build-with-Qt-5.11.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 4d0036617becc26a76fd021138c98aceec4c7b53 Mon Sep 17 00:00:00 2001
-From: Luca Beltrame <lbeltrame@kde.org>
-Date: Sun, 21 Jul 2019 09:14:32 +0200
-Subject: Fix build with Qt 5.13
-
----
- src/irc/outputfilter.cpp | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/irc/outputfilter.cpp b/src/irc/outputfilter.cpp
-index f9e6253..45d11fb 100644
---- a/src/irc/outputfilter.cpp
-+++ b/src/irc/outputfilter.cpp
-@@ -32,6 +32,7 @@
-
- #include <QStringList>
- #include <QFile>
-+#include <QMetaMethod>
- #include <QRegExp>
- #include <QTextCodec>
- #include <QByteArray>
---
-cgit v1.1
-
diff --git a/gnu/packages/patches/libcanberra-wayland-crash.patch b/gnu/packages/patches/libcanberra-wayland-crash.patch
new file mode 100644
index 0000000000..e347436bbe
--- /dev/null
+++ b/gnu/packages/patches/libcanberra-wayland-crash.patch
@@ -0,0 +1,55 @@
+# This patch comes from upstream commit c0620e432650e81062c1967cc669829dbd29b310.
+# gtk: Don't assume all GdkDisplays are GdkX11Displays: broadway/wayland
+
+--- src/canberra-gtk-module.c.orig
++++ src/canberra-gtk-module.c
+@@ -307,6 +307,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
+ guchar *data = NULL;
+ gint ret = -1;
+
++#ifdef GDK_IS_X11_DISPLAY
++ if (!GDK_IS_X11_DISPLAY(d))
++ return 0;
++#endif
++
+ if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
+ gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
+ 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
+@@ -335,6 +340,11 @@ static gint display_get_desktop(GdkDisplay *d) {
+ guchar *data = NULL;
+ gint ret = -1;
+
++#ifdef GDK_IS_X11_DISPLAY
++ if (!GDK_IS_X11_DISPLAY(d))
++ return 0;
++#endif
++
+ if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), DefaultRootWindow(GDK_DISPLAY_XDISPLAY(d)),
+ gdk_x11_get_xatom_by_name_for_display(d, "_NET_CURRENT_DESKTOP"),
+ 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
+@@ -365,6 +375,11 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) {
+ gboolean ret = FALSE;
+ Atom xembed;
+
++#ifdef GDK_IS_X11_DISPLAY
++ if (!GDK_IS_X11_DISPLAY(d))
++ return FALSE;
++#endif
++
+ /* Gnome Panel applets are XEMBED windows. We need to make sure we
+ * ignore them */
+
+--- src/canberra-gtk.c.orig
++++ src/canberra-gtk.c
+@@ -185,6 +185,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) {
+ guchar *data = NULL;
+ gint ret = -1;
+
++#ifdef GDK_IS_X11_DISPLAY
++ if (!GDK_IS_X11_DISPLAY(d))
++ return 0;
++#endif
++
+ if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w),
+ gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"),
+ 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
diff --git a/gnu/packages/patches/libcyaml-libyaml-compat.patch b/gnu/packages/patches/libcyaml-libyaml-compat.patch
new file mode 100644
index 0000000000..dcb8cb51b8
--- /dev/null
+++ b/gnu/packages/patches/libcyaml-libyaml-compat.patch
@@ -0,0 +1,51 @@
+Fix build against libyaml 0.2.5.
+
+Taken from upstream:
+https://github.com/tlsa/libcyaml/commit/0e947264b947f51f7ea785068637c4bfce5d4171
+
+diff --git a/test/units/save.c b/test/units/save.c
+--- a/test/units/save.c
++++ b/test/units/save.c
+@@ -3476,7 +3476,7 @@ static bool test_save_sequence_null_values_int(
+ ttest_report_ctx_t *report,
+ const cyaml_config_t *config)
+ {
+- static const unsigned char ref[] =
++ static const unsigned char ref1[] =
+ "---\n"
+ "- 7\n"
+ "- 6\n"
+@@ -3487,6 +3487,18 @@ static bool test_save_sequence_null_values_int(
+ "- \n"
+ "- 0\n"
+ "...\n";
++ /* As of libyaml 0.2.5, trailing spaces are not emitted. */
++ static const unsigned char ref2[] =
++ "---\n"
++ "- 7\n"
++ "- 6\n"
++ "- 5\n"
++ "-\n"
++ "- 3\n"
++ "- 2\n"
++ "-\n"
++ "- 0\n"
++ "...\n";
+ static const int d[] = { 7, 6, 5, 4, 3, 2, 1, 0 };
+ static const int *data[] = { d + 0, d + 1, d + 2, NULL,
+ d + 4, d + 5, NULL, d + 7, };
+@@ -3515,11 +3527,12 @@ static bool test_save_sequence_null_values_int(
+ return ttest_fail(&tc, cyaml_strerror(err));
+ }
+
+- if (len != YAML_LEN(ref) || memcmp(ref, buffer, len) != 0) {
++ if ((len != YAML_LEN(ref1) || memcmp(ref1, buffer, len) != 0) &&
++ (len != YAML_LEN(ref2) || memcmp(ref2, buffer, len) != 0)) {
+ return ttest_fail(&tc, "Bad data:\n"
+ "EXPECTED (%zu):\n\n%.*s\n\n"
+ "GOT (%zu):\n\n%.*s\n",
+- YAML_LEN(ref), YAML_LEN(ref), ref,
++ YAML_LEN(ref1), YAML_LEN(ref1), ref1,
+ len, len, buffer);
+ }
+
diff --git a/gnu/packages/patches/libdrm-realpath-virtio.patch b/gnu/packages/patches/libdrm-realpath-virtio.patch
deleted file mode 100644
index b7d85160b4..0000000000
--- a/gnu/packages/patches/libdrm-realpath-virtio.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Only check for for relative path on virtio devices. Otherwise it could
-break driver loading in some circumstances, notably the IceCat sandbox.
-
-https://gitlab.freedesktop.org/mesa/drm/-/issues/39
-
-Taken from upstream:
-https://gitlab.freedesktop.org/mesa/drm/-/commit/57df07572ce45a1b60bae6fb89770388d3abd6dd
-
-diff --git a/xf86drm.c b/xf86drm.c
---- a/xf86drm.c
-+++ b/xf86drm.c
-@@ -3103,15 +3103,18 @@ static int drmParseSubsystemType(int maj, int min)
- int subsystem_type;
-
- snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
-- if (!realpath(path, real_path))
-- return -errno;
-- snprintf(path, sizeof(path), "%s", real_path);
-
- subsystem_type = get_subsystem_type(path);
-+ /* Try to get the parent (underlying) device type */
- if (subsystem_type == DRM_BUS_VIRTIO) {
-+ /* Assume virtio-pci on error */
-+ if (!realpath(path, real_path))
-+ return DRM_BUS_VIRTIO;
- strncat(path, "/..", PATH_MAX);
- subsystem_type = get_subsystem_type(path);
-- }
-+ if (subsystem_type < 0)
-+ return DRM_BUS_VIRTIO;
-+ }
- return subsystem_type;
- #elif defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
- return DRM_BUS_PCI;
-@@ -3920,6 +3923,7 @@ process_device(drmDevicePtr *device, const char *d_name,
-
- switch (subsystem_type) {
- case DRM_BUS_PCI:
-+ case DRM_BUS_VIRTIO:
- return drmProcessPciDevice(device, node, node_type, maj, min,
- fetch_deviceinfo, flags);
- case DRM_BUS_USB:
diff --git a/gnu/packages/patches/liblouisutdml-fix-tests.patch b/gnu/packages/patches/liblouisutdml-fix-tests.patch
deleted file mode 100644
index 08d3db2c21..0000000000
--- a/gnu/packages/patches/liblouisutdml-fix-tests.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 52d44cdbc307d4e2ffc3ebe674745eb9d43ec337 Mon Sep 17 00:00:00 2001
-From: Christian Egli <christian.egli@sbs.ch>
-Date: Mon, 10 Aug 2020 16:08:17 +0200
-Subject: [PATCH] Some math over and under tests now actually pass
-
-with the newest liblouis
----
- tests/Makefile.am | 5 -----
- 1 file changed, 5 deletions(-)
-
-diff --git a/tests/Makefile.am b/tests/Makefile.am
-index 157b005..932a5d0 100644
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -321,10 +321,6 @@ XFAIL_TESTS += \
- mathml_nemeth/mover_06.test \
- mathml_nemeth/mover_07.test \
- mathml_nemeth/mover_08.test \
-- mathml_nemeth/mover_09.test \
-- mathml_nemeth/mover_10.test \
-- mathml_nemeth/mover_11.test \
-- mathml_nemeth/mover_12.test \
- mathml_nemeth/mover_13.test \
- mathml_nemeth/mover_14.test \
- mathml_nemeth/mover_15.test \
-@@ -332,7 +328,6 @@ XFAIL_TESTS += \
- mathml_nemeth/munder_01.test \
- mathml_nemeth/munder_02.test \
- mathml_nemeth/munder_03.test \
-- mathml_nemeth/munder_04.test \
- mathml_nemeth/munder_05.test \
- mathml_nemeth/munder_06.test \
- mathml_nemeth/munder_07.test \
diff --git a/gnu/packages/patches/libsndfile-CVE-2017-12562.patch b/gnu/packages/patches/libsndfile-CVE-2017-12562.patch
deleted file mode 100644
index 58cb242b10..0000000000
--- a/gnu/packages/patches/libsndfile-CVE-2017-12562.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-Fix CVE-2017-12562:
-
-https://github.com/erikd/libsndfile/issues/292
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12562
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8
-
-From cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=B6rn=20Heusipp?= <osmanx@problemloesungsmaschine.de>
-Date: Wed, 14 Jun 2017 12:25:40 +0200
-Subject: [PATCH] src/common.c: Fix heap buffer overflows when writing strings
- in binheader
-
-Fixes the following problems:
- 1. Case 's' only enlarges the buffer by 16 bytes instead of size bytes.
- 2. psf_binheader_writef() enlarges the header buffer (if needed) prior to the
- big switch statement by an amount (16 bytes) which is enough for all cases
- where only a single value gets added. Cases 's', 'S', 'p' however
- additionally write an arbitrary length block of data and again enlarge the
- buffer to the required amount. However, the required space calculation does
- not take into account the size of the length field which gets output before
- the data.
- 3. Buffer size requirement calculation in case 'S' does not account for the
- padding byte ("size += (size & 1) ;" happens after the calculation which
- uses "size").
- 4. Case 'S' can overrun the header buffer by 1 byte when no padding is
- involved
- ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + 1) ;" while
- the buffer is only guaranteed to have "size" space available).
- 5. "psf->header.ptr [psf->header.indx] = 0 ;" in case 'S' always writes 1 byte
- beyond the space which is guaranteed to be allocated in the header buffer.
- 6. Case 's' can overrun the provided source string by 1 byte if padding is
- involved ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size) ;"
- where "size" is "strlen (strptr) + 1" (which includes the 0 terminator,
- plus optionally another 1 which is padding and not guaranteed to be
- readable via the source string pointer).
-
-Closes: https://github.com/erikd/libsndfile/issues/292
----
- src/common.c | 15 +++++++--------
- 1 file changed, 7 insertions(+), 8 deletions(-)
-
-diff --git a/src/common.c b/src/common.c
-index 1a6204ca..6b2a2ee9 100644
---- a/src/common.c
-+++ b/src/common.c
-@@ -681,16 +681,16 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
- /* Write a C string (guaranteed to have a zero terminator). */
- strptr = va_arg (argptr, char *) ;
- size = strlen (strptr) + 1 ;
-- size += (size & 1) ;
-
-- if (psf->header.indx + (sf_count_t) size >= psf->header.len && psf_bump_header_allocation (psf, 16))
-+ if (psf->header.indx + 4 + (sf_count_t) size + (sf_count_t) (size & 1) > psf->header.len && psf_bump_header_allocation (psf, 4 + size + (size & 1)))
- return count ;
-
- if (psf->rwf_endian == SF_ENDIAN_BIG)
-- header_put_be_int (psf, size) ;
-+ header_put_be_int (psf, size + (size & 1)) ;
- else
-- header_put_le_int (psf, size) ;
-+ header_put_le_int (psf, size + (size & 1)) ;
- memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size) ;
-+ size += (size & 1) ;
- psf->header.indx += size ;
- psf->header.ptr [psf->header.indx - 1] = 0 ;
- count += 4 + size ;
-@@ -703,16 +703,15 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
- */
- strptr = va_arg (argptr, char *) ;
- size = strlen (strptr) ;
-- if (psf->header.indx + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, size))
-+ if (psf->header.indx + 4 + (sf_count_t) size + (sf_count_t) (size & 1) > psf->header.len && psf_bump_header_allocation (psf, 4 + size + (size & 1)))
- return count ;
- if (psf->rwf_endian == SF_ENDIAN_BIG)
- header_put_be_int (psf, size) ;
- else
- header_put_le_int (psf, size) ;
-- memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + 1) ;
-+ memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + (size & 1)) ;
- size += (size & 1) ;
- psf->header.indx += size ;
-- psf->header.ptr [psf->header.indx] = 0 ;
- count += 4 + size ;
- break ;
-
-@@ -724,7 +723,7 @@ psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...)
- size = (size & 1) ? size : size + 1 ;
- size = (size > 254) ? 254 : size ;
-
-- if (psf->header.indx + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, size))
-+ if (psf->header.indx + 1 + (sf_count_t) size > psf->header.len && psf_bump_header_allocation (psf, 1 + size))
- return count ;
-
- header_put_byte (psf, size) ;
diff --git a/gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch b/gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch
deleted file mode 100644
index 5f63231af0..0000000000
--- a/gnu/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-Fix CVE-2017-{8361,8363,8365}:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8361
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8363
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8365
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/fd0484aba8e51d16af1e3a880f9b8b857b385eb3
-
-From fd0484aba8e51d16af1e3a880f9b8b857b385eb3 Mon Sep 17 00:00:00 2001
-From: Erik de Castro Lopo <erikd@mega-nerd.com>
-Date: Wed, 12 Apr 2017 19:45:30 +1000
-Subject: [PATCH] FLAC: Fix a buffer read overrun
-
-Buffer read overrun occurs when reading a FLAC file that switches
-from 2 channels to one channel mid-stream. Only option is to
-abort the read.
-
-Closes: https://github.com/erikd/libsndfile/issues/230
----
- src/common.h | 1 +
- src/flac.c | 13 +++++++++++++
- src/sndfile.c | 1 +
- 3 files changed, 15 insertions(+)
-
-diff --git a/src/common.h b/src/common.h
-index 0bd810c3..e2669b6a 100644
---- a/src/common.h
-+++ b/src/common.h
-@@ -725,6 +725,7 @@ enum
- SFE_FLAC_INIT_DECODER,
- SFE_FLAC_LOST_SYNC,
- SFE_FLAC_BAD_SAMPLE_RATE,
-+ SFE_FLAC_CHANNEL_COUNT_CHANGED,
- SFE_FLAC_UNKOWN_ERROR,
-
- SFE_WVE_NOT_WVE,
-diff --git a/src/flac.c b/src/flac.c
-index 84de0e26..986a7b8f 100644
---- a/src/flac.c
-+++ b/src/flac.c
-@@ -434,6 +434,19 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
-
- switch (metadata->type)
- { case FLAC__METADATA_TYPE_STREAMINFO :
-+ if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
-+ { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
-+ "Nothing to be but to error out.\n" ,
-+ psf->sf.channels, metadata->data.stream_info.channels) ;
-+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
-+ return ;
-+ } ;
-+
-+ if (psf->sf.channels > 0 && psf->sf.samplerate != (int) metadata->data.stream_info.sample_rate)
-+ { psf_log_printf (psf, "Warning: FLAC stream changed sample rates from %d to %d.\n"
-+ "Carrying on as if nothing happened.",
-+ psf->sf.samplerate, metadata->data.stream_info.sample_rate) ;
-+ } ;
- psf->sf.channels = metadata->data.stream_info.channels ;
- psf->sf.samplerate = metadata->data.stream_info.sample_rate ;
- psf->sf.frames = metadata->data.stream_info.total_samples ;
-diff --git a/src/sndfile.c b/src/sndfile.c
-index 41875610..e2a87be8 100644
---- a/src/sndfile.c
-+++ b/src/sndfile.c
-@@ -245,6 +245,7 @@ ErrorStruct SndfileErrors [] =
- { SFE_FLAC_INIT_DECODER , "Error : problem with initialization of the flac decoder." },
- { SFE_FLAC_LOST_SYNC , "Error : flac decoder lost sync." },
- { SFE_FLAC_BAD_SAMPLE_RATE, "Error : flac does not support this sample rate." },
-+ { SFE_FLAC_CHANNEL_COUNT_CHANGED, "Error : flac channel changed mid stream." },
- { SFE_FLAC_UNKOWN_ERROR , "Error : unknown error in flac decoder." },
-
- { SFE_WVE_NOT_WVE , "Error : not a WVE file." },
---
-2.12.2
-
diff --git a/gnu/packages/patches/libsndfile-CVE-2017-8362.patch b/gnu/packages/patches/libsndfile-CVE-2017-8362.patch
deleted file mode 100644
index 5fc52a377a..0000000000
--- a/gnu/packages/patches/libsndfile-CVE-2017-8362.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-Fix CVE-2017-8362:
-
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8362
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808
-
-From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001
-From: Erik de Castro Lopo <erikd@mega-nerd.com>
-Date: Fri, 14 Apr 2017 15:19:16 +1000
-Subject: [PATCH] src/flac.c: Fix a buffer read overflow
-
-A file (generated by a fuzzer) which increased the number of channels
-from one frame to the next could cause a read beyond the end of the
-buffer provided by libFLAC. Only option is to abort the read.
-
-Closes: https://github.com/erikd/libsndfile/issues/231
----
- src/flac.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/src/flac.c b/src/flac.c
-index 5a4f8c21..e4f9aaa0 100644
---- a/src/flac.c
-+++ b/src/flac.c
-@@ -169,6 +169,14 @@ flac_buffer_copy (SF_PRIVATE *psf)
- const int32_t* const *buffer = pflac->wbuffer ;
- unsigned i = 0, j, offset, channels, len ;
-
-+ if (psf->sf.channels != (int) frame->header.channels)
-+ { psf_log_printf (psf, "Error: FLAC frame changed from %d to %d channels\n"
-+ "Nothing to do but to error out.\n" ,
-+ psf->sf.channels, frame->header.channels) ;
-+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
-+ return 0 ;
-+ } ;
-+
- /*
- ** frame->header.blocksize is variable and we're using a constant blocksize
- ** of FLAC__MAX_BLOCK_SIZE.
-@@ -202,7 +210,6 @@ flac_buffer_copy (SF_PRIVATE *psf)
- return 0 ;
- } ;
-
--
- len = SF_MIN (pflac->len, frame->header.blocksize) ;
-
- if (pflac->remain % channels != 0)
-@@ -436,7 +443,7 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
- { case FLAC__METADATA_TYPE_STREAMINFO :
- if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
- { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
-- "Nothing to be but to error out.\n" ,
-+ "Nothing to do but to error out.\n" ,
- psf->sf.channels, metadata->data.stream_info.channels) ;
- psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
- return ;
---
-2.12.2
-
diff --git a/gnu/packages/patches/libsndfile-armhf-type-checks.patch b/gnu/packages/patches/libsndfile-armhf-type-checks.patch
deleted file mode 100644
index 7e0c71c3f6..0000000000
--- a/gnu/packages/patches/libsndfile-armhf-type-checks.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-This is a regression in 1.0.28 that causes a test failure on armhf.
-
-Upstream bug URL:
-
-https://github.com/erikd/libsndfile/issues/229
-
-Patch copied from upstream source repository:
-
-https://github.com/erikd/libsndfile/commit/9d470ee5577d3ccedb1c28c7e0a7295ba17feaf5
-
-From 9d470ee5577d3ccedb1c28c7e0a7295ba17feaf5 Mon Sep 17 00:00:00 2001
-From: Erik de Castro Lopo <erikd@mega-nerd.com>
-Date: Sun, 16 Apr 2017 17:54:17 +1000
-Subject: [PATCH] src/rf64.c: Fix varargs related bug
-
-C's <stargs.h> functionality isn't type checked so that passing an
-`sf_count_t` (64 bits) by mistake in place of a `unit32_t` can cause
-errors. This would be fine if it was an error on every architecture
-and platform, but its not. This particular problem only manifested
-on armhf and some other Arm architectures. It was not an issue on
-32 bit x86.
-
-I have now fixed variants of this same bug several times.
-
-Closes: https://github.com/erikd/libsndfile/issues/229
----
- src/rf64.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/rf64.c b/src/rf64.c
-index b3d637f..02dd904 100644
---- a/src/rf64.c
-+++ b/src/rf64.c
-@@ -742,7 +742,7 @@ rf64_write_header (SF_PRIVATE *psf, int calc_length)
-
- pad_size = psf->dataoffset - 16 - psf->header.indx ;
- if (pad_size >= 0)
-- psf_binheader_writef (psf, "m4z", PAD_MARKER, pad_size, make_size_t (pad_size)) ;
-+ psf_binheader_writef (psf, "m4z", PAD_MARKER, (unsigned int) pad_size, make_size_t (pad_size)) ;
-
- if (wpriv->rf64_downgrade && (psf->filelength < RIFF_DOWNGRADE_BYTES))
- psf_binheader_writef (psf, "tm8", data_MARKER, psf->datalength) ;
diff --git a/gnu/packages/patches/lsh-fix-x11-forwarding.patch b/gnu/packages/patches/lsh-fix-x11-forwarding.patch
new file mode 100644
index 0000000000..fd56a5bafd
--- /dev/null
+++ b/gnu/packages/patches/lsh-fix-x11-forwarding.patch
@@ -0,0 +1,20 @@
+--- a/src/server_x11.c 2016-08-01 11:58:54.714647794 +0200
++++ b/src/server_x11.c 2016-08-01 11:58:46.606563478 +0200
+@@ -151,7 +151,7 @@ DEFINE_COMMAND(open_forwarded_x11)
+ #define X11_MIN_DISPLAY 10
+ #define X11_MAX_DISPLAY 1000
+
+-/* FIXME: Create the /tmp/.X11-unix directory, if needed. Figure out
++/* FIXME: Figure out
+ * if and how we should use /tmp/.X17-lock. Consider using display
+ * "unix:17" instead of just ":17".
+ */
+@@ -253,6 +253,7 @@ open_x11_socket(struct ssh_channel *chan
+
+ old_umask = umask(0077);
+
++ mkdir(X11_SOCKET_DIR, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX);
+ old_cd = lsh_pushd(X11_SOCKET_DIR, &dir, 0, 0);
+ if (old_cd < 0)
+ {
+
diff --git a/gnu/packages/patches/mailutils-fix-uninitialized-variable.patch b/gnu/packages/patches/mailutils-fix-uninitialized-variable.patch
new file mode 100644
index 0000000000..2a1c81648b
--- /dev/null
+++ b/gnu/packages/patches/mailutils-fix-uninitialized-variable.patch
@@ -0,0 +1,26 @@
+From 5ca6382fe8adb5bc436a6d873c8b86c69d5abfd1 Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <gray@gnu.org>
+Date: Sun, 13 Sep 2020 14:43:46 +0300
+Subject: [PATCH] Fix uninitialized variable in readmsg
+
+* readmsg/readmsg.c (main): Initialize weedc.
+---
+ readmsg/readmsg.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/readmsg/readmsg.c b/readmsg/readmsg.c
+index 9f305bb9c..3a9f420db 100644
+--- a/readmsg/readmsg.c
++++ b/readmsg/readmsg.c
+@@ -466,7 +466,7 @@ main (int argc, char **argv)
+ mu_mailbox_t mbox = NULL;
+ struct mu_wordsplit ws;
+ char **weedv;
+- int weedc;
++ int weedc = 0;
+ int unix_header = 0;
+
+ /* Native Language Support */
+--
+2.28.0
+
diff --git a/gnu/packages/patches/mariadb-client-test-32bit.patch b/gnu/packages/patches/mariadb-client-test-32bit.patch
deleted file mode 100644
index 02017e324d..0000000000
--- a/gnu/packages/patches/mariadb-client-test-32bit.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 93efa48a7b972fc463406603574a4d508eefe792 Mon Sep 17 00:00:00 2001
-From: Sergei Golubchik <serg@mariadb.org>
-Date: Sun, 13 May 2018 18:50:21 +0200
-Subject: [PATCH] fix failing main.mysql_client_test test on 32bit
-
-in `ulonglong=ulong*uint` multiplication
-is done in ulong, wrapping around on 32bit.
-
-This became visible after C/C changed the
-default charset to utf8, thus changing
-mbmaxlem from 1 to 3.
----
- tests/mysql_client_fw.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c
-index f69eb28a2871..4d036887629a 100644
---- a/tests/mysql_client_fw.c
-+++ b/tests/mysql_client_fw.c
-@@ -768,7 +768,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
- {
- MYSQL_FIELD *field;
- CHARSET_INFO *cs;
-- ulonglong expected_field_length;
-+ ulonglong expected_field_length= length;
-
- if (!(field= mysql_fetch_field_direct(result, no)))
- {
-@@ -777,7 +777,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
- }
- cs= get_charset(field->charsetnr, 0);
- DIE_UNLESS(cs);
-- if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32)
-+ if ((expected_field_length*= cs->mbmaxlen) > UINT_MAX32)
- expected_field_length= UINT_MAX32;
- if (!opt_silent)
- {
diff --git a/gnu/packages/patches/nginx-socket-cloexec.patch b/gnu/packages/patches/nginx-socket-cloexec.patch
new file mode 100644
index 0000000000..985ce573b5
--- /dev/null
+++ b/gnu/packages/patches/nginx-socket-cloexec.patch
@@ -0,0 +1,185 @@
+diff --git a/auto/unix b/auto/unix
+index 10835f6c..b5b33bb3 100644
+--- a/auto/unix
++++ b/auto/unix
+@@ -990,3 +990,27 @@ ngx_feature_test='struct addrinfo *res;
+ if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
+ freeaddrinfo(res)'
+ . auto/feature
++
++ngx_feature="SOCK_CLOEXEC support"
++ngx_feature_name="NGX_HAVE_SOCKET_CLOEXEC"
++ngx_feature_run=no
++ngx_feature_incs="#include <sys/types.h>
++ #include <sys/socket.h>"
++ngx_feature_path=
++ngx_feature_libs=
++ngx_feature_test="int fd;
++ fd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);"
++. auto/feature
++
++ngx_feature="FD_CLOEXEC support"
++ngx_feature_name="NGX_HAVE_FD_CLOEXEC"
++ngx_feature_run=no
++ngx_feature_incs="#include <sys/types.h>
++ #include <sys/socket.h>
++ #include <fcntl.h>"
++ngx_feature_path=
++ngx_feature_libs=
++ngx_feature_test="int fd;
++ fd = socket(AF_INET, SOCK_STREAM, 0);
++ fcntl(fd, F_SETFD, FD_CLOEXEC);"
++. auto/feature
+diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
+index cd55520c..438e0806 100644
+--- a/src/core/ngx_resolver.c
++++ b/src/core/ngx_resolver.c
+@@ -4466,8 +4466,14 @@ ngx_tcp_connect(ngx_resolver_connection_t *rec)
+ ngx_event_t *rev, *wev;
+ ngx_connection_t *c;
+
++#if (NGX_HAVE_SOCKET_CLOEXEC)
++ s = ngx_socket(rec->sockaddr->sa_family, SOCK_STREAM | SOCK_CLOEXEC, 0);
++
++#else
+ s = ngx_socket(rec->sockaddr->sa_family, SOCK_STREAM, 0);
+
++#endif
++
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, &rec->log, 0, "TCP socket %d", s);
+
+ if (s == (ngx_socket_t) -1) {
+@@ -4494,6 +4500,15 @@ ngx_tcp_connect(ngx_resolver_connection_t *rec)
+ goto failed;
+ }
+
++#if (NGX_HAVE_FD_CLOEXEC)
++ if (ngx_cloexec(s) == -1) {
++ ngx_log_error(NGX_LOG_ALERT, &rec->log, ngx_socket_errno,
++ ngx_cloexec_n " failed");
++
++ goto failed;
++ }
++#endif
++
+ rev = c->read;
+ wev = c->write;
+
+diff --git a/src/event/ngx_event.h b/src/event/ngx_event.h
+index 19fec68..8c2f01a 100644
+--- a/src/event/ngx_event.h
++++ b/src/event/ngx_event.h
+@@ -73,6 +73,9 @@ struct ngx_event_s {
+ /* to test on worker exit */
+ unsigned channel:1;
+ unsigned resolver:1;
++#if (HAVE_SOCKET_CLOEXEC_PATCH)
++ unsigned skip_socket_leak_check:1;
++#endif
+
+ unsigned cancelable:1;
+
+diff --git a/src/event/ngx_event_accept.c b/src/event/ngx_event_accept.c
+index 77563709..5827b9d0 100644
+--- a/src/event/ngx_event_accept.c
++++ b/src/event/ngx_event_accept.c
+@@ -62,7 +62,9 @@ ngx_event_accept(ngx_event_t *ev)
+
+ #if (NGX_HAVE_ACCEPT4)
+ if (use_accept4) {
+- s = accept4(lc->fd, &sa.sockaddr, &socklen, SOCK_NONBLOCK);
++ s = accept4(lc->fd, &sa.sockaddr, &socklen,
++ SOCK_NONBLOCK | SOCK_CLOEXEC);
++
+ } else {
+ s = accept(lc->fd, &sa.sockaddr, &socklen);
+ }
+@@ -202,6 +204,16 @@ ngx_event_accept(ngx_event_t *ev)
+ ngx_close_accepted_connection(c);
+ return;
+ }
++
++#if (NGX_HAVE_FD_CLOEXEC)
++ if (ngx_cloexec(s) == -1) {
++ ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
++ ngx_cloexec_n " failed");
++ ngx_close_accepted_connection(c);
++ return;
++ }
++#endif
++
+ }
+ }
+
+diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c
+index c5bb8068..cf33b1d2 100644
+--- a/src/event/ngx_event_connect.c
++++ b/src/event/ngx_event_connect.c
+@@ -38,8 +38,15 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
+
+ type = (pc->type ? pc->type : SOCK_STREAM);
+
++#if (NGX_HAVE_SOCKET_CLOEXEC)
++ s = ngx_socket(pc->sockaddr->sa_family, type | SOCK_CLOEXEC, 0);
++
++#else
+ s = ngx_socket(pc->sockaddr->sa_family, type, 0);
+
++#endif
++
++
+ ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pc->log, 0, "%s socket %d",
+ (type == SOCK_STREAM) ? "stream" : "dgram", s);
+
+@@ -80,6 +87,15 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
+ goto failed;
+ }
+
++#if (NGX_HAVE_FD_CLOEXEC)
++ if (ngx_cloexec(s) == -1) {
++ ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
++ ngx_cloexec_n " failed");
++
++ goto failed;
++ }
++#endif
++
+ if (pc->local) {
+
+ #if (NGX_HAVE_TRANSPARENT_PROXY)
+diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
+index c4376a5..48e8fa8 100644
+--- a/src/os/unix/ngx_process_cycle.c
++++ b/src/os/unix/ngx_process_cycle.c
+@@ -1032,6 +1032,9 @@ ngx_worker_process_exit(ngx_cycle_t *cycle)
+ for (i = 0; i < cycle->connection_n; i++) {
+ if (c[i].fd != -1
+ && c[i].read
++#if (HAVE_SOCKET_CLOEXEC_PATCH)
++ && !c[i].read->skip_socket_leak_check
++#endif
+ && !c[i].read->accept
+ && !c[i].read->channel
+ && !c[i].read->resolver)
+diff --git a/src/os/unix/ngx_socket.h b/src/os/unix/ngx_socket.h
+index fcc51533..d1eebf47 100644
+--- a/src/os/unix/ngx_socket.h
++++ b/src/os/unix/ngx_socket.h
+@@ -38,6 +38,17 @@ int ngx_blocking(ngx_socket_t s);
+
+ #endif
+
++#if (NGX_HAVE_FD_CLOEXEC)
++
++#define ngx_cloexec(s) fcntl(s, F_SETFD, FD_CLOEXEC)
++#define ngx_cloexec_n "fcntl(FD_CLOEXEC)"
++
++/* at least FD_CLOEXEC is required to ensure connection fd is closed
++ * after execve */
++#define HAVE_SOCKET_CLOEXEC_PATCH 1
++
++#endif
++
+ int ngx_tcp_nopush(ngx_socket_t s);
+ int ngx_tcp_push(ngx_socket_t s);
+
diff --git a/gnu/packages/patches/nss-pkgconfig.patch b/gnu/packages/patches/nss-3.56-pkgconfig.patch
index e3145aa4cf..91b6aef604 100644
--- a/gnu/packages/patches/nss-pkgconfig.patch
+++ b/gnu/packages/patches/nss-3.56-pkgconfig.patch
@@ -7,7 +7,7 @@ Modifications:
Remove optional patching in nss/Makefile.
Include -L$libdir in output from "nss-config --libs".
-Later adapted to apply cleanly to nss-3.21.
+Later adapted to apply cleanly to nss-3.53.
--- nss-3.21/nss/config/Makefile
+++ nss-3.21/nss/config/Makefile
@@ -217,9 +217,12 @@ Later adapted to apply cleanly to nss-3.21.
+
--- nss-3.21/nss/manifest.mn
+++ nss-3.21/nss/manifest.mn
-@@ -10,4 +10,4 @@
-
+@@ -10,7 +10,7 @@
+
RELEASE = nss
-
+
-DIRS = coreconf lib cmd cpputil gtests
+DIRS = coreconf lib cmd cpputil gtests config
+
+ lib: coreconf
+ cmd: lib
diff --git a/gnu/packages/patches/picard-fix-id3-rename-test.patch b/gnu/packages/patches/picard-fix-id3-rename-test.patch
new file mode 100644
index 0000000000..3c4fa63c84
--- /dev/null
+++ b/gnu/packages/patches/picard-fix-id3-rename-test.patch
@@ -0,0 +1,11 @@
+Index: b/test/formats/test_id3.py
+===================================================================
+--- a/test/formats/test_id3.py
++++ b/test/formats/test_id3.py
+@@ -266,5 +266,5 @@
+ def test_rename_txxx_tags(self):
+ file_path = os.path.join('test', 'data', 'test-id3-rename-tags.mp3')
+- filename = self.copy_file_tmp(file_path, 'mp3')
++ filename = self.copy_file_tmp(file_path, '.mp3')
+ raw_metadata = load_raw(filename)
+ self.assertIn('TXXX:Artists', raw_metadata)
diff --git a/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch b/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch
deleted file mode 100644
index affa0e1317..0000000000
--- a/gnu/packages/patches/python-gst-fix-build-with-python-3.8.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Fix build with Python 3.8 by also checking for python-3.X-embed.pc. Since
-Python 3.8 the normal checks don't include the Python libraries anymore and
-linking of the gst-python module would fail.
-
-See also https://github.com/mesonbuild/meson/issues/5629
-Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
-
-Patch based on upstream commit:
-
-https://gitlab.freedesktop.org/gstreamer/gst-python/-/commit/10707f437f2fc3632067c6a0efa4432f7ebaf362
-
-diff --git a/meson.build b/meson.build
-index 5f13b48..d7c7e66 100644
---- a/meson.build
-+++ b/meson.build
-@@ -23,7 +23,17 @@ pygobject_dep = dependency('pygobject-3.0', fallback: ['pygobject', 'pygobject_d
-
- pymod = import('python')
- python = pymod.find_installation(get_option('python'))
--python_dep = python.dependency(required : true)
-+pythonver = python.language_version()
-+if pythonver.version_compare('<3.0')
-+ error('Python2 is not supported anymore, please port your code to python3 (@0@ specified)'.format(python.language_version()))
-+endif
-+
-+# Workaround for https://github.com/mesonbuild/meson/issues/5629
-+# https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
-+python_dep = dependency('python-@0@-embed'.format(pythonver), version: '>=3', required: false)
-+if not python_dep.found()
-+ python_dep = python.dependency(required : true)
-+endif
-
- python_abi_flags = python.get_variable('ABIFLAGS', '')
- pylib_loc = get_option('libpython-dir')
---
-2.26.2
diff --git a/gnu/packages/patches/qemu-build-info-manual.patch b/gnu/packages/patches/qemu-build-info-manual.patch
new file mode 100644
index 0000000000..d57b26ea00
--- /dev/null
+++ b/gnu/packages/patches/qemu-build-info-manual.patch
@@ -0,0 +1,139 @@
+From 07303a0a4daa83a0555ac4abad7a5d65584307ad Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Thu, 17 Sep 2020 13:28:19 -0400
+Subject: [PATCH] build: Build and install the info manual.
+
+Take advantage of the Sphinx texinfo backend to generate a QEMU info
+manual. The texinfo format allows for more structure and info readers
+provide more advanced navigation capabilities compared to manpages
+readers.
+
+* configure (infodir): Add the --infodir option, which allows
+configuring the directory under which the info manuals are installed.
+* docs/index.rst: Include the top level documents to prevent
+warnings (treated as errors by sphinx-build).
+* Makefile (sphinxdocs-info, $(MANUAL_BUILDDIR)/QEMU.texi)): New targets.
+(info): Depend on sphinxdocs-info.
+(install-doc): Install the info manual.
+---
+ Makefile | 13 +++++++++++--
+ configure | 7 +++++++
+ docs/index.rst | 2 ++
+ 3 files changed, 20 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 13dd708c..da78612d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -864,12 +864,14 @@ endef
+ # Note that we deliberately do not install the "devel" manual: it is
+ # for QEMU developers, and not interesting to our users.
+ .PHONY: install-sphinxdocs
+-install-sphinxdocs: sphinxdocs
++install-sphinxdocs: sphinxdocs sphinxdocs-info
+ $(call install-manual,interop)
+ $(call install-manual,specs)
+ $(call install-manual,system)
+ $(call install-manual,tools)
+ $(call install-manual,user)
++ $(INSTALL_DIR) "$(DESTDIR)$(infodir)"
++ $(INSTALL_DATA) $(MANUAL_BUILDDIR)/QEMU.info "$(DESTDIR)$(infodir)"
+
+ install-doc: $(DOCS) install-sphinxdocs
+ $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
+@@ -1067,6 +1069,13 @@ sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \
+ $(MANUAL_BUILDDIR)/tools/index.html \
+ $(MANUAL_BUILDDIR)/user/index.html
+
++# Build the complete info manual.
++.PHONE: sphinxdocs-info
++sphinxdocs-info: $(MANUAL_BUILDDIR)/QEMU.info
++
++$(MANUAL_BUILDDIR)/QEMU.texi: $(call manual-deps,*) $(wildcard $(SRC_PATH)/docs/*.rst)
++ $(call build-manual,,texinfo)
++
+ # Canned command to build a single manual
+ # Arguments: $1 = manual name, $2 = Sphinx builder ('html' or 'man')
+ # Note the use of different doctree for each (manual, builder) tuple;
+@@ -1126,7 +1135,7 @@ docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi
+ @cp -p $< $@
+
+ html: docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs
+-info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
++info: docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info sphinxdocs-info
+ pdf: docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
+ txt: docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
+
+diff --git a/configure b/configure
+index 2acc4d14..3691bd2e 100755
+--- a/configure
++++ b/configure
+@@ -415,6 +415,7 @@ LDFLAGS_SHARED="-shared"
+ modules="no"
+ module_upgrades="no"
+ prefix="/usr/local"
++infodir="\${prefix}/share/info"
+ mandir="\${prefix}/share/man"
+ datadir="\${prefix}/share"
+ firmwarepath="\${prefix}/share/qemu-firmware"
+@@ -987,6 +988,7 @@ if test "$mingw32" = "yes" ; then
+ LIBS="-liberty $LIBS"
+ fi
+ prefix="c:/Program Files/QEMU"
++ infodir="\${prefix}"
+ mandir="\${prefix}"
+ datadir="\${prefix}"
+ qemu_docdir="\${prefix}"
+@@ -1087,6 +1089,8 @@ for opt do
+ static="yes"
+ QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
+ ;;
++ --infodir=*) infodir="$optarg"
++ ;;
+ --mandir=*) mandir="$optarg"
+ ;;
+ --bindir=*) bindir="$optarg"
+@@ -1780,6 +1784,7 @@ Advanced options (experts only):
+ --smbd=SMBD use specified smbd [$smbd]
+ --with-git=GIT use specified git [$git]
+ --static enable static build [$static]
++ --infodir=PATH install info manual in PATH
+ --mandir=PATH install man pages in PATH
+ --datadir=PATH install firmware in PATH$confsuffix
+ --docdir=PATH install documentation in PATH$confsuffix
+@@ -6836,6 +6841,7 @@ echo "include directory $(eval echo $includedir)"
+ echo "config directory $(eval echo $sysconfdir)"
+ if test "$mingw32" = "no" ; then
+ echo "local state directory $(eval echo $local_statedir)"
++echo "Info manual directory $(eval echo $infodir)"
+ echo "Manual directory $(eval echo $mandir)"
+ echo "ELF interp prefix $interp_prefix"
+ else
+@@ -7059,6 +7065,7 @@ echo "bindir=$bindir" >> $config_host_mak
+ echo "libdir=$libdir" >> $config_host_mak
+ echo "libexecdir=$libexecdir" >> $config_host_mak
+ echo "includedir=$includedir" >> $config_host_mak
++echo "infodir=$infodir" >> $config_host_mak
+ echo "mandir=$mandir" >> $config_host_mak
+ echo "sysconfdir=$sysconfdir" >> $config_host_mak
+ echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
+diff --git a/docs/index.rst b/docs/index.rst
+index 763e3d04..4f155b51 100644
+--- a/docs/index.rst
++++ b/docs/index.rst
+@@ -9,6 +9,7 @@ Welcome to QEMU's documentation!
+ .. toctree::
+ :maxdepth: 2
+ :caption: Contents:
++ :glob:
+
+ system/index
+ user/index
+@@ -16,3 +17,4 @@ Welcome to QEMU's documentation!
+ interop/index
+ specs/index
+ devel/index
++ *
+--
+2.28.0
+
diff --git a/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch b/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch
new file mode 100644
index 0000000000..b56c628537
--- /dev/null
+++ b/gnu/packages/patches/samba-fix-fcntl-hint-detection.patch
@@ -0,0 +1,55 @@
+From 454ccd986b61799908a6898a55d0480911f15306 Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <slow@samba.org>
+Date: Mon, 21 Sep 2020 07:48:43 +0200
+Subject: [PATCH] s3: fix fcntl waf configure check
+
+RN: Fix fcntl waf configure check
+BUG: https://bugzilla.samba.org/show_bug.cgi?id=14503
+
+Signed-off-by: Ralph Boehme <slow@samba.org>
+Reviewed-by: Volker Lendecke <vl@samba.org>
+
+Autobuild-User(master): Volker Lendecke <vl@samba.org>
+Autobuild-Date(master): Mon Sep 21 07:26:54 UTC 2020 on sn-devel-184
+---
+ source3/wscript | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/source3/wscript b/source3/wscript
+index 840ed430c0f..d3ef346eecd 100644
+--- a/source3/wscript
++++ b/source3/wscript
+@@ -1244,7 +1244,7 @@ err:
+
+ int main(void)
+ {
+- uint64_t *hint, get_hint;
++ uint64_t hint, get_hint;
+ int fd;
+
+ fd = open(DATA, O_RDONLY | O_CREAT | O_EXCL);
+@@ -1252,8 +1252,8 @@ int main(void)
+ goto err;
+ }
+
+- *hint = RWH_WRITE_LIFE_SHORT;
+- int ret = fcntl(fd, F_SET_RW_HINT, hint);
++ hint = RWH_WRITE_LIFE_SHORT;
++ int ret = fcntl(fd, F_SET_RW_HINT, &hint);
+ if (ret == -1) {
+ goto err;
+ }
+@@ -1267,8 +1267,8 @@ int main(void)
+ goto err;
+ }
+
+- *hint = RWH_WRITE_LIFE_EXTREME;
+- ret = fcntl(fd, F_SET_FILE_RW_HINT, hint);
++ hint = RWH_WRITE_LIFE_EXTREME;
++ ret = fcntl(fd, F_SET_FILE_RW_HINT, &hint);
+ if (ret == -1) {
+ goto err;
+ }
+--
+2.28.0
+
diff --git a/gnu/packages/patches/sbcl-graph-asdf-definitions.patch b/gnu/packages/patches/sbcl-graph-asdf-definitions.patch
deleted file mode 100644
index ec17949675..0000000000
--- a/gnu/packages/patches/sbcl-graph-asdf-definitions.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-commit 52ebece1243ae6900e414b6248b5145a28348eef
-Author: Guillaume Le Vaillant <glv@posteo.net>
-Date: Fri Oct 18 15:41:23 2019 +0200
-
- Use basic ASDF system definitions instead of package-inferred-system
-
-diff --git a/graph.asd b/graph.asd
-index 193b6e3..56afc8f 100644
---- a/graph.asd
-+++ b/graph.asd
-@@ -3,12 +3,10 @@
- :version "0.0.0"
- :author ("Eric Schulte <schulte.eric@gmail.com>" "Thomas Dye")
- :licence "GPL V3"
-- :class :package-inferred-system
-- :defsystem-depends-on (:asdf-package-system)
-+ :in-order-to ((test-op (test-op graph-test)))
- :depends-on (alexandria
- metabang-bind
- named-readtables
- curry-compose-reader-macros
-- graph/graph))
--
--(register-system-packages "femlisp-matlisp" '(:fl.matlisp))
-+ cl-heap)
-+ :components ((:file "graph")))
-diff --git a/graph-dot.asd b/graph-dot.asd
-new file mode 100644
-index 0000000..12aec7e
---- /dev/null
-+++ b/graph-dot.asd
-@@ -0,0 +1,8 @@
-+(defsystem :graph-dot
-+ :depends-on (alexandria
-+ metabang-bind
-+ named-readtables
-+ curry-compose-reader-macros
-+ cl-ppcre
-+ graph)
-+ :components ((:file "dot")))
-diff --git a/graph-json.asd b/graph-json.asd
-new file mode 100644
-index 0000000..e7d091f
---- /dev/null
-+++ b/graph-json.asd
-@@ -0,0 +1,8 @@
-+(defsystem :graph-json
-+ :depends-on (alexandria
-+ metabang-bind
-+ named-readtables
-+ curry-compose-reader-macros
-+ yason
-+ graph)
-+ :components ((:file "json")))
-diff --git a/graph-test.asd b/graph-test.asd
-new file mode 100644
-index 0000000..1e811e1
---- /dev/null
-+++ b/graph-test.asd
-@@ -0,0 +1,10 @@
-+(defsystem :graph-test
-+ :depends-on (alexandria
-+ metabang-bind
-+ named-readtables
-+ curry-compose-reader-macros
-+ graph
-+ stefil)
-+ :perform (test-op (o s)
-+ (uiop:symbol-call :graph/test 'test))
-+ :components ((:file "test")))
diff --git a/gnu/packages/patches/sunxi-tools-remove-sys-io.patch b/gnu/packages/patches/sunxi-tools-remove-sys-io.patch
new file mode 100644
index 0000000000..fc1e5ea28d
--- /dev/null
+++ b/gnu/packages/patches/sunxi-tools-remove-sys-io.patch
@@ -0,0 +1,52 @@
+From 783cbd59fcf086a9aaf603271823fb4ca71f0c55 Mon Sep 17 00:00:00 2001
+From: Danny Milosavljevic <dannym@scratchpost.org>
+Date: Thu, 8 Oct 2020 23:01:05 +0200
+Subject: [PATCH] meminfo: Replace sys/io.h by direct register accesses.
+See: https://github.com/linux-sunxi/sunxi-tools/pull/144
+
+Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
+---
+ meminfo.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/meminfo.c b/meminfo.c
+index 0b0ff23..3b3a5df 100644
+--- a/meminfo.c
++++ b/meminfo.c
+@@ -22,7 +22,6 @@
+ #include <sys/mman.h>
+ #include <stdint.h>
+ #include <errno.h>
+-#include <sys/io.h>
+ #include <stdbool.h>
+
+ #include "common.h"
+@@ -74,24 +73,24 @@ static enum sunxi_soc_version soc_version;
+ unsigned int
+ sunxi_io_read(void *base, int offset)
+ {
+- return inl((unsigned long) (base + offset));
++ return *(volatile unsigned int*) (base + offset);
+ }
+
+ void
+ sunxi_io_write(void *base, int offset, unsigned int value)
+ {
+- outl(value, (unsigned long) (base + offset));
++ *(volatile unsigned int*) (base + offset) = value;
+ }
+
+ void
+ sunxi_io_mask(void *base, int offset, unsigned int value, unsigned int mask)
+ {
+- unsigned int tmp = inl((unsigned long) (base + offset));
++ unsigned int tmp = sunxi_io_read(base, offset);
+
+ tmp &= ~mask;
+ tmp |= value & mask;
+
+- outl(tmp, (unsigned long) (base + offset));
++ sunxi_io_write(base, offset, tmp);
+ }
+
+
diff --git a/gnu/packages/patches/unison-fix-ocaml-4.08.patch b/gnu/packages/patches/unison-fix-ocaml-4.08.patch
new file mode 100644
index 0000000000..811f590721
--- /dev/null
+++ b/gnu/packages/patches/unison-fix-ocaml-4.08.patch
@@ -0,0 +1,81 @@
+This patch is taken from the opam repository:
+https://github.com/ocaml/opam-repository/blob/master/packages/unison/unison.2.51.2/files/ocaml48.patch
+
+It fixes compatibility with changes introduced in OCaml 4.08.
+
+diff --git a/src/Makefile.OCaml b/src/Makefile.OCaml
+index 7cefa2e..378fc8b 100644
+--- a/src/Makefile.OCaml
++++ b/src/Makefile.OCaml
+@@ -272,7 +272,7 @@ endif
+
+ # Gtk GUI
+ ifeq ($(UISTYLE), gtk)
+- CAMLFLAGS+=-I +lablgtk
++ CAMLFLAGS+=-I $(LABLGTKLIB)
+ OCAMLOBJS+=pixmaps.cmo uigtk.cmo linkgtk.cmo
+ OCAMLLIBS+=lablgtk.cma
+ endif
+@@ -282,7 +282,7 @@ OCAMLFIND := $(shell command -v ocamlfind 2> /dev/null)
+
+ ifeq ($(UISTYLE), gtk2)
+ ifndef OCAMLFIND
+- CAMLFLAGS+=-I +lablgtk2
++ CAMLFLAGS+=-I $(LABLGTK2LIB)
+ else
+ CAMLFLAGS+=$(shell $(OCAMLFIND) query -i-format lablgtk2 )
+ endif
+diff --git a/src/files.ml b/src/files.ml
+index 5ff1881..1d1fbcc 100644
+--- a/src/files.ml
++++ b/src/files.ml
+@@ -734,7 +734,7 @@ let get_files_in_directory dir =
+ with End_of_file ->
+ dirh.System.closedir ()
+ end;
+- Sort.list (<) !files
++ List.sort String.compare !files
+
+ let ls dir pattern =
+ Util.convertUnixErrorsToTransient
+diff --git a/src/recon.ml b/src/recon.ml
+index 2c619bb..2412c18 100644
+--- a/src/recon.ml
++++ b/src/recon.ml
+@@ -661,8 +661,8 @@ let rec reconcile
+
+ (* Sorts the paths so that they will be displayed in order *)
+ let sortPaths pathUpdatesList =
+- Sort.list
+- (fun (p1, _) (p2, _) -> Path.compare p1 p2 <= 0)
++ List.sort
++ Path.compare
+ pathUpdatesList
+
+ let rec enterPath p1 p2 t =
+diff --git a/src/system/system_generic.ml b/src/system/system_generic.ml
+index 453027d..c2288b8 100755
+--- a/src/system/system_generic.ml
++++ b/src/system/system_generic.ml
+@@ -47,7 +47,7 @@ let open_out_gen = open_out_gen
+ let chmod = Unix.chmod
+ let chown = Unix.chown
+ let utimes = Unix.utimes
+-let link = Unix.link
++let link s d = Unix.link s d
+ let openfile = Unix.openfile
+ let opendir f =
+ let h = Unix.opendir f in
+diff --git a/src/uigtk2.ml b/src/uigtk2.ml
+index fbc5d8f..4e82cc2 100644
+--- a/src/uigtk2.ml
++++ b/src/uigtk2.ml
+@@ -94,7 +94,7 @@ let icon =
+ let icon =
+ let p = GdkPixbuf.create ~width:48 ~height:48 ~has_alpha:true () in
+ Gpointer.blit
+- (Gpointer.region_of_string Pixmaps.icon_data) (GdkPixbuf.get_pixels p);
++ (Gpointer.region_of_bytes Pixmaps.icon_data) (GdkPixbuf.get_pixels p);
+ p
+
+ let leftPtrWatch =
diff --git a/gnu/packages/patches/xpra-4.0.4-norequests.patch b/gnu/packages/patches/xpra-4.0.4-norequests.patch
new file mode 100644
index 0000000000..e545be7f1d
--- /dev/null
+++ b/gnu/packages/patches/xpra-4.0.4-norequests.patch
@@ -0,0 +1,39 @@
+Remove python-requests dependency, r27626 upstream.
+
+--- a/xpra/net/websockets/common.py (revision 27625)
++++ b/xpra/net/websockets/common.py (revision 27626)
+@@ -7,7 +7,6 @@
+ import uuid
+ from hashlib import sha1
+ from base64 import b64encode
+-from requests.structures import CaseInsensitiveDict
+
+ from xpra.os_util import strtobytes, bytestostr, monotonic_time
+ from xpra.log import Logger
+@@ -77,7 +76,7 @@
+ for line in lines:
+ parts = line.split(b": ", 1)
+ if len(parts)==2:
+- headers[parts[0]] = parts[1]
++ headers[parts[0].lower()] = parts[1]
+ return headers
+
+ def verify_response_headers(headers, key):
+@@ -84,14 +83,13 @@
+ log("verify_response_headers(%s)", headers)
+ if not headers:
+ raise Exception("no http headers found in response")
+- headers = CaseInsensitiveDict(headers)
+- upgrade = headers.get(b"Upgrade", b"")
++ upgrade = headers.get(b"upgrade", b"")
+ if upgrade!=b"websocket":
+ raise Exception("invalid http upgrade: '%s'" % upgrade)
+- protocol = headers.get(b"Sec-WebSocket-Protocol", b"")
++ protocol = headers.get(b"sec-websocket-protocol", b"")
+ if protocol!=b"binary":
+ raise Exception("invalid websocket protocol: '%s'" % protocol)
+- accept_key = headers.get(b"Sec-WebSocket-Accept", b"")
++ accept_key = headers.get(b"sec-websocket-accept", b"")
+ if not accept_key:
+ raise Exception("websocket accept key is missing")
+ expected_key = make_websocket_accept_hash(key)