Skip to content

Commit 7a264d0

Browse files
fwilhemoritzkirchnersap
authored andcommitted
include patch to allow building with newer gcc (#186)
The kernel fails to build because at least one file is not compliant with c21 which is what we have in debian testing now. This PR backports a fix from newer kernels to rename the variable. Fixes gardenlinux/gardenlinux#3682 Replaces #185 Failing build without this patch for reference: https://github.com/gardenlinux/package-linux/actions/runs/18650879015/job/53168803454
1 parent f2ae7a8 commit 7a264d0

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
From 10f94d8fcc0880c93d7697184fe199022792a61c Mon Sep 17 00:00:00 2001
2+
From: Arnd Bergmann <[email protected]>
3+
Date: Mon, 8 Apr 2024 09:17:52 +0200
4+
Subject: [PATCH] scripts/unifdef: avoid constexpr keyword
5+
6+
Starting with c23, 'constexpr' is a keyword in C like in C++ and cannot
7+
be used as an identifier:
8+
9+
scripts/unifdef.c:206:25: error: 'constexpr' can only be used in variable declarations
10+
206 | static bool constexpr; /* constant #if expression */
11+
| ^
12+
scripts/unifdef.c:880:13: error: expected identifier or '('
13+
880 | constexpr = false;
14+
| ^
15+
16+
Rename this instance to allow changing to C23 at some point in the future.
17+
18+
Signed-off-by: Arnd Bergmann <[email protected]>
19+
Reviewed-By: Tony Finch <[email protected]>
20+
Reviewed-by: Nicolas Schier <[email protected]>
21+
Signed-off-by: Masahiro Yamada <[email protected]>
22+
---
23+
scripts/unifdef.c | 12 ++++++------
24+
1 file changed, 6 insertions(+), 6 deletions(-)
25+
26+
diff --git a/scripts/unifdef.c b/scripts/unifdef.c
27+
index db00e3e30a59d7..ff15efd6e7d749 100644
28+
--- a/scripts/unifdef.c
29+
+++ b/scripts/unifdef.c
30+
@@ -203,7 +203,7 @@ static int depth; /* current #if nesting */
31+
static int delcount; /* count of deleted lines */
32+
static unsigned blankcount; /* count of blank lines */
33+
static unsigned blankmax; /* maximum recent blankcount */
34+
-static bool constexpr; /* constant #if expression */
35+
+static bool constexpression; /* constant #if expression */
36+
static bool zerosyms = true; /* to format symdepth output */
37+
static bool firstsym; /* ditto */
38+
39+
@@ -819,7 +819,7 @@ static const struct ops {
40+
/*
41+
* Function for evaluating the innermost parts of expressions,
42+
* viz. !expr (expr) number defined(symbol) symbol
43+
- * We reset the constexpr flag in the last two cases.
44+
+ * We reset the constexpression flag in the last two cases.
45+
*/
46+
static Linetype
47+
eval_unary(const struct ops *ops, int *valp, const char **cpp)
48+
@@ -877,7 +877,7 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp)
49+
cp = skipcomment(cp);
50+
if (defparen && *cp++ != ')')
51+
return (LT_ERROR);
52+
- constexpr = false;
53+
+ constexpression = false;
54+
} else if (!endsym(*cp)) {
55+
debug("eval%d symbol", ops - eval_ops);
56+
sym = findsym(cp);
57+
@@ -895,7 +895,7 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp)
58+
lt = *valp ? LT_TRUE : LT_FALSE;
59+
cp = skipargs(cp);
60+
}
61+
- constexpr = false;
62+
+ constexpression = false;
63+
} else {
64+
debug("eval%d bad expr", ops - eval_ops);
65+
return (LT_ERROR);
66+
@@ -955,10 +955,10 @@ ifeval(const char **cpp)
67+
int val = 0;
68+
69+
debug("eval %s", *cpp);
70+
- constexpr = killconsts ? false : true;
71+
+ constexpression = killconsts ? false : true;
72+
ret = eval_table(eval_ops, &val, cpp);
73+
debug("eval = %d", val);
74+
- return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
75+
+ return (constexpression ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
76+
}
77+
78+
/*

upstream_patches/series

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ fpga-ofs-dev-6.6-lts-patches/0088-fpga-dfl-cxl-cache-depend-on-DRM.patch
8989
intel-dfl-fixes/001-fix-config-dependency-intel-s10hssi.patch
9090
CVE-2024-42107.patch
9191
CVE-2024-56647.patch
92-
CVE-2025-22037.patch
92+
10f94d8fcc0880c93d7697184fe199022792a61c.patch
9393
CVE-2025-22121.patch

0 commit comments

Comments
 (0)