summaryrefslogtreecommitdiff
path: root/config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch
diff options
context:
space:
mode:
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>2025-04-29 19:50:04 +0300
committerAlper Nebi Yasak <alpernebiyasak@gmail.com>2025-04-29 19:54:12 +0300
commit685685ab0e4f86927fbd9b1c332a7c39c457846c (patch)
tree3a737d634028d144efed6ab48a70f1fedbe2f3ee /config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch
parent02110f2bc1df6f856dcd2d6a20d4ced58c9ec497 (diff)
coreboot: fam15h: Add patches to fix build with GCC 15 as host compiler
Building the fam15h tree results in one of the same nonstring errors we also had when building the default tree. Copy the relevant patch from the default tree, while dropping a hunk that we don't need in this old version. Another build error is about bool being a reserved keyword now: .../lbmk/src/coreboot/fam15h/util/romcc/romcc.c:7140:13: error: 'bool' cannot be used here 7140 | static void bool(struct compile_state *state, struct triple *def) | ^~~~ .../lbmk/src/coreboot/fam15h/util/romcc/romcc.c:7140:13: note: 'bool' is a keyword with '-std=c23' onwards .../lbmk/src/coreboot/fam15h/util/romcc/romcc.c:7140:18: error: expected identifier or '(' before 'struct' 7140 | static void bool(struct compile_state *state, struct triple *def) | ^~~~~~ .../lbmk/src/coreboot/fam15h/util/romcc/romcc.c: In function 'mkcond_expr': .../lbmk/src/coreboot/fam15h/util/romcc/romcc.c:7708:19: error: expected ')' before ',' token 7708 | bool(state, test); | ^ | ) [...] Fix that by adding a patch that renames the function to bool_(). Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Diffstat (limited to 'config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch')
-rw-r--r--config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch b/config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch
new file mode 100644
index 00000000..b08c9edf
--- /dev/null
+++ b/config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch
@@ -0,0 +1,39 @@
+From 281151d85240bd8a60545b6415e0f44ce6a2af33 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] WIP: Fix build with GCC 15 as 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.
+
+The bios log prefixes are non-null-terminated as well, but I couldn't
+figure out how to mark them as non-strings. Temporarily disable the
+warning with a pragma to avoid the error. That pragma causes an error on
+GCC 14, so disable pragma warnings along with it to avoid that as well.
+
+Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
+---
+ util/cbfstool/common.c | 2 +-
+ 1 files changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
+index 7154bc9d5425..cb08c9e8ec11 100644
+--- a/util/cbfstool/common.c
++++ b/util/cbfstool/common.c
+@@ -192,7 +192,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.49.0
+