diff options
Diffstat (limited to 'meta/recipes-devtools/elfutils/files/0007-Fix-build-with-gcc-15.patch')
-rw-r--r-- | meta/recipes-devtools/elfutils/files/0007-Fix-build-with-gcc-15.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/files/0007-Fix-build-with-gcc-15.patch b/meta/recipes-devtools/elfutils/files/0007-Fix-build-with-gcc-15.patch new file mode 100644 index 0000000000..8f5c7e4421 --- /dev/null +++ b/meta/recipes-devtools/elfutils/files/0007-Fix-build-with-gcc-15.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | From 7508696d107ca01b65ce8273c881462a8658f90f Mon Sep 17 00:00:00 2001 | ||
2 | From: Sergei Trofimovich <slyich@gmail.com> | ||
3 | Date: Wed, 17 Jul 2024 23:03:34 +0100 | ||
4 | Subject: [PATCH] backends: allocate enough stace for null terminator | ||
5 | |||
6 | `gcc-15` added a new warning in https://gcc.gnu.org/PR115185: | ||
7 | |||
8 | i386_regs.c:88:11: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization] | ||
9 | 88 | "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip" | ||
10 | | ^~~~ | ||
11 | |||
12 | `elfutils` does not need to store '\0'. We could either initialize the | ||
13 | arrays with individual bytes or allocate extra byte for null. | ||
14 | |||
15 | This change initializes the array bytewise. | ||
16 | |||
17 | * backends/i386_regs.c (i386_register_info): Initialize the | ||
18 | array bytewise to fix gcc-15 warning. | ||
19 | * backends/x86_64_regs.c (x86_64_register_info): Ditto. | ||
20 | |||
21 | Signed-off-by: Sergei Trofimovich <slyich@gmail.com> | ||
22 | Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=7508696d107ca01b65ce8273c881462a8658f90f] | ||
23 | Signed-off-by: Martin Jansa <martin.jansa@gmail.com> | ||
24 | --- | ||
25 | backends/i386_regs.c | 10 +++++++++- | ||
26 | backends/x86_64_regs.c | 9 ++++++++- | ||
27 | 2 files changed, 17 insertions(+), 2 deletions(-) | ||
28 | |||
29 | diff --git a/backends/i386_regs.c b/backends/i386_regs.c | ||
30 | index 7ec93bb9..ead55ef7 100644 | ||
31 | --- a/backends/i386_regs.c | ||
32 | +++ b/backends/i386_regs.c | ||
33 | @@ -85,7 +85,15 @@ i386_register_info (Ebl *ebl __attribute__ ((unused)), | ||
34 | { | ||
35 | static const char baseregs[][2] = | ||
36 | { | ||
37 | - "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip" | ||
38 | + {'a', 'x'}, | ||
39 | + {'c', 'x'}, | ||
40 | + {'d', 'x'}, | ||
41 | + {'b', 'x'}, | ||
42 | + {'s', 'p'}, | ||
43 | + {'b', 'p'}, | ||
44 | + {'s', 'i'}, | ||
45 | + {'d', 'i'}, | ||
46 | + {'i', 'p'}, | ||
47 | }; | ||
48 | |||
49 | case 4: | ||
50 | diff --git a/backends/x86_64_regs.c b/backends/x86_64_regs.c | ||
51 | index ef987daf..dab8f27f 100644 | ||
52 | --- a/backends/x86_64_regs.c | ||
53 | +++ b/backends/x86_64_regs.c | ||
54 | @@ -82,7 +82,14 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)), | ||
55 | { | ||
56 | static const char baseregs[][2] = | ||
57 | { | ||
58 | - "ax", "dx", "cx", "bx", "si", "di", "bp", "sp" | ||
59 | + {'a', 'x'}, | ||
60 | + {'d', 'x'}, | ||
61 | + {'c', 'x'}, | ||
62 | + {'b', 'x'}, | ||
63 | + {'s', 'i'}, | ||
64 | + {'d', 'i'}, | ||
65 | + {'b', 'p'}, | ||
66 | + {'s', 'p'}, | ||
67 | }; | ||
68 | |||
69 | case 6 ... 7: | ||
70 | -- | ||
71 | 2.43.7 | ||
72 | |||