summaryrefslogtreecommitdiff
path: root/config/coreboot/fam15h
diff options
context:
space:
mode:
Diffstat (limited to 'config/coreboot/fam15h')
-rw-r--r--config/coreboot/fam15h/patches/0013-Fix-build-with-GCC-15-as-host-compiler.patch39
-rw-r--r--config/coreboot/fam15h/patches/0014-util-romcc-Fix-build-with-GCC-15.patch119
-rw-r--r--config/coreboot/fam15h/patches/0015-gmp-gcc15-patch.patch65
-rw-r--r--config/coreboot/fam15h/patches/0016-further-fix-for-std-c23-on-gmp-with-host-gcc-15.patch55
-rw-r--r--config/coreboot/fam15h/patches/0017-xgcc-update-nasm-to-2.16.03.patch44
5 files changed, 322 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
+
diff --git a/config/coreboot/fam15h/patches/0014-util-romcc-Fix-build-with-GCC-15.patch b/config/coreboot/fam15h/patches/0014-util-romcc-Fix-build-with-GCC-15.patch
new file mode 100644
index 00000000..d9de94c6
--- /dev/null
+++ b/config/coreboot/fam15h/patches/0014-util-romcc-Fix-build-with-GCC-15.patch
@@ -0,0 +1,119 @@
+From 74dc3c0a4603bc635c8bc5e95490cdf168af5f41 Mon Sep 17 00:00:00 2001
+From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
+Date: Tue, 29 Apr 2025 19:46:14 +0300
+Subject: [PATCH] util/romcc: Fix build with GCC 15
+
+With GCC 15, we get build errors complaining bool is a reserved keyword,
+so cannot be used as a function name. Rename our bool() to bool_().
+
+Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
+---
+ util/romcc/romcc.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
+index 378bfc50f290..b375e0fc83cb 100644
+--- a/util/romcc/romcc.c
++++ b/util/romcc/romcc.c
+@@ -7137,7 +7137,7 @@ static void integral(struct compile_state *state, struct triple *def)
+ }
+
+
+-static void bool(struct compile_state *state, struct triple *def)
++static void bool_(struct compile_state *state, struct triple *def)
+ {
+ if (!TYPE_ARITHMETIC(def->type->type) &&
+ ((def->type->type & TYPE_MASK) != TYPE_POINTER)) {
+@@ -7705,7 +7705,7 @@ static struct triple *mkcond_expr(
+ struct triple *def, *val, *var, *jmp1, *jmp2, *top, *mid, *end;
+ struct type *result_type;
+ unsigned int left_type, right_type;
+- bool(state, test);
++ bool_(state, test);
+ left_type = left->type->type;
+ right_type = right->type->type;
+ result_type = 0;
+@@ -11036,7 +11036,7 @@ static struct triple *unary_expr(struct compile_state *state)
+ case TOK_BANG:
+ eat(state, TOK_BANG);
+ right = read_expr(state, cast_expr(state));
+- bool(state, right);
++ bool_(state, right);
+ def = lfalse_expr(state, right);
+ break;
+ case TOK_SIZEOF:
+@@ -11363,10 +11363,10 @@ static struct triple *land_expr(struct compile_state *state)
+ while(peek(state) == TOK_LOGAND) {
+ struct triple *left, *right;
+ left = read_expr(state, def);
+- bool(state, left);
++ bool_(state, left);
+ eat(state, TOK_LOGAND);
+ right = read_expr(state, or_expr(state));
+- bool(state, right);
++ bool_(state, right);
+
+ def = mkland_expr(state,
+ ltrue_expr(state, left),
+@@ -11382,10 +11382,10 @@ static struct triple *lor_expr(struct compile_state *state)
+ while(peek(state) == TOK_LOGOR) {
+ struct triple *left, *right;
+ left = read_expr(state, def);
+- bool(state, left);
++ bool_(state, left);
+ eat(state, TOK_LOGOR);
+ right = read_expr(state, land_expr(state));
+- bool(state, right);
++ bool_(state, right);
+
+ def = mklor_expr(state,
+ ltrue_expr(state, left),
+@@ -11400,7 +11400,7 @@ static struct triple *conditional_expr(struct compile_state *state)
+ def = lor_expr(state);
+ if (peek(state) == TOK_QUEST) {
+ struct triple *test, *left, *right;
+- bool(state, def);
++ bool_(state, def);
+ test = ltrue_expr(state, read_expr(state, def));
+ eat(state, TOK_QUEST);
+ left = read_expr(state, expr(state));
+@@ -11676,7 +11676,7 @@ static void if_statement(struct compile_state *state, struct triple *first)
+ eat(state, TOK_IF);
+ eat(state, TOK_LPAREN);
+ test = expr(state);
+- bool(state, test);
++ bool_(state, test);
+ /* Cleanup and invert the test */
+ test = lfalse_expr(state, read_expr(state, test));
+ eat(state, TOK_RPAREN);
+@@ -11719,7 +11719,7 @@ static void for_statement(struct compile_state *state, struct triple *first)
+ eat(state, TOK_SEMI);
+ if (peek(state) != TOK_SEMI) {
+ test = expr(state);
+- bool(state, test);
++ bool_(state, test);
+ test = ltrue_expr(state, read_expr(state, test));
+ }
+ eat(state, TOK_SEMI);
+@@ -11767,7 +11767,7 @@ static void while_statement(struct compile_state *state, struct triple *first)
+ eat(state, TOK_WHILE);
+ eat(state, TOK_LPAREN);
+ test = expr(state);
+- bool(state, test);
++ bool_(state, test);
+ test = ltrue_expr(state, read_expr(state, test));
+ eat(state, TOK_RPAREN);
+ /* Generate the needed pieces */
+@@ -11818,7 +11818,7 @@ static void do_statement(struct compile_state *state, struct triple *first)
+ eat(state, TOK_WHILE);
+ eat(state, TOK_LPAREN);
+ test = read_expr(state, expr(state));
+- bool(state, test);
++ bool_(state, test);
+ eat(state, TOK_RPAREN);
+ eat(state, TOK_SEMI);
+ /* Thread the pieces together */
+
+--
+2.49.0
+
diff --git a/config/coreboot/fam15h/patches/0015-gmp-gcc15-patch.patch b/config/coreboot/fam15h/patches/0015-gmp-gcc15-patch.patch
new file mode 100644
index 00000000..40ea7c14
--- /dev/null
+++ b/config/coreboot/fam15h/patches/0015-gmp-gcc15-patch.patch
@@ -0,0 +1,65 @@
+From 8663b2a75d69aa241f86dd6e813232343a05b609 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <leah@libreboot.org>
+Date: Tue, 29 Apr 2025 21:26:25 +0100
+Subject: [PATCH 1/1] gmp gcc15 patch
+
+https://gmplib.org/list-archives/gmp-devel/2025-January/006279.html
+
+Signed-off-by: Leah Rowe <leah@libreboot.org>
+---
+ ...include.m4-fix-std-c23-build-failure.patch | 43 +++++++++++++++++++
+ 1 file changed, 43 insertions(+)
+ create mode 100644 util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure.patch
+
+diff --git a/util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure.patch b/util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure.patch
+new file mode 100644
+index 0000000000..adb66c6043
+--- /dev/null
++++ b/util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure.patch
+@@ -0,0 +1,43 @@
++From 7d4aa08224b53054754b8ee6fd61a4297ac47119 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 3c3ecf5..3a226fd 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/fam15h/patches/0016-further-fix-for-std-c23-on-gmp-with-host-gcc-15.patch b/config/coreboot/fam15h/patches/0016-further-fix-for-std-c23-on-gmp-with-host-gcc-15.patch
new file mode 100644
index 00000000..1287a02d
--- /dev/null
+++ b/config/coreboot/fam15h/patches/0016-further-fix-for-std-c23-on-gmp-with-host-gcc-15.patch
@@ -0,0 +1,55 @@
+From 8c3a1163eb24a608ad14747cd40169fb5a41d4f9 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <leah@libreboot.org>
+Date: Tue, 29 Apr 2025 23:18:56 +0100
+Subject: [PATCH 1/1] further fix for std=c23 on gmp with host gcc-15
+
+the fix had to be applied in the configure file, so that
+the correct function call is generated in conftest.c
+
+Signed-off-by: Leah Rowe <leah@libreboot.org>
+---
+ ...e.m4-fix-std-c23-build-failure-extra.patch | 32 +++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+ create mode 100644 util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure-extra.patch
+
+diff --git a/util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure-extra.patch b/util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure-extra.patch
+new file mode 100644
+index 0000000000..40569b27d8
+--- /dev/null
++++ b/util/crossgcc/patches/gmp-6.1.2_acinclude.m4-fix-std-c23-build-failure-extra.patch
+@@ -0,0 +1,32 @@
++From 6316016cfe6834b6d3242e7e088b7d2af91ada22 Mon Sep 17 00:00:00 2001
++From: Leah Rowe <leah@libreboot.org>
++Date: Tue, 29 Apr 2025 23:16:51 +0100
++Subject: [PATCH 1/1] further -std=23 gcc-15 fix for gmp
++
++the previously merged revision was correct, but
++applied in the wrong place. the conftest.c file
++was being generated by configure, in this place.
++
++this should fix build errors now, on gcc-15.
++
++Signed-off-by: Leah Rowe <leah@libreboot.org>
++---
++ configure | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/configure b/configure
++index 12ddffd..8b07818 100755
++--- a/configure
+++++ b/configure
++@@ -6458,7 +6458,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
+
diff --git a/config/coreboot/fam15h/patches/0017-xgcc-update-nasm-to-2.16.03.patch b/config/coreboot/fam15h/patches/0017-xgcc-update-nasm-to-2.16.03.patch
new file mode 100644
index 00000000..8dc52ac9
--- /dev/null
+++ b/config/coreboot/fam15h/patches/0017-xgcc-update-nasm-to-2.16.03.patch
@@ -0,0 +1,44 @@
+From 0d639c485bdf136e4c5ac7af81fc12da3f21bc46 Mon Sep 17 00:00:00 2001
+From: Leah Rowe <leah@libreboot.org>
+Date: Wed, 30 Apr 2025 04:07:31 +0100
+Subject: [PATCH 1/1] xgcc: update nasm to 2.16.03
+
+Signed-off-by: Leah Rowe <leah@libreboot.org>
+---
+ util/crossgcc/buildgcc | 2 +-
+ util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum | 1 -
+ util/crossgcc/sum/nasm-2.16.03.tar.bz2.cksum | 1 +
+ 3 files changed, 2 insertions(+), 2 deletions(-)
+ delete mode 100644 util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum
+ create mode 100644 util/crossgcc/sum/nasm-2.16.03.tar.bz2.cksum
+
+diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
+index 0ad1980104..2d48ff038e 100755
+--- a/util/crossgcc/buildgcc
++++ b/util/crossgcc/buildgcc
+@@ -61,7 +61,7 @@ EXPAT_VERSION=2.2.7
+ CLANG_VERSION=8.0.0
+ MAKE_VERSION=4.2.1
+ CMAKE_VERSION=3.15.3
+-NASM_VERSION=2.14.02
++NASM_VERSION=2.16.03
+
+ # GCC toolchain archive locations
+ # These are sanitized by the jenkins toolchain test builder, so if
+diff --git a/util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum b/util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum
+deleted file mode 100644
+index f3b9de9d29..0000000000
+--- a/util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum
++++ /dev/null
+@@ -1 +0,0 @@
+-fe098ee4dc9c4c983696c4948e64b23e4098b92b tarballs/nasm-2.14.02.tar.bz2
+diff --git a/util/crossgcc/sum/nasm-2.16.03.tar.bz2.cksum b/util/crossgcc/sum/nasm-2.16.03.tar.bz2.cksum
+new file mode 100644
+index 0000000000..9ca23fb0c4
+--- /dev/null
++++ b/util/crossgcc/sum/nasm-2.16.03.tar.bz2.cksum
+@@ -0,0 +1 @@
++c63080347a5c1c8904456fe6c680b722558383b4 tarballs/nasm-2.16.03.tar.bz2
+--
+2.39.5
+