summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/jami-sip-contacts.patch38
-rw-r--r--gnu/packages/patches/jami-sipaccount-segfault.patch30
-rw-r--r--gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch5
-rw-r--r--gnu/packages/patches/julia-allow-parallel-build.patch32
-rw-r--r--gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch40
-rw-r--r--gnu/packages/patches/python-seaborn-2690.patch268
-rw-r--r--gnu/packages/patches/python-seaborn-kde-test.patch36
-rw-r--r--gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch565
-rw-r--r--gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch27
-rw-r--r--gnu/packages/patches/sssd-optional-systemd.patch45
-rw-r--r--gnu/packages/patches/u-boot-allow-disabling-openssl.patch66
11 files changed, 702 insertions, 450 deletions
diff --git a/gnu/packages/patches/jami-sip-contacts.patch b/gnu/packages/patches/jami-sip-contacts.patch
new file mode 100644
index 0000000000..dce8f6b98d
--- /dev/null
+++ b/gnu/packages/patches/jami-sip-contacts.patch
@@ -0,0 +1,38 @@
+From 3ba007d02bc19e499c8f3c2345302453028831a8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
+Date: Tue, 29 Nov 2022 09:26:20 -0500
+Subject: [PATCH] misc: fix incoming message sip
+
+We do not need to check contacts for SIP as it will be considered
+automatically as a contact
+
+Change-Id: If78113e9d79dcd695c39c2d12c0441e2cb282737
+---
+ src/libclient/conversationmodel.cpp | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/client-qt/src/libclient/conversationmodel.cpp b/client-qt/src/libclient/conversationmodel.cpp
+index dba206bd..5604a17c 100644
+--- a/client-qt/src/libclient/conversationmodel.cpp
++++ b/client-qt/src/libclient/conversationmodel.cpp
+@@ -3611,8 +3611,12 @@ ConversationModelPimpl::addIncomingMessage(const QString& peerId,
+ try {
+ auto contact = linked.owner.contactModel->getContact(peerId);
+ isRequest = contact.profileInfo.type == profile::Type::PENDING;
+- if (isRequest && !contact.isBanned && peerId != linked.owner.profileInfo.uri) {
+- addContactRequest(peerId);
++ // if isSip, it will be a contact!
++ auto isSip = linked.owner.profileInfo.type == profile::Type::SIP;
++ if (isSip
++ || (isRequest && !contact.isBanned && peerId != linked.owner.profileInfo.uri)) {
++ if (!isSip)
++ addContactRequest(peerId);
+ convIds.push_back(storage::beginConversationWithPeer(db, contact.profileInfo.uri));
+ auto& conv = getConversationForPeerUri(contact.profileInfo.uri).get();
+ conv.uid = convIds[0];
+
+base-commit: 6f30acf0043d07dcbe63ee8636509885a9b6fd76
+--
+2.38.1
+
diff --git a/gnu/packages/patches/jami-sipaccount-segfault.patch b/gnu/packages/patches/jami-sipaccount-segfault.patch
new file mode 100644
index 0000000000..1cef512124
--- /dev/null
+++ b/gnu/packages/patches/jami-sipaccount-segfault.patch
@@ -0,0 +1,30 @@
+From e5a449d60abc667d85dacd75ad6e31d4ddca5853 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
+Date: Thu, 17 Nov 2022 12:02:20 -0500
+Subject: [PATCH] sipaccount: fix potential null dereference
+
+Detected by sonarqube
+
+Change-Id: I606f9cf2458dda07471d0a67af8915c7ca13d410
+---
+ src/sip/sipaccount.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp
+index 695b71839..e544ac31a 100644
+--- a/daemon/src/sip/sipaccount.cpp
++++ b/daemon/src/sip/sipaccount.cpp
+@@ -789,7 +789,8 @@ SIPAccount::sendRegister()
+ if (pjsip_regc_set_transport(regc, &tp_sel) != PJ_SUCCESS)
+ throw VoipLinkException("Unable to set transport");
+
+- setUpTransmissionData(tdata, tp_sel.u.transport->key.type);
++ if (tp_sel.u.transport)
++ setUpTransmissionData(tdata, tp_sel.u.transport->key.type);
+
+ // pjsip_regc_send increment the transport ref count by one,
+ if ((status = pjsip_regc_send(regc, tdata)) != PJ_SUCCESS) {
+--
+GitLab
+
diff --git a/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch b/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch
index b60f284923..c6ca48fff0 100644
--- a/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch
+++ b/gnu/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch
@@ -8,15 +8,16 @@ Patch by Nicoló Balzarotti <[email protected]>.
--- a/base/loading.jl
+++ b/base/loading.jl
-@@ -807,7 +807,10 @@
- path = normpath(joinpath(dirname(prev), _path))
+@@ -1131,7 +1131,10 @@ function _include_dependency(mod::Module, _path::AbstractString)
end
if _track_dependencies[]
+ @lock require_lock begin
- push!(_require_dependencies, (mod, path, mtime(path)))
+ push!(_require_dependencies,
+ (mod, path,
+ haskey(ENV, "SOURCE_DATE_EPOCH") ?
+ parse(Float64, ENV["SOURCE_DATE_EPOCH"]) : mtime(path)))
+ end
end
return path, prev
end
diff --git a/gnu/packages/patches/julia-allow-parallel-build.patch b/gnu/packages/patches/julia-allow-parallel-build.patch
deleted file mode 100644
index cc1d42fee4..0000000000
--- a/gnu/packages/patches/julia-allow-parallel-build.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Allow parallel tests with isolated environment.
-
-See https://github.com/JuliaLang/julia/issues/43205 and
-https://github.com/JuliaLang/julia/pull/43211.
-
-diff --git a/test/runtests.jl b/test/runtests.jl
-index 2f9cd058bb..150395e78c 100644
---- a/test/runtests.jl
-+++ b/test/runtests.jl
-@@ -4,7 +4,7 @@ using Test
- using Distributed
- using Dates
- import REPL
--using Printf: @sprintf
-+using Printf: @sprintf, @printf
- using Base: Experimental
-
- include("choosetests.jl")
-@@ -83,11 +83,12 @@ prepend!(tests, linalg_tests)
- import LinearAlgebra
- cd(@__DIR__) do
- n = 1
-- if net_on
-+ if net_on || haskey(ENV, "JULIA_CPU_THREADS")
- n = min(Sys.CPU_THREADS, length(tests))
- n > 1 && addprocs_with_testenv(n)
- LinearAlgebra.BLAS.set_num_threads(1)
- end
-+ @printf("Number of threads: %i\n", n)
- skipped = 0
-
- @everywhere include("testdefs.jl")
diff --git a/gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch b/gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch
deleted file mode 100644
index 8ef4b111e4..0000000000
--- a/gnu/packages/patches/libunwind-julia-fix-GCC10-fno-common.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Fix compilation with -fno-common.
-
-Borrowed from upstream 29e17d8d2ccbca07c423e3089a6d5ae8a1c9cb6e.
-Author: Yichao Yu <[email protected]>
-AuthorDate: Tue Mar 31 00:43:32 2020 -0400
-Commit: Dave Watson <[email protected]>
-CommitDate: Tue Mar 31 08:06:29 2020 -0700
-
-diff --git a/src/x86/Ginit.c b/src/x86/Ginit.c
-index f6b8dc2..9550efa 100644
---- a/src/x86/Ginit.c
-+++ b/src/x86/Ginit.c
-@@ -54,13 +54,6 @@ tdep_uc_addr (ucontext_t *uc, int reg)
-
- # endif /* UNW_LOCAL_ONLY */
-
--HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
--
--/* XXX fix me: there is currently no way to locate the dyn-info list
-- by a remote unwinder. On ia64, this is done via a special
-- unwind-table entry. Perhaps something similar can be done with
-- DWARF2 unwind info. */
--
- static void
- put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
- {
-@@ -71,7 +64,12 @@ static int
- get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
- void *arg)
- {
-- *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
-+#ifndef UNW_LOCAL_ONLY
-+# pragma weak _U_dyn_info_list_addr
-+ if (!_U_dyn_info_list_addr)
-+ return -UNW_ENOINFO;
-+#endif
-+ *dyn_info_list_addr = _U_dyn_info_list_addr ();
- return 0;
- }
-
diff --git a/gnu/packages/patches/python-seaborn-2690.patch b/gnu/packages/patches/python-seaborn-2690.patch
deleted file mode 100644
index 4662d19c2d..0000000000
--- a/gnu/packages/patches/python-seaborn-2690.patch
+++ /dev/null
@@ -1,268 +0,0 @@
-This patch was adapted from the upstream pull request 2690.
-
-From ebd6812d48f5b8ed1ebb7d79bda0b2a7b9ae2812 Mon Sep 17 00:00:00 2001
-From: Michael Waskom <[email protected]>
-Date: Sun, 31 Oct 2021 15:09:27 -0400
-Subject: [PATCH 1/4] Update boxplot tests for mpl3.5 compatability
-
----
- seaborn/tests/test_categorical.py | 30 +++++++++++++++++++-----------
- 1 file changed, 19 insertions(+), 11 deletions(-)
-
-diff --git a/seaborn/tests/test_categorical.py b/seaborn/tests/test_categorical.py
-index d4e09b703..488fad2d6 100644
---- a/seaborn/tests/test_categorical.py
-+++ b/seaborn/tests/test_categorical.py
-@@ -110,6 +110,11 @@ class CategoricalFixture:
- df = pd.DataFrame(dict(y=y, g=g, h=h, u=u))
- x_df["W"] = g
-
-+ def get_box_artists(self, ax):
-+
-+ # Exclude labeled patches, which are for the legend
-+ return [p for p in ax.patches if not p.get_label()]
-+
-
- class TestCategoricalPlotter(CategoricalFixture):
-
-@@ -855,12 +863,12 @@ def test_hue_offsets(self):
- def test_axes_data(self):
-
- ax = cat.boxplot(x="g", y="y", data=self.df)
-- assert len(ax.artists) == 3
-+ assert len(self.get_box_artists(ax)) == 3
-
- plt.close("all")
-
- ax = cat.boxplot(x="g", y="y", hue="h", data=self.df)
-- assert len(ax.artists) == 6
-+ assert len(self.get_box_artists(ax)) == 6
-
- plt.close("all")
-
-@@ -868,14 +876,14 @@ def test_box_colors(self):
-
- ax = cat.boxplot(x="g", y="y", data=self.df, saturation=1)
- pal = palettes.color_palette(n_colors=3)
-- for patch, color in zip(ax.artists, pal):
-+ for patch, color in zip(self.get_box_artists(ax), pal):
- assert patch.get_facecolor()[:3] == color
-
- plt.close("all")
-
- ax = cat.boxplot(x="g", y="y", hue="h", data=self.df, saturation=1)
- pal = palettes.color_palette(n_colors=2)
-- for patch, color in zip(ax.artists, pal * 2):
-+ for patch, color in zip(self.get_box_artists(ax), pal * 2):
- assert patch.get_facecolor()[:3] == color
-
- plt.close("all")
-@@ -884,7 +892,7 @@ def test_draw_missing_boxes(self):
-
- ax = cat.boxplot(x="g", y="y", data=self.df,
- order=["a", "b", "c", "d"])
-- assert len(ax.artists) == 3
-+ assert len(self.get_box_artists(ax)) == 3
-
- def test_missing_data(self):
-
-@@ -894,13 +902,13 @@ def test_missing_data(self):
- y[-2:] = np.nan
-
- ax = cat.boxplot(x=x, y=y)
-- assert len(ax.artists) == 3
-+ assert len(self.get_box_artists(ax)) == 3
-
- plt.close("all")
-
- y[-1] = 0
- ax = cat.boxplot(x=x, y=y, hue=h)
-- assert len(ax.artists) == 7
-+ assert len(self.get_box_artists(ax)) == 7
-
- plt.close("all")
-
-@@ -2766,11 +2774,11 @@ def test_plot_elements(self):
-
- g = cat.catplot(x="g", y="y", data=self.df, kind="box")
- want_artists = self.g.unique().size
-- assert len(g.ax.artists) == want_artists
-+ assert len(self.get_box_artists(g.ax)) == want_artists
-
- g = cat.catplot(x="g", y="y", hue="h", data=self.df, kind="box")
- want_artists = self.g.unique().size * self.h.unique().size
-- assert len(g.ax.artists) == want_artists
-+ assert len(self.get_box_artists(g.ax)) == want_artists
-
- g = cat.catplot(x="g", y="y", data=self.df,
- kind="violin", inner=None)
-@@ -3137,14 +3145,14 @@ def test_box_colors(self):
-
- ax = cat.boxenplot(x="g", y="y", data=self.df, saturation=1)
- pal = palettes.color_palette(n_colors=3)
-- for patch, color in zip(ax.artists, pal):
-+ for patch, color in zip(self.get_box_artists(ax), pal):
- assert patch.get_facecolor()[:3] == color
-
- plt.close("all")
-
- ax = cat.boxenplot(x="g", y="y", hue="h", data=self.df, saturation=1)
- pal = palettes.color_palette(n_colors=2)
-- for patch, color in zip(ax.artists, pal * 2):
-+ for patch, color in zip(self.get_box_artists(ax), pal * 2):
- assert patch.get_facecolor()[:3] == color
-
- plt.close("all")
-
-From ff78ed38817a346e760194ab3b03b28d7ea3ba1b Mon Sep 17 00:00:00 2001
-From: Michael Waskom <[email protected]>
-Date: Sun, 31 Oct 2021 15:50:54 -0400
-Subject: [PATCH 2/4] Update kdeplot tests for mpl3.5 compatability
-
----
- seaborn/tests/test_distributions.py | 53 ++++++++++++++++++++---------
- 1 file changed, 37 insertions(+), 16 deletions(-)
-
-diff --git a/seaborn/tests/test_distributions.py b/seaborn/tests/test_distributions.py
-index d241fd978..466efb69e 100644
---- a/seaborn/tests/test_distributions.py
-+++ b/seaborn/tests/test_distributions.py
-@@ -39,6 +39,27 @@
- )
-
-
-+def get_contour_coords(c):
-+ """Provide compatability for change in contour artist type in mpl3.5."""
-+ # See https://github.com/matplotlib/matplotlib/issues/20906
-+ if isinstance(c, mpl.collections.LineCollection):
-+ return c.get_segments()
-+ elif isinstance(c, mpl.collections.PathCollection):
-+ return [p.vertices[:np.argmax(p.codes) + 1] for p in c.get_paths()]
-+
-+
-+def get_contour_color(c):
-+ """Provide compatability for change in contour artist type in mpl3.5."""
-+ # See https://github.com/matplotlib/matplotlib/issues/20906
-+ if isinstance(c, mpl.collections.LineCollection):
-+ return c.get_color()
-+ elif isinstance(c, mpl.collections.PathCollection):
-+ if c.get_facecolor().size:
-+ return c.get_facecolor()
-+ else:
-+ return c.get_edgecolor()
-+
-+
- class TestDistPlot(object):
-
- rs = np.random.RandomState(0)
-@@ -902,7 +923,7 @@ def test_fill_artists(self, long_df):
- f, ax = plt.subplots()
- kdeplot(data=long_df, x="x", y="y", hue="c", fill=fill)
- for c in ax.collections:
-- if fill:
-+ if fill or Version(mpl.__version__) >= Version("3.5.0b0"):
- assert isinstance(c, mpl.collections.PathCollection)
- else:
- assert isinstance(c, mpl.collections.LineCollection)
-@@ -918,8 +939,8 @@ def test_common_norm(self, rng):
- kdeplot(x=x, y=y, hue=hue, common_norm=True, ax=ax1)
- kdeplot(x=x, y=y, hue=hue, common_norm=False, ax=ax2)
-
-- n_seg_1 = sum([len(c.get_segments()) > 0 for c in ax1.collections])
-- n_seg_2 = sum([len(c.get_segments()) > 0 for c in ax2.collections])
-+ n_seg_1 = sum([len(get_contour_coords(c)) > 0 for c in ax1.collections])
-+ n_seg_2 = sum([len(get_contour_coords(c)) > 0 for c in ax2.collections])
- assert n_seg_2 > n_seg_1
-
- def test_log_scale(self, rng):
-@@ -946,7 +967,7 @@ def test_log_scale(self, rng):
- ax2.contour(10 ** xx, yy, density, levels=levels)
-
- for c1, c2 in zip(ax1.collections, ax2.collections):
-- assert_array_equal(c1.get_segments(), c2.get_segments())
-+ assert_array_equal(get_contour_coords(c1), get_contour_coords(c2))
-
- def test_bandwidth(self, rng):
-
-@@ -959,7 +980,7 @@ def test_bandwidth(self, rng):
- kdeplot(x=x, y=y, bw_adjust=2, ax=ax2)
-
- for c1, c2 in zip(ax1.collections, ax2.collections):
-- seg1, seg2 = c1.get_segments(), c2.get_segments()
-+ seg1, seg2 = get_contour_coords(c1), get_contour_coords(c2)
- if seg1 + seg2:
- x1 = seg1[0][:, 0]
- x2 = seg2[0][:, 0]
-@@ -980,9 +1001,9 @@ def test_weights(self, rng):
- kdeplot(x=x, y=y, hue=hue, weights=weights, ax=ax2)
-
- for c1, c2 in zip(ax1.collections, ax2.collections):
-- if c1.get_segments() and c2.get_segments():
-- seg1 = np.concatenate(c1.get_segments(), axis=0)
-- seg2 = np.concatenate(c2.get_segments(), axis=0)
-+ if get_contour_coords(c1) and get_contour_coords(c2):
-+ seg1 = np.concatenate(get_contour_coords(c1), axis=0)
-+ seg2 = np.concatenate(get_contour_coords(c2), axis=0)
- assert not np.array_equal(seg1, seg2)
-
- def test_hue_ignores_cmap(self, long_df):
-@@ -1030,7 +1051,7 @@ def test_levels_and_thresh(self, long_df):
- kdeplot(**plot_kws, levels=np.linspace(thresh, 1, n), ax=ax2)
-
- for c1, c2 in zip(ax1.collections, ax2.collections):
-- assert_array_equal(c1.get_segments(), c2.get_segments())
-+ assert_array_equal(get_contour_coords(c1), get_contour_coords(c2))
-
- with pytest.raises(ValueError):
- kdeplot(**plot_kws, levels=[0, 1, 2])
-@@ -1042,7 +1063,7 @@ def test_levels_and_thresh(self, long_df):
- kdeplot(**plot_kws, levels=n, thresh=0, ax=ax2)
-
- for c1, c2 in zip(ax1.collections, ax2.collections):
-- assert_array_equal(c1.get_segments(), c2.get_segments())
-+ assert_array_equal(get_contour_coords(c1), get_contour_coords(c2))
- for c1, c2 in zip(ax1.collections, ax2.collections):
- assert_array_equal(c1.get_facecolors(), c2.get_facecolors())
-
-@@ -2322,13 +2343,13 @@ def test_bivariate_kde_norm(self, rng):
- z = [0] * 80 + [1] * 20
-
- g = displot(x=x, y=y, col=z, kind="kde", levels=10)
-- l1 = sum(bool(c.get_segments()) for c in g.axes.flat[0].collections)
-- l2 = sum(bool(c.get_segments()) for c in g.axes.flat[1].collections)
-+ l1 = sum(bool(get_contour_coords(c)) for c in g.axes.flat[0].collections)
-+ l2 = sum(bool(get_contour_coords(c)) for c in g.axes.flat[1].collections)
- assert l1 > l2
-
- g = displot(x=x, y=y, col=z, kind="kde", levels=10, common_norm=False)
-- l1 = sum(bool(c.get_segments()) for c in g.axes.flat[0].collections)
-- l2 = sum(bool(c.get_segments()) for c in g.axes.flat[1].collections)
-+ l1 = sum(bool(get_contour_coords(c)) for c in g.axes.flat[0].collections)
-+ l2 = sum(bool(get_contour_coords(c)) for c in g.axes.flat[1].collections)
- assert l1 == l2
-
- def test_bivariate_hist_norm(self, rng):
-
-From a20ce3fabeb23c97b5827d9fb0c6a96ac109ea64 Mon Sep 17 00:00:00 2001
-From: Michael Waskom <[email protected]>
-Date: Sun, 31 Oct 2021 16:10:47 -0400
-Subject: [PATCH 3/4] Update legend tests for mpl3.5 compatability
-
----
- seaborn/tests/test_distributions.py | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/seaborn/tests/test_distributions.py b/seaborn/tests/test_distributions.py
-index 466efb69e..024fe7541 100644
---- a/seaborn/tests/test_distributions.py
-+++ b/seaborn/tests/test_distributions.py
-@@ -872,7 +872,7 @@ def test_legend(self, long_df):
- for label, level in zip(legend_labels, order):
- assert label.get_text() == level
-
-- legend_artists = ax.legend_.findobj(mpl.lines.Line2D)[::2]
-+ legend_artists = ax.legend_.findobj(mpl.lines.Line2D)
- palette = color_palette()
- for artist, color in zip(legend_artists, palette):
- assert_colors_equal(artist.get_color(), color)
-
diff --git a/gnu/packages/patches/python-seaborn-kde-test.patch b/gnu/packages/patches/python-seaborn-kde-test.patch
deleted file mode 100644
index f300dffc6f..0000000000
--- a/gnu/packages/patches/python-seaborn-kde-test.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-This patch is an excerpt of this upstream commit:
-
- commit 0a24478a550132f1882e5be5f5dbc0fc446a8a6c
- Author: Michael Waskom <[email protected]>
- Date: Mon Dec 21 18:44:58 2020 -0500
-
- Raise minimal supported Python to 3.7 and bump requirements (#2396)
-
-It fixes the failure of 'test_weights'.
-
---- a/seaborn/tests/test_distributions.py
-+++ b/seaborn/tests/test_distributions.py
-@@ -709,21 +708,17 @@ class TestKDEPlotUnivariate:
- integral = integrate.trapz(ydata, np.log10(xdata))
- assert integral == pytest.approx(1)
-
-- @pytest.mark.skipif(
-- LooseVersion(scipy.__version__) < "1.2.0",
-- reason="Weights require scipy >= 1.2.0"
-- )
- def test_weights(self):
-
- x = [1, 2]
- weights = [2, 1]
-
-- ax = kdeplot(x=x, weights=weights)
-+ ax = kdeplot(x=x, weights=weights, bw_method=.1)
-
- xdata, ydata = ax.lines[0].get_xydata().T
-
-- y1 = ydata[np.argwhere(np.abs(xdata - 1).min())]
-- y2 = ydata[np.argwhere(np.abs(xdata - 2).min())]
-+ y1 = ydata[np.abs(xdata - 1).argmin()]
-+ y2 = ydata[np.abs(xdata - 2).argmin()]
-
- assert y1 == pytest.approx(2 * y2)
diff --git a/gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch b/gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch
new file mode 100644
index 0000000000..4567f81224
--- /dev/null
+++ b/gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch
@@ -0,0 +1,565 @@
+https://github.com/rust-lang/rust/commit/263edd43c5255084292329423c61a9d69715ebfa.patch
+https://github.com/rust-lang/rust/issues/102155
+Issue seen on native builds on riscv64 across multiple Linux
+Distributions. An alternative workaround appears to be building stage 1
+with debug enabled.
+
+From 27412d1e3e128349bc515c16ce882860e20f037d Mon Sep 17 00:00:00 2001
+From: 5225225 <[email protected]>
+Date: Thu, 14 Jul 2022 22:42:47 +0100
+Subject: [PATCH] Use constant eval to do strict validity checks
+
+---
+ Cargo.lock | 1 +
+ .../src/intrinsics/mod.rs | 15 +----
+ compiler/rustc_codegen_ssa/Cargo.toml | 1 +
+ compiler/rustc_codegen_ssa/src/mir/block.rs | 9 ++-
+ .../src/const_eval/machine.rs | 2 +-
+ .../src/interpret/intrinsics.rs | 56 ++++++++--------
+ compiler/rustc_const_eval/src/lib.rs | 6 ++
+ .../src/might_permit_raw_init.rs | 40 +++++++++++
+ compiler/rustc_middle/src/query/mod.rs | 8 +++
+ compiler/rustc_middle/src/ty/query.rs | 1 +
+ compiler/rustc_query_impl/src/keys.rs | 12 +++-
+ compiler/rustc_target/src/abi/mod.rs | 38 +++++------
+ .../intrinsics/panic-uninitialized-zeroed.rs | 66 ++++++++++++-------
+ 13 files changed, 161 insertions(+), 94 deletions(-)
+ create mode 100644 compiler/rustc_const_eval/src/might_permit_raw_init.rs
+
+diff --git a/Cargo.lock b/Cargo.lock
+index 147d47044078a..dd6f0345affd0 100644
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -3664,6 +3664,7 @@ dependencies = [
+ "rustc_arena",
+ "rustc_ast",
+ "rustc_attr",
++ "rustc_const_eval",
+ "rustc_data_structures",
+ "rustc_errors",
+ "rustc_fs_util",
+diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
+index eafae1cdc8af0..4b2207f375879 100644
+--- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
++++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
+@@ -58,7 +58,6 @@ pub(crate) use llvm::codegen_llvm_intrinsic_call;
+ use rustc_middle::ty::print::with_no_trimmed_paths;
+ use rustc_middle::ty::subst::SubstsRef;
+ use rustc_span::symbol::{kw, sym, Symbol};
+-use rustc_target::abi::InitKind;
+
+ use crate::prelude::*;
+ use cranelift_codegen::ir::AtomicRmwOp;
+@@ -672,12 +671,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
+ return;
+ }
+
+- if intrinsic == sym::assert_zero_valid
+- && !layout.might_permit_raw_init(
+- fx,
+- InitKind::Zero,
+- fx.tcx.sess.opts.unstable_opts.strict_init_checks) {
+-
++ if intrinsic == sym::assert_zero_valid && !fx.tcx.permits_zero_init(layout) {
+ with_no_trimmed_paths!({
+ crate::base::codegen_panic(
+ fx,
+@@ -688,12 +682,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
+ return;
+ }
+
+- if intrinsic == sym::assert_uninit_valid
+- && !layout.might_permit_raw_init(
+- fx,
+- InitKind::Uninit,
+- fx.tcx.sess.opts.unstable_opts.strict_init_checks) {
+-
++ if intrinsic == sym::assert_uninit_valid && !fx.tcx.permits_uninit_init(layout) {
+ with_no_trimmed_paths!({
+ crate::base::codegen_panic(
+ fx,
+diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml
+index faabea92f5a6c..81c8b9ceb136e 100644
+--- a/compiler/rustc_codegen_ssa/Cargo.toml
++++ b/compiler/rustc_codegen_ssa/Cargo.toml
+@@ -40,6 +40,7 @@ rustc_metadata = { path = "../rustc_metadata" }
+ rustc_query_system = { path = "../rustc_query_system" }
+ rustc_target = { path = "../rustc_target" }
+ rustc_session = { path = "../rustc_session" }
++rustc_const_eval = { path = "../rustc_const_eval" }
+
+ [dependencies.object]
+ version = "0.29.0"
+diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
+index 745da821c9d76..773c55cf551d5 100644
+--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
++++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
+@@ -22,7 +22,7 @@ use rustc_span::source_map::Span;
+ use rustc_span::{sym, Symbol};
+ use rustc_symbol_mangling::typeid_for_fnabi;
+ use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode};
+-use rustc_target::abi::{self, HasDataLayout, InitKind, WrappingRange};
++use rustc_target::abi::{self, HasDataLayout, WrappingRange};
+ use rustc_target::spec::abi::Abi;
+
+ /// Used by `FunctionCx::codegen_terminator` for emitting common patterns
+@@ -528,7 +528,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
+ source_info: mir::SourceInfo,
+ target: Option<mir::BasicBlock>,
+ cleanup: Option<mir::BasicBlock>,
+- strict_validity: bool,
+ ) -> bool {
+ // Emit a panic or a no-op for `assert_*` intrinsics.
+ // These are intrinsics that compile to panics so that we can get a message
+@@ -547,12 +546,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
+ });
+ if let Some(intrinsic) = panic_intrinsic {
+ use AssertIntrinsic::*;
++
+ let ty = instance.unwrap().substs.type_at(0);
+ let layout = bx.layout_of(ty);
+ let do_panic = match intrinsic {
+ Inhabited => layout.abi.is_uninhabited(),
+- ZeroValid => !layout.might_permit_raw_init(bx, InitKind::Zero, strict_validity),
+- UninitValid => !layout.might_permit_raw_init(bx, InitKind::Uninit, strict_validity),
++ ZeroValid => !bx.tcx().permits_zero_init(layout),
++ UninitValid => !bx.tcx().permits_uninit_init(layout),
+ };
+ if do_panic {
+ let msg_str = with_no_visible_paths!({
+@@ -687,7 +687,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
+ source_info,
+ target,
+ cleanup,
+- self.cx.tcx().sess.opts.unstable_opts.strict_init_checks,
+ ) {
+ return;
+ }
+diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs
+index 29ab1d187719c..e00e667fb71e2 100644
+--- a/compiler/rustc_const_eval/src/const_eval/machine.rs
++++ b/compiler/rustc_const_eval/src/const_eval/machine.rs
+@@ -104,7 +104,7 @@ pub struct CompileTimeInterpreter<'mir, 'tcx> {
+ }
+
+ impl<'mir, 'tcx> CompileTimeInterpreter<'mir, 'tcx> {
+- pub(super) fn new(const_eval_limit: Limit, can_access_statics: bool) -> Self {
++ pub(crate) fn new(const_eval_limit: Limit, can_access_statics: bool) -> Self {
+ CompileTimeInterpreter {
+ steps_remaining: const_eval_limit.0,
+ stack: Vec::new(),
+diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+index e2a8a9891f72f..7827fb8395b7f 100644
+--- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs
++++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+@@ -15,7 +15,7 @@ use rustc_middle::ty::layout::LayoutOf as _;
+ use rustc_middle::ty::subst::SubstsRef;
+ use rustc_middle::ty::{Ty, TyCtxt};
+ use rustc_span::symbol::{sym, Symbol};
+-use rustc_target::abi::{Abi, Align, InitKind, Primitive, Size};
++use rustc_target::abi::{Abi, Align, Primitive, Size};
+
+ use super::{
+ util::ensure_monomorphic_enough, CheckInAllocMsg, ImmTy, InterpCx, Machine, OpTy, PlaceTy,
+@@ -413,35 +413,33 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
+ ),
+ )?;
+ }
+- if intrinsic_name == sym::assert_zero_valid
+- && !layout.might_permit_raw_init(
+- self,
+- InitKind::Zero,
+- self.tcx.sess.opts.unstable_opts.strict_init_checks,
+- )
+- {
+- M::abort(
+- self,
+- format!(
+- "aborted execution: attempted to zero-initialize type `{}`, which is invalid",
+- ty
+- ),
+- )?;
++
++ if intrinsic_name == sym::assert_zero_valid {
++ let should_panic = !self.tcx.permits_zero_init(layout);
++
++ if should_panic {
++ M::abort(
++ self,
++ format!(
++ "aborted execution: attempted to zero-initialize type `{}`, which is invalid",
++ ty
++ ),
++ )?;
++ }
+ }
+- if intrinsic_name == sym::assert_uninit_valid
+- && !layout.might_permit_raw_init(
+- self,
+- InitKind::Uninit,
+- self.tcx.sess.opts.unstable_opts.strict_init_checks,
+- )
+- {
+- M::abort(
+- self,
+- format!(
+- "aborted execution: attempted to leave type `{}` uninitialized, which is invalid",
+- ty
+- ),
+- )?;
++
++ if intrinsic_name == sym::assert_uninit_valid {
++ let should_panic = !self.tcx.permits_uninit_init(layout);
++
++ if should_panic {
++ M::abort(
++ self,
++ format!(
++ "aborted execution: attempted to leave type `{}` uninitialized, which is invalid",
++ ty
++ ),
++ )?;
++ }
+ }
+ }
+ sym::simd_insert => {
+diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs
+index d65d4f7eb720e..72ac6af685dc4 100644
+--- a/compiler/rustc_const_eval/src/lib.rs
++++ b/compiler/rustc_const_eval/src/lib.rs
+@@ -33,11 +33,13 @@ extern crate rustc_middle;
+ pub mod const_eval;
+ mod errors;
+ pub mod interpret;
++mod might_permit_raw_init;
+ pub mod transform;
+ pub mod util;
+
+ use rustc_middle::ty;
+ use rustc_middle::ty::query::Providers;
++use rustc_target::abi::InitKind;
+
+ pub fn provide(providers: &mut Providers) {
+ const_eval::provide(providers);
+@@ -59,4 +61,8 @@ pub fn provide(providers: &mut Providers) {
+ let (param_env, value) = param_env_and_value.into_parts();
+ const_eval::deref_mir_constant(tcx, param_env, value)
+ };
++ providers.permits_uninit_init =
++ |tcx, ty| might_permit_raw_init::might_permit_raw_init(tcx, ty, InitKind::Uninit);
++ providers.permits_zero_init =
++ |tcx, ty| might_permit_raw_init::might_permit_raw_init(tcx, ty, InitKind::Zero);
+ }
+diff --git a/compiler/rustc_const_eval/src/might_permit_raw_init.rs b/compiler/rustc_const_eval/src/might_permit_raw_init.rs
+new file mode 100644
+index 0000000000000..f971c2238c7bb
+--- /dev/null
++++ b/compiler/rustc_const_eval/src/might_permit_raw_init.rs
+@@ -0,0 +1,40 @@
++use crate::const_eval::CompileTimeInterpreter;
++use crate::interpret::{InterpCx, MemoryKind, OpTy};
++use rustc_middle::ty::layout::LayoutCx;
++use rustc_middle::ty::{layout::TyAndLayout, ParamEnv, TyCtxt};
++use rustc_session::Limit;
++use rustc_target::abi::InitKind;
++
++pub fn might_permit_raw_init<'tcx>(
++ tcx: TyCtxt<'tcx>,
++ ty: TyAndLayout<'tcx>,
++ kind: InitKind,
++) -> bool {
++ let strict = tcx.sess.opts.unstable_opts.strict_init_checks;
++
++ if strict {
++ let machine = CompileTimeInterpreter::new(Limit::new(0), false);
++
++ let mut cx = InterpCx::new(tcx, rustc_span::DUMMY_SP, ParamEnv::reveal_all(), machine);
++
++ let allocated = cx
++ .allocate(ty, MemoryKind::Machine(crate::const_eval::MemoryKind::Heap))
++ .expect("OOM: failed to allocate for uninit check");
++
++ if kind == InitKind::Zero {
++ cx.write_bytes_ptr(
++ allocated.ptr,
++ std::iter::repeat(0_u8).take(ty.layout.size().bytes_usize()),
++ )
++ .expect("failed to write bytes for zero valid check");
++ }
++
++ let ot: OpTy<'_, _> = allocated.into();
++
++ // Assume that if it failed, it's a validation failure.
++ cx.validate_operand(&ot).is_ok()
++ } else {
++ let layout_cx = LayoutCx { tcx, param_env: ParamEnv::reveal_all() };
++ ty.might_permit_raw_init(&layout_cx, kind)
++ }
++}
+diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
+index bdae7e5fcd6b1..0581ef41f66c2 100644
+--- a/compiler/rustc_middle/src/query/mod.rs
++++ b/compiler/rustc_middle/src/query/mod.rs
+@@ -2053,4 +2053,12 @@ rustc_queries! {
+ desc { |tcx| "looking up generator diagnostic data of `{}`", tcx.def_path_str(key) }
+ separate_provide_extern
+ }
++
++ query permits_uninit_init(key: TyAndLayout<'tcx>) -> bool {
++ desc { "checking to see if {:?} permits being left uninit", key.ty }
++ }
++
++ query permits_zero_init(key: TyAndLayout<'tcx>) -> bool {
++ desc { "checking to see if {:?} permits being left zeroed", key.ty }
++ }
+ }
+diff --git a/compiler/rustc_middle/src/ty/query.rs b/compiler/rustc_middle/src/ty/query.rs
+index 3d662ed5de4ba..2452bcf6a61b8 100644
+--- a/compiler/rustc_middle/src/ty/query.rs
++++ b/compiler/rustc_middle/src/ty/query.rs
+@@ -28,6 +28,7 @@ use crate::traits::query::{
+ use crate::traits::specialization_graph;
+ use crate::traits::{self, ImplSource};
+ use crate::ty::fast_reject::SimplifiedType;
++use crate::ty::layout::TyAndLayout;
+ use crate::ty::subst::{GenericArg, SubstsRef};
+ use crate::ty::util::AlwaysRequiresDrop;
+ use crate::ty::GeneratorDiagnosticData;
+diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs
+index 6fbafeb1d32b3..5477431431374 100644
+--- a/compiler/rustc_query_impl/src/keys.rs
++++ b/compiler/rustc_query_impl/src/keys.rs
+@@ -6,7 +6,7 @@ use rustc_middle::mir;
+ use rustc_middle::traits;
+ use rustc_middle::ty::fast_reject::SimplifiedType;
+ use rustc_middle::ty::subst::{GenericArg, SubstsRef};
+-use rustc_middle::ty::{self, Ty, TyCtxt};
++use rustc_middle::ty::{self, layout::TyAndLayout, Ty, TyCtxt};
+ use rustc_span::symbol::{Ident, Symbol};
+ use rustc_span::{Span, DUMMY_SP};
+
+@@ -385,6 +385,16 @@ impl<'tcx> Key for Ty<'tcx> {
+ }
+ }
+
++impl<'tcx> Key for TyAndLayout<'tcx> {
++ #[inline(always)]
++ fn query_crate_is_local(&self) -> bool {
++ true
++ }
++ fn default_span(&self, _: TyCtxt<'_>) -> Span {
++ DUMMY_SP
++ }
++}
++
+ impl<'tcx> Key for (Ty<'tcx>, Ty<'tcx>) {
+ #[inline(always)]
+ fn query_crate_is_local(&self) -> bool {
+diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs
+index d1eafd6ac5fb8..6f4d073d70486 100644
+--- a/compiler/rustc_target/src/abi/mod.rs
++++ b/compiler/rustc_target/src/abi/mod.rs
+@@ -1372,7 +1372,7 @@ pub struct PointeeInfo {
+
+ /// Used in `might_permit_raw_init` to indicate the kind of initialisation
+ /// that is checked to be valid
+-#[derive(Copy, Clone, Debug)]
++#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+ pub enum InitKind {
+ Zero,
+ Uninit,
+@@ -1487,14 +1487,18 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
+ ///
+ /// `init_kind` indicates if the memory is zero-initialized or left uninitialized.
+ ///
+- /// `strict` is an opt-in debugging flag added in #97323 that enables more checks.
++ /// This code is intentionally conservative, and will not detect
++ /// * zero init of an enum whose 0 variant does not allow zero initialization
++ /// * making uninitialized types who have a full valid range (ints, floats, raw pointers)
++ /// * Any form of invalid value being made inside an array (unless the value is uninhabited)
+ ///
+- /// This is conservative: in doubt, it will answer `true`.
++ /// A strict form of these checks that uses const evaluation exists in
++ /// `rustc_const_eval::might_permit_raw_init`, and a tracking issue for making these checks
++ /// stricter is <https://github.com/rust-lang/rust/issues/66151>.
+ ///
+- /// FIXME: Once we removed all the conservatism, we could alternatively
+- /// create an all-0/all-undef constant and run the const value validator to see if
+- /// this is a valid value for the given type.
+- pub fn might_permit_raw_init<C>(self, cx: &C, init_kind: InitKind, strict: bool) -> bool
++ /// FIXME: Once all the conservatism is removed from here, and the checks are ran by default,
++ /// we can use the const evaluation checks always instead.
++ pub fn might_permit_raw_init<C>(self, cx: &C, init_kind: InitKind) -> bool
+ where
+ Self: Copy,
+ Ty: TyAbiInterface<'a, C>,
+@@ -1507,13 +1511,8 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
+ s.valid_range(cx).contains(0)
+ }
+ InitKind::Uninit => {
+- if strict {
+- // The type must be allowed to be uninit (which means "is a union").
+- s.is_uninit_valid()
+- } else {
+- // The range must include all values.
+- s.is_always_valid(cx)
+- }
++ // The range must include all values.
++ s.is_always_valid(cx)
+ }
+ }
+ };
+@@ -1534,19 +1533,12 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
+ // If we have not found an error yet, we need to recursively descend into fields.
+ match &self.fields {
+ FieldsShape::Primitive | FieldsShape::Union { .. } => {}
+- FieldsShape::Array { count, .. } => {
++ FieldsShape::Array { .. } => {
+ // FIXME(#66151): For now, we are conservative and do not check arrays by default.
+- if strict
+- && *count > 0
+- && !self.field(cx, 0).might_permit_raw_init(cx, init_kind, strict)
+- {
+- // Found non empty array with a type that is unhappy about this kind of initialization
+- return false;
+- }
+ }
+ FieldsShape::Arbitrary { offsets, .. } => {
+ for idx in 0..offsets.len() {
+- if !self.field(cx, idx).might_permit_raw_init(cx, init_kind, strict) {
++ if !self.field(cx, idx).might_permit_raw_init(cx, init_kind) {
+ // We found a field that is unhappy with this kind of initialization.
+ return false;
+ }
+diff --git a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs
+index 3ffd35ecdb8da..255151a96032c 100644
+--- a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs
++++ b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs
+@@ -57,6 +57,13 @@ enum LR_NonZero {
+
+ struct ZeroSized;
+
++#[allow(dead_code)]
++#[repr(i32)]
++enum ZeroIsValid {
++ Zero(u8) = 0,
++ One(NonNull<()>) = 1,
++}
++
+ fn test_panic_msg<T>(op: impl (FnOnce() -> T) + panic::UnwindSafe, msg: &str) {
+ let err = panic::catch_unwind(op).err();
+ assert_eq!(
+@@ -152,33 +159,12 @@ fn main() {
+ "attempted to zero-initialize type `*const dyn core::marker::Send`, which is invalid"
+ );
+
+- /* FIXME(#66151) we conservatively do not error here yet.
+- test_panic_msg(
+- || mem::uninitialized::<LR_NonZero>(),
+- "attempted to leave type `LR_NonZero` uninitialized, which is invalid"
+- );
+- test_panic_msg(
+- || mem::zeroed::<LR_NonZero>(),
+- "attempted to zero-initialize type `LR_NonZero`, which is invalid"
+- );
+-
+- test_panic_msg(
+- || mem::uninitialized::<ManuallyDrop<LR_NonZero>>(),
+- "attempted to leave type `std::mem::ManuallyDrop<LR_NonZero>` uninitialized, \
+- which is invalid"
+- );
+- test_panic_msg(
+- || mem::zeroed::<ManuallyDrop<LR_NonZero>>(),
+- "attempted to zero-initialize type `std::mem::ManuallyDrop<LR_NonZero>`, \
+- which is invalid"
+- );
+- */
+-
+ test_panic_msg(
+ || mem::uninitialized::<(NonNull<u32>, u32, u32)>(),
+ "attempted to leave type `(core::ptr::non_null::NonNull<u32>, u32, u32)` uninitialized, \
+ which is invalid"
+ );
++
+ test_panic_msg(
+ || mem::zeroed::<(NonNull<u32>, u32, u32)>(),
+ "attempted to zero-initialize type `(core::ptr::non_null::NonNull<u32>, u32, u32)`, \
+@@ -196,11 +182,23 @@ fn main() {
+ which is invalid"
+ );
+
++ test_panic_msg(
++ || mem::uninitialized::<LR_NonZero>(),
++ "attempted to leave type `LR_NonZero` uninitialized, which is invalid"
++ );
++
++ test_panic_msg(
++ || mem::uninitialized::<ManuallyDrop<LR_NonZero>>(),
++ "attempted to leave type `core::mem::manually_drop::ManuallyDrop<LR_NonZero>` uninitialized, \
++ which is invalid"
++ );
++
+ test_panic_msg(
+ || mem::uninitialized::<NoNullVariant>(),
+ "attempted to leave type `NoNullVariant` uninitialized, \
+ which is invalid"
+ );
++
+ test_panic_msg(
+ || mem::zeroed::<NoNullVariant>(),
+ "attempted to zero-initialize type `NoNullVariant`, \
+@@ -212,10 +210,12 @@ fn main() {
+ || mem::uninitialized::<bool>(),
+ "attempted to leave type `bool` uninitialized, which is invalid"
+ );
++
+ test_panic_msg(
+ || mem::uninitialized::<LR>(),
+ "attempted to leave type `LR` uninitialized, which is invalid"
+ );
++
+ test_panic_msg(
+ || mem::uninitialized::<ManuallyDrop<LR>>(),
+ "attempted to leave type `core::mem::manually_drop::ManuallyDrop<LR>` uninitialized, which is invalid"
+@@ -229,6 +229,7 @@ fn main() {
+ let _val = mem::zeroed::<Option<&'static i32>>();
+ let _val = mem::zeroed::<MaybeUninit<NonNull<u32>>>();
+ let _val = mem::zeroed::<[!; 0]>();
++ let _val = mem::zeroed::<ZeroIsValid>();
+ let _val = mem::uninitialized::<MaybeUninit<bool>>();
+ let _val = mem::uninitialized::<[!; 0]>();
+ let _val = mem::uninitialized::<()>();
+@@ -259,12 +260,33 @@ fn main() {
+ || mem::zeroed::<[NonNull<()>; 1]>(),
+ "attempted to zero-initialize type `[core::ptr::non_null::NonNull<()>; 1]`, which is invalid"
+ );
++
++ // FIXME(#66151) we conservatively do not error here yet (by default).
++ test_panic_msg(
++ || mem::zeroed::<LR_NonZero>(),
++ "attempted to zero-initialize type `LR_NonZero`, which is invalid"
++ );
++
++ test_panic_msg(
++ || mem::zeroed::<ManuallyDrop<LR_NonZero>>(),
++ "attempted to zero-initialize type `core::mem::manually_drop::ManuallyDrop<LR_NonZero>`, \
++ which is invalid"
++ );
+ } else {
+ // These are UB because they have not been officially blessed, but we await the resolution
+ // of <https://github.com/rust-lang/unsafe-code-guidelines/issues/71> before doing
+ // anything about that.
+ let _val = mem::uninitialized::<i32>();
+ let _val = mem::uninitialized::<*const ()>();
++
++ // These are UB, but best to test them to ensure we don't become unintentionally
++ // stricter.
++
++ // It's currently unchecked to create invalid enums and values inside arrays.
++ let _val = mem::zeroed::<LR_NonZero>();
++ let _val = mem::zeroed::<[LR_NonZero; 1]>();
++ let _val = mem::zeroed::<[NonNull<()>; 1]>();
++ let _val = mem::uninitialized::<[NonNull<()>; 1]>();
+ }
+ }
+ }
diff --git a/gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch b/gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch
deleted file mode 100644
index 4fe3ed16db..0000000000
--- a/gnu/packages/patches/sbcl-fix-build-on-arm64-with-clisp-as-host.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 944f53fb00794f4bc96700dd14df1e88b6cd5623 Mon Sep 17 00:00:00 2001
-From: Christophe Rhodes <[email protected]>
-Date: Thu, 17 Nov 2022 22:29:26 +0000
-Subject: [PATCH] Fix build on arm64 with clisp as host
-
-Make sure the offset constants are defined while compiling vm.lisp.
----
- src/compiler/arm64/vm.lisp | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/compiler/arm64/vm.lisp b/src/compiler/arm64/vm.lisp
-index ae6d7c7fa..2a151be58 100644
---- a/src/compiler/arm64/vm.lisp
-+++ b/src/compiler/arm64/vm.lisp
-@@ -23,7 +23,8 @@
- (macrolet ((defreg (name offset)
- (let ((offset-sym (symbolicate name "-OFFSET")))
- `(progn
-- (defconstant ,offset-sym ,offset)
-+ (eval-when (:compile-toplevel :load-toplevel :execute)
-+ (defconstant ,offset-sym ,offset))
- (setf (svref *register-names* ,offset-sym) ,(symbol-name name)))))
-
- (defregset (name &rest regs)
---
-2.30.2
-
diff --git a/gnu/packages/patches/sssd-optional-systemd.patch b/gnu/packages/patches/sssd-optional-systemd.patch
deleted file mode 100644
index e6d74e79fa..0000000000
--- a/gnu/packages/patches/sssd-optional-systemd.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Allow running sss_analyze without Python modules for systemd.
-Upstream PR: https://github.com/SSSD/sssd/pull/6125
-
-diff --git a/src/tools/analyzer/modules/request.py b/src/tools/analyzer/modules/request.py
-index b9fe3caf8..51ec3a151 100644
---- a/src/tools/analyzer/modules/request.py
-+++ b/src/tools/analyzer/modules/request.py
-@@ -1,8 +1,6 @@
- import re
- import logging
-
--from sssd.source_files import Files
--from sssd.source_journald import Journald
- from sssd.parser import SubparsersAction
- from sssd.parser import Option
-
-@@ -76,8 +74,10 @@ class RequestAnalyzer:
- Instantiated source object
- """
- if args.source == "journald":
-+ from sssd.source_journald import Journald
- source = Journald()
- else:
-+ from sssd.source_files import Files
- source = Files(args.logdir)
- return source
-
-@@ -142,7 +142,7 @@ class RequestAnalyzer:
- self.consumed_logs.append(line.rstrip(line[-1]))
- else:
- # files source includes newline
-- if isinstance(source, Files):
-+ if type(source).__name__ == 'Files':
- print(line, end='')
- else:
- print(line)
-@@ -240,7 +240,7 @@ class RequestAnalyzer:
- self.print_formatted_verbose(source, patterns)
- else:
- for line in self.matched_line(source, patterns):
-- if isinstance(source, Journald):
-+ if type(source).__name__ == 'Journald':
- print(line)
- else:
- self.print_formatted(line)
diff --git a/gnu/packages/patches/u-boot-allow-disabling-openssl.patch b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
index 73e5878546..5f2856dbb4 100644
--- a/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
+++ b/gnu/packages/patches/u-boot-allow-disabling-openssl.patch
@@ -5,6 +5,9 @@ Subject: [PATCH] Revert "tools: kwbimage: Do not hide usage of secure header
This reverts commit b4f3cc2c42d97967a3a3c8796c340f6b07ecccac.
+Addendum 2022-12-08, Ricardo Wurmus: This patch has been updated to introduce
+CONFIG_FIT_PRELOAD to remove fit_pre_load_data, which depends on openssl.
+
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 94b7685392..eec599b0ee 100644
--- a/tools/kwbimage.c
@@ -137,3 +140,66 @@ index 94b7685392..eec599b0ee 100644
*imagesz = headersz;
+--- a/tools/image-host.c
++++ b/tools/image-host.c
+@@ -14,10 +14,12 @@
+ #include <image.h>
+ #include <version.h>
+
++#ifdef CONFIG_FIT_PRELOAD
+ #include <openssl/pem.h>
+ #include <openssl/evp.h>
+
+ #define IMAGE_PRE_LOAD_PATH "/image/pre-load/sig"
++#endif
+
+ /**
+ * fit_set_hash_value - set hash value in requested has node
+@@ -1116,6 +1118,7 @@
+ return 0;
+ }
+
++#ifdef CONFIG_FIT_PRELOAD
+ /*
+ * 0) open file (open)
+ * 1) read certificate (PEM_read_X509)
+@@ -1224,6 +1227,7 @@
+ out:
+ return ret;
+ }
++#endif
+
+ int fit_cipher_data(const char *keydir, void *keydest, void *fit,
+ const char *comment, int require_keys,
+--- a/tools/fit_image.c
++++ b/tools/fit_image.c
+@@ -59,9 +59,10 @@
+ ret = fit_set_timestamp(ptr, 0, time);
+ }
+
++#ifdef CONFIG_FIT_PRELOAD
+ if (!ret)
+ ret = fit_pre_load_data(params->keydir, dest_blob, ptr);
+-
++#endif
+ if (!ret) {
+ ret = fit_cipher_data(params->keydir, dest_blob, ptr,
+ params->comment,
+--- a/include/image.h
++++ b/include/image.h
+@@ -1090,6 +1090,7 @@
+
+ int fit_set_timestamp(void *fit, int noffset, time_t timestamp);
+
++#ifdef CONFIG_FIT_PRELOAD
+ /**
+ * fit_pre_load_data() - add public key to fdt blob
+ *
+@@ -1104,6 +1105,7 @@
+ * < 0, on failure
+ */
+ int fit_pre_load_data(const char *keydir, void *keydest, void *fit);
++#endif
+
+ int fit_cipher_data(const char *keydir, void *keydest, void *fit,
+ const char *comment, int require_keys,