From c5ed3fcc0a1436379f449d739198316c4d4fbd47 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jul 2026 13:36:24 -0400 Subject: [PATCH 1/7] Add some stuff to .gitignore This adds a few things to .gitignore: - vim and emacs temporary files - generated source files - our target object directories Signed-off-by: Peter Jones --- .gitignore | 8 ++++++++ lib/.gitignore | 1 + 2 files changed, 9 insertions(+) create mode 100644 lib/.gitignore diff --git a/.gitignore b/.gitignore index 7f79717f..188fde08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.sw? +*~ *.efi *.efi.debug *.o @@ -5,3 +7,9 @@ *.so *.tar.* *.tar +/aarch64/ +/arm/ +/ia32/ +/ia64/ +/mips64el/ +/x86_64/ diff --git a/lib/.gitignore b/lib/.gitignore new file mode 100644 index 00000000..eee4ded6 --- /dev/null +++ b/lib/.gitignore @@ -0,0 +1 @@ +ms_va_print.c From 8bef16fbd81727739986b3ff249cda1c8cc00727 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 20 May 2026 13:27:00 -0400 Subject: [PATCH 2/7] make: make it easier to specify optimization and debug flags This adds two new make variables, OPTIMIZATION_CFLAGS and DEBUG_CFLAGS, and moves the relevant compiler flags from EFI_CFLAGS into those variables. This makes it easier to align those options with applications using consuming this library. Signed-off-by: Peter Jones --- Make.defaults | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Make.defaults b/Make.defaults index cf7a88e7..6429bd24 100755 --- a/Make.defaults +++ b/Make.defaults @@ -270,12 +270,17 @@ ifeq ($(IS_MINGW32),) EFI_CFLAGS += -fPIC endif +OPTIMIZATION_CFLAGS ?= -O2 +DEBUG_CFLAGS ?= -g + ifeq ($(USING_FREEBSD),1) -EFI_CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Wstrict-prototypes -Werror \ +EFI_CFLAGS += $(ARCH3264) $(OPTIMIZATION_CFLAGS) $(DEBUG_CFLAGS) \ + -Wall -Wextra -Wstrict-prototypes -Werror \ -fno-strict-aliasing \ -ffreestanding -fno-stack-protector else -EFI_CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Wstrict-prototypes -Werror \ +EFI_CFLAGS += $(ARCH3264) $(OPTIMIZATION_CFLAGS) $(DEBUG_CFLAGS) \ + -Wall -Wextra -Wstrict-prototypes -Werror \ -fno-strict-aliasing \ -ffreestanding -fno-stack-protector \ $(if $(findstring 0,$(USING_CLANG)),-fno-merge-all-constants,) From 3f7cd908eaf7887992e554a973af3303f56b34c1 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 20 May 2026 13:23:15 -0400 Subject: [PATCH 3/7] x86_64: Enable building the entire library as EFIAPI. This adds a build variable, GNU_EFI_EXPORT_MS_ABI, that allows an application consuming gnu-efi to build the entire tree with -mabi=ms. This has numerous advantages, not least traceback handlers that expect that ABI will seamlessly walk the call stack from a faulting function all the way up into the firmware correctly. As an implementation detail, this changes the ABI of _entry() to effectively be EFIAPI, and as such on x86_64 that means _start has to call _entry() with those conventions. If it weren't for this detail we wouldn't actually need the GNU_EFI_EXPORT_MS_ABI variable, we could just pass -mabi=ms in to EFI_CFLAGS. Signed-off-by: Peter Jones --- Make.defaults | 3 +++ gnuefi/crt0-efi-x86_64.S | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/Make.defaults b/Make.defaults index 6429bd24..5b0c690a 100755 --- a/Make.defaults +++ b/Make.defaults @@ -180,6 +180,9 @@ EFI_CFLAGS += -std=c11 ifeq ($(ARCH),x86_64) ifeq ($(GCCNEWENOUGH),1) EFI_CFLAGS += -DGNU_EFI_USE_MS_ABI + ifeq ($(GNU_EFI_EXPORT_MS_ABI),1) + EFI_CFLAGS += -mabi=ms -DGNU_EFI_EXPORT_MS_ABI + endif ifneq ($(USING_CLANG),clang) EFI_CFLAGS += -maccumulate-outgoing-args endif diff --git a/gnuefi/crt0-efi-x86_64.S b/gnuefi/crt0-efi-x86_64.S index b393a18b..7ffd3166 100644 --- a/gnuefi/crt0-efi-x86_64.S +++ b/gnuefi/crt0-efi-x86_64.S @@ -40,6 +40,28 @@ .globl _start .type _start,%function _start: + +#if defined(GNU_EFI_EXPORT_MS_ABI) + pushq %rsi + movq %rdx, %rsi + pushq %rbx + movq %rcx, %rbx + movq %rdx, %r9 + movq %rcx, %r8 + subq $40, %rsp + + lea _DYNAMIC(%rip), %rdx + lea ImageBase(%rip), %rcx + call _relocate + + addq $40, %rsp + movq %rsi, %rdx + movq %rbx, %rcx + popq %rbx + popq %rsi + jmp _entry + nop +#else subq $8, %rsp pushq %rcx pushq %rdx @@ -59,6 +81,7 @@ _start: call _entry addq $8, %rsp +#endif .L_exit: ret From 7c96e4c41211ec06c92a1f509088532167a02c95 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jul 2026 14:16:35 -0400 Subject: [PATCH 4/7] Use -mabi=ms when ARCH=x64 This breaks out x86_64 and x64 as two separate arches, and treats x64 as the microsoft-defined 64-bit ABI and x86_64 as the system-v defined version. Signed-off-by: Peter Jones --- .gitignore | 1 + Make.defaults | 33 ++++++++++++++++++++++++++++----- Make.rules | 8 ++++++++ apps/Makefile | 10 +++++----- gnuefi/Makefile | 13 ++++++++----- lib/Makefile | 10 +++++----- 6 files changed, 55 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 188fde08..fbaa4dc9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /ia64/ /mips64el/ /x86_64/ +/x64/ diff --git a/Make.defaults b/Make.defaults index 5b0c690a..5bba4d07 100755 --- a/Make.defaults +++ b/Make.defaults @@ -113,9 +113,6 @@ ifeq ($(ARCH),amd64) endif # Allow UEFI shorthands to be specified for the arch -ifeq ($(ARCH),x64) - override ARCH := x86_64 -endif ifeq ($(ARCH),mips64) override ARCH := mips64el endif @@ -141,6 +138,17 @@ GCCNEWENOUGH := $(shell ( [ $(GCCVERSION) -gt "4" ] \ && [ $(GCCMINOR) -ge "7" ] ) ) \ && echo 1) +# +# if we don't supprt -mabi=ms, the user definitely wants the old UEFI shorthand +# name behavior for ARCH=x64 +# +ifeq ($(GCCNEWENOUGH),0) + ifeq ($(ARCH),x64) + override ARCH := x86_64 + endif +endif +SRC_ARCH=$(ARCH) + PART_ONE = $(shell echo "$(1)" | cut -f1 -d.) PART_TWO = $(shell echo "$(1)" | cut -f2 -d.) @@ -159,7 +167,7 @@ OBJDIR := $(TOPDIR)/$(ARCH) # # Arch-specific compilation flags -EFI_CFLAGS += -DCONFIG_$(ARCH) +EFI_CFLAGS += -DCONFIG_$(SRC_ARCH) EFI_CFLAGS += -Wno-error=pragmas @@ -193,8 +201,23 @@ ifeq ($(ARCH),x86_64) ARCH3264 = -m64 endif endif +ifeq ($(ARCH),x64) + ifeq ($(GCCNEWENOUGH),0) + $(error this needs newer gcc) + endif + EFI_CFLAGS += -DGNU_EFI_USE_MS_ABI -mabi=ms -DGNU_EFI_EXPORT_MS_ABI + ifneq ($(USING_CLANG),clang) + EFI_CFLAGS += -maccumulate-outgoing-args + endif + + EFI_CFLAGS += -mno-red-zone + ifeq ($(HOSTARCH),ia32) + ARCH3264 = -m64 + endif + SRC_ARCH=x86_64 +endif -ifneq (,$(filter $(ARCH),ia32 x86_64)) +ifneq (,$(filter $(ARCH),ia32 x86_64 x64)) # Disable AVX, if the compiler supports that. CC_CAN_DISABLE_AVX=$(shell $(CC) -Werror -c -o /dev/null -xc -mno-avx - /dev/null 2>&1 && echo 1) ifeq ($(CC_CAN_DISABLE_AVX), 1) diff --git a/Make.rules b/Make.rules index e4eccf53..7936f618 100644 --- a/Make.rules +++ b/Make.rules @@ -70,6 +70,10 @@ endif @$(ECHO) " CC $(notdir $@)" $(HIDE)$(CC) $(INCDIR) $(CFLAGS) -c $< -o $@ +$(ARCH)/%.o: $(SRC_ARCH)/%.c + @$(ECHO) " CC $(notdir $@)" + $(HIDE)$(CC) $(INCDIR) $(CFLAGS) -c $< -o $@ + %.s: %.c @$(ECHO) " CC $(notdir $@)" $(HIDE)$(CC) $(INCDIR) $(CFLAGS) -S $< -o $@ @@ -82,6 +86,10 @@ endif @$(ECHO) " AS $(notdir $@)" $(HIDE)$(CC) $(INCDIR) $(CFLAGS) -c $< -o $@ +$(ARCH)/%.o: $(SRC_ARCH)/%.S + @$(ECHO) " AS $(notdir $@)" + $(HIDE)$(CC) $(INCDIR) $(CFLAGS) -c $< -o $@ + %.s: %.S @$(ECHO) " CPP $(notdir $@)" $(HIDE)$(CC) $(INCDIR) $(CFLAGS) -E $< -o $@ diff --git a/apps/Makefile b/apps/Makefile index cbb93df6..66463ef4 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -57,9 +57,9 @@ CRT0_LIBS = -lgnuefi endif ifneq ($(CRT0_LIBS),) -CRTOBJS = $(TOPDIR)/$(ARCH)/gnuefi/crt0-efi-$(ARCH)$(CRT0_LOCAL).o +CRTOBJS = $(TOPDIR)/$(ARCH)/gnuefi/crt0-efi-$(SRC_ARCH)$(CRT0_LOCAL).o -LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_efi$(LDS_LOCAL).lds +LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(SRC_ARCH)_efi$(LDS_LOCAL).lds ifeq ($(USING_FREEBSD),1) LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_fbsd_efi.lds endif @@ -99,9 +99,9 @@ $(TARGET_RTDRIVERS): SUBSYSTEM = 0xc ifeq ($(SYSTEM_HAS_EFI_OBJCOPY),1) -FORMAT := -O efi-app-$(ARCH) -$(TARGET_BSDRIVERS): FORMAT=-O efi-bsdrv-$(ARCH) -$(TARGET_RTDRIVERS): FORMAT=-O efi-rtdrv-$(ARCH) +FORMAT := -O efi-app-$(SRC_ARCH) +$(TARGET_BSDRIVERS): FORMAT=-O efi-bsdrv-$(SRC_ARCH) +$(TARGET_RTDRIVERS): FORMAT=-O efi-rtdrv-$(SRC_ARCH) ifneq ($(IS_MINGW32),) EFI_LDFLAGS += -s -Wl,-dll diff --git a/gnuefi/Makefile b/gnuefi/Makefile index 5972a31f..1b414d23 100644 --- a/gnuefi/Makefile +++ b/gnuefi/Makefile @@ -40,7 +40,7 @@ SRCDIR = $(VPATH) include $(SRCDIR)/../Make.defaults PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig -FILES = reloc_$(ARCH) +FILES = reloc_$(SRC_ARCH) OBJS = $(FILES:%=%.o) @@ -50,6 +50,9 @@ else gnu_efi_default_is_objcopy=false endif # https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html#uefi-image-types +ifeq ($(ARCH),x64) + efi_machine_type_name=x64 +endif ifeq ($(ARCH),x86_64) efi_machine_type_name=x64 endif @@ -79,7 +82,7 @@ ifneq (,$(filter $(ARCH),aarch64 riscv64 ia32)) CRT0_LOCAL_TARGET = crt0-efi-$(ARCH)-local.o endif -LIBS = crt0-efi-$(ARCH).o libgnuefi.a $(CRT0_LOCAL_TARGET) +LIBS = crt0-efi-$(SRC_ARCH).o libgnuefi.a $(CRT0_LOCAL_TARGET) TARGETS = $(LIBS) gnu-efi.pc all: $(TARGETS) @@ -112,12 +115,12 @@ install: mkdir -p $(INSTALLROOT)$(LIBDIR) $(INSTALL) -m 644 $(LIBS) $(INSTALLROOT)$(LIBDIR) ifneq (,$(filter $(ARCH),x86_64 ia32)) - $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_fbsd_efi.lds $(INSTALLROOT)$(LIBDIR) + $(INSTALL) -m 644 $(SRCDIR)/elf_$(SRC_ARCH)_fbsd_efi.lds $(INSTALLROOT)$(LIBDIR) endif ifneq (,$(filter $(ARCH),aarch64 riscv64 ia32)) - $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi_local.lds $(INSTALLROOT)$(LIBDIR) + $(INSTALL) -m 644 $(SRCDIR)/elf_$(SRC_ARCH)_efi_local.lds $(INSTALLROOT)$(LIBDIR) endif - $(INSTALL) -m 644 $(SRCDIR)/elf_$(ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR) + $(INSTALL) -m 644 $(SRCDIR)/elf_$(SRC_ARCH)_efi.lds $(INSTALLROOT)$(LIBDIR) $(INSTALL) -d $(INSTALLROOT)$(PKGCONFIGDIR) $(INSTALL) -m 644 gnu-efi.pc $(INSTALLROOT)$(PKGCONFIGDIR) diff --git a/lib/Makefile b/lib/Makefile index 76261224..57367413 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -44,15 +44,15 @@ FILES = boxdraw smbios console crc data debug dpath \ entry error event exit guid hand hw init lock \ misc pause sread str cmdline runtime/rtlock \ runtime/efirtlib runtime/rtstr runtime/vm runtime/rtdata \ - $(ARCH)/initplat $(ARCH)/math $(ARCH)/setjmp \ + $(SRC_ARCH)/initplat $(SRC_ARCH)/math $(SRC_ARCH)/setjmp \ ctors print ms_va_print va_print ifeq ($(ARCH),ia64) FILES += $(ARCH)/salpal $(ARCH)/palproc endif -ifeq ($(ARCH),x86_64) -FILES += $(ARCH)/callwrap $(ARCH)/efi_stub +ifneq (,$(filter $(ARCH),x64 x86_64)) +FILES += $(SRC_ARCH)/callwrap $(SRC_ARCH)/efi_stub endif ifeq ($(ARCH),arm) @@ -60,9 +60,9 @@ FILES += $(ARCH)/uldiv $(ARCH)/ldivmod $(ARCH)/div $(ARCH)/llsl $(ARCH)/llsr \ $(ARCH)/mullu endif -OBJS = $(FILES:%=%.o) +OBJS = $(subst $(SRC_ARCH)/,$(ARCH)/,$(FILES:%=%.o)) -SUBDIRS = ia32 x86_64 ia64 aarch64 arm mips64el riscv64 loongarch64 runtime +SUBDIRS = x64 ia32 x86_64 ia64 aarch64 arm mips64el riscv64 loongarch64 runtime all: libefi.a From 02725671c4d308cb1078bf3ee3666926047773d9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jul 2026 14:09:11 -0400 Subject: [PATCH 5/7] github actions: rename x64 (mostly) to x86_64, add x64 This adds the new x64 ABI targets to CI, and by doing so changes the old one to be named x86_64 where applicable. Signed-off-by: Peter Jones --- .github/workflows/linux-gcc-musl.yml | 21 ++++++++++++++++++--- .github/workflows/linux-gcc.yml | 28 ++++++++++++++++++++++------ .github/workflows/linux-llvm.yml | 21 ++++++++++++++++++--- .github/workflows/linux-mingw.yml | 16 +++++++++------- .github/workflows/macos-gcc.yml | 18 +++++++++++------- .github/workflows/windows-mingw.yml | 16 +++++++++------- .github/workflows/windows-vs2026.yml | 9 ++++++--- 7 files changed, 93 insertions(+), 36 deletions(-) diff --git a/.github/workflows/linux-gcc-musl.yml b/.github/workflows/linux-gcc-musl.yml index b2536ac9..52b5c34e 100644 --- a/.github/workflows/linux-gcc-musl.yml +++ b/.github/workflows/linux-gcc-musl.yml @@ -11,6 +11,12 @@ jobs: arch: [x64] include: - arch: x64 + dir: x64 + musl: musl-dev + cross_compile: x86_64-linux-musl- + arch: [x86_64] + include: + - arch: x86_64 dir: x86_64 musl: musl-dev cross_compile: x86_64-linux-musl- @@ -56,6 +62,15 @@ jobs: pkg: qemu-system-x86 qemu_arch: x86_64 qemu_opts: -M q35 + fw_arch: x64 + fw_base: OVMF + arch: [x86_64] + include: + - arch: x86_64 + pkg: qemu-system-x86 + qemu_arch: x86_64 + qemu_opts: -M q35 + fw_arch: x64 fw_base: OVMF steps: @@ -76,7 +91,7 @@ jobs: - name: Download UEFI firmware run: | - fw_arch=$(echo ${{ matrix.arch }} | tr a-z A-Z) + fw_arch=$(echo ${{ matrix.fw_arch }} | tr a-z A-Z) fw_zip=${{ matrix.fw_base }}-${fw_arch}.zip curl -O https://efi.akeo.ie/${{ matrix.fw_base }}/${fw_zip} 7z x ${fw_zip} @@ -85,11 +100,11 @@ jobs: - name: Download UEFI Shell run: | mkdir -p ./image/efi/boot - curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.arch }}.efi -o ./image/efi/boot/boot${{ matrix.arch }}.efi + curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.fw_arch }}.efi -o ./image/efi/boot/boot${{ matrix.fw_arch }}.efi - name: Run tests run: | - export UEFI_ARCH=${{ matrix.arch }} + export UEFI_ARCH=${{ matrix.fw_arch }} export UEFI_DIR=./image export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -nodefaults -nographic -serial stdio -net none -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.fw_base }}.fd,readonly=on -drive format=raw,file=fat:rw:image" ./tests/gen_tests.sh ./tests/test_list.txt diff --git a/.github/workflows/linux-gcc.yml b/.github/workflows/linux-gcc.yml index afdc37ff..9e071a7e 100644 --- a/.github/workflows/linux-gcc.yml +++ b/.github/workflows/linux-gcc.yml @@ -8,16 +8,20 @@ jobs: strategy: matrix: - arch: [ia32, x64, aa64, arm, riscv64, loongarch64] + arch: [ia32, x86_64, x64, aa64, arm, riscv64, loongarch64] include: - arch: ia32 dir: ia32 gcc: multilib cross_compile: - - arch: x64 + - arch: x86_64 dir: x86_64 gcc: multilib cross_compile: + - arch: x64 + dir: x64 + gcc: multilib + cross_compile: - arch: aa64 dir: aarch64 gcc: aarch64-linux-gnu @@ -75,37 +79,49 @@ jobs: strategy: matrix: - arch: [x64, ia32, aa64, arm, riscv64, loongarch64] + arch: [x86_64, x64, ia32, aa64, arm, riscv64, loongarch64] include: - arch: x64 pkg: qemu-system-x86 qemu_arch: x86_64 qemu_opts: -M q35 + fw_arch: x64 + fw_base: OVMF + - arch: x86_64 + pkg: qemu-system-x86 + qemu_arch: x86_64 + qemu_opts: -M q35 + fw_arch: x64 fw_base: OVMF - arch: ia32 pkg: qemu-system-x86 qemu_arch: i386 qemu_opts: -M pc + fw_arch: ia32 fw_base: OVMF - arch: aa64 pkg: qemu-system-arm qemu_arch: aarch64 qemu_opts: -M virt -cpu cortex-a57 + fw_arch: aa64 fw_base: AAVMF - arch: arm pkg: qemu-system-arm qemu_arch: arm qemu_opts: -M virt -cpu cortex-a15 + fw_arch: arm fw_base: AAVMF - arch: riscv64 pkg: qemu-system-riscv64 qemu_arch: riscv64 qemu_opts: -M virt,pflash0=pflash0 + fw_arch: riscv64 fw_base: QEMU_EFI - arch: loongarch64 pkg: qemu-system-loongarch64 qemu_arch: loongarch64 qemu_opts: -M virt -cpu la464 + fw_arch: loongarch64 fw_base: QEMU_EFI steps: @@ -126,7 +142,7 @@ jobs: - name: Download UEFI firmware run: | - fw_arch=$(echo ${{ matrix.arch }} | tr a-z A-Z) + fw_arch=$(echo ${{ matrix.fw_arch }} | tr a-z A-Z) fw_zip=${{ matrix.fw_base }}-${fw_arch}.zip curl -O https://efi.akeo.ie/${{ matrix.fw_base }}/${fw_zip} 7z x ${fw_zip} @@ -135,11 +151,11 @@ jobs: - name: Download UEFI Shell run: | mkdir -p ./image/efi/boot - curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.arch }}.efi -o ./image/efi/boot/boot${{ matrix.arch }}.efi + curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.fw_arch }}.efi -o ./image/efi/boot/boot${{ matrix.fw_arch }}.efi - name: Run tests run: | - export UEFI_ARCH=${{ matrix.arch }} + export UEFI_ARCH=${{ matrix.fw_arch }} export UEFI_DIR=./image if [ "$UEFI_ARCH" = "riscv64" ]; then export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -nodefaults -nographic -serial stdio -net none -L . -blockdev node-name=pflash0,driver=file,read-only=on,filename=${{ matrix.fw_base }}.fd -drive format=raw,file=fat:rw:image,id=drv1 -device virtio-blk-device,drive=drv1" diff --git a/.github/workflows/linux-llvm.yml b/.github/workflows/linux-llvm.yml index e1f64252..0f5e0a30 100644 --- a/.github/workflows/linux-llvm.yml +++ b/.github/workflows/linux-llvm.yml @@ -11,6 +11,12 @@ jobs: arch: [x64] include: - arch: x64 + dir: x64 + gcc: multilib + cross_compile: + arch: [x86_64] + include: + - arch: x86_64 dir: x86_64 gcc: multilib cross_compile: @@ -50,6 +56,15 @@ jobs: pkg: qemu-system-x86 qemu_arch: x86_64 qemu_opts: -M q35 + fw_arch: x64 + fw_base: OVMF + arch: [x86_64] + include: + - arch: x86_64 + pkg: qemu-system-x86 + qemu_arch: x86_64 + qemu_opts: -M q35 + fw_arch: x64 fw_base: OVMF steps: @@ -70,7 +85,7 @@ jobs: - name: Download UEFI firmware run: | - fw_arch=$(echo ${{ matrix.arch }} | tr a-z A-Z) + fw_arch=$(echo ${{ matrix.fw_arch }} | tr a-z A-Z) fw_zip=${{ matrix.fw_base }}-${fw_arch}.zip curl -O https://efi.akeo.ie/${{ matrix.fw_base }}/${fw_zip} 7z x ${fw_zip} @@ -79,11 +94,11 @@ jobs: - name: Download UEFI Shell run: | mkdir -p ./image/efi/boot - curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.arch }}.efi -o ./image/efi/boot/boot${{ matrix.arch }}.efi + curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.fw_arch }}.efi -o ./image/efi/boot/boot${{ matrix.fw_arch }}.efi - name: Run tests run: | - export UEFI_ARCH=${{ matrix.arch }} + export UEFI_ARCH=${{ matrix.fw_arch }} export UEFI_DIR=./image export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -nodefaults -nographic -serial stdio -net none -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.fw_base }}.fd,readonly=on -drive format=raw,file=fat:rw:image" ./tests/gen_tests.sh ./tests/test_list.txt diff --git a/.github/workflows/linux-mingw.yml b/.github/workflows/linux-mingw.yml index 2eaf8a83..60eb4931 100644 --- a/.github/workflows/linux-mingw.yml +++ b/.github/workflows/linux-mingw.yml @@ -8,9 +8,9 @@ jobs: strategy: matrix: - arch: [x64, ia32] + arch: [x86_64, ia32] include: - - arch: x64 + - arch: x86_64 dir: x86_64 pkg: gcc-mingw-w64-x86-64 tuple: x86_64-w64-mingw32- @@ -43,17 +43,19 @@ jobs: strategy: matrix: - arch: [x64, ia32] + arch: [x86_64, ia32] include: - - arch: x64 + - arch: x86_64 pkg: qemu-system-x86 qemu_arch: x86_64 qemu_opts: -M q35 + fw_arch: x64 fw_base: OVMF - arch: ia32 pkg: qemu-system-x86 qemu_arch: i386 qemu_opts: -M pc + fw_arch: ia32 fw_base: OVMF steps: @@ -74,7 +76,7 @@ jobs: - name: Download UEFI firmware run: | - fw_arch=$(echo ${{ matrix.arch }} | tr a-z A-Z) + fw_arch=$(echo ${{ matrix.fw_arch }} | tr a-z A-Z) fw_zip=${{ matrix.fw_base }}-${fw_arch}.zip curl -O https://efi.akeo.ie/${{ matrix.fw_base }}/${fw_zip} 7z x ${fw_zip} @@ -83,11 +85,11 @@ jobs: - name: Download UEFI Shell run: | mkdir -p ./image/efi/boot - curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.arch }}.efi -o ./image/efi/boot/boot${{ matrix.arch }}.efi + curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.fw_arch }}.efi -o ./image/efi/boot/boot${{ matrix.fw_arch }}.efi - name: Run tests run: | - export UEFI_ARCH=${{ matrix.arch }} + export UEFI_ARCH=${{ matrix.fw_arch }} export UEFI_DIR=./image export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.fw_base }}.fd,readonly=on -drive format=raw,file=fat:rw:image -nodefaults -nographic -serial stdio -net none" ./tests/gen_tests.sh ./tests/test_list.txt diff --git a/.github/workflows/macos-gcc.yml b/.github/workflows/macos-gcc.yml index 0fbc15df..b5cfc17f 100644 --- a/.github/workflows/macos-gcc.yml +++ b/.github/workflows/macos-gcc.yml @@ -8,13 +8,13 @@ jobs: strategy: matrix: - arch: [ia32, x64, aa64, arm] + arch: [ia32, x86_64, aa64, arm] include: - arch: ia32 dir: ia32 cross_compile: i686-elf- toolchain: i686-elf-gcc - - arch: x64 + - arch: x86_64 dir: x86_64 cross_compile: x86_64-elf- toolchain: x86_64-elf-gcc @@ -58,27 +58,31 @@ jobs: strategy: matrix: - arch: [ia32, x64, aa64, arm] + arch: [ia32, x86_64, aa64, arm] include: - - arch: x64 + - arch: x86_64 pkg: qemu-system-x86 qemu_arch: x86_64 qemu_opts: -M q35 + fw_arch: x64 fw_base: OVMF - arch: ia32 pkg: qemu-system-x86 qemu_arch: i386 qemu_opts: -M pc + fw_arch: ia32 fw_base: OVMF - arch: aa64 pkg: qemu-system-arm qemu_arch: aarch64 qemu_opts: -M virt -cpu cortex-a57 + fw_arch: aa64 fw_base: AAVMF - arch: arm pkg: qemu-system-arm qemu_arch: arm qemu_opts: -M virt -cpu cortex-a15 + fw_arch: arm fw_base: AAVMF steps: @@ -99,7 +103,7 @@ jobs: - name: Download UEFI firmware run: | - fw_arch=$(echo ${{ matrix.arch }} | tr a-z A-Z) + fw_arch=$(echo ${{ matrix.fw_arch }} | tr a-z A-Z) fw_zip=${{ matrix.fw_base }}-${fw_arch}.zip curl -O https://efi.akeo.ie/${{ matrix.fw_base }}/${fw_zip} 7z x ${fw_zip} @@ -108,11 +112,11 @@ jobs: - name: Download UEFI Shell run: | mkdir -p ./image/efi/boot - curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.arch }}.efi -o ./image/efi/boot/boot${{ matrix.arch }}.efi + curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.fw_arch }}.efi -o ./image/efi/boot/boot${{ matrix.fw_arch }}.efi - name: Run tests run: | - export UEFI_ARCH=${{ matrix.arch }} + export UEFI_ARCH=${{ matrix.fw_arch }} export UEFI_DIR=./image export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -nodefaults -nographic -serial stdio -net none -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.fw_base }}.fd,readonly=on -drive format=raw,file=fat:rw:image" ./tests/gen_tests.sh ./tests/test_list.txt diff --git a/.github/workflows/windows-mingw.yml b/.github/workflows/windows-mingw.yml index de1ca689..05077b6a 100644 --- a/.github/workflows/windows-mingw.yml +++ b/.github/workflows/windows-mingw.yml @@ -8,9 +8,9 @@ jobs: strategy: matrix: - arch: [x64, ia32] + arch: [x86_64, ia32] include: - - arch: x64 + - arch: x86_64 dir: x86_64 sys: mingw64 env: x86_64 @@ -54,17 +54,19 @@ jobs: strategy: matrix: - arch: [x64, ia32] + arch: [x86_64, ia32] include: - - arch: x64 + - arch: x86_64 pkg: qemu-system-x86 qemu_arch: x86_64 qemu_opts: -M q35 + fw_arch: x64 fw_base: OVMF - arch: ia32 pkg: qemu-system-x86 qemu_arch: i386 qemu_opts: -M pc + fw_arch: ia32 fw_base: OVMF steps: @@ -85,7 +87,7 @@ jobs: - name: Download UEFI firmware run: | - fw_arch=$(echo ${{ matrix.arch }} | tr a-z A-Z) + fw_arch=$(echo ${{ matrix.fw_arch }} | tr a-z A-Z) fw_zip=${{ matrix.fw_base }}-${fw_arch}.zip curl -O https://efi.akeo.ie/${{ matrix.fw_base }}/${fw_zip} 7z x ${fw_zip} @@ -94,11 +96,11 @@ jobs: - name: Download UEFI Shell run: | mkdir -p ./image/efi/boot - curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.arch }}.efi -o ./image/efi/boot/boot${{ matrix.arch }}.efi + curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.fw_arch }}.efi -o ./image/efi/boot/boot${{ matrix.fw_arch }}.efi - name: Run tests run: | - export UEFI_ARCH=${{ matrix.arch }} + export UEFI_ARCH=${{ matrix.fw_arch }} export UEFI_DIR=./image export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.fw_base }}.fd,readonly=on -drive format=raw,file=fat:rw:image -nodefaults -nographic -serial stdio -net none" ./tests/gen_tests.sh ./tests/test_list.txt diff --git a/.github/workflows/windows-vs2026.yml b/.github/workflows/windows-vs2026.yml index 99815dff..7f352e8a 100644 --- a/.github/workflows/windows-vs2026.yml +++ b/.github/workflows/windows-vs2026.yml @@ -45,16 +45,19 @@ jobs: pkg: qemu-system-x86 qemu_arch: x86_64 qemu_opts: -M q35 + fw_arch: x64 fw_base: OVMF - arch: ia32 pkg: qemu-system-x86 qemu_arch: i386 qemu_opts: -M pc + fw_arch: ia32 fw_base: OVMF - arch: aa64 pkg: qemu-system-arm qemu_arch: aarch64 qemu_opts: -M virt -cpu cortex-a57 + fw_arch: aa64 fw_base: AAVMF steps: @@ -75,7 +78,7 @@ jobs: - name: Download UEFI firmware run: | - fw_arch=$(echo ${{ matrix.arch }} | tr a-z A-Z) + fw_arch=$(echo ${{ matrix.fw_arch }} | tr a-z A-Z) fw_zip=${{ matrix.fw_base }}-${fw_arch}.zip curl -O https://efi.akeo.ie/${{ matrix.fw_base }}/${fw_zip} 7z x ${fw_zip} @@ -84,11 +87,11 @@ jobs: - name: Download UEFI Shell run: | mkdir -p ./image/efi/boot - curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.arch }}.efi -o ./image/efi/boot/boot${{ matrix.arch }}.efi + curl -L https://github.com/pbatard/UEFI-Shell/releases/download/24H2/shell${{ matrix.fw_arch }}.efi -o ./image/efi/boot/boot${{ matrix.fw_arch }}.efi - name: Run tests run: | - export UEFI_ARCH=${{ matrix.arch }} + export UEFI_ARCH=${{ matrix.fw_arch }} export UEFI_DIR=./image export QEMU_CMD="qemu-system-${{ matrix.qemu_arch }} ${{ matrix.qemu_opts }} -L . -drive if=pflash,format=raw,unit=0,file=${{ matrix.fw_base }}.fd,readonly=on -drive format=raw,file=fat:rw:image -nodefaults -nographic -serial stdio -net none" ./tests/gen_tests.sh ./tests/test_list.txt From 2a4e930a1fd01621beb526c3f501624f891a6b3e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jul 2026 17:10:10 -0400 Subject: [PATCH 6/7] maybe also mingw --- .github/workflows/windows-mingw.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-mingw.yml b/.github/workflows/windows-mingw.yml index 05077b6a..74f540a5 100644 --- a/.github/workflows/windows-mingw.yml +++ b/.github/workflows/windows-mingw.yml @@ -8,8 +8,12 @@ jobs: strategy: matrix: - arch: [x86_64, ia32] + arch: [x64, x86_64, ia32] include: + - arch: x64 + dir: x64 + sys: mingw64 + env: x86_64 - arch: x86_64 dir: x86_64 sys: mingw64 @@ -40,7 +44,7 @@ jobs: fetch-depth: 0 - name: Build - run: make + run: make ARCH=${{ matrix.arch }} - name: Upload artifacts uses: actions/upload-artifact@v7 @@ -54,8 +58,14 @@ jobs: strategy: matrix: - arch: [x86_64, ia32] + arch: [x64, x86_64, ia32] include: + - arch: x64 + pkg: qemu-system-x86 + qemu_arch: x86_64 + qemu_opts: -M q35 + fw_arch: x64 + fw_base: OVMF - arch: x86_64 pkg: qemu-system-x86 qemu_arch: x86_64 From 8d650bd3587e0d112ebecbbdc874240250c81538 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jul 2026 17:12:33 -0400 Subject: [PATCH 7/7] maybe also macos --- .github/workflows/macos-gcc.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-gcc.yml b/.github/workflows/macos-gcc.yml index b5cfc17f..252b2e71 100644 --- a/.github/workflows/macos-gcc.yml +++ b/.github/workflows/macos-gcc.yml @@ -8,12 +8,16 @@ jobs: strategy: matrix: - arch: [ia32, x86_64, aa64, arm] + arch: [x64, ia32, x86_64, aa64, arm] include: - arch: ia32 dir: ia32 cross_compile: i686-elf- toolchain: i686-elf-gcc + - arch: x64 + dir: x64 + cross_compile: x86_64-elf- + toolchain: x86_64-elf-gcc - arch: x86_64 dir: x86_64 cross_compile: x86_64-elf- @@ -58,8 +62,14 @@ jobs: strategy: matrix: - arch: [ia32, x86_64, aa64, arm] + arch: [x64, ia32, x86_64, aa64, arm] include: + - arch: x64 + pkg: qemu-system-x86 + qemu_arch: x86_64 + qemu_opts: -M q35 + fw_arch: x64 + fw_base: OVMF - arch: x86_64 pkg: qemu-system-x86 qemu_arch: x86_64