diff options
Diffstat (limited to 'config/coreboot/default')
3 files changed, 187 insertions, 0 deletions
diff --git a/config/coreboot/default/patches/0040-Fix-build-with-GCC-15-as-host-compiler.patch b/config/coreboot/default/patches/0040-Fix-build-with-GCC-15-as-host-compiler.patch new file mode 100644 index 00000000..a7b28f2e --- /dev/null +++ b/config/coreboot/default/patches/0040-Fix-build-with-GCC-15-as-host-compiler.patch @@ -0,0 +1,62 @@ +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> +--- + src/commonlib/include/commonlib/loglevel.h | 4 ++++ + util/cbfstool/common.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/commonlib/include/commonlib/loglevel.h b/src/commonlib/include/commonlib/loglevel.h +index 79fbcfc6d92b..31438c945ff5 100644 +--- a/src/commonlib/include/commonlib/loglevel.h ++++ b/src/commonlib/include/commonlib/loglevel.h +@@ -163,6 +163,9 @@ + * When printing logs, lines should be printed with the following prefixes in + * front of them according to the BIOS_LOG_PREFIX_PATTERN printf() pattern. + */ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wpragmas" ++#pragma GCC diagnostic ignored "-Wunterminated-string-initialization" + #define BIOS_LOG_PREFIX_PATTERN "[%.5s] " + #define BIOS_LOG_PREFIX_MAX_LEVEL BIOS_SPEW + static const char bios_log_prefix[BIOS_LOG_PREFIX_MAX_LEVEL + 1][5] = { +@@ -177,6 +180,7 @@ static const char bios_log_prefix[BIOS_LOG_PREFIX_MAX_LEVEL + 1][5] = { + [BIOS_DEBUG] = "DEBUG", + [BIOS_SPEW] = "SPEW ", + }; ++#pragma GCC diagnostic pop + + /* + * When printing to terminals supporting ANSI escape sequences, the following +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 + diff --git a/config/coreboot/default/patches/0041-crossgcc-gmp-Add-upstream-fix-for-GCC-15.patch b/config/coreboot/default/patches/0041-crossgcc-gmp-Add-upstream-fix-for-GCC-15.patch new file mode 100644 index 00000000..1d0b6072 --- /dev/null +++ b/config/coreboot/default/patches/0041-crossgcc-gmp-Add-upstream-fix-for-GCC-15.patch @@ -0,0 +1,71 @@ +From ee3925486f3567b9fe45cb98a88b9acc64991127 Mon Sep 17 00:00:00 2001 +From: Leah Rowe <leah@libreboot.org> +Date: Tue, 29 Apr 2025 21:15:22 +0100 +Subject: [PATCH 1/1] crossgcc/gmp: Add upstream fix for GCC 15 + +See: +https://gmplib.org/list-archives/gmp-devel/2025-January/006279.html + +by default, upstream GCC-15 now defaults to -std=c23, instead +of -std=c17, which can cause some build issues. + +GMP has this patch on their mailing list for GCC-15 (see link). + +Signed-off-by: Leah Rowe <leah@libreboot.org> +--- + .../gmp-6.3.0_acinclude-m4-fix-std-c23.patch | 43 +++++++++++++++++++ + 1 file changed, 43 insertions(+) + create mode 100644 util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23.patch + +diff --git a/util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23.patch b/util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23.patch +new file mode 100644 +index 0000000000..b884b62df7 +--- /dev/null ++++ b/util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23.patch +@@ -0,0 +1,43 @@ ++From b1b61bc8ab19659f0fb8c0f87edcd79ae1bfef7e Mon Sep 17 00:00:00 2001 ++From: Rudi Heitbaum <rudi@heitbaum.com> ++Date: Wed, 22 Jan 2025 02:34:09 +0100 ++Subject: [PATCH 1/1] acinclude.m4: fix -std=c23 build failure ++ ++Add prototype to configure test function as c23 removes unprototyped ++functions. ++ ++gcc-15 switched to -std=c23 by default: ++ ++ https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212 ++ ++As a result `configure` fails with: ++ conftest.c: In function 'f': ++ conftest.c:12:48: error: too many arguments to function 'g'; expected 0, have 6 ++ 12 | for(i=0;i<1;i++){if(e(got,got,9,d[i].n)==0)h();g(i,d[i].src,d[i].n,got,d[i].want,9);if(d[i].n)h();}} ++ | ^ ~ ++ conftest.c:7:6: note: declared here ++ 7 | void g(){} ++ | ^ ++ ++Link: https://gmplib.org/list-archives/gmp-bugs/2024-November/005550.html ++Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com> ++--- ++ acinclude.m4 | 2 +- ++ 1 file changed, 1 insertion(+), 1 deletion(-) ++ ++diff --git a/acinclude.m4 b/acinclude.m4 ++index 9cf9483..1eed843 100644 ++--- a/acinclude.m4 +++++ b/acinclude.m4 ++@@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1], ++ ++ #if defined (__GNUC__) && ! defined (__cplusplus) ++ typedef unsigned long long t1;typedef t1*t2; ++-void g(){} +++void g(int,const t1 *,t1,t1 *,const t1 *,int){} ++ void h(){} ++ static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) ++ {t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;} ++-- ++2.39.5 ++ +-- +2.39.5 + diff --git a/config/coreboot/default/patches/0042-further-gcc-15-fix-for-compiling-gmp.patch b/config/coreboot/default/patches/0042-further-gcc-15-fix-for-compiling-gmp.patch new file mode 100644 index 00000000..a2f5c982 --- /dev/null +++ b/config/coreboot/default/patches/0042-further-gcc-15-fix-for-compiling-gmp.patch @@ -0,0 +1,54 @@ +From 983835d1470dde4559d9ee58c60e65c0bb3873c2 Mon Sep 17 00:00:00 2001 +From: Leah Rowe <leah@libreboot.org> +Date: Tue, 29 Apr 2025 23:13:42 +0100 +Subject: [PATCH 1/1] further gcc-15 fix for compiling gmp + +same as the previous fix, but we needed to apply +the exact same change to the configure file, in +the appropriate place. + +Signed-off-by: Leah Rowe <leah@libreboot.org> +--- + ...6.3.0_acinclude-m4-fix-std-c23-extra.patch | 30 +++++++++++++++++++ + 1 file changed, 30 insertions(+) + create mode 100644 util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23-extra.patch + +diff --git a/util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23-extra.patch b/util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23-extra.patch +new file mode 100644 +index 0000000000..bee0159abf +--- /dev/null ++++ b/util/crossgcc/patches/gmp-6.3.0_acinclude-m4-fix-std-c23-extra.patch +@@ -0,0 +1,30 @@ ++From f1da82325f91ccf8f3a251c0f94388acf091c1fe Mon Sep 17 00:00:00 2001 ++From: Leah Rowe <leah@libreboot.org> ++Date: Tue, 29 Apr 2025 23:11:25 +0100 ++Subject: [PATCH 1/1] further gcc-15 -std=23 mitigation ++ ++the same fix as in the previous revision, also needs ++to be applied here. this make the coreboot build process ++pass, when compiling gmp. ++ ++Signed-off-by: Leah Rowe <leah@libreboot.org> ++--- ++ configure | 2 +- ++ 1 file changed, 1 insertion(+), 1 deletion(-) ++ ++diff --git a/configure b/configure ++index 7910aa0..bd4342d 100755 ++--- a/configure +++++ b/configure ++@@ -6568,7 +6568,7 @@ if test "$gmp_prog_cc_works" = yes; then ++ ++ #if defined (__GNUC__) && ! defined (__cplusplus) ++ typedef unsigned long long t1;typedef t1*t2; ++-void g(){} +++void g(int,const t1 *,t1,t1 *,const t1 *,int){} ++ void h(){} ++ static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) ++ {t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;} ++-- ++2.39.5 ++ +-- +2.39.5 + |