+++ /dev/null
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=2
-
-inherit bsdmk freebsd flag-o-matic
-
-DESCRIPTION="FreeBSD's bootloader"
-SLOT="0"
-KEYWORDS="~amd64-fbsd ~x86-fbsd"
-
-IUSE="bzip2 ieee1394 tftp zfs"
-
-SRC_URI="mirror://gentoo/${SYS}.tar.bz2
- mirror://gentoo/${LIB}.tar.bz2
- mirror://gentoo/${CONTRIB}.tar.bz2"
-
-RDEPEND=""
-DEPEND="=sys-freebsd/freebsd-mk-defs-${RV}*
- =sys-freebsd/freebsd-lib-${RV}*"
-
-S="${WORKDIR}/sys/boot"
-
-PATCHES=( "${FILESDIR}/${PN}-9.2-gcc46.patch"
- "${FILESDIR}/${PN}-add-nossp-cflags.patch" )
-
-boot0_use_enable() {
- use ${1} && mymakeopts="${mymakeopts} LOADER_${2}_SUPPORT=\"yes\""
-}
-
-pkg_setup() {
- boot0_use_enable ieee1394 FIREWIRE
- boot0_use_enable zfs ZFS
- boot0_use_enable tftp TFTP
- boot0_use_enable bzip2 BZIP2
-}
-
-src_prepare() {
- sed -e '/-fomit-frame-pointer/d' -e '/-mno-align-long-strings/d' \
- -i "${S}"/i386/boot2/Makefile \
- -i "${S}"/i386/gptboot/Makefile \
- -i "${S}"/i386/gptzfsboot/Makefile \
- -i "${S}"/i386/zfsboot/Makefile || die
-}
-
-src_compile() {
- strip-flags
- append-flags "-fno-strict-aliasing"
-
- cd "${WORKDIR}/lib/libstand" || die
- freebsd_src_compile
-
- cd "${S}"
- CFLAGS="${CFLAGS} -I${WORKDIR}/lib/libstand"
- LDFLAGS="${LDFLAGS} -L${WORKDIR}/lib/libstand"
- export LIBSTAND="${WORKDIR}/lib/libstand/libstand.a"
- NOFLAGSTRIP="yes" freebsd_src_compile
-}
-
-src_install() {
- dodir /boot/defaults
- mkinstall FILESDIR=/boot || die "mkinstall failed"
-}
+++ /dev/null
-diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc
-index f5faec7..a9cf593 100644
---- a/sys/boot/i386/Makefile.inc
-+++ b/sys/boot/i386/Makefile.inc
-@@ -12,7 +12,6 @@ LDFLAGS+= -nostdlib
- .if ${MACHINE_CPUARCH} == "amd64"
- CFLAGS+= -m32
- ACFLAGS+= -m32
--LDFLAGS+= -m elf_i386_fbsd
- AFLAGS+= --32
- .endif
-
-diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
-index 65815a5..61840dd 100644
---- a/sys/boot/i386/boot2/Makefile
-+++ b/sys/boot/i386/boot2/Makefile
-@@ -109,3 +109,10 @@ machine:
- # XXX: clang integrated-as doesn't grok .codeNN directives yet
- CFLAGS.boot1.S= ${CLANG_NO_IAS}
- CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
-+
-+# gcc 4.6 or later version, -fno-asynchronous-unwind-tables is required to build.
-+CFLAGS+= -fno-asynchronous-unwind-tables
-+
-+.if ${MACHINE_CPUARCH} == "amd64"
-+LDFLAGS+= -m elf_i386_fbsd
-+.endif
-diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile
-index e1a640a..29886cc 100644
---- a/sys/boot/i386/gptboot/Makefile
-+++ b/sys/boot/i386/gptboot/Makefile
-@@ -78,3 +78,8 @@ machine:
- # XXX: clang integrated-as doesn't grok .codeNN directives yet
- CFLAGS.gptldr.S= ${CLANG_NO_IAS}
- CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
-+
-+.if ${MACHINE_CPUARCH} == "amd64"
-+LDFLAGS+= -m elf_i386_fbsd
-+.endif
-+
-diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile
-index a2b8fcc..107f531 100644
---- a/sys/boot/i386/gptzfsboot/Makefile
-+++ b/sys/boot/i386/gptzfsboot/Makefile
-@@ -76,3 +76,8 @@ machine:
- # XXX: clang integrated-as doesn't grok .codeNN directives yet
- CFLAGS.gptldr.S= ${CLANG_NO_IAS}
- CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
-+
-+.if ${MACHINE_CPUARCH} == "amd64"
-+LDFLAGS+= -m elf_i386_fbsd
-+.endif
-+
-diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile
-index b2db778..252dc62 100644
---- a/sys/boot/i386/zfsboot/Makefile
-+++ b/sys/boot/i386/zfsboot/Makefile
-@@ -89,3 +89,8 @@ machine:
- # XXX: clang integrated-as doesn't grok .codeNN directives yet
- CFLAGS.zfsldr.S= ${CLANG_NO_IAS}
- CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
-+
-+.if ${MACHINE_CPUARCH} == "amd64"
-+LDFLAGS+= -m elf_i386_fbsd
-+.endif
-+