summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Leemhuis <fedora@leemhuis.info>2022-01-29 10:35:52 +0100
committerThorsten Leemhuis <fedora@leemhuis.info>2022-01-29 15:13:43 +0100
commit0ba20cb7f23e1e47882f44add1a539db285fe604 (patch)
treebbfb30e0f9835405864e4d1545e11aa7e4ce3cdc
parent5351eeaf7fb73a38a41d710c76864be068df26ff (diff)
downloadkernel-0ba20cb7f23e1e47882f44add1a539db285fe604.tar.gz
kernel-0ba20cb7f23e1e47882f44add1a539db285fe604.tar.xz
kernel-0ba20cb7f23e1e47882f44add1a539db285fe604.zip
add patch for gcc12 to compile on rawhide againkernel-5.17.0-0.rc1.20220128git145d9b498fc8.79.vanilla.1.fc36
-rw-r--r--gcc-12-subcmd-util.patch35
-rwxr-xr-xkernel.spec10
2 files changed, 45 insertions, 0 deletions
diff --git a/gcc-12-subcmd-util.patch b/gcc-12-subcmd-util.patch
new file mode 100644
index 000000000..ac063292e
--- /dev/null
+++ b/gcc-12-subcmd-util.patch
@@ -0,0 +1,35 @@
+From b3d2907a37c53f7379be8742bfbfe47aa2877bfc Mon Sep 17 00:00:00 2001
+From: "Justin M. Forbes" <jforbes@fedoraproject.org>
+Date: Thu, 27 Jan 2022 15:33:37 -0600
+Subject: [PATCH] Fix subcmd-util for gcc 12
+
+Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
+---
+ tools/lib/subcmd/subcmd-util.h | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h
+index 794a375dad36..7009fc176636 100644
+--- a/tools/lib/subcmd/subcmd-util.h
++++ b/tools/lib/subcmd/subcmd-util.h
+@@ -49,13 +49,12 @@ static NORETURN inline void die(const char *err, ...)
+
+ static inline void *xrealloc(void *ptr, size_t size)
+ {
+- void *ret = realloc(ptr, size);
+- if (!ret && !size)
+- ret = realloc(ptr, 1);
++ void *ret;
++ if (!size)
++ size = 1;
++ ret = realloc(ptr, size);
+ if (!ret) {
+ ret = realloc(ptr, size);
+- if (!ret && !size)
+- ret = realloc(ptr, 1);
+ if (!ret)
+ die("Out of memory, realloc failed");
+ }
+--
+2.34.1
+
diff --git a/kernel.spec b/kernel.spec
index ddd45e590..177137d2c 100755
--- a/kernel.spec
+++ b/kernel.spec
@@ -862,6 +862,11 @@ Source4002: gating.yaml
Patch1: patch-%{patchversion}-redhat.patch
%endif
+# from kernel-ark
+Patch2: gcc-12-subcmd-util.patch
+# from https://lore.kernel.org/all/20220120233748.2062559-1-slyich@gmail.com/raw
+Patch3: gcc-12-objtool-check.patch
+
# empty final patch to facilitate testing of kernel patches
Patch999999: linux-kernel-test.patch
@@ -1403,6 +1408,11 @@ ApplyOptionalPatch patch-%{patchversion}-redhat.patch
ApplyOptionalPatch linux-kernel-test.patch
+%if 0%{?fedora} >= 36
+ApplyOptionalPatch gcc-12-subcmd-util.patch
+ApplyOptionalPatch gcc-12-objtool-check.patch
+%endif
+
# END OF PATCH APPLICATIONS
# Any further pre-build tree manipulations happen here.