Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,250 @@
From 2e3092703698657703e0af9d463c289d78c3c195 Mon Sep 17 00:00:00 2001
From: lzcunt <lzcunt@rawr.fun>
Date: Tue, 9 Dec 2025 15:37:03 +0300
Subject: [PATCH] Revert setjmp/longjmp ABI break in #77
aa27c28 introduced an ABI break in a minor version which broke syslinux.
syslinux externs the setjmp/longjmp implementation of GNU-EFI, therefore
depends on the symbol name.
Let's alias base_setjmp and base_longjmp to setjmp and longjmp
respectively so syslinux builds again.
Signed-off-by: lzcunt <lzcunt@rawr.fun>
Upstream: https://github.com/ncroxon/gnu-efi/pull/77#ref-commit-2e30927
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
lib/aarch64/setjmp.S | 6 ++++++
lib/arm/setjmp.S | 6 ++++++
lib/ia32/setjmp.S | 14 +++++++++++---
lib/ia64/setjmp.S | 6 ++++++
lib/loongarch64/setjmp.S | 7 ++++++-
lib/mips64el/setjmp.S | 6 ++++++
lib/riscv64/setjmp.S | 6 ++++++
lib/x86_64/setjmp.S | 8 ++++++++
8 files changed, 55 insertions(+), 4 deletions(-)
diff --git a/lib/aarch64/setjmp.S b/lib/aarch64/setjmp.S
index a83eb88e..27acce71 100644
--- a/lib/aarch64/setjmp.S
+++ b/lib/aarch64/setjmp.S
@@ -33,6 +33,9 @@ BASIS,
#define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS]
#define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS]
+ .globl setjmp
+ .type setjmp, @function
+setjmp:
.globl base_setjmp
.type base_setjmp, @function
base_setjmp:
@@ -48,6 +51,9 @@ base_setjmp:
#define REG_PAIR(REG1, REG2, OFFS) ldp REG1, REG2, [x0, OFFS]
#define REG_ONE(REG1, OFFS) ldr REG1, [x0, OFFS]
+ .globl longjmp
+ .type longjmp, @function
+longjmp:
.globl base_longjmp
.type base_longjmp, @function
base_longjmp:
diff --git a/lib/arm/setjmp.S b/lib/arm/setjmp.S
index 2f0b9543..8fe3a439 100644
--- a/lib/arm/setjmp.S
+++ b/lib/arm/setjmp.S
@@ -11,6 +11,9 @@
*/
.text
.arm
+ .globl setjmp
+ .type setjmp, %function
+setjmp:
.globl base_setjmp
.type base_setjmp, %function
base_setjmp:
@@ -19,6 +22,9 @@ base_setjmp:
eor r0, r0, r0
bx lr
+ .globl longjmp
+ .type longjmp, %function
+longjmp:
.globl base_longjmp
.type base_longjmp, %function
base_longjmp:
diff --git a/lib/ia32/setjmp.S b/lib/ia32/setjmp.S
index b59e7391..2708d1a7 100644
--- a/lib/ia32/setjmp.S
+++ b/lib/ia32/setjmp.S
@@ -13,12 +13,16 @@ BASIS,
* IMPLIED.
*/
.text
+ .globl setjmp
.globl base_setjmp
#ifndef __MINGW32__
- .type base_setjmp, @function
+ .type setjmp, @function
+ .type base_setjmp, @function
#else
- .def base_setjmp; .scl 2; .type 32; .endef
+ .def setjmp; .scl 2; .type 32; .endef
+ .def base_setjmp; .scl 2; .type 32; .endef
#endif
+setjmp:
base_setjmp:
pop %ecx
movl (%esp), %edx
@@ -30,12 +34,16 @@ base_setjmp:
xorl %eax, %eax
jmp *%ecx
+ .globl longjmp
.globl base_longjmp
#ifndef __MINGW32__
+ .type longjmp, @function
.type base_longjmp, @function
#else
- .def base_longjmp; .scl 2; .type 32; .endef
+ .def longjmp; .scl 2; .type 32; .endef
+ .def base_longjmp; .scl 2; .type 32; .endef
#endif
+longjmp:
base_longjmp:
pop %eax
pop %edx
diff --git a/lib/ia64/setjmp.S b/lib/ia64/setjmp.S
index 3ab9a153..26d35530 100644
--- a/lib/ia64/setjmp.S
+++ b/lib/ia64/setjmp.S
@@ -13,6 +13,9 @@ BASIS,
* IMPLIED.
*/
.text
+ .globl setjmp
+ .type setjmp, @function
+setjmp:
.globl base_setjmp
.type base_setjmp, @function
base_setjmp:
@@ -96,6 +99,9 @@ base_setjmp:
br.ret.sptk b0
;;
+ .globl longjmp
+ .type longjmp, @function
+longjmp:
.globl base_longjmp
.type base_longjmp, @function
.regstk 2, 0, 0, 0
diff --git a/lib/loongarch64/setjmp.S b/lib/loongarch64/setjmp.S
index 42f411e0..9f043593 100644
--- a/lib/loongarch64/setjmp.S
+++ b/lib/loongarch64/setjmp.S
@@ -20,7 +20,9 @@
.text
.p2align 3
-
+ .globl setjmp
+ .type setjmp, @function
+setjmp:
.globl base_setjmp
.type base_setjmp, @function
base_setjmp:
@@ -40,6 +42,9 @@ base_setjmp:
move $a0, $zero
jr $ra
+ .globl longjmp
+ .type longjmp, @function
+longjmp:
.globl base_longjmp
.type base_longjmp, @function
base_longjmp:
diff --git a/lib/mips64el/setjmp.S b/lib/mips64el/setjmp.S
index c07e239d..5bbbed5f 100644
--- a/lib/mips64el/setjmp.S
+++ b/lib/mips64el/setjmp.S
@@ -18,6 +18,9 @@ BASIS,
.text
.p2align 3
+ .globl setjmp
+ .type setjmp, @function
+setjmp:
.globl base_setjmp
.type base_setjmp, @function
base_setjmp:
@@ -54,6 +57,9 @@ base_setjmp:
move $v0, $zero
jr $ra
+ .globl longjmp
+ .type longjmp, @function
+longjmp:
.globl base_longjmp
.type base_longjmp, @function
base_longjmp:
diff --git a/lib/riscv64/setjmp.S b/lib/riscv64/setjmp.S
index 2f96e18d..f9552b55 100644
--- a/lib/riscv64/setjmp.S
+++ b/lib/riscv64/setjmp.S
@@ -39,6 +39,9 @@
#define REG_ONE(R, P) sd R, P(a0)
#define FREG_ONE(R, P) fsd R, P(a0)
+ .globl setjmp
+ .type setjmp, @function
+setjmp:
.globl base_setjmp
.type base_setjmp, @function
@@ -56,6 +59,9 @@ base_setjmp:
#define REG_ONE(R, P) ld R, P(a0)
#define FREG_ONE(R, P) fld R, P(a0)
+ .globl longjmp
+ .type lobgjmp, @function
+longjmp:
.globl base_longjmp
.type base_longjmp, @function
diff --git a/lib/x86_64/setjmp.S b/lib/x86_64/setjmp.S
index 719b0219..bf320c83 100644
--- a/lib/x86_64/setjmp.S
+++ b/lib/x86_64/setjmp.S
@@ -1,10 +1,14 @@
.text
+ .globl setjmp
.globl base_setjmp
#ifndef __MINGW32__
+ .type setjmp, @function
.type base_setjmp, @function
#else
.def base_setjmp; .scl 2; .type 32; .endef
+ .def setjmp; .scl 2; .type 32; .endef
#endif
+setjmp:
base_setjmp:
pop %rsi
movq %rbx,0x00(%rdi)
@@ -19,12 +23,16 @@ base_setjmp:
xor %rax,%rax
ret
+ .globl longjmp
.globl base_longjmp
#ifndef __MINGW32__
+ .type longjmp, @function
.type base_longjmp, @function
#else
+ .def longjmp; .scl 2; .type 32; .endef
.def base_longjmp; .scl 2; .type 32; .endef
#endif
+longjmp:
base_longjmp:
movl %esi, %eax
movq 0x00(%rdi), %rbx

18
package/gnu-efi/Config.in Normal file
View File

@@ -0,0 +1,18 @@
config BR2_PACKAGE_GNU_EFI_ARCH_SUPPORTS
bool
default y if BR2_arm && BR2_ARM_CPU_HAS_ARM && !BR2_ARM_SOFT_FLOAT
default y if BR2_RISCV_64
default y if BR2_aarch64
default y if BR2_i386
default y if BR2_x86_64
depends on BR2_USE_MMU
config BR2_PACKAGE_GNU_EFI
bool "gnu-efi"
depends on BR2_PACKAGE_GNU_EFI_ARCH_SUPPORTS
help
Develop EFI applications for ARM-64, ARM-32, x86_64, IA-64
(IPF), IA-32 (x86), and MIPS platforms using the GNU toolchain
and the EFI development environment.
https://github.com/ncroxon/gnu-efi

View File

@@ -0,0 +1,9 @@
# Locally computed
sha256 40b61e842a4efcbf80f3e53b2f220c044e8cfe46eb4dd6396c83b751240b1c0d gnu-efi-4.0.4.tar.gz
sha256 e2b4e4a370f19dfdb3c84256ccb1d545ee98329faa20adbb5a06797119c3cd55 LICENSE
sha256 01852478a0585ed9955de5d674f417ced8ef8934c300f124ab66a8cf251c46d8 licenses/LICENSE.BSD-3-Clause
sha256 7aa278b6f1a2125d0a0c596fa537caca5a41e7b03f7d2dd0489905f65ffdb984 licenses/LICENSE.edk2
sha256 146958d2c66a609a6ea72f73017ca626023e0cb3ecbfd9f55722f493427253e7 licenses/LICENSE.efilib
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 licenses/LICENSE.GPL-2.0-or-later
sha256 4796125347fa98a7f3f056117fff04191712538ab9d9ab797075daad808bb538 licenses/LICENSE.GPL-3.0-or-later
sha256 c0e22e2ea9fe4e12448ab248194a3d53703a13f67a4bb7a412715cb05cd1b274 licenses/LICENSE.LGPL-3.0-or-later

View File

@@ -0,0 +1,55 @@
################################################################################
#
# gnu-efi
#
################################################################################
GNU_EFI_VERSION = 4.0.4
GNU_EFI_SITE = $(call github,ncroxon,gnu-efi,$(GNU_EFI_VERSION))
GNU_EFI_INSTALL_STAGING = YES
GNU_EFI_LICENSE = \
BSD-3-Clause and/or GPL-2.0+ (gnuefi), \
BSD-3-Clause (efilib), \
BSD-2-Clause-Patent (EDK2 routines)
GNU_EFI_LICENSE_FILES = \
LICENSE \
licenses/LICENSE.BSD-3-Clause \
licenses/LICENSE.edk2 \
licenses/LICENSE.efilib \
licenses/LICENSE.GPL-2.0-or-later \
licenses/LICENSE.GPL-3.0-or-later \
licenses/LICENSE.LGPL-3.0-or-later
# gnu-efi is a set of library and header files used to build
# standalone EFI applications such as bootloaders. There is no point
# in installing these libraries to the target.
GNU_EFI_INSTALL_TARGET = NO
ifeq ($(BR2_i386),y)
GNU_EFI_PLATFORM = ia32
else ifeq ($(BR2_x86_64),y)
GNU_EFI_PLATFORM = x86_64
else ifeq ($(BR2_arm)$(BR2_armeb),y)
GNU_EFI_PLATFORM = arm
else ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
GNU_EFI_PLATFORM = aarch64
else ifeq ($(BR2_RISCV_64),y)
GNU_EFI_PLATFORM = riscv64
endif
GNU_EFI_MAKE_OPTS = \
ARCH=$(GNU_EFI_PLATFORM) \
CROSS_COMPILE="$(TARGET_CROSS)" \
PREFIX=/usr
define GNU_EFI_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(GNU_EFI_MAKE_OPTS)
endef
define GNU_EFI_INSTALL_STAGING_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(GNU_EFI_MAKE_OPTS) \
INSTALLROOT=$(STAGING_DIR) install
endef
$(eval $(generic-package))