diff --git a/conf/layer.conf b/conf/layer.conf index dbc1dad..037219c 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -10,4 +10,4 @@ BBFILE_PRIORITY_coreboot = "85" LAYERVERSION_coreboot = "1" -LAYERSERIES_COMPAT_coreboot = "scarthgap master" +LAYERSERIES_COMPAT_coreboot = "whinlatter" diff --git a/recipes-bsp/coreboot-utils/amdtool_git.bb b/recipes-bsp/coreboot-utils/amdtool_git.bb index e831d80..62a6d2a 100644 --- a/recipes-bsp/coreboot-utils/amdtool_git.bb +++ b/recipes-bsp/coreboot-utils/amdtool_git.bb @@ -19,6 +19,7 @@ SRC_URI = " \ git://github.com/coreboot/coreboot.git;branch=main;protocol=https \ file://coreboot-amdtool.patch \ " +SRC_URI:remove = "file://0002-treewide-Work-around-GCC-15-Werror-unterminated-stri.patch;patchdir=${PATCHDIR}" SRCREV = "e59c5abd13e6be052281a77c076037bc85de7084" diff --git a/recipes-bsp/coreboot-utils/cbfstool_git.bb b/recipes-bsp/coreboot-utils/cbfstool_git.bb index bf07ad5..2ec74a9 100644 --- a/recipes-bsp/coreboot-utils/cbfstool_git.bb +++ b/recipes-bsp/coreboot-utils/cbfstool_git.bb @@ -3,7 +3,7 @@ require coreboot-utils.inc SUMMARY = "Tool for manipulating CBFS file" SRC_URI += " \ - git://review.coreboot.org/vboot.git;destsuffix=git/3rdparty/vboot;name=vboot;protocol=https;branch=main \ + git://review.coreboot.org/vboot.git;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/3rdparty/vboot;name=vboot;protocol=https;branch=main \ " SRCREV_vboot = "0c11187c755394683d1b75bdb103cb1959fa6d40" diff --git a/recipes-bsp/coreboot-utils/coreboot-utils.inc b/recipes-bsp/coreboot-utils/coreboot-utils.inc index c0ff8be..36a6b11 100644 --- a/recipes-bsp/coreboot-utils/coreboot-utils.inc +++ b/recipes-bsp/coreboot-utils/coreboot-utils.inc @@ -9,8 +9,11 @@ PV = "4.21+git${SRCPV}" SRC_URI = " \ git://github.com/Dasharo/coreboot.git;protocol=https;branch=dasharo-4.21\ - " +" +SRC_URI:append = " \ + file://0002-treewide-Work-around-GCC-15-Werror-unterminated-stri.patch;patchdir=${PATCHDIR} \ +" SRCREV = "d08d5eaa98b1204b5e665d3ae4f63fb6f84a0d77" -S = "${WORKDIR}/git" +PATCHDIR = "${UNPACKDIR}/${BB_GIT_DEFAULT_DESTSUFFIX}" diff --git a/recipes-bsp/coreboot-utils/files/0001-Makefile-disable-deprecated-warnigs-as-errors.patch b/recipes-bsp/coreboot-utils/files/0001-Makefile-disable-deprecated-warnigs-as-errors.patch index 1a01fe6..b15f293 100644 --- a/recipes-bsp/coreboot-utils/files/0001-Makefile-disable-deprecated-warnigs-as-errors.patch +++ b/recipes-bsp/coreboot-utils/files/0001-Makefile-disable-deprecated-warnigs-as-errors.patch @@ -3,6 +3,7 @@ From: wkawka Date: Fri, 16 Sep 2022 11:09:29 +0200 Subject: [PATCH] Makefile: disable deprecated warnings as errors +Upstream-Status: Pending Signed-off-by: wkawka --- Makefile | 2 +- @@ -21,5 +22,5 @@ index 7f38bd6b..e3615a11 100644 FIRMWARE_FLAGS := -nostdinc -ffreestanding -fno-builtin -fno-stack-protector COMMON_FLAGS := -pipe ${WERROR} -Wall -Wstrict-prototypes -Wtype-limits \ -Wundef -Wmissing-prototypes -Wno-trigraphs -Wredundant-decls -Wshadow \ --- +-- 2.25.1 diff --git a/recipes-bsp/coreboot-utils/files/0002-treewide-Work-around-GCC-15-Werror-unterminated-stri.patch b/recipes-bsp/coreboot-utils/files/0002-treewide-Work-around-GCC-15-Werror-unterminated-stri.patch new file mode 100644 index 0000000..c66cd5b --- /dev/null +++ b/recipes-bsp/coreboot-utils/files/0002-treewide-Work-around-GCC-15-Werror-unterminated-stri.patch @@ -0,0 +1,93 @@ +From 0c60beac7c621abe22c96b06f42e55b26c83d686 Mon Sep 17 00:00:00 2001 +From: Kas User +Date: Sat, 21 Mar 2026 14:42:56 +0000 +Subject: [PATCH] treewide: Work around GCC 15 + Werror=unterminated-string-initialization + +GCC 15 added a new `unterminated-string-initialization` warning. Even +though crossgcc is still using GCC 14, some Linux distributions (e.g. +Arch Linux) already started shipping GCC 15. Given that coreboot uses +`-Werror` (warnings are errors), this new warning causes build errors +for things built using the host toolchain, such as utilities. In this +case, cbfstool is affected, which prevents building coreboot images. + +The nonstring attribute is used to tell the compiler whether or not a +string is intentionally not null terminated. Since the attribute is +only included in GCC 15 for multidimensional character arrays (and even +later for clang) we need to check the GCC version before using the +attribute. + +On GCC version prior to GCC 15 the nonstring attribute will not be used, +but that is not a problem since the unterminated-string-initialization +warning only exists since GCC 15. So you can still build on all GCC +versions as before. This way it also works if your host toolchain is GCC +15 (which builds commonlib code for cbfstool) and your coreboot cross +toolchain is GCC 14 (which builds commonlib code for coreboot). +Clang is a different matter. According to the documentation, the nonstring +attribute only exists in version 21 which is not yet released by LLVM. + +TEST=Build qemu/Q35 successfully + +Change-Id: I919d71cb2811e91869ba1ff493a0719ddcc86c36 + +Signed-off-by: Angel Pons +Reviewed-on: https://review.coreboot.org/c/coreboot/+/87825 +Reviewed-by: Benjamin Doron +Reviewed-by: Nicholas Chin +Reviewed-by: Matt DeVillier +Tested-by: build bot (Jenkins) + +Upstream-Status: Backport [25.06] +Signed-off-by: Kas User +--- + src/commonlib/bsd/include/commonlib/bsd/compiler.h | 7 +++++++ + src/commonlib/include/commonlib/loglevel.h | 2 +- + util/cbfstool/common.c | 2 +- + 3 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/commonlib/bsd/include/commonlib/bsd/compiler.h b/src/commonlib/bsd/include/commonlib/bsd/compiler.h +index 6bde28db0e..a06ffc22de 100644 +--- a/src/commonlib/bsd/include/commonlib/bsd/compiler.h ++++ b/src/commonlib/bsd/include/commonlib/bsd/compiler.h +@@ -62,6 +62,13 @@ + #define __printf(a, b) __attribute__((format(printf, a, b))) + #endif + ++/* This checks the support for the nonstring attribute on multidimensional character arrays. */ ++#if (defined(__GNUC__) && __GNUC__ >= 15) || (defined(__clang__) && __clang_major__ >= 21) ++#define __nonstring __attribute__((__nonstring__)) ++#else ++#define __nonstring ++#endif ++ + /* + * This evaluates to the type of the first expression, unless that is constant + * in which case it evaluates to the type of the second. This is useful when +diff --git a/src/commonlib/include/commonlib/loglevel.h b/src/commonlib/include/commonlib/loglevel.h +index 34d9824179..5975ebb037 100644 +--- a/src/commonlib/include/commonlib/loglevel.h ++++ b/src/commonlib/include/commonlib/loglevel.h +@@ -165,7 +165,7 @@ + */ + #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] = { ++static const char __nonstring bios_log_prefix[BIOS_LOG_PREFIX_MAX_LEVEL + 1][5] = { + /* Note: These strings are *not* null-terminated to save space. */ + [BIOS_EMERG] = "EMERG", + [BIOS_ALERT] = "ALERT", +diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c +index 7154bc9d54..d5eb87ca25 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 __nonstring translate[16] = "0123456789abcdef"; + + char *result = malloc(len * 2 + 1); + if (result == NULL) +-- +2.39.2 diff --git a/recipes-bsp/coreboot-utils/futil_git.bb b/recipes-bsp/coreboot-utils/futil_git.bb index 5bb3ee1..9c46557 100644 --- a/recipes-bsp/coreboot-utils/futil_git.bb +++ b/recipes-bsp/coreboot-utils/futil_git.bb @@ -20,8 +20,6 @@ SRC_URI = " \ " SRCREV = "dc68f9f1b56d92f76026dca490e79493599ff4cf" -S = "${WORKDIR}/git" - inherit pkgconfig TARGET_CC_ARCH += "${LDFLAGS}" diff --git a/recipes-bsp/coreboot-utils/intelp2m_git.bb b/recipes-bsp/coreboot-utils/intelp2m_git.bb index 94ee6d9..13b5e04 100644 --- a/recipes-bsp/coreboot-utils/intelp2m_git.bb +++ b/recipes-bsp/coreboot-utils/intelp2m_git.bb @@ -13,9 +13,10 @@ GO_IMPORT = "github.com/dasharo/coreboot/" # directory as expected by the go bbclass SRC_URI = " \ git://github.com/dasharo/coreboot.git;protocol=https;branch=dasharo-4.21;destsuffix=${GO_IMPORT} \ - " +" -S = "${WORKDIR}/${GO_IMPORT}/util/intelp2m" +S = "${UNPACKDIR}/${GO_IMPORT}/util/intelp2m" +PATCHDIR = "${UNPACKDIR}/${GO_IMPORT}" inherit goarch inherit go diff --git a/recipes-bsp/coreboot-utils/msrtool_git.bb b/recipes-bsp/coreboot-utils/msrtool_git.bb index 6736d2f..5d58a79 100644 --- a/recipes-bsp/coreboot-utils/msrtool_git.bb +++ b/recipes-bsp/coreboot-utils/msrtool_git.bb @@ -2,6 +2,6 @@ require coreboot-utils.inc SUMMARY = "Dumps chipset-specific MSR registers." DEPENDS += "pciutils" -S = "${WORKDIR}/git/util/msrtool" +S = "${UNPACKDIR}/${BP}/util/msrtool" export PREFIX = "${prefix}" inherit autotools-brokensep diff --git a/recipes-bsp/coreboot-utils/txesbmantool_git.bb b/recipes-bsp/coreboot-utils/txesbmantool_git.bb index ce8952c..ae100cb 100644 --- a/recipes-bsp/coreboot-utils/txesbmantool_git.bb +++ b/recipes-bsp/coreboot-utils/txesbmantool_git.bb @@ -3,7 +3,7 @@ HOMEPAGE = "https://github.com/Dasharo/coreboot" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "\ - file://${WORKDIR}/git/LICENSES/GPL-2.0-only.txt;md5=5430828348d2cf7d4b5e8395f774a68e\ + file://${UNPACKDIR}/${BP}/LICENSES/GPL-2.0-only.txt;md5=5430828348d2cf7d4b5e8395f774a68e\ " DEPENDS += "wolfssl" @@ -11,12 +11,12 @@ DEPENDS += "wolfssl" PV = "1.0+git${SRCPV}" SRC_URI = "\ - git://github.com/Dasharo/coreboot.git;branch=dasharo;protocol=https\ + git://github.com/Dasharo/coreboot.git;branch=dasharo;protocol=https \ " SRCREV = "0c63e7441c20e8a96ca110f53a08db3ac7e5e7fd" -S = "${WORKDIR}/git/util/txesbmantool" +S = "${UNPACKDIR}/${BP}/util/txesbmantool" inherit pkgconfig