summaryrefslogtreecommitdiff
path: root/config/coreboot/coreboot413/patches/0002-Fix-cbfstool-build-error-on-GCC-15-host-compiler.patch
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-30 00:59:39 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-30 00:59:39 +0100
commitb0a6d4711a34542ca3f7358c655042f5d81c90fb (patch)
tree6be80e2eba05c31a4510530a25e250e9c410cae3 /config/coreboot/coreboot413/patches/0002-Fix-cbfstool-build-error-on-GCC-15-host-compiler.patch
parent628ae867c9ac61ddb7345c51307c44080047dc44 (diff)
coreboot413: add alper's fix to cbfstool for gcc15
otherwise, it won't compile on gcc 15 (pragma fix from earlier on, used on the other coreboot trees) Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'config/coreboot/coreboot413/patches/0002-Fix-cbfstool-build-error-on-GCC-15-host-compiler.patch')
-rw-r--r--config/coreboot/coreboot413/patches/0002-Fix-cbfstool-build-error-on-GCC-15-host-compiler.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/config/coreboot/coreboot413/patches/0002-Fix-cbfstool-build-error-on-GCC-15-host-compiler.patch b/config/coreboot/coreboot413/patches/0002-Fix-cbfstool-build-error-on-GCC-15-host-compiler.patch
new file mode 100644
index 00000000..9b7b8c5b
--- /dev/null
+++ b/config/coreboot/coreboot413/patches/0002-Fix-cbfstool-build-error-on-GCC-15-host-compiler.patch
@@ -0,0 +1,33 @@
+From 06e8d7a9db4efe1dc2b7e5865b801a5518b38fbd Mon Sep 17 00:00:00 2001
+From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
+Date: Tue, 29 Apr 2025 17:31:13 +0300
+Subject: [PATCH 1/1] Fix cbfstool build error on GCC 15 host compiler
+
+GCC 15 now considers the unterminated-string-initialization warning as
+part of -Werror by default. Coreboot compiles host utilities with the
+system compiler, which results in getting this error in some files.
+
+Mark a hexadecimal translation table in cbfstool code as "nonstring" to
+avoid the warning-turned-error.
+
+Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
+---
+ util/cbfstool/common.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
+index 539d0baccf..f6fe647503 100644
+--- a/util/cbfstool/common.c
++++ b/util/cbfstool/common.c
+@@ -188,7 +188,7 @@ uint64_t intfiletype(const char *name)
+
+ char *bintohex(uint8_t *data, size_t len)
+ {
+- static const char translate[16] = "0123456789abcdef";
++ static const char translate[16] __attribute__((__nonstring__)) = "0123456789abcdef";
+
+ char *result = malloc(len * 2 + 1);
+ if (result == NULL)
+--
+2.39.5
+