summaryrefslogtreecommitdiffstats
path: root/gnu-efi
diff options
context:
space:
mode:
authorzorz <zorz@krypt.sh>2026-05-05 18:29:35 +0300
committerzorz <zorz@krypt.sh>2026-05-05 18:29:35 +0300
commit3ee93968e10126adc7dad5c8872f0170c3421e13 (patch)
treebcac8daa62b6c9a94a48dae87f5d3f6de1985bba /gnu-efi
parent936433a5deb6ccc8f8476096f2c2b8dc72c33388 (diff)
downloadzorz-3ee93968e10126adc7dad5c8872f0170c3421e13.tar.gz
zorz-3ee93968e10126adc7dad5c8872f0170c3421e13.tar.xz
various obsolette
Diffstat (limited to 'gnu-efi')
-rw-r--r--gnu-efi/.footprint60
-rw-r--r--gnu-efi/.signature10
-rw-r--r--gnu-efi/MAKEPKG100
-rw-r--r--gnu-efi/gnu-efi-3.0.18-clang.patch26
-rw-r--r--gnu-efi/gnu-efi-3.0.18-remove-linux-headers.patch14
-rw-r--r--gnu-efi/gnu-efi-3.0.19-fix-binutils-2.46.patch19
6 files changed, 229 insertions, 0 deletions
diff --git a/gnu-efi/.footprint b/gnu-efi/.footprint
new file mode 100644
index 0000000..bfdfd54
--- /dev/null
+++ b/gnu-efi/.footprint
@@ -0,0 +1,60 @@
1drwxr-xr-x root/root usr/
2drwxr-xr-x root/root usr/include/
3drwxr-xr-x root/root usr/include/efi/
4-rw-r--r-- root/root usr/include/efi/efi.h
5-rw-r--r-- root/root usr/include/efi/efi_nii.h
6-rw-r--r-- root/root usr/include/efi/efi_pxe.h
7-rw-r--r-- root/root usr/include/efi/efiapi.h
8-rw-r--r-- root/root usr/include/efi/eficompiler.h
9-rw-r--r-- root/root usr/include/efi/eficon.h
10-rw-r--r-- root/root usr/include/efi/eficonex.h
11-rw-r--r-- root/root usr/include/efi/efidebug.h
12-rw-r--r-- root/root usr/include/efi/efidef.h
13-rw-r--r-- root/root usr/include/efi/efidevp.h
14-rw-r--r-- root/root usr/include/efi/efierr.h
15-rw-r--r-- root/root usr/include/efi/efifs.h
16-rw-r--r-- root/root usr/include/efi/efigpt.h
17-rw-r--r-- root/root usr/include/efi/efiip.h
18-rw-r--r-- root/root usr/include/efi/efilib.h
19-rw-r--r-- root/root usr/include/efi/efilink.h
20-rw-r--r-- root/root usr/include/efi/efinet.h
21-rw-r--r-- root/root usr/include/efi/efipart.h
22-rw-r--r-- root/root usr/include/efi/efipciio.h
23-rw-r--r-- root/root usr/include/efi/efipoint.h
24-rw-r--r-- root/root usr/include/efi/efiprot.h
25-rw-r--r-- root/root usr/include/efi/efipxebc.h
26-rw-r--r-- root/root usr/include/efi/efirtlib.h
27-rw-r--r-- root/root usr/include/efi/efiser.h
28-rw-r--r-- root/root usr/include/efi/efisetjmp.h
29-rw-r--r-- root/root usr/include/efi/efishell.h
30-rw-r--r-- root/root usr/include/efi/efishellintf.h
31-rw-r--r-- root/root usr/include/efi/efistdarg.h
32-rw-r--r-- root/root usr/include/efi/efitcp.h
33-rw-r--r-- root/root usr/include/efi/efiudp.h
34-rw-r--r-- root/root usr/include/efi/efiui.h
35-rw-r--r-- root/root usr/include/efi/lib.h
36-rw-r--r-- root/root usr/include/efi/libsmbios.h
37-rw-r--r-- root/root usr/include/efi/pci22.h
38-rw-r--r-- root/root usr/include/efi/pe.h
39-rw-r--r-- root/root usr/include/efi/romload.h
40drwxr-xr-x root/root usr/include/efi/protocol/
41-rw-r--r-- root/root usr/include/efi/protocol/adapterdebug.h
42-rw-r--r-- root/root usr/include/efi/protocol/eficonsplit.h
43-rw-r--r-- root/root usr/include/efi/protocol/efidbg.h
44-rw-r--r-- root/root usr/include/efi/protocol/efivar.h
45-rw-r--r-- root/root usr/include/efi/protocol/intload.h
46-rw-r--r-- root/root usr/include/efi/protocol/legacyboot.h
47-rw-r--r-- root/root usr/include/efi/protocol/piflash64.h
48-rw-r--r-- root/root usr/include/efi/protocol/vgaclass.h
49drwxr-xr-x root/root usr/include/efi/x86_64/
50-rw-r--r-- root/root usr/include/efi/x86_64/efibind.h
51-rw-r--r-- root/root usr/include/efi/x86_64/efilibplat.h
52-rw-r--r-- root/root usr/include/efi/x86_64/efisetjmp_arch.h
53-rw-r--r-- root/root usr/include/efi/x86_64/pe.h
54drwxr-xr-x root/root usr/lib/
55-rw-r--r-- root/root usr/lib/crt0-efi-x86_64.o
56-rw-r--r-- root/root usr/lib/elf_x86_64_efi.lds
57-rw-r--r-- root/root usr/lib/libefi.a
58-rw-r--r-- root/root usr/lib/libgnuefi.a
59drwxr-xr-x root/root usr/lib/pkgconfig/
60-rw-r--r-- root/root usr/lib/pkgconfig/gnu-efi.pc
diff --git a/gnu-efi/.signature b/gnu-efi/.signature
new file mode 100644
index 0000000..88c56c3
--- /dev/null
+++ b/gnu-efi/.signature
@@ -0,0 +1,10 @@
1untrusted comment: verify with zorz.pub
2RWTZ9IduCSQ/mN2CGS6Er3qQNMb/CTlIjkqvTX1NNdL5NYcTcH9T74dkf7oTXyvoVPGUoEdaO5q1x8NTdmY30cYKviDLtr5j8wM=
3
4SHA256 (MAKEPKG) = d599cc8cfcdd2610c6affa42a958c186488272f246d7be0d9736e7e3d9363930
5SHA256 (.footprint) = 9ebae1f784c664782582b968923210166e2f3a8a268d59abf1cc28c9de658410
6SHA256 (gnu-efi-3.0.18.tar.bz2) = 7f212c96ee66547eeefb531267b641e5473d7d8529f0bd8ccdefd33cf7413f5c
7SHA256 (binutils-2.46.0.tar.xz) = d75a94f4d73e7a4086f7513e67e439e8fcdcbb726ffe63f4661744e6256b2cf2
8SHA256 (gnu-efi-3.0.18-clang.patch) = cbd8f6af3b8f522fc65c65a96a589602a9a072a501740954f8617990029ae984
9SHA256 (gnu-efi-3.0.18-remove-linux-headers.patch) = 0996a5a167567066d7289cc4f9d576602cc61a3ea67608e76544b58bb0a47e94
10SHA256 (gnu-efi-3.0.19-fix-binutils-2.46.patch) = 173191018e118048025e6a5acc8e4fd9a401e58fa485bfab04dd09b5c24e4a4f
diff --git a/gnu-efi/MAKEPKG b/gnu-efi/MAKEPKG
new file mode 100644
index 0000000..94c971b
--- /dev/null
+++ b/gnu-efi/MAKEPKG
@@ -0,0 +1,100 @@
1#!/bin/mkpkg
2# description: EFI application development toolkit
3# url: https://sourceforge.net/projects/gnu-efi/
4
5name=gnu-efi
6version=3.0.18
7release=1
8depends=()
9makedeps=()
10source=(https://downloads.sourceforge.net/sourceforge/gnu-efi/gnu-efi-$version.tar.bz2
11 https://ftp.gnu.org/gnu/binutils/binutils-2.46.0.tar.xz
12 gnu-efi-3.0.18-clang.patch
13 gnu-efi-3.0.18-remove-linux-headers.patch
14 gnu-efi-3.0.19-fix-binutils-2.46.patch)
15sha256sums=(
16 "7f212c96ee66547eeefb531267b641e5473d7d8529f0bd8ccdefd33cf7413f5c"
17 "d75a94f4d73e7a4086f7513e67e439e8fcdcbb726ffe63f4661744e6256b2cf2"
18 "cbd8f6af3b8f522fc65c65a96a589602a9a072a501740954f8617990029ae984"
19 "0996a5a167567066d7289cc4f9d576602cc61a3ea67608e76544b58bb0a47e94"
20 "173191018e118048025e6a5acc8e4fd9a401e58fa485bfab04dd09b5c24e4a4f"
21)
22
23build() {
24 # Build private GNU binutils — need objcopy with EFI/pei- target support
25 cd $SRC/binutils-2.46.0
26 CONFIG_SHELL=/bin/bash ./configure \
27 --prefix=$SRC/binutils-local \
28 --disable-nls \
29 --disable-multilib \
30 --disable-werror \
31 --disable-gdb \
32 --disable-gdbserver \
33 --disable-gold \
34 --disable-gprofng \
35 --disable-sim \
36 --disable-libdecnumber \
37 --disable-readline \
38 --enable-ld \
39 --enable-targets=x86_64-linux,i686-linux,x86_64-pep \
40 --with-system-zlib \
41 CC=clang CXX=clang++
42 make $MKPKG_MAKEFLAGS
43 make install
44 export PATH="$SRC/binutils-local/bin:$PATH"
45
46 cd $SRC/gnu-efi-$version
47
48 # apply patches
49 patch -N -p1 < $SRC/gnu-efi-3.0.18-clang.patch || true
50 patch -N -p1 < $SRC/gnu-efi-3.0.18-remove-linux-headers.patch || true
51 patch -N -p1 < $SRC/gnu-efi-3.0.19-fix-binutils-2.46.patch || true
52
53 # remove -Werror
54 sed -i 's/-Werror//g' Make.defaults
55
56 # fix CHAR16 typedef for clang — wchar_t causes pointer mismatch
57 sed -i 's/typedef wchar_t CHAR16/typedef uint16_t CHAR16/' \
58 inc/x86_64/efibind.h
59
60 # musl: include clang's own headers first, then system
61 CPPINCLUDEDIR=$(clang -print-resource-dir 2>/dev/null)/include
62 export CFLAGS="-nostdinc -isystem $CPPINCLUDEDIR -isystem /usr/include"
63
64 mkdir -p $SRC/gnu-efi-$version/x86_64/lib/runtime
65 mkdir -p $SRC/gnu-efi-$version/x86_64/lib/x86_64
66 mkdir -p $SRC/gnu-efi-$version/x86_64/gnuefi
67 mkdir -p $SRC/gnu-efi-$version/x86_64/inc
68
69 make -j1 ARCH=x86_64 \
70 CC=clang \
71 AS="$SRC/binutils-local/bin/as" \
72 LD="$SRC/binutils-local/bin/ld" \
73 AR=llvm-ar \
74 RANLIB=llvm-ranlib \
75 OBJCOPY="$SRC/binutils-local/bin/objcopy" \
76 SUBDIRS="lib gnuefi inc" \
77 all
78
79 make -j1 ARCH=x86_64 \
80 CC=clang \
81 AS="$SRC/binutils-local/bin/as" \
82 LD="$SRC/binutils-local/bin/ld" \
83 AR=llvm-ar \
84 RANLIB=llvm-ranlib \
85 OBJCOPY="$SRC/binutils-local/bin/objcopy" \
86 PREFIX=/usr \
87 LIBDIR=/usr/lib \
88 INSTALLROOT=$PKG \
89 SUBDIRS="lib gnuefi inc" \
90 install
91
92 # xen and other tools expect efi/pe.h directly
93 cp $PKG/usr/include/efi/x86_64/pe.h $PKG/usr/include/efi/pe.h
94}
95signify() {
96 untrusted comment: public key
97 RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
98}
99
100# vim: filetype=sh
diff --git a/gnu-efi/gnu-efi-3.0.18-clang.patch b/gnu-efi/gnu-efi-3.0.18-clang.patch
new file mode 100644
index 0000000..7819351
--- /dev/null
+++ b/gnu-efi/gnu-efi-3.0.18-clang.patch
@@ -0,0 +1,26 @@
1https://bugs.gentoo.org/930538
2https://github.com/ncroxon/gnu-efi/issues/4
3https://github.com/ncroxon/gnu-efi/pull/5
4https://github.com/ncroxon/gnu-efi/commit/a0111e0df165d49cf34fc4f5fae46fc0921a756d
5
6From a0111e0df165d49cf34fc4f5fae46fc0921a756d Mon Sep 17 00:00:00 2001
7From: Callum Farmer <gmbr3@opensuse.org>
8Date: Wed, 24 Apr 2024 12:04:48 +0100
9Subject: [PATCH] Disable RELRO
10
11No point having PT_GNU_RELRO as ELF data won't exist when merging into PE32+ file
12
13Unbreaks lld usage which complains about linker script
14Fixes ncroxon/gnu-efi#4
15--- a/Make.defaults
16+++ b/Make.defaults
17@@ -199,7 +199,7 @@ endif
18 ARFLAGS := rDv
19 ASFLAGS += $(ARCH3264)
20 LDFLAGS += -nostdlib --warn-common --no-undefined --fatal-warnings \
21- --build-id=sha1 -z nocombreloc
22+ --build-id=sha1 -z nocombreloc -z norelro
23
24 ifneq ($(ARCH),arm)
25 export LIBGCC=$(shell $(CC) $(CFLAGS) $(ARCH3264) -print-libgcc-file-name)
26
diff --git a/gnu-efi/gnu-efi-3.0.18-remove-linux-headers.patch b/gnu-efi/gnu-efi-3.0.18-remove-linux-headers.patch
new file mode 100644
index 0000000..e997aae
--- /dev/null
+++ b/gnu-efi/gnu-efi-3.0.18-remove-linux-headers.patch
@@ -0,0 +1,14 @@
1https://bugs.gentoo.org/888829
2
3--- a/apps/Makefile
4+++ b/apps/Makefile
5@@ -41,9 +41,7 @@
6
7 include $(SRCDIR)/../Make.defaults
8
9-LINUX_HEADERS = /usr/src/sys/build
10 APPSDIR = $(LIBDIR)/gnuefi/apps
11-CPPFLAGS += -D__KERNEL__ -I$(LINUX_HEADERS)/include
12 CRTOBJS = $(TOPDIR)/$(ARCH)/gnuefi/crt0-efi-$(ARCH).o
13
14 LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_efi.lds
diff --git a/gnu-efi/gnu-efi-3.0.19-fix-binutils-2.46.patch b/gnu-efi/gnu-efi-3.0.19-fix-binutils-2.46.patch
new file mode 100644
index 0000000..3499371
--- /dev/null
+++ b/gnu-efi/gnu-efi-3.0.19-fix-binutils-2.46.patch
@@ -0,0 +1,19 @@
1Backport the fix from gnu-efi 4.0.4 to build with binutils-2.46.
2
3https://bugs.gentoo.org/970040
4
5--- a/apps/Makefile
6+++ b/apps/Makefile
7@@ -66,9 +66,9 @@
8
9 ifneq ($(HAVE_EFI_OBJCOPY),)
10
11-FORMAT := --target efi-app-$(ARCH)
12-$(TARGET_BSDRIVERS): FORMAT=--target efi-bsdrv-$(ARCH)
13-$(TARGET_RTDRIVERS): FORMAT=--target efi-rtdrv-$(ARCH)
14+FORMAT := -O efi-app-$(ARCH)
15+$(TARGET_BSDRIVERS): FORMAT=-O efi-bsdrv-$(ARCH)
16+$(TARGET_RTDRIVERS): FORMAT=-O efi-rtdrv-$(ARCH)
17
18 else
19