summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory A. Pratt <anarchy@gentoo.org>2018-05-30 07:32:01 -0500
committerJory A. Pratt <anarchy@gentoo.org>2018-05-30 07:32:01 -0500
commit5a0a3c6bbf2a6badccb4e50b29130de7d2560218 (patch)
tree7a0045d4f89c061201c62f24877bb43a18502458
parentdev-lang/python - python-2.7.15 update (diff)
downloadanarchy-5a0a3c6bbf2a6badccb4e50b29130de7d2560218.tar.gz
anarchy-5a0a3c6bbf2a6badccb4e50b29130de7d2560218.tar.bz2
anarchy-5a0a3c6bbf2a6badccb4e50b29130de7d2560218.zip
sys-boot/syslinux: Musl fix
-rw-r--r--sys-boot/syslinux/Manifest5
-rw-r--r--sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch34
-rw-r--r--sys-boot/syslinux/files/syslinux-6.04-musl-support.patch313
-rw-r--r--sys-boot/syslinux/metadata.xml11
-rw-r--r--sys-boot/syslinux/syslinux-6.04_pre1.ebuild113
5 files changed, 476 insertions, 0 deletions
diff --git a/sys-boot/syslinux/Manifest b/sys-boot/syslinux/Manifest
new file mode 100644
index 0000000..eadc175
--- /dev/null
+++ b/sys-boot/syslinux/Manifest
@@ -0,0 +1,5 @@
+AUX syslinux-6.03-sysmacros.patch 950 SHA256 e87e4c5f64dc888f578cca5ae3216b98b473bdd9dcda44a706a4eb4bb1e0dbab SHA512 8659e82e5a5402633c807c8a8f99b25fd6e3066fd0838a7e984452e2ebeccc0331481c93101f00a698e573cadcd98966ea216e4f2d9873e6893af817998e2549 WHIRLPOOL 92ce77dc0f3be59364efef7f2798ffbdd6bc45b7d086e49bb2d5db90a66dafe8e4d6866e0d32142dfc92b7924c67d8795a4b79f0e5ee5c2defb07390074d4218
+AUX syslinux-6.04-musl-support.patch 8646 SHA256 0b22d3887a2101ee46279d55bdbd362b1326fda204d82f6aa2d7bfc80ca0ad5a SHA512 adce47e67d1a6e2a0e40500c56d6a174d786bdd573f371be7092f6ae543ba3fd27dd1f5467176988e599a87c76a2000b1c1d5f8bb42cddb783e7415264a2419b WHIRLPOOL 0a0be9591509c68b81621516bbc2f798f6ebabd417629ac6d7b63ff150629d7e56ef3467deacbfb9da9c5750081a9d7e9248172afb6fd9ec290eaebbb8875e50
+DIST syslinux-6.04-pre1.tar.xz 5283272 SHA256 3f6d50a57f3ed47d8234fd0ab4492634eb7c9aaf7dd902f33d3ac33564fd631d SHA512 7927dd39be8e2dcf4138a6fea33def67d19d938379d694f15b48fdd2f5924c028b7a9e7bd71d0c7c6630c203e9e2a54296628e530632ad5e6f55b1ebefe8fc98 WHIRLPOOL d8d3765b974122a1265ca95470379c577108a6aba755c19c1f0373f3986d117c1cfaf1f3f2a9477d2558e66f82db3de980ab12d66c721396154dea7ee1edc28a
+EBUILD syslinux-6.04_pre1.ebuild 3459 SHA256 fb5a03d3dc4a55f38d3e63a83327034ccfd0779850a7e68005f18a65ec885f21 SHA512 3c9460aedd787a4ac15814b9b86951ebf6c91faebe5d521d83c41fa5038206e23fb04f31e4b78bffe891a43f63614bbb49f25c037bc2d8ed1dabba7e97a3c164 WHIRLPOOL 10b8a87b08c5372e409be903e6ed5f0345aa32298684a1b1c6aded8b416313833a2e08120ae8d0c9143571b6abe743219acce570fde8c133ba186495a1921997
+MISC metadata.xml 330 SHA256 264a473aea8781b3aa141a0307ff5445e3e0c800262c209b8bdeb5b36b55b627 SHA512 89e1dde9592f2cc3ed391f6f3ad29b877751b95b0c1bbb4416cd0c38f136c4a293f4687ebb5758adab540d6f3ff63f20f43847e294644c9e68ee84f3223657ac WHIRLPOOL fd7bf363f8a45db96a14e83625a63c0333a7527cc664b323fa2aa5cd40043e0094441052fa701e687cd115a3eded20f9a2aa5c18c9226cbbe6a559fbc95a622d
diff --git a/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch b/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch
new file mode 100644
index 0000000..af464fe
--- /dev/null
+++ b/sys-boot/syslinux/files/syslinux-6.03-sysmacros.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/579928
+
+From d84db34dbe39d55b4d7e868764c056689aa0793b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 01:56:41 -0400
+Subject: [PATCH] extlinux: pull in sys/sysmacros.h for major/minor/makedev
+
+These functions are defined in sys/sysmacros.h, so add the include to
+main.c. This is already handled correctly in mountinfo.c. Otherwise
+we get build failures like:
+
+main.o: In function 'find_device_sysfs':
+extlinux/main.c:1131: undefined reference to 'minor'
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ extlinux/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/extlinux/main.c b/extlinux/main.c
+index a7ebd49..ebff7ea 100644
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -38,6 +38,7 @@
+ #include <sysexits.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/vfs.h>
+--
+2.7.4
+
diff --git a/sys-boot/syslinux/files/syslinux-6.04-musl-support.patch b/sys-boot/syslinux/files/syslinux-6.04-musl-support.patch
new file mode 100644
index 0000000..df4ac7b
--- /dev/null
+++ b/sys-boot/syslinux/files/syslinux-6.04-musl-support.patch
@@ -0,0 +1,313 @@
+diff --git a/efi/wrapper.c b/efi/wrapper.c
+index 19881248..d8bdba5b 100644
+--- a/efi/wrapper.c
++++ b/efi/wrapper.c
+@@ -17,6 +17,7 @@
+ #include <linux/elf.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -43,8 +44,8 @@ typedef Elf64_Addr Elf_Addr;
+ * For 64bit machines (class == ELFCLASS64), the optional
+ * header includes PE32+header fields
+ */
+-static void write_header(FILE *f, __uint32_t entry, size_t data_size,
+- __uint32_t so_memsz, __uint8_t class)
++static void write_header(FILE *f, uint32_t entry, size_t data_size,
++ uint32_t so_memsz, uint8_t class)
+ {
+ struct optional_hdr o_hdr;
+ struct optional_hdr_pe32p o_hdr_pe32p;
+@@ -53,9 +54,9 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size,
+ struct extra_hdr_pe32p e_hdr_pe32p;
+ struct coff_hdr c_hdr;
+ struct header hdr;
+- __uint32_t total_sz = data_size;
+- __uint32_t hdr_sz;
+- __uint32_t reloc_start, reloc_end;
++ uint32_t total_sz = data_size;
++ uint32_t hdr_sz;
++ uint32_t reloc_start, reloc_end;
+
+ /*
+ * The header size have to be a multiple of file_align, which currently
+@@ -103,7 +104,7 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size,
+ e_hdr.image_sz = hdr_sz + so_memsz;
+ e_hdr.headers_sz = hdr_sz;
+ e_hdr.subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION;
+- e_hdr.rva_and_sizes_nr = sizeof(e_hdr.data_directory) / sizeof(__uint64_t);
++ e_hdr.rva_and_sizes_nr = sizeof(e_hdr.data_directory) / sizeof(uint64_t);
+ fwrite(&e_hdr, sizeof(e_hdr), 1, f);
+ }
+ else if (class == ELFCLASS64) {
+@@ -126,7 +127,7 @@ static void write_header(FILE *f, __uint32_t entry, size_t data_size,
+ e_hdr_pe32p.image_sz = hdr_sz + so_memsz;
+ e_hdr_pe32p.headers_sz = hdr_sz;
+ e_hdr_pe32p.subsystem = IMAGE_SUBSYSTEM_EFI_APPLICATION;
+- e_hdr_pe32p.rva_and_sizes_nr = sizeof(e_hdr_pe32p.data_directory) / sizeof(__uint64_t);
++ e_hdr_pe32p.rva_and_sizes_nr = sizeof(e_hdr_pe32p.data_directory) / sizeof(uint64_t);
+ fwrite(&e_hdr_pe32p, sizeof(e_hdr_pe32p), 1, f);
+ }
+
+@@ -163,10 +164,10 @@ int main(int argc, char **argv)
+ {
+ Elf32_Ehdr e32_hdr;
+ Elf64_Ehdr e64_hdr;
+- __uint32_t entry;
+- __uint8_t class;
+- __uint64_t phoff = 0;
+- __uint16_t phnum = 0, phentsize = 0;
++ uint32_t entry;
++ uint8_t class;
++ uint64_t phoff = 0;
++ uint16_t phnum = 0, phentsize = 0;
+ unsigned char *id;
+ FILE *f_in, *f_out;
+ void *buf;
+diff --git a/efi/wrapper.h b/efi/wrapper.h
+index 0e6b38ea..bc1c64e3 100644
+--- a/efi/wrapper.h
++++ b/efi/wrapper.h
+@@ -27,13 +27,13 @@
+ #define OFFSETOF(t,m) ((size_t)&((t *)0)->m)
+
+ struct header {
+- __uint16_t msdos_signature;
+- __uint8_t _pad1[0x16];
+- __uint16_t relocs_ptr;
+- __uint8_t __pad2[0x3c - 0x1a];
+- __uint32_t pe_hdr;
+- __uint16_t pe_signature;
+- __uint16_t _pad2;
++ uint16_t msdos_signature;
++ uint8_t _pad1[0x16];
++ uint16_t relocs_ptr;
++ uint8_t __pad2[0x3c - 0x1a];
++ uint32_t pe_hdr;
++ uint16_t pe_signature;
++ uint16_t _pad2;
+ } __packed;
+
+ /* FIXME: when setting up coff_hdr, set up optional_hdr_sz
+@@ -43,72 +43,72 @@ struct header {
+ * COFF header
+ */
+ struct coff_hdr {
+- __uint16_t arch;
+- __uint16_t nr_sections;
+- __uint32_t timedatestamp;
+- __uint32_t symtab;
+- __uint32_t nr_syms;
+- __uint16_t optional_hdr_sz;
+- __uint16_t characteristics;
++ uint16_t arch;
++ uint16_t nr_sections;
++ uint32_t timedatestamp;
++ uint32_t symtab;
++ uint32_t nr_syms;
++ uint16_t optional_hdr_sz;
++ uint16_t characteristics;
+ } __packed;
+
+ struct optional_hdr {
+- __uint16_t format;
+- __uint8_t major_linker_version;
+- __uint8_t minor_linker_version;
+- __uint32_t code_sz;
+- __uint32_t initialized_data_sz;
+- __uint32_t uninitialized_data_sz;
+- __uint32_t entry_point;
+- __uint32_t base_code;
+- __uint32_t data;
++ uint16_t format;
++ uint8_t major_linker_version;
++ uint8_t minor_linker_version;
++ uint32_t code_sz;
++ uint32_t initialized_data_sz;
++ uint32_t uninitialized_data_sz;
++ uint32_t entry_point;
++ uint32_t base_code;
++ uint32_t data;
+ } __packed;
+
+ /* For PE32+, the optional_header does NOT have
+ * data after base_code
+ */
+ struct optional_hdr_pe32p {
+- __uint16_t format;
+- __uint8_t major_linker_version;
+- __uint8_t minor_linker_version;
+- __uint32_t code_sz;
+- __uint32_t initialized_data_sz;
+- __uint32_t uninitialized_data_sz;
+- __uint32_t entry_point;
+- __uint32_t base_code;
++ uint16_t format;
++ uint8_t major_linker_version;
++ uint8_t minor_linker_version;
++ uint32_t code_sz;
++ uint32_t initialized_data_sz;
++ uint32_t uninitialized_data_sz;
++ uint32_t entry_point;
++ uint32_t base_code;
+ } __packed;
+ /*
+ * Extra header fields
+ */
+ struct extra_hdr {
+- __uint32_t image_base;
+- __uint32_t section_align;
+- __uint32_t file_align;
+- __uint16_t major_os_version;
+- __uint16_t minor_os_version;
+- __uint16_t major_image_version;
+- __uint16_t minor_image_version;
+- __uint16_t major_subsystem_version;
+- __uint16_t minor_subsystem_version;
+- __uint32_t win32_version;
+- __uint32_t image_sz;
+- __uint32_t headers_sz;
+- __uint32_t checksum;
+- __uint16_t subsystem;
+- __uint16_t dll_characteristics;
+- __uint32_t stack_reserve_sz;
+- __uint32_t stack_commit_sz;
+- __uint32_t heap_reserve_sz;
+- __uint32_t heap_commit_sz;
+- __uint32_t loader_flags;
+- __uint32_t rva_and_sizes_nr;
++ uint32_t image_base;
++ uint32_t section_align;
++ uint32_t file_align;
++ uint16_t major_os_version;
++ uint16_t minor_os_version;
++ uint16_t major_image_version;
++ uint16_t minor_image_version;
++ uint16_t major_subsystem_version;
++ uint16_t minor_subsystem_version;
++ uint32_t win32_version;
++ uint32_t image_sz;
++ uint32_t headers_sz;
++ uint32_t checksum;
++ uint16_t subsystem;
++ uint16_t dll_characteristics;
++ uint32_t stack_reserve_sz;
++ uint32_t stack_commit_sz;
++ uint32_t heap_reserve_sz;
++ uint32_t heap_commit_sz;
++ uint32_t loader_flags;
++ uint32_t rva_and_sizes_nr;
+ struct {
+- __uint64_t export_table;
+- __uint64_t import_table;
+- __uint64_t resource_table;
+- __uint64_t exception_table;
+- __uint64_t certification_table;
+- __uint64_t base_relocation_table;
++ uint64_t export_table;
++ uint64_t import_table;
++ uint64_t resource_table;
++ uint64_t exception_table;
++ uint64_t certification_table;
++ uint64_t base_relocation_table;
+ } data_directory;
+ } __packed;
+
+@@ -117,54 +117,54 @@ struct extra_hdr {
+ */
+
+ struct extra_hdr_pe32p {
+- __uint64_t image_base;
+- __uint32_t section_align;
+- __uint32_t file_align;
+- __uint16_t major_os_version;
+- __uint16_t minor_os_version;
+- __uint16_t major_image_version;
+- __uint16_t minor_image_version;
+- __uint16_t major_subsystem_version;
+- __uint16_t minor_subsystem_version;
+- __uint32_t win32_version;
+- __uint32_t image_sz;
+- __uint32_t headers_sz;
+- __uint32_t checksum;
+- __uint16_t subsystem;
+- __uint16_t dll_characteristics;
+- __uint64_t stack_reserve_sz;
+- __uint64_t stack_commit_sz;
+- __uint64_t heap_reserve_sz;
+- __uint64_t heap_commit_sz;
+- __uint32_t loader_flags;
+- __uint32_t rva_and_sizes_nr;
++ uint64_t image_base;
++ uint32_t section_align;
++ uint32_t file_align;
++ uint16_t major_os_version;
++ uint16_t minor_os_version;
++ uint16_t major_image_version;
++ uint16_t minor_image_version;
++ uint16_t major_subsystem_version;
++ uint16_t minor_subsystem_version;
++ uint32_t win32_version;
++ uint32_t image_sz;
++ uint32_t headers_sz;
++ uint32_t checksum;
++ uint16_t subsystem;
++ uint16_t dll_characteristics;
++ uint64_t stack_reserve_sz;
++ uint64_t stack_commit_sz;
++ uint64_t heap_reserve_sz;
++ uint64_t heap_commit_sz;
++ uint32_t loader_flags;
++ uint32_t rva_and_sizes_nr;
+ struct {
+- __uint64_t export_table;
+- __uint64_t import_table;
+- __uint64_t resource_table;
+- __uint64_t exception_table;
+- __uint64_t certification_table;
+- __uint64_t base_relocation_table;
++ uint64_t export_table;
++ uint64_t import_table;
++ uint64_t resource_table;
++ uint64_t exception_table;
++ uint64_t certification_table;
++ uint64_t base_relocation_table;
+ } data_directory;
+ } __packed;
+
+ struct section {
+- __uint8_t name[8];
+- __uint32_t virtual_sz;
+- __uint32_t virtual_address;
+- __uint32_t raw_data_sz;
+- __uint32_t raw_data;
+- __uint32_t relocs;
+- __uint32_t line_numbers;
+- __uint16_t relocs_nr;
+- __uint16_t line_numbers_nr;
+- __uint32_t characteristics;
++ uint8_t name[8];
++ uint32_t virtual_sz;
++ uint32_t virtual_address;
++ uint32_t raw_data_sz;
++ uint32_t raw_data;
++ uint32_t relocs;
++ uint32_t line_numbers;
++ uint16_t relocs_nr;
++ uint16_t line_numbers_nr;
++ uint32_t characteristics;
+ } __packed;
+
+ struct coff_reloc {
+- __uint32_t virtual_address;
+- __uint32_t symtab_index;
+- __uint16_t type;
++ uint32_t virtual_address;
++ uint32_t symtab_index;
++ uint16_t type;
+ };
+
+ #endif /* EFI_WRAPPER_H */
diff --git a/sys-boot/syslinux/metadata.xml b/sys-boot/syslinux/metadata.xml
new file mode 100644
index 0000000..dbe176c
--- /dev/null
+++ b/sys-boot/syslinux/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://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>
+</pkgmetadata>
diff --git a/sys-boot/syslinux/syslinux-6.04_pre1.ebuild b/sys-boot/syslinux/syslinux-6.04_pre1.ebuild
new file mode 100644
index 0000000..4d11802
--- /dev/null
+++ b/sys-boot/syslinux/syslinux-6.04_pre1.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
+HOMEPAGE="http://www.syslinux.org/"
+# Final releases in 6.xx/$PV.tar.* (literal "xx")
+# Testing releases in Testing/$PV/$PV.tar.*
+SRC_URI_DIR=${PV:0:1}.xx
+SRC_URI_TESTING=Testing/${PV:0:4}
+[[ ${PV/_alpha} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+[[ ${PV/_beta} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+[[ ${PV/_pre} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+[[ ${PV/_rc} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
+SRC_URI="mirror://kernel/linux/utils/boot/syslinux/${SRC_URI_DIR}/${P/_/-}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="custom-cflags"
+
+RDEPEND="sys-fs/mtools
+ dev-perl/Crypt-PasswdMD5
+ dev-perl/Digest-SHA1"
+DEPEND="${RDEPEND}
+ dev-lang/nasm
+ >=sys-boot/gnu-efi-3.0u
+ virtual/os-headers"
+
+S=${WORKDIR}/${P/_/-}
+
+# This ebuild is a departure from the old way of rebuilding everything in syslinux
+# This departure is necessary since hpa doesn't support the rebuilding of anything other
+# than the installers.
+
+# These are executables which come precompiled and are run by the boot loader
+QA_PREBUILT="usr/share/${PN}/*.c32"
+
+# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore
+
+src_prepare() {
+ rm -f gethostip #bug 137081
+
+ epatch "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928
+ epatch "${FILESDIR}"/${PN}-6.04-musl-support.patch
+
+ # Don't prestrip or override user LDFLAGS, bug #305783
+ local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \
+ sample/Makefile utils/Makefile"
+ sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed"
+
+ if use custom-cflags; then
+ sed -i ${SYSLINUX_MAKEFILES} \
+ -e 's|-g -Os||g' \
+ -e 's|-Os||g' \
+ -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \
+ || die "sed custom-cflags failed"
+ else
+ QA_FLAGS_IGNORED="
+ /sbin/extlinux
+ /usr/bin/memdiskfind
+ /usr/bin/gethostip
+ /usr/bin/isohybrid
+ /usr/bin/syslinux
+ "
+ fi
+ case ${ARCH} in
+ amd64) loaderarch="efi64" ;;
+ x86) loaderarch="efi32" ;;
+ *) ewarn "Unsupported architecture, building installers only." ;;
+ esac
+
+ # building with ld.gold causes problems, bug #563364
+ if tc-ld-is-gold; then
+ ewarn "Building syslinux with the gold linker may cause problems, see bug #563364"
+ if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
+ tc-ld-disable-gold
+ ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this."
+ else
+ ewarn "Continuing anyway as requested."
+ fi
+ fi
+}
+
+src_compile() {
+ # build system abuses the LDFLAGS variable to pass arguments to ld
+ unset LDFLAGS
+ if [[ ! -z ${loaderarch} ]]; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch}
+ fi
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" ${loaderarch} installer
+}
+
+src_install() {
+ # parallel install fails sometimes
+ einfo "loaderarch=${loaderarch}"
+ emake -j1 LD="$(tc-getLD)" INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install
+ dodoc README NEWS doc/*.txt
+}
+
+pkg_postinst() {
+ # print warning for users upgrading from the previous stable version
+ if has 4.07 ${REPLACING_VERSIONS}; then
+ ewarn "syslinux now uses dynamically linked ELF executables. Before you reboot,"
+ ewarn "ensure that needed dependencies are fulfilled. For example, run from your"
+ ewarn "syslinux directory:"
+ ewarn
+ ewarn "LD_LIBRARY_PATH=\".\" ldd menu.c32"
+ fi
+}