summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-03-24 09:33:22 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-27 11:19:03 +0000
commit5f081bc5fadb1017a93ae1adcf4f4ab0c9e77ca2 (patch)
tree4b41df0a6327483abc61cc9538bcaf378139b393
parent8050390f99cf4e87608b0a4ba6e190f2516a1017 (diff)
downloadpoky-5f081bc5fadb1017a93ae1adcf4f4ab0c9e77ca2.tar.gz
unifdef: Don't use C23 constexpr keyword
Fixes build with GCC-15 (From OE-Core rev: 6aa6b4d59cbbc385edd96fa489b27c1a1848566a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/unifdef/unifdef/0001-Don-t-use-C23-constexpr-keyword.patch57
-rw-r--r--meta/recipes-devtools/unifdef/unifdef_2.12.bb3
2 files changed, 59 insertions, 1 deletions
diff --git a/meta/recipes-devtools/unifdef/unifdef/0001-Don-t-use-C23-constexpr-keyword.patch b/meta/recipes-devtools/unifdef/unifdef/0001-Don-t-use-C23-constexpr-keyword.patch
new file mode 100644
index 0000000000..9d02183930
--- /dev/null
+++ b/meta/recipes-devtools/unifdef/unifdef/0001-Don-t-use-C23-constexpr-keyword.patch
@@ -0,0 +1,57 @@
1From ca1ac9c8bde84dbdea972299b1a6e30e78c2d785 Mon Sep 17 00:00:00 2001
2From: Sam James <sam@gentoo.org>
3Date: Sun, 17 Nov 2024 01:26:27 +0000
4Subject: [PATCH] Don't use C23 constexpr keyword
5
6This fixes building with upcoming GCC 15 which defaults to -std=gnu23.
7
8Upstream-Status: Submitted [https://github.com/fanf2/unifdef/pull/19]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 unifdef.c | 10 +++++-----
12 1 file changed, 5 insertions(+), 5 deletions(-)
13
14diff --git a/unifdef.c b/unifdef.c
15index dc145a2..4bd3bda 100644
16--- a/unifdef.c
17+++ b/unifdef.c
18@@ -202,7 +202,7 @@ static int depth; /* current #if nesting */
19 static int delcount; /* count of deleted lines */
20 static unsigned blankcount; /* count of blank lines */
21 static unsigned blankmax; /* maximum recent blankcount */
22-static bool constexpr; /* constant #if expression */
23+static bool is_constexpr; /* constant #if expression */
24 static bool zerosyms; /* to format symdepth output */
25 static bool firstsym; /* ditto */
26
27@@ -1086,7 +1086,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
28 *valp = (value[sym] != NULL);
29 lt = *valp ? LT_TRUE : LT_FALSE;
30 }
31- constexpr = false;
32+ is_constexpr = false;
33 } else if (!endsym(*cp)) {
34 debug("eval%d symbol", prec(ops));
35 sym = findsym(&cp);
36@@ -1103,7 +1103,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
37 lt = *valp ? LT_TRUE : LT_FALSE;
38 cp = skipargs(cp);
39 }
40- constexpr = false;
41+ is_constexpr = false;
42 } else {
43 debug("eval%d bad expr", prec(ops));
44 return (LT_ERROR);
45@@ -1170,10 +1170,10 @@ ifeval(const char **cpp)
46 long val = 0;
47
48 debug("eval %s", *cpp);
49- constexpr = killconsts ? false : true;
50+ is_constexpr = killconsts ? false : true;
51 ret = eval_table(eval_ops, &val, cpp);
52 debug("eval = %d", val);
53- return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
54+ return (is_constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
55 }
56
57 /*
diff --git a/meta/recipes-devtools/unifdef/unifdef_2.12.bb b/meta/recipes-devtools/unifdef/unifdef_2.12.bb
index 3e08b3a0a4..bf0f3e1b17 100644
--- a/meta/recipes-devtools/unifdef/unifdef_2.12.bb
+++ b/meta/recipes-devtools/unifdef/unifdef_2.12.bb
@@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=3498caf346f6b77934882101749ada23 \
8 file://unifdef.c;endline=32;md5=6f4ee8085d6e6ab0f7cb4390e1a9c497 \ 8 file://unifdef.c;endline=32;md5=6f4ee8085d6e6ab0f7cb4390e1a9c497 \
9 " 9 "
10 10
11SRC_URI = "http://dotat.at/prog/${BPN}/${BP}.tar.xz" 11SRC_URI = "http://dotat.at/prog/${BPN}/${BP}.tar.xz \
12 file://0001-Don-t-use-C23-constexpr-keyword.patch"
12SRC_URI[md5sum] = "ae8c0b3b4c43c1f6bc5f32412a820818" 13SRC_URI[md5sum] = "ae8c0b3b4c43c1f6bc5f32412a820818"
13SRC_URI[sha256sum] = "43ce0f02ecdcdc723b2475575563ddb192e988c886d368260bc0a63aee3ac400" 14SRC_URI[sha256sum] = "43ce0f02ecdcdc723b2475575563ddb192e988c886d368260bc0a63aee3ac400"
14 15