summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2022-05-30 15:53:16 -0400
committerMike Gilbert <floppym@gentoo.org>2022-05-30 16:00:57 -0400
commitdd588aed9953294f244862dcc4c75960ecf54f6e (patch)
tree1ec77c0c3dad145be6bb1bcca46670ec29d854c5 /sys-boot
parenttoolchain.eclass: ensure thumb mode for armv6m (diff)
downloadgentoo-dd588aed9953294f244862dcc4c75960ecf54f6e.tar.gz
gentoo-dd588aed9953294f244862dcc4c75960ecf54f6e.tar.bz2
gentoo-dd588aed9953294f244862dcc4c75960ecf54f6e.zip
sys-boot/syslinux: add 6.04_pre3
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/syslinux/Manifest1
-rw-r--r--sys-boot/syslinux/files/6.04_pre3/0001-Strip-the-.note.gnu.property-section-for-the-mbr.patch47
-rw-r--r--sys-boot/syslinux/files/6.04_pre3/0002-Force-the-linker-to-put-all-sections-into-a-single-P.patch311
-rw-r--r--sys-boot/syslinux/files/6.04_pre3/0003-GCC-10-compatibility-patch.patch99
-rw-r--r--sys-boot/syslinux/files/6.04_pre3/0004-Inherit-toolchain-vars-from-environment.patch72
-rw-r--r--sys-boot/syslinux/files/6.04_pre3/0005-Include-efisetjmp.h-from-efi.h.patch24
-rw-r--r--sys-boot/syslinux/metadata.xml25
-rw-r--r--sys-boot/syslinux/syslinux-6.04_pre3.ebuild92
8 files changed, 661 insertions, 10 deletions
diff --git a/sys-boot/syslinux/Manifest b/sys-boot/syslinux/Manifest
index 10c5556ec517..199f8fc51470 100644
--- a/sys-boot/syslinux/Manifest
+++ b/sys-boot/syslinux/Manifest
@@ -1 +1,2 @@
DIST syslinux-6.04-pre1.tar.xz 5283272 BLAKE2B 800e5977ed13b26a1756c33d8625e850631b642e26a86e3328196ddd998596693c3a26db0ada4c0ba78a4ba692a1cc01886b6eb693d877ddafcfb325ecdeb639 SHA512 7927dd39be8e2dcf4138a6fea33def67d19d938379d694f15b48fdd2f5924c028b7a9e7bd71d0c7c6630c203e9e2a54296628e530632ad5e6f55b1ebefe8fc98
+DIST syslinux-6.04-pre3.tar.gz 10760898 BLAKE2B 708bb7f3ecbe1888471f3be0102270c056bf8c5be22013f36b56c90f13f5358ce1853722b14b962d8156cd1f045b9687166b98a1d7ad2853acbe6303fa40fae9 SHA512 0619a25347f3964e0c7c6ff629b2f59f01bd9e0afd822f46b67f26b8c84cbc55534cf7b22ff1bf83eec4986fd2d8f1646a3d750190a7c6c50251affc0b62594d
diff --git a/sys-boot/syslinux/files/6.04_pre3/0001-Strip-the-.note.gnu.property-section-for-the-mbr.patch b/sys-boot/syslinux/files/6.04_pre3/0001-Strip-the-.note.gnu.property-section-for-the-mbr.patch
new file mode 100644
index 000000000000..5d823436bec8
--- /dev/null
+++ b/sys-boot/syslinux/files/6.04_pre3/0001-Strip-the-.note.gnu.property-section-for-the-mbr.patch
@@ -0,0 +1,47 @@
+From 60fef313164d1048cf11423656732953776e5e2f Mon Sep 17 00:00:00 2001
+From: Lukas Schwaighofer <lukas@schwaighofer.name>
+Date: Sat, 18 Aug 2018 12:48:21 +0200
+Subject: [PATCH 1/5] Strip the .note.gnu.property section for the mbr
+
+This section is added since binutils Debian version 2.31.1-2 and causes mbr.bin
+to grow in size beyond what can fit into the master boot record.
+
+Forwarded: https://www.syslinux.org/archives/2018-August/026168.html
+---
+ mbr/i386/mbr.ld | 6 +++++-
+ mbr/x86_64/mbr.ld | 6 +++++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/mbr/i386/mbr.ld b/mbr/i386/mbr.ld
+index d14ba802..6d489904 100644
+--- a/mbr/i386/mbr.ld
++++ b/mbr/i386/mbr.ld
+@@ -69,5 +69,9 @@ SECTIONS
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+- /DISCARD/ : { *(.note.GNU-stack) }
++ /DISCARD/ :
++ {
++ *(.note.GNU-stack)
++ *(.note.gnu.property)
++ }
+ }
+diff --git a/mbr/x86_64/mbr.ld b/mbr/x86_64/mbr.ld
+index ae27d49a..5b46db66 100644
+--- a/mbr/x86_64/mbr.ld
++++ b/mbr/x86_64/mbr.ld
+@@ -68,5 +68,9 @@ SECTIONS
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+- /DISCARD/ : { *(.note.GNU-stack) }
++ /DISCARD/ :
++ {
++ *(.note.GNU-stack)
++ *(.note.gnu.property)
++ }
+ }
+--
+2.35.1
+
diff --git a/sys-boot/syslinux/files/6.04_pre3/0002-Force-the-linker-to-put-all-sections-into-a-single-P.patch b/sys-boot/syslinux/files/6.04_pre3/0002-Force-the-linker-to-put-all-sections-into-a-single-P.patch
new file mode 100644
index 000000000000..33b6a36c63ea
--- /dev/null
+++ b/sys-boot/syslinux/files/6.04_pre3/0002-Force-the-linker-to-put-all-sections-into-a-single-P.patch
@@ -0,0 +1,311 @@
+From 0c646f067a6b766a5ce0434e5e4e7b839b511331 Mon Sep 17 00:00:00 2001
+From: Lukas Schwaighofer <lukas@schwaighofer.name>
+Date: Sat, 18 Aug 2018 16:56:35 +0200
+Subject: [PATCH 2/5] Force the linker to put all sections into a single
+ PT_LOAD segment
+
+This is required when using binutils >= 2.31 which writes two PT_LOAD segments
+by default. This is not supported by the wrapper.c script used to convert the
+shared object into an elf binary.
+
+Forwarded: https://www.syslinux.org/archives/2018-August/026167.html
+---
+ efi/i386/syslinux.ld | 37 +++++++++++++++++++++----------------
+ efi/x86_64/syslinux.ld | 37 +++++++++++++++++++++----------------
+ 2 files changed, 42 insertions(+), 32 deletions(-)
+
+diff --git a/efi/i386/syslinux.ld b/efi/i386/syslinux.ld
+index bab3fc74..19c16479 100644
+--- a/efi/i386/syslinux.ld
++++ b/efi/i386/syslinux.ld
+@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+ OUTPUT_ARCH(i386)
+ ENTRY(_start)
+
++PHDRS
++{
++ all PT_LOAD ;
++}
++
+ SECTIONS
+ {
+ . = 0;
+@@ -31,7 +36,7 @@ SECTIONS
+ *(.text)
+ *(.text.*)
+ __text_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -40,7 +45,7 @@ SECTIONS
+ *(.rodata)
+ *(.rodata.*)
+ __rodata_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -49,14 +54,14 @@ SECTIONS
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ __ctors_end = .;
+- }
++ } :all
+
+ .dtors : {
+ __dtors_start = .;
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ __dtors_end = .;
+- }
++ } :all
+
+ . = ALIGN(4096);
+ .rel : {
+@@ -64,7 +69,7 @@ SECTIONS
+ *(.rel.data)
+ *(.rel.data.*)
+ *(.rel.ctors)
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -72,14 +77,14 @@ SECTIONS
+ __gnu_hash_start = .;
+ *(.gnu.hash)
+ __gnu_hash_end = .;
+- }
++ } :all
+
+
+ .dynsym : {
+ __dynsym_start = .;
+ *(.dynsym)
+ __dynsym_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -87,7 +92,7 @@ SECTIONS
+ __dynstr_start = .;
+ *(.dynstr)
+ __dynstr_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -104,7 +109,7 @@ SECTIONS
+ KEEP (*(.got.plt))
+ KEEP (*(.got))
+ __got_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -112,7 +117,7 @@ SECTIONS
+ __dynamic_start = .;
+ *(.dynamic)
+ __dynamic_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -122,19 +127,19 @@ SECTIONS
+ *(.data.*)
+ *(.lowmem)
+ __data_end = .;
+- }
++ } :all
+
+ .reloc : {
+ *(.reloc)
+- }
++ } :all
+
+ .symtab : {
+ *(.symtab)
+- }
++ } :all
+
+ .strtab : {
+ *(.strtab)
+- }
++ } :all
+
+ .bss (NOLOAD) : {
+ /* the EFI loader doesn't seem to like a .bss section,
+@@ -148,7 +153,7 @@ SECTIONS
+ __bss_end = .;
+ *(.sbss)
+ *(.scommon)
+- }
++ } :all
+ __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
+ __bss_dwords = (__bss_len + 3) >> 2;
+
+@@ -161,7 +166,7 @@ SECTIONS
+ *(.hugebss)
+ *(.hugebss.*)
+ __hugebss_end = .;
+- }
++ } :all
+
+ _end = .;
+
+diff --git a/efi/x86_64/syslinux.ld b/efi/x86_64/syslinux.ld
+index 450641c6..a2c124fd 100644
+--- a/efi/x86_64/syslinux.ld
++++ b/efi/x86_64/syslinux.ld
+@@ -19,6 +19,11 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
+ OUTPUT_ARCH(i386:x86-64)
+ ENTRY(_start)
+
++PHDRS
++{
++ all PT_LOAD ;
++}
++
+ SECTIONS
+ {
+ . = 0;
+@@ -31,7 +36,7 @@ SECTIONS
+ *(.text)
+ *(.text.*)
+ __text_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -40,7 +45,7 @@ SECTIONS
+ *(.rodata)
+ *(.rodata.*)
+ __rodata_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -49,14 +54,14 @@ SECTIONS
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.ctors))
+ __ctors_end = .;
+- }
++ } :all
+
+ .dtors : {
+ __dtors_start = .;
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ __dtors_end = .;
+- }
++ } :all
+
+ . = ALIGN(4096);
+ .rel : {
+@@ -64,7 +69,7 @@ SECTIONS
+ *(.rel.data)
+ *(.rel.data.*)
+ *(.rel.ctors)
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -72,14 +77,14 @@ SECTIONS
+ __gnu_hash_start = .;
+ *(.gnu.hash)
+ __gnu_hash_end = .;
+- }
++ } :all
+
+
+ .dynsym : {
+ __dynsym_start = .;
+ *(.dynsym)
+ __dynsym_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -87,7 +92,7 @@ SECTIONS
+ __dynstr_start = .;
+ *(.dynstr)
+ __dynstr_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -104,7 +109,7 @@ SECTIONS
+ KEEP (*(.got.plt))
+ KEEP (*(.got))
+ __got_end = .;
+- }
++ } :all
+
+ . = ALIGN(4);
+
+@@ -112,7 +117,7 @@ SECTIONS
+ __dynamic_start = .;
+ *(.dynamic)
+ __dynamic_end = .;
+- }
++ } :all
+
+ . = ALIGN(16);
+
+@@ -122,19 +127,19 @@ SECTIONS
+ *(.data.*)
+ *(.lowmem)
+ __data_end = .;
+- }
++ } :all
+
+ .reloc : {
+ *(.reloc)
+- }
++ } :all
+
+ .symtab : {
+ *(.symtab)
+- }
++ } :all
+
+ .strtab : {
+ *(.strtab)
+- }
++ } :all
+
+ .bss (NOLOAD) : {
+ /* the EFI loader doesn't seem to like a .bss section,
+@@ -148,7 +153,7 @@ SECTIONS
+ __bss_end = .;
+ *(.sbss)
+ *(.scommon)
+- }
++ } :all
+ __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
+ __bss_dwords = (__bss_len + 3) >> 2;
+
+@@ -161,7 +166,7 @@ SECTIONS
+ *(.hugebss)
+ *(.hugebss.*)
+ __hugebss_end = .;
+- }
++ } :all
+
+ _end = .;
+
+--
+2.35.1
+
diff --git a/sys-boot/syslinux/files/6.04_pre3/0003-GCC-10-compatibility-patch.patch b/sys-boot/syslinux/files/6.04_pre3/0003-GCC-10-compatibility-patch.patch
new file mode 100644
index 000000000000..6d60eab14bbb
--- /dev/null
+++ b/sys-boot/syslinux/files/6.04_pre3/0003-GCC-10-compatibility-patch.patch
@@ -0,0 +1,99 @@
+From b92e6e8f624c96acf2ce80192a893ee25de527a1 Mon Sep 17 00:00:00 2001
+From: Lukas Schwaighofer <lukas@schwaighofer.name>
+Date: Sun, 16 Aug 2020 15:23:21 +0200
+Subject: [PATCH 3/5] GCC-10 compatibility patch
+
+* Add `-fcommon` to most gcc invocations to allow duplicate definitions
+* __builtin_strlen is not really a "builtin" an implementation still
+ needs to be provided (source:
+ https://bugzilla.suse.com/show_bug.cgi?id=1166605#c5). Work around the
+ issue by supplying an inline function. The strlen function added to
+ dos/string.h was copied from com32/lib/strlen.c.
+---
+ dos/string.h | 11 ++++++++++-
+ mk/efi.mk | 1 +
+ mk/elf.mk | 1 +
+ mk/embedded.mk | 2 +-
+ mk/lib.mk | 2 +-
+ 5 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/dos/string.h b/dos/string.h
+index f648de2d..c4649f5f 100644
+--- a/dos/string.h
++++ b/dos/string.h
+@@ -5,12 +5,21 @@
+ #ifndef _STRING_H
+ #define _STRING_H
+
++#include <stddef.h>
++
+ /* Standard routines */
+ #define memcpy(a,b,c) __builtin_memcpy(a,b,c)
+ #define memmove(a,b,c) __builtin_memmove(a,b,c)
+ #define memset(a,b,c) __builtin_memset(a,b,c)
+ #define strcpy(a,b) __builtin_strcpy(a,b)
+-#define strlen(a) __builtin_strlen(a)
++
++static inline size_t strlen(const char *s)
++{
++ const char *ss = s;
++ while (*ss)
++ ss++;
++ return ss - s;
++}
+
+ /* This only returns true or false */
+ static inline int memcmp(const void *__m1, const void *__m2, unsigned int __n)
+diff --git a/mk/efi.mk b/mk/efi.mk
+index f097ad22..407bc077 100644
+--- a/mk/efi.mk
++++ b/mk/efi.mk
+@@ -25,6 +25,7 @@ FORMAT=efi-app-$(EFI_SUBARCH)
+
+ CFLAGS = -I$(EFIINC) -I$(EFIINC)/$(EFI_SUBARCH) \
+ -DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
++ -fcommon \
+ -Wall -I$(com32)/include -I$(com32)/include/sys \
+ -I$(core)/include -I$(core)/ $(ARCHOPT) \
+ -I$(com32)/lib/ -I$(com32)/libutil/include -std=gnu99 \
+diff --git a/mk/elf.mk b/mk/elf.mk
+index b46dbd06..dc265ce9 100644
+--- a/mk/elf.mk
++++ b/mk/elf.mk
+@@ -55,6 +55,7 @@ GPLINCLUDE =
+ endif
+
+ CFLAGS = $(GCCOPT) $(GCCWARN) -W -Wall \
++ -fcommon \
+ -fomit-frame-pointer -D__COM32__ -D__FIRMWARE_$(FIRMWARE)__ -DDYNAMIC_MODULE \
+ -nostdinc -iwithprefix include \
+ -I$(com32)/libutil/include -I$(com32)/include \
+diff --git a/mk/embedded.mk b/mk/embedded.mk
+index 488dc0fc..fae13e20 100644
+--- a/mk/embedded.mk
++++ b/mk/embedded.mk
+@@ -57,7 +57,7 @@ LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
+ LD += -m elf_$(ARCH)
+
+ # Note: use += for CFLAGS and SFLAGS in case something is set in MCONFIG.local
+-CFLAGS += $(GCCOPT) -g $(GCCWARN) -Wno-sign-compare $(OPTFLAGS) $(INCLUDES)
++CFLAGS += $(GCCOPT) -g $(GCCWARN) -Wno-sign-compare -fcommon $(OPTFLAGS) $(INCLUDES)
+ SFLAGS += $(CFLAGS) -D__ASSEMBLY__
+
+ .SUFFIXES: .c .o .S .s .i .elf .com .bin .asm .lst .c32 .lss
+diff --git a/mk/lib.mk b/mk/lib.mk
+index f8591e56..6dd54295 100644
+--- a/mk/lib.mk
++++ b/mk/lib.mk
+@@ -49,7 +49,7 @@ OPTFLAGS = -Os -march=$(MARCH) -falign-functions=0 -falign-jumps=0 \
+ -falign-labels=0 -ffast-math -fomit-frame-pointer
+ WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
+
+-CFLAGS = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
++CFLAGS = $(OPTFLAGS) $(REQFLAGS) -fcommon $(WARNFLAGS) $(LIBFLAGS)
+
+ ifeq ($(FWCLASS),EFI)
+ CFLAGS += -mno-red-zone
+--
+2.35.1
+
diff --git a/sys-boot/syslinux/files/6.04_pre3/0004-Inherit-toolchain-vars-from-environment.patch b/sys-boot/syslinux/files/6.04_pre3/0004-Inherit-toolchain-vars-from-environment.patch
new file mode 100644
index 000000000000..40784f9b2698
--- /dev/null
+++ b/sys-boot/syslinux/files/6.04_pre3/0004-Inherit-toolchain-vars-from-environment.patch
@@ -0,0 +1,72 @@
+From 46d58e2b03e15a863aed8661b9ee922da4930a3e Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Mon, 30 May 2022 11:57:07 -0400
+Subject: [PATCH 4/5] Inherit toolchain vars from environment
+
+---
+ mk/syslinux.mk | 36 ++++++++++++++++++------------------
+ 1 file changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/mk/syslinux.mk b/mk/syslinux.mk
+index 593ff75f..91d984e8 100644
+--- a/mk/syslinux.mk
++++ b/mk/syslinux.mk
+@@ -37,7 +37,7 @@ ifdef DEBUG
+ DEBUGOPT = -DDEBUG=$(DEBUG)
+ endif
+
+-NASM = nasm
++NASM ?= nasm
+ NASMOPT = -Ox $(DEBUGOPT)
+
+ PERL = perl
+@@ -46,29 +46,29 @@ UPX = upx
+
+ CHMOD = chmod
+
+-CC = gcc
++CC ?= gcc
+ gcc_ok = $(shell tmpf=gcc_ok.$$$$.tmp; \
+ if $(CC) $(GCCOPT) $(1) -c $(topdir)/dummy.c \
+ -o $$tmpf 2>/dev/null ; \
+ then echo '$(1)'; else echo '$(2)'; fi; \
+ rm -f $$tmpf)
+
+-LD = ld
+-OBJDUMP = objdump
+-OBJCOPY = objcopy
+-STRIP = strip
+-AR = ar
+-NM = nm
+-RANLIB = ranlib
+-STRIP = strip
+-GZIPPROG = gzip
+-XZ = xz
+-PNGTOPNM = pngtopnm
+-MCOPY = mcopy
+-MFORMAT = mformat
+-MKISOFS = mkisofs
+-SED = sed
+-WGET = wget
++LD ?= ld
++OBJDUMP ?= objdump
++OBJCOPY ?= objcopy
++STRIP ?= strip
++AR ?= ar
++NM ?= nm
++RANLIB ?= ranlib
++STRIP ?= strip
++GZIPPROG ?= gzip
++XZ ?= xz
++PNGTOPNM ?= pngtopnm
++MCOPY ?= mcopy
++MFORMAT ?= mformat
++MKISOFS ?= mkisofs
++SED ?= sed
++WGET ?= wget
+
+ com32 = $(topdir)/com32
+
+--
+2.35.1
+
diff --git a/sys-boot/syslinux/files/6.04_pre3/0005-Include-efisetjmp.h-from-efi.h.patch b/sys-boot/syslinux/files/6.04_pre3/0005-Include-efisetjmp.h-from-efi.h.patch
new file mode 100644
index 000000000000..0d32d7167024
--- /dev/null
+++ b/sys-boot/syslinux/files/6.04_pre3/0005-Include-efisetjmp.h-from-efi.h.patch
@@ -0,0 +1,24 @@
+From 9889f441d006d11d0fb0b726b9f81396ce6fcfbd Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Mon, 30 May 2022 14:22:28 -0400
+Subject: [PATCH 5/5] Include efisetjmp.h from efi.h
+
+---
+ efi/efi.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/efi/efi.h b/efi/efi.h
+index c266532f..250c511e 100644
+--- a/efi/efi.h
++++ b/efi/efi.h
+@@ -22,6 +22,7 @@
+
+ #include <efi.h>
+ #include <efilib.h>
++#include <efisetjmp.h>
+ #include <efistdarg.h>
+
+ /* Delay for 100 ms */
+--
+2.35.1
+
diff --git a/sys-boot/syslinux/metadata.xml b/sys-boot/syslinux/metadata.xml
index 423c8b85ac5e..22c238faa909 100644
--- a/sys-boot/syslinux/metadata.xml
+++ b/sys-boot/syslinux/metadata.xml
@@ -1,14 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<maintainer type="person">
- <email>chithanh@gentoo.org</email>
-</maintainer>
-<maintainer type="project">
- <email>base-system@gentoo.org</email>
- <name>Gentoo Base System</name>
-</maintainer>
-<upstream>
- <remote-id type="cpe">cpe:/a:gentoo:syslinux</remote-id>
-</upstream>
+ <maintainer type="person">
+ <email>chithanh@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <use>
+ <flag name="bios">Enable BIOS support</flag>
+ <flag name="efi32">Enable 32-bit EFI support</flag>
+ <flag name="efi64">Enable 64-bit EFI support</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:gentoo:syslinux</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-boot/syslinux/syslinux-6.04_pre3.ebuild b/sys-boot/syslinux/syslinux-6.04_pre3.ebuild
new file mode 100644
index 000000000000..14724565c3dd
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-6.04_pre3.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
+HOMEPAGE="https://www.syslinux.org/"
+MY_P=${P/_/-}
+SRC_URI="https://git.zytor.com/syslinux/syslinux.git/snapshot/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="+bios efi32 efi64"
+REQUIRED_USE="|| ( bios efi32 efi64 )"
+
+BDEPEND="
+ dev-lang/perl
+ bios? (
+ app-arch/upx
+ app-text/asciidoc
+ dev-lang/nasm
+ )
+"
+RDEPEND="
+ sys-apps/util-linux
+ sys-fs/mtools
+ dev-perl/Crypt-PasswdMD5
+ dev-perl/Digest-SHA1
+"
+DEPEND="${RDEPEND}
+ efi32? ( sys-boot/gnu-efi[abi_x86_32(-)] )
+ efi64? ( sys-boot/gnu-efi[abi_x86_64(-)] )
+ virtual/os-headers
+"
+
+S=${WORKDIR}/${MY_P}
+
+QA_EXECSTACK="usr/share/syslinux/*"
+QA_WX_LOAD="usr/share/syslinux/*"
+QA_PRESTRIPPED="usr/share/syslinux/.*"
+QA_FLAGS_IGNORED=".*"
+
+src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}/${PV}"
+ )
+ default
+}
+
+efimake() {
+ local ABI="${1}"
+ local libdir="$(get_libdir)"
+ shift
+ local args=(
+ EFIINC="${ESYSROOT}/usr/include/efi"
+ LIBDIR="${ESYSROOT}/usr/${libdir}"
+ LIBEFI="${ESYSROOT}/usr/${libdir}/libefi.a"
+ "${@}"
+ )
+ emake "${args[@]}"
+}
+
+src_compile() {
+ tc-export AR CC LD OBJCOPY RANLIB
+ unset LDFLAGS
+ if use bios; then
+ emake bios
+ fi
+ if use efi32; then
+ efimake x86 efi32
+ fi
+ if use efi64; then
+ efimake amd64 efi64
+ fi
+}
+
+src_install() {
+ local args=(
+ INSTALLROOT="${ED}"
+ MANDIR='$(DATADIR)/man'
+ $(usev bios)
+ $(usev efi32)
+ $(usev efi64)
+ install
+ )
+ emake -j1 "${args[@]}"
+ einstalldocs
+ dostrip -x /usr/share/syslinux
+}