From 8f6b42dfbaada38618deb888a20bb42689704ea2 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 22 Sep 2026 08:29:15 +0100 Subject: experimental edk2 support Signed-off-by: Leah Rowe --- config/module/edk2/default/nuke.list | 18 + ...ing-for-coreboot-images-built-without-a-p.patch | 39 ++ ...akefile.mk-use-3rdparty-cmocka-by-default.patch | 30 + .../patches/0003-remove-Werror-tree-wide.patch | 718 +++++++++++++++++++++ .../patches/0004-Remove-KCONFIG_WERROR.patch | 94 +++ .../default/patches/0006-don-t-delete-edk2.patch | 28 + .../default/patches/0007-don-t-delete-build.patch | 38 ++ .../patches/0008-copy-edk2-don-t-move-it.patch | 34 + ...ove-crossgcc-to-crossgcc_orig-and-symlink.patch | 215 ++++++ .../edk2/default/patches/0053-use-std-gnu2x.patch | 156 +++++ config/module/edk2/default/target.cfg | 43 ++ .../edk2/mrchromebox/config/libgfxinit_corebootfb | 13 + config/module/edk2/mrchromebox/target.cfg | 6 + 13 files changed, 1432 insertions(+) create mode 100644 config/module/edk2/default/nuke.list create mode 100644 config/module/edk2/default/patches/0001-Remove-warning-for-coreboot-images-built-without-a-p.patch create mode 100644 config/module/edk2/default/patches/0002-tests-Makefile.mk-use-3rdparty-cmocka-by-default.patch create mode 100644 config/module/edk2/default/patches/0003-remove-Werror-tree-wide.patch create mode 100644 config/module/edk2/default/patches/0004-Remove-KCONFIG_WERROR.patch create mode 100644 config/module/edk2/default/patches/0006-don-t-delete-edk2.patch create mode 100644 config/module/edk2/default/patches/0007-don-t-delete-build.patch create mode 100644 config/module/edk2/default/patches/0008-copy-edk2-don-t-move-it.patch create mode 100644 config/module/edk2/default/patches/0009-move-crossgcc-to-crossgcc_orig-and-symlink.patch create mode 100644 config/module/edk2/default/patches/0053-use-std-gnu2x.patch create mode 100644 config/module/edk2/default/target.cfg create mode 100644 config/module/edk2/mrchromebox/config/libgfxinit_corebootfb create mode 100644 config/module/edk2/mrchromebox/target.cfg (limited to 'config/module') diff --git a/config/module/edk2/default/nuke.list b/config/module/edk2/default/nuke.list new file mode 100644 index 00000000..e6c247d2 --- /dev/null +++ b/config/module/edk2/default/nuke.list @@ -0,0 +1,18 @@ +3rdparty/fsp/EagleStreamFspBinPkg +3rdparty/fsp/MeteorLakeFspBinPkg +3rdparty/fsp/IceLakeFspBinPkg +3rdparty/fsp/AmberLakeFspBinPkg +3rdparty/fsp/DenvertonNSFspBinPkg +3rdparty/fsp/TigerLakeFspBinPkg +3rdparty/fsp/CedarIslandFspBinPkg +3rdparty/fsp/ElkhartLakeFspBinPkg +3rdparty/fsp/CometLakeFspBinPkg +3rdparty/fsp/WhitleyFspBinPkg +3rdparty/fsp/ArrowLakeFspBinPkg +3rdparty/fsp/IdavilleFspBinPkg +3rdparty/fsp/BraswellFspBinPkg +3rdparty/fsp/CoffeeLakeFspBinPkg +3rdparty/fsp/RaptorLakeFspBinPkg +3rdparty/fsp/ApolloLakeFspBinPkg +3rdparty/fsp/SkylakeFspBinPkg +3rdparty/vboot/tests diff --git a/config/module/edk2/default/patches/0001-Remove-warning-for-coreboot-images-built-without-a-p.patch b/config/module/edk2/default/patches/0001-Remove-warning-for-coreboot-images-built-without-a-p.patch new file mode 100644 index 00000000..8c922522 --- /dev/null +++ b/config/module/edk2/default/patches/0001-Remove-warning-for-coreboot-images-built-without-a-p.patch @@ -0,0 +1,39 @@ +From c7797c30efd80203bf4c99da293921f658f6b677 Mon Sep 17 00:00:00 2001 +From: Nicholas Chin +Date: Fri, 12 May 2023 19:55:15 -0600 +Subject: [PATCH 1/9] Remove warning for coreboot images built without a + payload + +I added this in upstream to prevent people from accidentally flashing +roms without a payload resulting in a no boot situation, but in +libreboot lbmk handles the payload and thus this warning always comes +up. This has caused confusion and concern so just patch it out. +--- + payloads/Makefile.mk | 13 +------------ + 1 file changed, 1 insertion(+), 12 deletions(-) + +diff --git a/payloads/Makefile.mk b/payloads/Makefile.mk +index 5f988dac1b..516133880f 100644 +--- a/payloads/Makefile.mk ++++ b/payloads/Makefile.mk +@@ -50,16 +50,5 @@ distclean-payloads: + print-repo-info-payloads: + -$(foreach payload, $(PAYLOADS_LIST), $(MAKE) -C $(payload) print-repo-info 2>/dev/null; ) + +-ifeq ($(CONFIG_PAYLOAD_NONE),y) +-show_notices:: warn_no_payload +-endif +- +-warn_no_payload: +- printf "\n\t** WARNING **\n" +- printf "coreboot has been built without a payload. Writing\n" +- printf "a coreboot image without a payload to your board's\n" +- printf "flash chip will result in a non-booting system. You\n" +- printf "can use cbfstool to add a payload to the image.\n\n" +- + .PHONY: force-payload coreinfo nvramcui +-.PHONY: clean-payloads distclean-payloads print-repo-info-payloads warn_no_payload ++.PHONY: clean-payloads distclean-payloads print-repo-info-payloads +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0002-tests-Makefile.mk-use-3rdparty-cmocka-by-default.patch b/config/module/edk2/default/patches/0002-tests-Makefile.mk-use-3rdparty-cmocka-by-default.patch new file mode 100644 index 00000000..4d379ea7 --- /dev/null +++ b/config/module/edk2/default/patches/0002-tests-Makefile.mk-use-3rdparty-cmocka-by-default.patch @@ -0,0 +1,30 @@ +From ff67d8671b451ed391523dc139680b07594fb8c0 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Sat, 20 Dec 2025 22:36:18 +0100 +Subject: [PATCH 2/9] tests/Makefile.mk: use 3rdparty/cmocka by default + +(tests) + +Signed-off-by: Leah Rowe +--- + tests/Makefile.mk | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/Makefile.mk b/tests/Makefile.mk +index ab302634ec..7e6f260b27 100644 +--- a/tests/Makefile.mk ++++ b/tests/Makefile.mk +@@ -25,7 +25,9 @@ TEST_LDFLAGS += --coverage + endif + + # Use system cmoka in default, or build from 3rdparty source code if requested +-USE_SYSTEM_CMOCKA ?= 1 ++# PATCH NOTE: lbmk sets it to 0 by default. You can still override it to 1 ++# if you wish; upstream sets this to 1 by default, but we do 0 ++USE_SYSTEM_CMOCKA ?= 0 + ifeq ($(USE_SYSTEM_CMOCKA),1) + # Only probe for Cmocka (and possibly warn that it will be built from 3rdparty) + # when the requested goals actually build or run unit tests. Otherwise every +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0003-remove-Werror-tree-wide.patch b/config/module/edk2/default/patches/0003-remove-Werror-tree-wide.patch new file mode 100644 index 00000000..bf37dd58 --- /dev/null +++ b/config/module/edk2/default/patches/0003-remove-Werror-tree-wide.patch @@ -0,0 +1,718 @@ +From 193253bf2437ba3d5d2ea4378157eb94b2f66bda Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Mon, 21 Sep 2026 10:46:07 +0100 +Subject: [PATCH 3/9] remove -Werror tree-wide + +Signed-off-by: Leah Rowe +--- + Makefile.mk | 2 - + .../external/tint/tint-0.07_libpayload.patch | 70 +++++++++---------- + payloads/libpayload/Makefile.mk | 2 +- + payloads/libpayload/Makefile.payload | 2 +- + payloads/libpayload/sample/Makefile | 2 +- + payloads/libpayload/sample/arch_mock/Makefile | 2 +- + payloads/libpayload/tests/Makefile.mk | 2 +- + payloads/linuxcheck/Makefile | 2 +- + src/commonlib/gnat/Makefile.mk | 1 - + tests/Makefile.common | 2 +- + util/amdfwtool/Makefile.mk | 2 +- + util/archive/Makefile | 2 +- + util/bincfg/Makefile | 2 +- + util/bucts/Makefile | 2 +- + util/cbfstool/Makefile.mk | 2 +- + util/cbfstool/lz4/Makefile | 8 +-- + util/cbmem/Makefile | 2 +- + util/crossgcc/patches/gcc-15.2.0_libcpp.patch | 2 +- + util/ectool/Makefile | 2 +- + util/futility/Makefile.mk | 2 +- + util/ifdtool/Makefile.mk | 2 +- + util/intelvbttool/Makefile | 2 +- + ...fdata.c-fix-Werror-discarded-qualifi.patch | 4 +- + util/kconfig/patches/series | 2 +- + util/msrtool/configure | 2 +- + util/pmh7tool/Makefile | 2 +- + util/superiotool/Makefile | 6 +- + util/uio_usbdebug/Makefile | 2 +- + util/xcompile/xcompile | 2 +- + 29 files changed, 67 insertions(+), 70 deletions(-) + +diff --git a/Makefile.mk b/Makefile.mk +index 7a208d041d..f3480b1a28 100644 +--- a/Makefile.mk ++++ b/Makefile.mk +@@ -555,7 +555,6 @@ CFLAGS_common += -ffunction-sections + CFLAGS_common += -fdata-sections + CFLAGS_common += -fno-pie + CFLAGS_common += -Wstring-compare +-CFLAGS_common += -Werror + ifeq ($(CONFIG_COMPILER_GCC),y) + CFLAGS_common += -Wold-style-declaration + CFLAGS_common += -Wcast-function-type +@@ -581,7 +580,6 @@ endif + ADAFLAGS_common += -gnatp + ADAFLAGS_common += -Wuninitialized + ADAFLAGS_common += -Wall +-ADAFLAGS_common += -Werror + ADAFLAGS_common += -pipe + ADAFLAGS_common += -g + ADAFLAGS_common += -nostdinc +diff --git a/payloads/external/tint/tint-0.07_libpayload.patch b/payloads/external/tint/tint-0.07_libpayload.patch +index 6c9594a369..3d70539ffb 100644 +--- a/payloads/external/tint/tint-0.07_libpayload.patch ++++ b/payloads/external/tint/tint-0.07_libpayload.patch +@@ -4,7 +4,7 @@ diff -rupN tint-0.05/config.h tint/config.h + @@ -29,7 +29,15 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +- ++ + +#include + +#include + + +@@ -15,7 +15,7 @@ diff -rupN tint-0.05/config.h tint/config.h + +#if 0 + const char scorefile[] = SCOREFILE; + +#endif +- ++ + #endif /* #ifndef CONFIG_H */ + diff -rupN tint-0.05/engine.c tint/engine.c + --- tint-0.05/engine.c 2005-07-17 13:26:22.000000000 +0200 +@@ -23,14 +23,14 @@ diff -rupN tint-0.05/engine.c tint/engine.c + @@ -27,10 +27,13 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +- ++ + +#include "config.h" + + + +#if 0 + #include + #include + +#endif +- ++ + -#include "typedefs.h" + #include "utils.h" + #include "io.h" +@@ -41,10 +41,10 @@ diff -rupN tint-0.05/engine.h tint/engine.h + @@ -29,7 +29,7 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +- ++ + -#include "typedefs.h" /* bool */ + +#include "curses.h" /* bool */ +- ++ + /* + * Macros + diff -rupN tint-0.05/io.c tint/io.c +@@ -53,7 +53,7 @@ diff -rupN tint-0.05/io.c tint/io.c + @@ -27,9 +27,13 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +- ++ + +#include "config.h" + + + +#if 0 +@@ -61,9 +61,9 @@ diff -rupN tint-0.05/io.c tint/io.c + #include /* gettimeofday() */ + #include /* gettimeofday() */ + +#endif +- ++ + #include "io.h" +- ++ + @@ -68,7 +72,11 @@ static int in_timeleft; + /* Initialize screen */ + void io_init () +@@ -101,16 +101,16 @@ diff -rupN tint-0.05/io.c tint/io.c + +#endif + return ch; + } +- ++ + diff -rupN tint-0.05/io.h tint/io.h + --- tint-0.05/io.h 2010-06-23 14:55:03.000000000 +0100 + +++ tint/io.h 2021-02-09 08:00:00.000000000 +0200 + @@ -30,7 +30,6 @@ + */ +- ++ + #include + -#include +- ++ + /* + * Colors + diff -rupN tint-0.05/Makefile tint/Makefile +@@ -166,7 +166,7 @@ diff -rupN tint-0.05/Makefile tint/Makefile + +HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD_DIR)/lib/libpayload.a) + +LIB_CONFIG ?= configs/defconfig-tinycurses + + +-+# CFLAGS := -Wall -Werror -Os +++# CFLAGS := -Wall -Os + +CFLAGS := -Wall -g -Os + +TARGET := tint + +OBJS := $(TARGET).o engine.o io.o utils.o +@@ -234,7 +234,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + @@ -27,6 +26,7 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +- ++ + +#if 0 + #include + #include +@@ -244,24 +244,24 @@ diff -rupN tint-0.05/tint.c tint/tint.c + #include + #include + +#endif +- ++ + -#include "typedefs.h" + #include "utils.h" + #include "io.h" + #include "config.h" + @@ -304,7 +304,7 @@ static void showstatus (engine_t *engine + /***************************************************************************/ +- ++ + /* Header for scorefile */ + -#define SCORE_HEADER "Tint 0.02b (c) Abraham vd Merwe - Scores" + +#define SCORE_HEADER "Tint 0.05 (c) Abraham vd Merwe - Scores" +- ++ + /* Header for score title */ + static const char scoretitle[] = "\n\t TINT HIGH SCORES\n\n\tRank Score Name\n\n"; + @@ -322,6 +322,7 @@ typedef struct + time_t timestamp; + } score_t; +- ++ + +#if 0 + static void getname (char *name) + { +@@ -271,7 +271,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + } + } + +#endif +- ++ + +#if 0 + static void err1 () + { +@@ -281,7 +281,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + exit (EXIT_FAILURE); + } + +#endif +- ++ + void showplayerstats (engine_t *engine) + { + - fprintf (stderr, +@@ -292,7 +292,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + @@ -361,6 +365,7 @@ void showplayerstats (engine_t *engine) + GETSCORE (engine->score),engine->status.efficiency,GETSCORE (engine->score) / getsum ()); + } +- ++ + +#if 0 + static void createscores (int score) + { +@@ -302,7 +302,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + fprintf (stderr,"\t 1* %7d %s\n\n",score,scores[0].name); + } + +#endif +- ++ + +#if 0 + static int cmpscores (const void *a,const void *b) + { +@@ -312,7 +312,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + return 0; + } + +#endif +- ++ + +#if 0 + static void savescores (int score) + { +@@ -322,11 +322,11 @@ diff -rupN tint-0.05/tint.c tint/tint.c + fprintf (stderr,"\n"); + } + +#endif +- ++ + /***************************************************************************/ + /***************************************************************************/ + /***************************************************************************/ +- ++ + +#if 0 + static void showhelp () + { +@@ -336,7 +336,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + exit (EXIT_FAILURE); + } + +#endif +- ++ + static void parse_options (int argc,char *argv[]) + { + +#if 0 +@@ -349,12 +349,12 @@ diff -rupN tint-0.05/tint.c tint/tint.c + } + +#endif + } +- ++ + static void choose_level () + { + +#if 0 + char buf[NAMELEN]; +- ++ + do + @@ -557,6 +572,8 @@ static void choose_level () + buf[strlen (buf) - 1] = '\0'; +@@ -363,7 +363,7 @@ diff -rupN tint-0.05/tint.c tint/tint.c + +#endif + + level = 1; + } +- ++ + /***************************************************************************/ + @@ -569,6 +586,8 @@ int main (int argc,char *argv[]) + int ch; +@@ -423,14 +423,14 @@ diff -rupN tint-0.05/tint.c tint/tint.c + exit (EXIT_SUCCESS); + +#endif + } +- ++ + diff -rupN tint-0.05/utils.c tint/utils.c + --- tint-0.05/utils.c 2001-12-07 16:49:19.000000000 +0100 + +++ tint/utils.c 2021-02-09 08:00:00.000000000 +0200 + @@ -27,11 +27,13 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +- ++ + +#include "config.h" + + + +#if 0 +@@ -440,7 +440,7 @@ diff -rupN tint-0.05/utils.c tint/utils.c + - + -#include "typedefs.h" + +#endif +- ++ + /* + * Initialize random number generator + @@ -61,6 +63,7 @@ int rand_value (int range) +@@ -454,7 +454,7 @@ diff -rupN tint-0.05/utils.c tint/utils.c + @@ -69,3 +72,4 @@ bool str2int (int *i,const char *str) + return TRUE; + } +- ++ + +#endif + diff -rupN tint-0.05/utils.h tint/utils.h + --- tint-0.05/utils.h 2001-12-07 16:49:35.000000000 +0100 +@@ -462,9 +462,9 @@ diff -rupN tint-0.05/utils.h tint/utils.h + @@ -29,7 +29,7 @@ + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +- ++ + -#include "typedefs.h" + +#include +- ++ + /* + * Initialize random number generator +diff --git a/payloads/libpayload/Makefile.mk b/payloads/libpayload/Makefile.mk +index 0f5d1a0e11..45c2c5ad74 100644 +--- a/payloads/libpayload/Makefile.mk ++++ b/payloads/libpayload/Makefile.mk +@@ -80,7 +80,7 @@ CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer + CFLAGS += -ffunction-sections -fdata-sections + CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wvla + CFLAGS += -Wwrite-strings -Wredundant-decls -Wimplicit-fallthrough +-CFLAGS += -Wstrict-aliasing -Wshadow -Wno-address-of-packed-member -Werror ++CFLAGS += -Wstrict-aliasing -Wshadow -Wno-address-of-packed-member + + ifeq ($(CONFIG_LP_LTO),y) + CFLAGS += -flto +diff --git a/payloads/libpayload/Makefile.payload b/payloads/libpayload/Makefile.payload +index 2eafd4bec3..c74704c58d 100644 +--- a/payloads/libpayload/Makefile.payload ++++ b/payloads/libpayload/Makefile.payload +@@ -84,7 +84,7 @@ endif + + CFLAGS = $(CFLAGS_$(ARCH)) + CFLAGS += -Os -ffreestanding +-CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror ++CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla + ifeq ($(CONFIG_LP_LTO),y) + CFLAGS += -flto + endif +diff --git a/payloads/libpayload/sample/Makefile b/payloads/libpayload/sample/Makefile +index 1249e9a017..269511d7df 100644 +--- a/payloads/libpayload/sample/Makefile ++++ b/payloads/libpayload/sample/Makefile +@@ -44,7 +44,7 @@ AS := $(AS_$(ARCH-y)) + LIBPAYLOAD_DIR := ../install/libpayload + XCC := CC="$(CC)" $(LIBPAYLOAD_DIR)/bin/lpgcc + XAS := AS="$(AS)" $(LIBPAYLOAD_DIR)/bin/lpas +-CFLAGS := -fno-builtin -Wall -Werror -Os ++CFLAGS := -fno-builtin -Wall -Os + TARGET := hello + OBJS := $(TARGET).o + +diff --git a/payloads/libpayload/sample/arch_mock/Makefile b/payloads/libpayload/sample/arch_mock/Makefile +index a1e748111e..a146c2b3be 100644 +--- a/payloads/libpayload/sample/arch_mock/Makefile ++++ b/payloads/libpayload/sample/arch_mock/Makefile +@@ -12,7 +12,7 @@ CC := gcc + AS := as + OBJCOPY := objcopy + LIBPAYLOAD_DIR := ../../install/libpayload +-CFLAGS := -fno-builtin -Wall -Werror -Os \ ++CFLAGS := -fno-builtin -Wall -Os \ + -include $(LIBPAYLOAD_DIR)/include/kconfig.h \ + -include $(LIBPAYLOAD_DIR)/include/compiler.h \ + -I $(LIBPAYLOAD_DIR)/include \ +diff --git a/payloads/libpayload/tests/Makefile.mk b/payloads/libpayload/tests/Makefile.mk +index 6b6c78d835..b2e7433b65 100644 +--- a/payloads/libpayload/tests/Makefile.mk ++++ b/payloads/libpayload/tests/Makefile.mk +@@ -45,7 +45,7 @@ TEST_CFLAGS += -I$(cmockasrc)/include + # Minimal subset of warnings and errors. Tests can be less strict than actual build. + TEST_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wvla + TEST_CFLAGS += -Wwrite-strings -Wno-address-of-packed-member -Wimplicit-fallthrough +-TEST_CFLAGS += -Wstrict-aliasing -Wshadow -Werror ++TEST_CFLAGS += -Wstrict-aliasing -Wshadow + TEST_CFLAGS += -Wno-unknown-warning-option -Wno-source-mgr -Wno-main-return-type + + TEST_CFLAGS += -std=gnu11 -ffunction-sections -fdata-sections -fno-builtin +diff --git a/payloads/linuxcheck/Makefile b/payloads/linuxcheck/Makefile +index 838c90df0c..a9d016db36 100644 +--- a/payloads/linuxcheck/Makefile ++++ b/payloads/linuxcheck/Makefile +@@ -3,7 +3,7 @@ XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile + # build libpayload and put .config file in $(CURDIR) instead of ../libpayload + # to avoid pollute the libpayload source directory and possible conflicts + LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config" +-CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib ++CFLAGS += -Wall -Wvla -Os -ffreestanding -nostdinc -nostdlib + ifeq ($(CONFIG_ARCH_X86),y) + TARGETARCH = i386 + endif +diff --git a/src/commonlib/gnat/Makefile.mk b/src/commonlib/gnat/Makefile.mk +index 773615c2cc..26891690cc 100644 +--- a/src/commonlib/gnat/Makefile.mk ++++ b/src/commonlib/gnat/Makefile.mk +@@ -12,7 +12,6 @@ ADAFLAGS_libgnat-$(1) := \ + -gnatpg \ + -I$(dir) \ + $$(GCC_ADAFLAGS_$(1)) \ +- -Werror \ + -fno-pie \ + + libgnat-$(1)-y += a-unccon.ads +diff --git a/tests/Makefile.common b/tests/Makefile.common +index 14cacaeca7..c35e312a79 100644 +--- a/tests/Makefile.common ++++ b/tests/Makefile.common +@@ -46,7 +46,7 @@ TEST_INCLUDES += -I$(dir $(TEST_KCONFIG_AUTOHEADER)) + # -Wmissing-prototypes just make working with the test framework cumbersome. + # Only put conservative warnings here that really detect code that's obviously + # unintentional. +-TEST_CFLAGS += -Wall -Werror -Wundef -Wstrict-prototypes -Wno-inline-asm ++TEST_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-inline-asm + TEST_CFLAGS += -Wno-unknown-warning-option -Wno-source-mgr -Wno-main-return-type + TEST_CFLAGS += -Wno-array-compare -Wno-trigraphs + TEST_CFLAGS += -Wno-unused-but-set-variables +diff --git a/util/amdfwtool/Makefile.mk b/util/amdfwtool/Makefile.mk +index 1f819d918f..f7dce01b71 100644 +--- a/util/amdfwtool/Makefile.mk ++++ b/util/amdfwtool/Makefile.mk +@@ -6,7 +6,7 @@ amdfwtoolobj = amdfwtool.o data_parse.o signed_psp.o handle_file.o opts.o soc.o + amdfwreadobj = amdfwread.o + amdfwheader = amdfwtool.h + +-WERROR ?= -Werror ++WERROR = + AMDFWTOOLCFLAGS :=-O2 -Wall -Wextra -Wshadow $(WERROR) + AMDFWTOOLCFLAGS += -I $(top)/src/commonlib/bsd/include + AMDFWTOOLCFLAGS += -I $(top)/src/ +diff --git a/util/archive/Makefile b/util/archive/Makefile +index 2de6a6294a..d301017253 100644 +--- a/util/archive/Makefile ++++ b/util/archive/Makefile +@@ -1,7 +1,7 @@ + ## SPDX-License-Identifier: GPL-2.0-only + PROGRAM = archive + HOSTCC ?= gcc +-WERROR=-Werror ++WERROR= + CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} + + SRCS = $(PROGRAM).c +diff --git a/util/bincfg/Makefile b/util/bincfg/Makefile +index dbcbc7711c..5f97f60f34 100644 +--- a/util/bincfg/Makefile ++++ b/util/bincfg/Makefile +@@ -3,7 +3,7 @@ CC = gcc + YACC = bison + LEX = flex + TARGET=bincfg +-WERROR=-Werror ++WERROR= + CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} + CFLAGS+=-Wno-unused-function + LDFLAGS= -lfl +diff --git a/util/bucts/Makefile b/util/bucts/Makefile +index d32258d1ec..50da491a8a 100644 +--- a/util/bucts/Makefile ++++ b/util/bucts/Makefile +@@ -3,7 +3,7 @@ CC:=gcc + OBJ:=bucts.o + TARGET=bucts + VERSION:=$(shell git describe) +-WERROR=-Werror ++WERROR= + CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} + + ifeq ($(shell uname), FreeBSD) +diff --git a/util/cbfstool/Makefile.mk b/util/cbfstool/Makefile.mk +index 315a9a751a..d195e4713a 100644 +--- a/util/cbfstool/Makefile.mk ++++ b/util/cbfstool/Makefile.mk +@@ -146,7 +146,7 @@ test_obj += fmap.o + test_obj += kv_pair.o + test_obj += valstr.o + +-TOOLCFLAGS ?= -Werror -Wall -Wextra -Wshadow ++TOOLCFLAGS ?= -Wall -Wextra -Wshadow + TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow + TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings + TOOLCFLAGS += -O2 +diff --git a/util/cbfstool/lz4/Makefile b/util/cbfstool/lz4/Makefile +index d624e84703..be484c805f 100644 +--- a/util/cbfstool/lz4/Makefile ++++ b/util/cbfstool/lz4/Makefile +@@ -72,10 +72,10 @@ cmake: + @cd cmake_unofficial; cmake CMakeLists.txt; $(MAKE) + + gpptest: clean +- $(MAKE) all CC=g++ CFLAGS="-O3 -I../lib -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" ++ $(MAKE) all CC=g++ CFLAGS="-O3 -I../lib -Wall -Wextra -Wundef -Wshadow -Wcast-align" + + clangtest: clean +- CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) all CC=clang ++ CFLAGS="-O3 -Wconversion -Wno-sign-conversion" $(MAKE) all CC=clang + + sanitize: clean + CFLAGS="-O3 -g -fsanitize=undefined" $(MAKE) test CC=clang FUZZER_TIME="-T1mn" NB_LOOPS=-i1 +@@ -84,8 +84,8 @@ staticAnalyze: clean + CFLAGS=-g clang-tidy $(CLANG_TIDY_CHECKS) $(CLANG_TIDY_ARGS) $(SRCS) + + armtest: clean +- CFLAGS="-O3 -Werror" $(MAKE) -C $(LZ4DIR) all CC=arm-linux-gnueabi-gcc +- CFLAGS="-O3 -Werror" $(MAKE) -C $(PRGDIR) bins CC=arm-linux-gnueabi-gcc ++ CFLAGS="-O3" $(MAKE) -C $(LZ4DIR) all CC=arm-linux-gnueabi-gcc ++ CFLAGS="-O3" $(MAKE) -C $(PRGDIR) bins CC=arm-linux-gnueabi-gcc + + versionsTest: clean + $(MAKE) -C versionsTest +diff --git a/util/cbmem/Makefile b/util/cbmem/Makefile +index c0dfcbdc52..fe2891be6d 100644 +--- a/util/cbmem/Makefile ++++ b/util/cbmem/Makefile +@@ -9,7 +9,7 @@ CC ?= $(CROSS_COMPILE)gcc + INSTALL ?= /usr/bin/env install + PREFIX ?= /usr/local + CFLAGS ?= -O2 +-WERROR=-Werror ++WERROR= + CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wshadow $(WERROR) + CFLAGS += -std=gnu23 + CPPFLAGS += -I . -I $(ROOT)/commonlib/include -I $(ROOT)/commonlib/bsd/include +diff --git a/util/crossgcc/patches/gcc-15.2.0_libcpp.patch b/util/crossgcc/patches/gcc-15.2.0_libcpp.patch +index ba60732f72..f1dc6aa2d6 100644 +--- a/util/crossgcc/patches/gcc-15.2.0_libcpp.patch ++++ b/util/crossgcc/patches/gcc-15.2.0_libcpp.patch +@@ -1,4 +1,4 @@ +-GCC with `-Wformat-security -Werror=format-security` hardening options enabled ++GCC with `-Wformat-security =format-security` hardening options enabled + by default rejects some codes in libcpp. This patch fixes them. + + --- gcc-15-20250112/libcpp/expr.cc.bak +diff --git a/util/ectool/Makefile b/util/ectool/Makefile +index a90773e5c6..5724ac6009 100644 +--- a/util/ectool/Makefile ++++ b/util/ectool/Makefile +@@ -1,7 +1,7 @@ + ## SPDX-License-Identifier: GPL-2.0-only + + CC ?= gcc +-WERROR=-Werror ++WERROR= + CFLAGS = -O2 -Wall -Wextra -Wshadow $(WERROR) + PROGRAM = ectool + INSTALL ?= /usr/bin/env install +diff --git a/util/futility/Makefile.mk b/util/futility/Makefile.mk +index a7bcee50d3..ba930a046b 100644 +--- a/util/futility/Makefile.mk ++++ b/util/futility/Makefile.mk +@@ -10,7 +10,7 @@ $(VBOOT_FUTILITY): | check-openssl-presence + unset CFLAGS LDFLAGS; $(MAKE) -C $(VBOOT_SOURCE) \ + BUILD=$(VBOOT_HOST_BUILD) \ + CC="$(HOSTCC)" \ +- WERROR="-Werror -Wno-deprecated-declarations" \ ++ WERROR=" -Wno-deprecated-declarations" \ + PKG_CONFIG="$(HOSTPKGCONFIG)" \ + V=$(V) \ + USE_FLASHROM=0 \ +diff --git a/util/ifdtool/Makefile.mk b/util/ifdtool/Makefile.mk +index 53506469d3..57d192ccb8 100644 +--- a/util/ifdtool/Makefile.mk ++++ b/util/ifdtool/Makefile.mk +@@ -2,7 +2,7 @@ + + ifdtoolobj = ifdtool.o fmap.o kv_pair.o valstr.o + +-IFDTOOLCFLAGS = -O2 -g -Wall -Wextra -Wmissing-prototypes -Werror ++IFDTOOLCFLAGS = -O2 -g -Wall -Wextra -Wmissing-prototypes + IFDTOOLCFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/include + IFDTOOLCFLAGS += -I$(top)/util/cbfstool/flashmap + IFDTOOLCFLAGS += -include $(top)/src/commonlib/bsd/include/commonlib/bsd/compiler.h +diff --git a/util/intelvbttool/Makefile b/util/intelvbttool/Makefile +index 5c770dec9e..8963263354 100644 +--- a/util/intelvbttool/Makefile ++++ b/util/intelvbttool/Makefile +@@ -6,7 +6,7 @@ CC ?= gcc + INSTALL ?= /usr/bin/env install + PREFIX ?= /usr/local + CFLAGS ?= -O2 -g +-CFLAGS += -Wall -Werror ++CFLAGS += -Wall + CFLAGS += -I../../src/commonlib/include -I ../../src/commonlib/bsd/include + + all: $(PROGRAM) +diff --git a/util/kconfig/patches/0016-util-kconfig-confdata.c-fix-Werror-discarded-qualifi.patch b/util/kconfig/patches/0016-util-kconfig-confdata.c-fix-Werror-discarded-qualifi.patch +index a367256102..401061d6c5 100644 +--- a/util/kconfig/patches/0016-util-kconfig-confdata.c-fix-Werror-discarded-qualifi.patch ++++ b/util/kconfig/patches/0016-util-kconfig-confdata.c-fix-Werror-discarded-qualifi.patch +@@ -1,7 +1,7 @@ + From 2a1a1d1b305ab276279234f70410bb6486a2049f Mon Sep 17 00:00:00 2001 + From: Mike Banon + Date: Tue, 10 Mar 2026 00:14:58 +0100 +-Subject: [PATCH] util/kconfig/confdata.c: fix -Werror=discarded-qualifiers ++Subject: [PATCH] util/kconfig/confdata.c: fix =discarded-qualifiers + + In conf_read_simple(), strchr() is called on 'sym_name', which is + declared const char. The function returns a char that discards the +@@ -36,6 +36,6 @@ index 0105917..ae6ae2b 100644 + int i, def_flags; + - const char *warn_unknown, *sym_name; + + const char *warn_unknown; +- ++ + warn_unknown = getenv("KCONFIG_WARN_UNKNOWN_SYMBOLS"); + if (name) { +diff --git a/util/kconfig/patches/series b/util/kconfig/patches/series +index 31d446ef81..739bee9279 100644 +--- a/util/kconfig/patches/series ++++ b/util/kconfig/patches/series +@@ -8,4 +8,4 @@ + 0013-util-kconfig-detect-ncurses-on-FreeBSD.patch + 0014-util-kconfig-Move-Kconfig-deps-back-into-build-confi.patch + 0015-fix-incorrect-spdx-strings.patch +-0016-util-kconfig-confdata.c-fix-Werror-discarded-qualifi.patch ++0016-util-kconfig-confdata.c-fix-discarded-qualifi.patch +diff --git a/util/msrtool/configure b/util/msrtool/configure +index 659cbcd66b..0415e4d9c9 100755 +--- a/util/msrtool/configure ++++ b/util/msrtool/configure +@@ -133,7 +133,7 @@ CC=`findprog "compiler" "${CC}" clang gcc cc icc` || exit + INSTALL=`findprog "install" "${INSTALL}" install ginstall` || exit + + test -n "$DEBUG" && myCFLAGS="-O2 -g" || myCFLAGS="-Os" +-CFLAGS="${CFLAGS} ${myCFLAGS} -Wall -Werror" ++CFLAGS="${CFLAGS} ${myCFLAGS} -Wall " + + cat > .config.c << EOF + #include +diff --git a/util/pmh7tool/Makefile b/util/pmh7tool/Makefile +index 0a2ebbe147..c04d7e9bf9 100644 +--- a/util/pmh7tool/Makefile ++++ b/util/pmh7tool/Makefile +@@ -1,7 +1,7 @@ + ## SPDX-License-Identifier: GPL-2.0-only + + CC = gcc +-CFLAGS = -O2 -Wall -Wextra -Werror ++CFLAGS = -O2 -Wall -Wextra + PROGRAM = pmh7tool + INSTALL = /usr/bin/env install + PREFIX = /usr/local +diff --git a/util/superiotool/Makefile b/util/superiotool/Makefile +index 2dcfc9e929..2aad3b92e5 100644 +--- a/util/superiotool/Makefile ++++ b/util/superiotool/Makefile +@@ -12,7 +12,7 @@ PREFIX ?= /usr/local + VERSION := -D'SUPERIOTOOL_VERSION="$(shell git describe 2>/dev/null)"' + + CFLAGS += -O2 -Wall -Wstrict-prototypes -Wundef -Wstrict-aliasing \ +- -Werror-implicit-function-declaration -std=c11 -pedantic $(VERSION) \ ++ -implicit-function-declaration -std=c11 -pedantic $(VERSION) \ + -Wno-variadic-macros -I $(TOP)/src/commonlib/bsd/include + LDFLAGS += -lz + +@@ -24,8 +24,8 @@ ifeq ($(OS_ARCH), Darwin) + LIBS = -framework IOKit -framework DirectHW -lpci -lz + endif + ifeq ($(OS_ARCH), FreeBSD) +-CFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -Wundef -Wstrict-aliasing \ +- -Werror-implicit-function-declaration -std=c11 $(VERSION) \ ++CFLAGS = -O2 -Wall -Wstrict-prototypes -Wundef -Wstrict-aliasing \ ++ -implicit-function-declaration -std=c11 $(VERSION) \ + -I/usr/local/include + LDFLAGS += -L/usr/local/lib + LIBS = -lz +diff --git a/util/uio_usbdebug/Makefile b/util/uio_usbdebug/Makefile +index af1cc8e1ec..8a3603c41d 100644 +--- a/util/uio_usbdebug/Makefile ++++ b/util/uio_usbdebug/Makefile +@@ -30,7 +30,7 @@ KCONFIG_H := ../../src/include/kconfig.h + + CFLAGS += \ + -m32 -g \ +- -Wall -Wextra -Werror \ ++ -Wall -Wextra \ + -Wno-unused-parameter -Wno-error=sign-compare + CPPFLAGS += \ + -Iinclude/ \ +diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile +index f88da69306..02d134c8e8 100755 +--- a/util/xcompile/xcompile ++++ b/util/xcompile/xcompile +@@ -124,7 +124,7 @@ testcc() { + local tmp_o="$TMPFILE.o" + rm -f "$tmp_c" "$tmp_o" + echo "void _start(void) {}" >"$tmp_c" +- "$cc" -nostdlib -Werror $cflags -c "$tmp_c" -o "$tmp_o" >/dev/null 2>&1 ++ "$cc" -nostdlib $cflags -c "$tmp_c" -o "$tmp_o" >/dev/null 2>&1 + } + + testld() { +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0004-Remove-KCONFIG_WERROR.patch b/config/module/edk2/default/patches/0004-Remove-KCONFIG_WERROR.patch new file mode 100644 index 00000000..04038189 --- /dev/null +++ b/config/module/edk2/default/patches/0004-Remove-KCONFIG_WERROR.patch @@ -0,0 +1,94 @@ +From 2676e5c95bb583db83cadb932a82977c8cdb2c20 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Mon, 21 Sep 2026 11:20:54 +0100 +Subject: [PATCH 4/9] Remove KCONFIG_WERROR + +Signed-off-by: Leah Rowe +--- + Documentation/getting_started/kconfig.md | 3 --- + Makefile | 4 ---- + util/kconfig/Makefile | 4 ---- + util/kconfig/confdata.c | 2 -- + util/kconfig/symbol.c | 2 -- + 5 files changed, 15 deletions(-) + +diff --git a/Documentation/getting_started/kconfig.md b/Documentation/getting_started/kconfig.md +index 2917c53aae..6c4102ba17 100644 +--- a/Documentation/getting_started/kconfig.md ++++ b/Documentation/getting_started/kconfig.md +@@ -99,9 +99,6 @@ included in the Linux version. + - KCONFIG_SPLITCONFIG=”directory name for individual SYMBOL.h files”. + coreboot sets this to $(obj)/config. + +-- KCONFIG_WERROR=value. Define to enable warnings as errors. This is enabled +- in coreboot, and should not be changed. +- + #### Used only for ‘make menuconfig’ + - MENUCONFIG_MODE=single_menu. Set to "single_menu" to enable. All other + values disable the option. This makes submenus appear below the menu option +diff --git a/Makefile b/Makefile +index 6a36b5968f..35576f3734 100644 +--- a/Makefile ++++ b/Makefile +@@ -31,7 +31,6 @@ KCONFIG_DEPENDENCIES := $(obj)/auto.conf.cmd + KCONFIG_SPLITCONFIG := $(obj)/config/ + KCONFIG_TRISTATE := $(obj)/tristate.conf + KCONFIG_NEGATIVES := 1 +-KCONFIG_WERROR := 1 + KCONFIG_WARN_UNKNOWN_SYMBOLS := 1 + KCONFIG_PACKAGE := CB.Config + KCONFIG_MAKEFILE_REAL ?= $(objk)/Makefile.real +@@ -39,9 +38,6 @@ KCONFIG_MAKEFILE_REAL ?= $(objk)/Makefile.real + COREBOOT_EXPORTS += KCONFIG_CONFIG KCONFIG_AUTOHEADER KCONFIG_AUTOCONFIG + COREBOOT_EXPORTS += KCONFIG_DEPENDENCIES KCONFIG_SPLITCONFIG KCONFIG_TRISTATE + COREBOOT_EXPORTS += KCONFIG_NEGATIVES +-ifeq ($(filter %config,$(MAKECMDGOALS)),) +-COREBOOT_EXPORTS += KCONFIG_WERROR +-endif + COREBOOT_EXPORTS += KCONFIG_WARN_UNKNOWN_SYMBOLS + COREBOOT_EXPORTS += KCONFIG_AUTOADS KCONFIG_PACKAGE + COREBOOT_EXPORTS += KCONFIG_RUSTCCFG +diff --git a/util/kconfig/Makefile b/util/kconfig/Makefile +index 76cc2c5e2c..45366936fc 100644 +--- a/util/kconfig/Makefile ++++ b/util/kconfig/Makefile +@@ -31,10 +31,6 @@ ifneq ($(findstring c, $(KBUILD_EXTRA_WARN)),) + export KCONFIG_WARN_UNKNOWN_SYMBOLS=1 + endif + +-ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),) +-export KCONFIG_WERROR=1 +-endif +- + # We need this, in case the user has it in its environment + unexport CONFIG_ + +diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c +index ae6ae2b3d3..fa09647f44 100644 +--- a/util/kconfig/confdata.c ++++ b/util/kconfig/confdata.c +@@ -157,8 +157,6 @@ static int conf_lineno, conf_warnings; + + bool conf_errors(void) + { +- if (conf_warnings) +- return getenv("KCONFIG_WERROR"); + return false; + } + +diff --git a/util/kconfig/symbol.c b/util/kconfig/symbol.c +index 3afe5be2d4..1a24d458cb 100644 +--- a/util/kconfig/symbol.c ++++ b/util/kconfig/symbol.c +@@ -317,8 +317,6 @@ static void sym_warn_unmet_dep(struct symbol *sym) + + bool sym_dep_errors(void) + { +- if (sym_warnings) +- return getenv("KCONFIG_WERROR"); + return false; + } + +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0006-don-t-delete-edk2.patch b/config/module/edk2/default/patches/0006-don-t-delete-edk2.patch new file mode 100644 index 00000000..74272902 --- /dev/null +++ b/config/module/edk2/default/patches/0006-don-t-delete-edk2.patch @@ -0,0 +1,28 @@ +From d952ebf5ff9ef68424cc1c85b4e2adfabebdb24e Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Tue, 22 Sep 2026 08:01:01 +0100 +Subject: [PATCH 6/9] don't delete edk2 + +Signed-off-by: Leah Rowe +--- + payloads/external/edk2/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile +index 75b7f7983d..05df683fed 100644 +--- a/payloads/external/edk2/Makefile ++++ b/payloads/external/edk2/Makefile +@@ -424,8 +424,8 @@ UniversalPayload: $(WORKSPACE)/Build/UefiPayloadPkgIA32/UniversalPayload.fit + clean: + test -d $(WORKSPACE) && (cd $(WORKSPACE); rm -rf Build; rm -f Conf/tools_def.txt Conf/CapsuleFmpPkcs7Pcd.inc) || exit 0 + +-distclean: +- rm -rf $(WORKSPACE) ++distclean: clean ++ : + + .PHONY: $(EDK2_PATH) checktools logo UefiPayloadPkg UniversalPayload clean distclean + +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0007-don-t-delete-build.patch b/config/module/edk2/default/patches/0007-don-t-delete-build.patch new file mode 100644 index 00000000..fa320332 --- /dev/null +++ b/config/module/edk2/default/patches/0007-don-t-delete-build.patch @@ -0,0 +1,38 @@ +From 8227a6b08675fbd31bcee9b9143a73dd75be813e Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Tue, 22 Sep 2026 08:56:32 +0100 +Subject: [PATCH 7/9] don't delete build + +lbmk build.list needs to be able to copy this + +it also means that we will then have the ability +to quickly re-use old build artifacts on re-build. + +this is a highly experimental edk2 integration in +lbmk. when i implement it properly, lbmk will have +its own logic for everything, without relying on +the coreboot build system. i'm only doing it this +way for now as a proof of concept, to show that +edk2 can work in libreboot. + +Signed-off-by: Leah Rowe +--- + payloads/external/edk2/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile +index 05df683fed..948169d74a 100644 +--- a/payloads/external/edk2/Makefile ++++ b/payloads/external/edk2/Makefile +@@ -422,7 +422,7 @@ UniversalPayload: $(WORKSPACE)/Build/UefiPayloadPkgIA32/UniversalPayload.fit + $(EDK2_UNIVERSAL_PAYLOAD_OUT) + + clean: +- test -d $(WORKSPACE) && (cd $(WORKSPACE); rm -rf Build; rm -f Conf/tools_def.txt Conf/CapsuleFmpPkcs7Pcd.inc) || exit 0 ++ test -d $(WORKSPACE) && (cd $(WORKSPACE); rm -f Conf/tools_def.txt Conf/CapsuleFmpPkcs7Pcd.inc) || exit 0 + + distclean: clean + : +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0008-copy-edk2-don-t-move-it.patch b/config/module/edk2/default/patches/0008-copy-edk2-don-t-move-it.patch new file mode 100644 index 00000000..6a5e9afa --- /dev/null +++ b/config/module/edk2/default/patches/0008-copy-edk2-don-t-move-it.patch @@ -0,0 +1,34 @@ +From da0ea93d3ba5e749380ea27f7c015ec8e4c32479 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Tue, 22 Sep 2026 09:15:38 +0100 +Subject: [PATCH 8/9] copy edk2, don't move it + +then we will have it in build.list for lbmk + +Signed-off-by: Leah Rowe +--- + payloads/external/edk2/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile +index 948169d74a..d6f3d98001 100644 +--- a/payloads/external/edk2/Makefile ++++ b/payloads/external/edk2/Makefile +@@ -413,12 +413,12 @@ $(WORKSPACE)/Build/UefiPayloadPkgIA32/UniversalPayload.fit: \ + + UefiPayloadPkg: $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_GCC/FV/UEFIPAYLOAD.fd + mkdir -p $(dir $(EDK2_UEFIPAYLOAD_OUT)) +- mv $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_GCC/FV/UEFIPAYLOAD.fd \ ++ cp $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_GCC/FV/UEFIPAYLOAD.fd \ + $(EDK2_UEFIPAYLOAD_OUT) + + UniversalPayload: $(WORKSPACE)/Build/UefiPayloadPkgIA32/UniversalPayload.fit + mkdir -p $(dir $(EDK2_UNIVERSAL_PAYLOAD_OUT)) +- mv $(WORKSPACE)/Build/UefiPayloadPkgIA32/UniversalPayload.fit \ ++ cp $(WORKSPACE)/Build/UefiPayloadPkgIA32/UniversalPayload.fit \ + $(EDK2_UNIVERSAL_PAYLOAD_OUT) + + clean: +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0009-move-crossgcc-to-crossgcc_orig-and-symlink.patch b/config/module/edk2/default/patches/0009-move-crossgcc-to-crossgcc_orig-and-symlink.patch new file mode 100644 index 00000000..ba744512 --- /dev/null +++ b/config/module/edk2/default/patches/0009-move-crossgcc-to-crossgcc_orig-and-symlink.patch @@ -0,0 +1,215 @@ +From b346f014103c88b9f2cf2a439c6156a4b0e699f1 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Tue, 22 Sep 2026 09:17:41 +0100 +Subject: [PATCH 9/9] move crossgcc to crossgcc_orig, and symlink + +make a symlink for crossgcc/ for us to re-use +from libreboot. + +this patch will have to be maintained according +to whatever xarch is set to in edk2 lbmk, but +it will probably always be default, and thus +this patch will always be correct. + +Signed-off-by: Leah Rowe +--- + util/crossgcc | 1 + + util/crossgcc/tarballs/.empty | 0 + util/{crossgcc => crossgcc_orig}/.gitignore | 0 + util/{crossgcc => crossgcc_orig}/Makefile | 0 + util/{crossgcc => crossgcc_orig}/Makefile.mk | 0 + util/{crossgcc => crossgcc_orig}/README | 0 + util/{crossgcc => crossgcc_orig}/buildgcc | 0 + util/{crossgcc => crossgcc_orig}/description.md | 0 + util/{crossgcc => crossgcc_orig}/edk2tools.txt | 0 + util/{crossgcc => crossgcc_orig}/getopt.c | 0 + .../patches/acpica-unix-20251212_iasl.patch | 0 + .../patches/binutils-2.46.1_as-ipxe.patch | 0 + .../patches/binutils-2.46.1_no-makeinfo.patch | 0 + .../patches/gcc-15.2.0_asan_shadow_offset_callback.patch | 0 + util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_gnat.patch | 0 + .../{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_libcody.patch | 0 + util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_libcpp.patch | 0 + util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_libgcc.patch | 0 + .../patches/gcc-15.2.0_musl_poisoned_calloc.patch | 0 + .../patches/gcc-15.2.0_rv32iafc.patch | 0 + .../patches/gmp-6.3.0_fix-c23-prototypes.patch | 0 + .../patches/gmp-6.3.0_generic-build.patch | 0 + ...rc_clang-add-x86_64-baremetal-triple-include-search-pat.patch | 0 + .../sum/acpica-unix-20251212.tar.gz.cksum | 0 + .../{crossgcc => crossgcc_orig}/sum/binutils-2.46.1.tar.xz.cksum | 0 + util/{crossgcc => crossgcc_orig}/sum/cmake-4.3.4.tar.gz.cksum | 0 + util/{crossgcc => crossgcc_orig}/sum/gcc-15.2.0.tar.xz.cksum | 0 + util/{crossgcc => crossgcc_orig}/sum/gmp-6.3.0.tar.xz.cksum | 0 + .../sum/llvm-project-22.1.8.src.tar.xz.cksum | 0 + util/{crossgcc => crossgcc_orig}/sum/mpc-1.4.1.tar.xz.cksum | 0 + util/{crossgcc => crossgcc_orig}/sum/mpfr-4.2.2.tar.xz.cksum | 0 + util/{crossgcc => crossgcc_orig}/sum/nasm-3.02.tar.bz2.cksum | 0 + 32 files changed, 1 insertion(+) + create mode 120000 util/crossgcc + delete mode 100644 util/crossgcc/tarballs/.empty + rename util/{crossgcc => crossgcc_orig}/.gitignore (100%) + rename util/{crossgcc => crossgcc_orig}/Makefile (100%) + rename util/{crossgcc => crossgcc_orig}/Makefile.mk (100%) + rename util/{crossgcc => crossgcc_orig}/README (100%) + rename util/{crossgcc => crossgcc_orig}/buildgcc (100%) + rename util/{crossgcc => crossgcc_orig}/description.md (100%) + rename util/{crossgcc => crossgcc_orig}/edk2tools.txt (100%) + rename util/{crossgcc => crossgcc_orig}/getopt.c (100%) + rename util/{crossgcc => crossgcc_orig}/patches/acpica-unix-20251212_iasl.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/binutils-2.46.1_as-ipxe.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/binutils-2.46.1_no-makeinfo.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_asan_shadow_offset_callback.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_gnat.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_libcody.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_libcpp.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_libgcc.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_musl_poisoned_calloc.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gcc-15.2.0_rv32iafc.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gmp-6.3.0_fix-c23-prototypes.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/gmp-6.3.0_generic-build.patch (100%) + rename util/{crossgcc => crossgcc_orig}/patches/llvm-project-22.1.8.src_clang-add-x86_64-baremetal-triple-include-search-pat.patch (100%) + rename util/{crossgcc => crossgcc_orig}/sum/acpica-unix-20251212.tar.gz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/binutils-2.46.1.tar.xz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/cmake-4.3.4.tar.gz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/gcc-15.2.0.tar.xz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/gmp-6.3.0.tar.xz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/llvm-project-22.1.8.src.tar.xz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/mpc-1.4.1.tar.xz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/mpfr-4.2.2.tar.xz.cksum (100%) + rename util/{crossgcc => crossgcc_orig}/sum/nasm-3.02.tar.bz2.cksum (100%) + +diff --git a/util/crossgcc b/util/crossgcc +new file mode 120000 +index 0000000000..9a648d35f7 +--- /dev/null ++++ b/util/crossgcc +@@ -0,0 +1 @@ ++../../../coreboot/default/util/crossgcc/ +\ No newline at end of file +diff --git a/util/crossgcc/tarballs/.empty b/util/crossgcc/tarballs/.empty +deleted file mode 100644 +index e69de29bb2..0000000000 +diff --git a/util/crossgcc/.gitignore b/util/crossgcc_orig/.gitignore +similarity index 100% +rename from util/crossgcc/.gitignore +rename to util/crossgcc_orig/.gitignore +diff --git a/util/crossgcc/Makefile b/util/crossgcc_orig/Makefile +similarity index 100% +rename from util/crossgcc/Makefile +rename to util/crossgcc_orig/Makefile +diff --git a/util/crossgcc/Makefile.mk b/util/crossgcc_orig/Makefile.mk +similarity index 100% +rename from util/crossgcc/Makefile.mk +rename to util/crossgcc_orig/Makefile.mk +diff --git a/util/crossgcc/README b/util/crossgcc_orig/README +similarity index 100% +rename from util/crossgcc/README +rename to util/crossgcc_orig/README +diff --git a/util/crossgcc/buildgcc b/util/crossgcc_orig/buildgcc +similarity index 100% +rename from util/crossgcc/buildgcc +rename to util/crossgcc_orig/buildgcc +diff --git a/util/crossgcc/description.md b/util/crossgcc_orig/description.md +similarity index 100% +rename from util/crossgcc/description.md +rename to util/crossgcc_orig/description.md +diff --git a/util/crossgcc/edk2tools.txt b/util/crossgcc_orig/edk2tools.txt +similarity index 100% +rename from util/crossgcc/edk2tools.txt +rename to util/crossgcc_orig/edk2tools.txt +diff --git a/util/crossgcc/getopt.c b/util/crossgcc_orig/getopt.c +similarity index 100% +rename from util/crossgcc/getopt.c +rename to util/crossgcc_orig/getopt.c +diff --git a/util/crossgcc/patches/acpica-unix-20251212_iasl.patch b/util/crossgcc_orig/patches/acpica-unix-20251212_iasl.patch +similarity index 100% +rename from util/crossgcc/patches/acpica-unix-20251212_iasl.patch +rename to util/crossgcc_orig/patches/acpica-unix-20251212_iasl.patch +diff --git a/util/crossgcc/patches/binutils-2.46.1_as-ipxe.patch b/util/crossgcc_orig/patches/binutils-2.46.1_as-ipxe.patch +similarity index 100% +rename from util/crossgcc/patches/binutils-2.46.1_as-ipxe.patch +rename to util/crossgcc_orig/patches/binutils-2.46.1_as-ipxe.patch +diff --git a/util/crossgcc/patches/binutils-2.46.1_no-makeinfo.patch b/util/crossgcc_orig/patches/binutils-2.46.1_no-makeinfo.patch +similarity index 100% +rename from util/crossgcc/patches/binutils-2.46.1_no-makeinfo.patch +rename to util/crossgcc_orig/patches/binutils-2.46.1_no-makeinfo.patch +diff --git a/util/crossgcc/patches/gcc-15.2.0_asan_shadow_offset_callback.patch b/util/crossgcc_orig/patches/gcc-15.2.0_asan_shadow_offset_callback.patch +similarity index 100% +rename from util/crossgcc/patches/gcc-15.2.0_asan_shadow_offset_callback.patch +rename to util/crossgcc_orig/patches/gcc-15.2.0_asan_shadow_offset_callback.patch +diff --git a/util/crossgcc/patches/gcc-15.2.0_gnat.patch b/util/crossgcc_orig/patches/gcc-15.2.0_gnat.patch +similarity index 100% +rename from util/crossgcc/patches/gcc-15.2.0_gnat.patch +rename to util/crossgcc_orig/patches/gcc-15.2.0_gnat.patch +diff --git a/util/crossgcc/patches/gcc-15.2.0_libcody.patch b/util/crossgcc_orig/patches/gcc-15.2.0_libcody.patch +similarity index 100% +rename from util/crossgcc/patches/gcc-15.2.0_libcody.patch +rename to util/crossgcc_orig/patches/gcc-15.2.0_libcody.patch +diff --git a/util/crossgcc/patches/gcc-15.2.0_libcpp.patch b/util/crossgcc_orig/patches/gcc-15.2.0_libcpp.patch +similarity index 100% +rename from util/crossgcc/patches/gcc-15.2.0_libcpp.patch +rename to util/crossgcc_orig/patches/gcc-15.2.0_libcpp.patch +diff --git a/util/crossgcc/patches/gcc-15.2.0_libgcc.patch b/util/crossgcc_orig/patches/gcc-15.2.0_libgcc.patch +similarity index 100% +rename from util/crossgcc/patches/gcc-15.2.0_libgcc.patch +rename to util/crossgcc_orig/patches/gcc-15.2.0_libgcc.patch +diff --git a/util/crossgcc/patches/gcc-15.2.0_musl_poisoned_calloc.patch b/util/crossgcc_orig/patches/gcc-15.2.0_musl_poisoned_calloc.patch +similarity index 100% +rename from util/crossgcc/patches/gcc-15.2.0_musl_poisoned_calloc.patch +rename to util/crossgcc_orig/patches/gcc-15.2.0_musl_poisoned_calloc.patch +diff --git a/util/crossgcc/patches/gcc-15.2.0_rv32iafc.patch b/util/crossgcc_orig/patches/gcc-15.2.0_rv32iafc.patch +similarity index 100% +rename from util/crossgcc/patches/gcc-15.2.0_rv32iafc.patch +rename to util/crossgcc_orig/patches/gcc-15.2.0_rv32iafc.patch +diff --git a/util/crossgcc/patches/gmp-6.3.0_fix-c23-prototypes.patch b/util/crossgcc_orig/patches/gmp-6.3.0_fix-c23-prototypes.patch +similarity index 100% +rename from util/crossgcc/patches/gmp-6.3.0_fix-c23-prototypes.patch +rename to util/crossgcc_orig/patches/gmp-6.3.0_fix-c23-prototypes.patch +diff --git a/util/crossgcc/patches/gmp-6.3.0_generic-build.patch b/util/crossgcc_orig/patches/gmp-6.3.0_generic-build.patch +similarity index 100% +rename from util/crossgcc/patches/gmp-6.3.0_generic-build.patch +rename to util/crossgcc_orig/patches/gmp-6.3.0_generic-build.patch +diff --git a/util/crossgcc/patches/llvm-project-22.1.8.src_clang-add-x86_64-baremetal-triple-include-search-pat.patch b/util/crossgcc_orig/patches/llvm-project-22.1.8.src_clang-add-x86_64-baremetal-triple-include-search-pat.patch +similarity index 100% +rename from util/crossgcc/patches/llvm-project-22.1.8.src_clang-add-x86_64-baremetal-triple-include-search-pat.patch +rename to util/crossgcc_orig/patches/llvm-project-22.1.8.src_clang-add-x86_64-baremetal-triple-include-search-pat.patch +diff --git a/util/crossgcc/sum/acpica-unix-20251212.tar.gz.cksum b/util/crossgcc_orig/sum/acpica-unix-20251212.tar.gz.cksum +similarity index 100% +rename from util/crossgcc/sum/acpica-unix-20251212.tar.gz.cksum +rename to util/crossgcc_orig/sum/acpica-unix-20251212.tar.gz.cksum +diff --git a/util/crossgcc/sum/binutils-2.46.1.tar.xz.cksum b/util/crossgcc_orig/sum/binutils-2.46.1.tar.xz.cksum +similarity index 100% +rename from util/crossgcc/sum/binutils-2.46.1.tar.xz.cksum +rename to util/crossgcc_orig/sum/binutils-2.46.1.tar.xz.cksum +diff --git a/util/crossgcc/sum/cmake-4.3.4.tar.gz.cksum b/util/crossgcc_orig/sum/cmake-4.3.4.tar.gz.cksum +similarity index 100% +rename from util/crossgcc/sum/cmake-4.3.4.tar.gz.cksum +rename to util/crossgcc_orig/sum/cmake-4.3.4.tar.gz.cksum +diff --git a/util/crossgcc/sum/gcc-15.2.0.tar.xz.cksum b/util/crossgcc_orig/sum/gcc-15.2.0.tar.xz.cksum +similarity index 100% +rename from util/crossgcc/sum/gcc-15.2.0.tar.xz.cksum +rename to util/crossgcc_orig/sum/gcc-15.2.0.tar.xz.cksum +diff --git a/util/crossgcc/sum/gmp-6.3.0.tar.xz.cksum b/util/crossgcc_orig/sum/gmp-6.3.0.tar.xz.cksum +similarity index 100% +rename from util/crossgcc/sum/gmp-6.3.0.tar.xz.cksum +rename to util/crossgcc_orig/sum/gmp-6.3.0.tar.xz.cksum +diff --git a/util/crossgcc/sum/llvm-project-22.1.8.src.tar.xz.cksum b/util/crossgcc_orig/sum/llvm-project-22.1.8.src.tar.xz.cksum +similarity index 100% +rename from util/crossgcc/sum/llvm-project-22.1.8.src.tar.xz.cksum +rename to util/crossgcc_orig/sum/llvm-project-22.1.8.src.tar.xz.cksum +diff --git a/util/crossgcc/sum/mpc-1.4.1.tar.xz.cksum b/util/crossgcc_orig/sum/mpc-1.4.1.tar.xz.cksum +similarity index 100% +rename from util/crossgcc/sum/mpc-1.4.1.tar.xz.cksum +rename to util/crossgcc_orig/sum/mpc-1.4.1.tar.xz.cksum +diff --git a/util/crossgcc/sum/mpfr-4.2.2.tar.xz.cksum b/util/crossgcc_orig/sum/mpfr-4.2.2.tar.xz.cksum +similarity index 100% +rename from util/crossgcc/sum/mpfr-4.2.2.tar.xz.cksum +rename to util/crossgcc_orig/sum/mpfr-4.2.2.tar.xz.cksum +diff --git a/util/crossgcc/sum/nasm-3.02.tar.bz2.cksum b/util/crossgcc_orig/sum/nasm-3.02.tar.bz2.cksum +similarity index 100% +rename from util/crossgcc/sum/nasm-3.02.tar.bz2.cksum +rename to util/crossgcc_orig/sum/nasm-3.02.tar.bz2.cksum +-- +2.47.3 + diff --git a/config/module/edk2/default/patches/0053-use-std-gnu2x.patch b/config/module/edk2/default/patches/0053-use-std-gnu2x.patch new file mode 100644 index 00000000..a1e437b8 --- /dev/null +++ b/config/module/edk2/default/patches/0053-use-std-gnu2x.patch @@ -0,0 +1,156 @@ +From 47a2305433ea6b123ef6baf65f496b4583e198da Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Mon, 21 Sep 2026 13:00:09 +0100 +Subject: [PATCH 53/56] use -std=gnu2x +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +equiv to gnu23 in practise, and fixes a build error +for a user who reported: + +cc: error: unrecognized command-line option ‘-std=gnu23’; did you mean ‘-std=gnu2x’? + +when building coreboot utils + +gnu2x is gnu23 in practise, on both gcc and clang. +we can just use this, and it won't break systems +that worked. + +the user did not say what compiler and compiler version +they were using (cbutils are built using hostcc in lbmk) + +Signed-off-by: Leah Rowe +--- + Makefile.mk | 2 +- + payloads/libpayload/Makefile | 2 +- + tests/Makefile.common | 2 +- + util/amdfwtool/Makefile.mk | 2 +- + util/cbfstool/Makefile.mk | 2 +- + util/cbmem/Makefile | 2 +- + util/ifdtool/Makefile.mk | 2 +- + util/sconfig/Makefile.mk | 2 +- + util/supermicro/Makefile.mk | 2 +- + 13 files changed, 599 insertions(+), 9 deletions(-) + +diff --git a/Makefile.mk b/Makefile.mk +index 2c39d3d632..12e2368a8f 100644 +--- a/Makefile.mk ++++ b/Makefile.mk +@@ -530,7 +530,7 @@ endif + CFLAGS_common += -pipe + CFLAGS_common += -g + CFLAGS_common += -nostdinc +-CFLAGS_common += -std=gnu23 ++CFLAGS_common += -std=gnu2x + CFLAGS_common += -nostdlib + CFLAGS_common += -Wall + CFLAGS_common += -Wundef +diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile +index 29c3fb199f..bb7c6f600f 100644 +--- a/payloads/libpayload/Makefile ++++ b/payloads/libpayload/Makefile +@@ -218,7 +218,7 @@ STRIP := $(STRIP_$(ARCH-y)) + AR := $(AR_$(ARCH-y)) + endif + +-CFLAGS += -std=gnu23 $(CFLAGS_$(ARCH-y)) ++CFLAGS += -std=gnu2x $(CFLAGS_$(ARCH-y)) + + ifeq ($(CONFIG_LP_COMPILER_LLVM_CLANG),y) + CC:=clang +diff --git a/tests/Makefile.common b/tests/Makefile.common +index c35e312a79..5c6f8ff798 100644 +--- a/tests/Makefile.common ++++ b/tests/Makefile.common +@@ -51,7 +51,7 @@ TEST_CFLAGS += -Wno-unknown-warning-option -Wno-source-mgr -Wno-main-return-type + TEST_CFLAGS += -Wno-array-compare -Wno-trigraphs + TEST_CFLAGS += -Wno-unused-but-set-variables + +-TEST_CFLAGS += -std=gnu23 -ffunction-sections -fdata-sections -fno-builtin ++TEST_CFLAGS += -std=gnu2x -ffunction-sections -fdata-sections -fno-builtin + + ifneq ($(filter-out 0,$(DEBUG)),) + TEST_CFLAGS += -Og -ggdb3 +diff --git a/util/amdfwtool/Makefile.mk b/util/amdfwtool/Makefile.mk +index f7dce01b71..ac09d083cf 100644 +--- a/util/amdfwtool/Makefile.mk ++++ b/util/amdfwtool/Makefile.mk +@@ -11,7 +11,7 @@ AMDFWTOOLCFLAGS :=-O2 -Wall -Wextra -Wshadow $(WERROR) + AMDFWTOOLCFLAGS += -I $(top)/src/commonlib/bsd/include + AMDFWTOOLCFLAGS += -I $(top)/src/ + AMDFWTOOLCFLAGS += -D_GNU_SOURCE # memmem() from string.h +-AMDFWTOOLCFLAGS += -std=gnu23 ++AMDFWTOOLCFLAGS += -std=gnu2x + AMDFWTOOLCFLAGS += -ffunction-sections -fdata-sections + + ifneq ($(PKG_CONFIG),) +diff --git a/util/cbfstool/Makefile.mk b/util/cbfstool/Makefile.mk +index d195e4713a..75e8f1797f 100644 +--- a/util/cbfstool/Makefile.mk ++++ b/util/cbfstool/Makefile.mk +@@ -175,7 +175,7 @@ HOSTCFLAGS += -fms-extensions + TOOLCFLAGS += -mno-ms-bitfields + endif + ifeq ($(shell uname -o 2>/dev/null), Cygwin) +-TOOLCFLAGS+=-std=gnu23 ++TOOLCFLAGS+=-std=gnu2x + TOOLCPPFLAGS+=-D_GNU_SOURCE + else + TOOLCFLAGS+=-std=c11 +diff --git a/util/cbmem/Makefile b/util/cbmem/Makefile +index fe2891be6d..bb305cee77 100644 +--- a/util/cbmem/Makefile ++++ b/util/cbmem/Makefile +@@ -11,7 +11,7 @@ PREFIX ?= /usr/local + CFLAGS ?= -O2 + WERROR= + CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wshadow $(WERROR) +-CFLAGS += -std=gnu23 ++CFLAGS += -std=gnu2x + CPPFLAGS += -I . -I $(ROOT)/commonlib/include -I $(ROOT)/commonlib/bsd/include + CPPFLAGS += -include $(ROOT)/commonlib/bsd/include/commonlib/bsd/compiler.h + +diff --git a/util/ifdtool/Makefile.mk b/util/ifdtool/Makefile.mk +index 57d192ccb8..58bec4739c 100644 +--- a/util/ifdtool/Makefile.mk ++++ b/util/ifdtool/Makefile.mk +@@ -7,7 +7,7 @@ IFDTOOLCFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/inclu + IFDTOOLCFLAGS += -I$(top)/util/cbfstool/flashmap + IFDTOOLCFLAGS += -include $(top)/src/commonlib/bsd/include/commonlib/bsd/compiler.h + IFDTOOLCFLAGS += -D_DEFAULT_SOURCE # for endianness converting functions +-IFDTOOLCFLAGS += -std=gnu23 ++IFDTOOLCFLAGS += -std=gnu2x + + $(objutil)/ifdtool/%.o: $(top)/util/ifdtool/%.c + $(HOSTCC) $(IFDTOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $< +diff --git a/util/sconfig/Makefile.mk b/util/sconfig/Makefile.mk +index 9dcf5b5c71..cda1d81223 100644 +--- a/util/sconfig/Makefile.mk ++++ b/util/sconfig/Makefile.mk +@@ -6,7 +6,7 @@ sconfigobj += main.o + + SCONFIGFLAGS += -I$(top)/util/sconfig -I$(objutil)/sconfig + SCONFIGFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/include +-SCONFIGFLAGS += -std=gnu23 ++SCONFIGFLAGS += -std=gnu2x + + $(objutil)/sconfig: + mkdir -p $@ +diff --git a/util/supermicro/Makefile.mk b/util/supermicro/Makefile.mk +index f627b854bd..f5e0d7012c 100644 +--- a/util/supermicro/Makefile.mk ++++ b/util/supermicro/Makefile.mk +@@ -6,7 +6,7 @@ SMCBIOSINFOTOOL:= $(objutil)/supermicro/smcbiosinfo + $(SMCBIOSINFOTOOL): $(dir)/smcbiosinfo/smcbiosinfo.c + printf " HOSTCC Creating SMCBIOSINFO tool\n" + mkdir -p $(objutil)/supermicro +- $(HOSTCC) -std=gnu23 $(TOOLCPPFLAGS) $< -o $@ ++ $(HOSTCC) -std=gnu2x $(TOOLCPPFLAGS) $< -o $@ + + ifeq ($(CONFIG_VENDOR_SUPERMICRO),y) + ifneq ($(call strip_quotes, $(CONFIG_SUPERMICRO_BOARDID)),) + +-- +2.47.3 + diff --git a/config/module/edk2/default/target.cfg b/config/module/edk2/default/target.cfg new file mode 100644 index 00000000..0fcde42a --- /dev/null +++ b/config/module/edk2/default/target.cfg @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +# can be overridden per-tree e.g. use mrchromebox +url="https://github.com/coreboot/coreboot.git" +bkup_url="https://review.coreboot.org/coreboot" + +makeargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" + +rev="8ce4c91c41da3f042979f92095149a85bc93227d" + +# edk2 in lbmk is actually coreboot, but with a fake board config +# that turns on edk2. coreboot is patched to never delete tianocore +# source code. + +# however, it is also patched not to download tianocore. we download +# it, using libreboot's submodules feature! for redundancy, and patching + +# this is a lazy way to do edk2 without integrating it into lbmk, which +# would bloat lbmk. coreboot already does all the magic, and matt maintains +# it. why reinvent matt's perfect wheel? + +# it costs about half a minute extra, to build one coreboot target, +# and then the build is used in bulk across boards. this is the leah +# way to do tianocore in your coreboot distribution. + +# yes. + +xarch="i386-elf" # hack. for building the fake coreboot target +# not a performance hurdle on releases, since we will also use +# that coreboot target, and thus we will use crossgcc there + +tree="default" + +# we will build crossgcc in here, +# with ours symlinking to it +fetch_depend="coreboot/default" + +# not stable yet for lbmk releases. +# tianocore payloads will be disabled +# in coreboot targets that use them, +# and coreboot targets that only use +# edk2 will have release=n as well +release="n" diff --git a/config/module/edk2/mrchromebox/config/libgfxinit_corebootfb b/config/module/edk2/mrchromebox/config/libgfxinit_corebootfb new file mode 100644 index 00000000..5991c06c --- /dev/null +++ b/config/module/edk2/mrchromebox/config/libgfxinit_corebootfb @@ -0,0 +1,13 @@ +CONFIG_USE_CBFS_FILE_OPTION_BACKEND=y +CONFIG_VENDOR_LENOVO=y +# CONFIG_NO_POST is not set +CONFIG_CBFS_SIZE=0xEEC000 +CONFIG_CONSOLE_SERIAL=y +CONFIG_USE_LEGACY_8254_TIMER=y +CONFIG_BOARD_LENOVO_T480=y +# CONFIG_FSP_HYPERTHREADING is not set +CONFIG_MEC1653_ENABLE_UART=y +# CONFIG_SMMSTORE is not set +# CONFIG_FSP_USE_REPO is not set +# CONFIG_TPM2 is not set +CONFIG_PAYLOAD_EDK2=y diff --git a/config/module/edk2/mrchromebox/target.cfg b/config/module/edk2/mrchromebox/target.cfg new file mode 100644 index 00000000..90b914d9 --- /dev/null +++ b/config/module/edk2/mrchromebox/target.cfg @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +# look inside default/ +# all the logic for this hack is in there! + +tree="default" -- cgit v1.2.1