summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Kinard <kumba@gentoo.org>2015-03-05 04:45:30 +0000
committerJoshua Kinard <kumba@gentoo.org>2015-03-05 04:45:30 +0000
commitdf9d9ee805b2a541c40aeca7c63d947118f08981 (patch)
tree61ee2d7e1de8ec05e96d40b35238098833a7914b /sys-boot
parentbump, add use flag timezone, rm one old (diff)
downloadgentoo-2-df9d9ee805b2a541c40aeca7c63d947118f08981.tar.gz
gentoo-2-df9d9ee805b2a541c40aeca7c63d947118f08981.tar.bz2
gentoo-2-df9d9ee805b2a541c40aeca7c63d947118f08981.zip
Big cleanup: Include some patches and a manpage from Debian, re-work the code a little to compile under an n32-only system (should work for n64 as well), silence many compiler warnings, and move patches to a tarball due to the size of the changes.
(Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key D25D95E3)
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/arcload/ChangeLog14
-rw-r--r--sys-boot/arcload/arcload-0.50-r2.ebuild (renamed from sys-boot/arcload/arcload-0.50-r1.ebuild)67
-rw-r--r--sys-boot/arcload/files/arcload-0.50-makefile-targets.patch42
-rw-r--r--sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch273
-rw-r--r--sys-boot/arcload/files/arcload.865
5 files changed, 133 insertions, 328 deletions
diff --git a/sys-boot/arcload/ChangeLog b/sys-boot/arcload/ChangeLog
index ae4e86a1597c..0b1db93c130a 100644
--- a/sys-boot/arcload/ChangeLog
+++ b/sys-boot/arcload/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for sys-boot/arcload
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/ChangeLog,v 1.16 2014/08/10 20:20:54 slyfox Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/ChangeLog,v 1.17 2015/03/05 04:45:30 kumba Exp $
+
+*arcload-0.50-r2 (05 Mar 2015)
+
+ 05 Mar 2015; Joshua Kinard <kumba@gentoo.org> -arcload-0.50-r1.ebuild,
+ +arcload-0.50-r2.ebuild, -files/arcload-0.50-makefile-targets.patch,
+ -files/arcload-0.50-shut-gcc4x-up.patch, +files/arcload.8:
+ Big cleanup: Include some patches and a manpage from Debian, re-work the code
+ a little to compile under an n32-only system (should work for n64 as well),
+ silence many compiler warnings, and move patches to a tarball due to the size
+ of the changes.
10 Aug 2014; Sergei Trofimovich <slyfox@gentoo.org> arcload-0.50-r1.ebuild:
QA: drop trailing '.' from DESCRIPTION
diff --git a/sys-boot/arcload/arcload-0.50-r1.ebuild b/sys-boot/arcload/arcload-0.50-r2.ebuild
index b98e38cdb152..1e7340a6b34b 100644
--- a/sys-boot/arcload/arcload-0.50-r1.ebuild
+++ b/sys-boot/arcload/arcload-0.50-r2.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.50-r1.ebuild,v 1.6 2014/08/10 20:20:54 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.50-r2.ebuild,v 1.1 2015/03/05 04:45:30 kumba Exp $
EAPI=4
@@ -9,31 +9,73 @@ inherit eutils toolchain-funcs versionator
# Hack until upstream renames from 0.5 to 0.50
MY_PV="${PV/50/5}"
+PATCHREV="1"
DESCRIPTION="ARCLoad - SGI Multi-bootloader. Able to bootload many different SGI Systems"
HOMEPAGE="http://www.linux-mips.org/wiki/index.php/ARCLoad"
-SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${PN}-${MY_PV}.tar.bz2"
+SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${PN}-${MY_PV}.tar.bz2
+ mirror://gentoo/${P}-patches-v${PATCHREV}.tar.xz"
LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="-* ~mips"
IUSE=""
-DEPEND="sys-boot/dvhtool"
+DEPEND="sys-boot/dvhtool
+ abi_mips_o32? ( sys-devel/kgcc64 )"
RDEPEND=""
RESTRICT="strip"
S="${WORKDIR}/${PN}-${MY_PV}"
+PATCHDIR="${WORKDIR}/${P}-patches"
src_prepare() {
# For gcc-4.x, quiet down some of the warnings
- $(version_is_at_least "4.0" "$(gcc-version)") && \
- epatch "${FILESDIR}"/${P}-shut-gcc4x-up.patch
+ epatch "${PATCHDIR}"/${P}-shut-gcc4x-up.patch
# Redefine the targets in the primary Makefile to give us
# finer control over building the tools. This is for properly
# cross-compiling arcload
- epatch "${FILESDIR}"/${P}-makefile-targets.patch
+ epatch "${PATCHDIR}"/${P}-makefile-targets.patch
+
+ # Patches borrowed from Debian:
+ # - Load ELF64 images on 32-bit systems
+ # - Pass an arcload label name directly on the PROM cmdline.
+ # - Look for arc.cf in /etc and fallback to /.
+ epatch "${PATCHDIR}"/${P}_deb-elf64-on-m32.patch
+ epatch "${PATCHDIR}"/${P}_deb-cmdline-config.patch
+ epatch "${PATCHDIR}"/${P}_deb-config-in-etc.patch
+
+ # Building arcload on different MIPS ABIs can be difficult,
+ # so we include specific bits from standard system headers
+ # to make the compiler happy. These should rarely, if ever,
+ # change...
+ epatch "${PATCHDIR}"/${P}-local-elf_h.patch
+
+ # Patch wreckoff.c to handle the new .MIPS.abiflags section.
+ epatch "${PATCHDIR}"/${P}-wreckoff-abiflags-fix.patch
+
+ # In order to convert from ELF to ECOFF, we need to disable
+ # SSP, as that adds additional program headers that I don't
+ # know how to handle in wreckoff.c.
+ epatch "${PATCHDIR}"/${P}-disable-ssp.patch
+
+ # The code is old and has a lot of issues. But it's just a
+ # simple bootloader, so silence the various warnings until
+ # it can be re-written.
+ epatch "${PATCHDIR}"/${P}-silence-warnings.patch
}
src_compile() {
+ local myCC myCC64 myLD myLD64
+
+ myCC="$(tc-getCC)"
+ myLD="$(tc-getLD)"
+ if use abi_mips_o32; then
+ myCC64=${myCC/mips/mips64}
+ myLD64=${myLD/mips/mips64}
+ else
+ myCC64=${myCC}
+ myLD64=${myLD}
+ fi
+
# Build the wreckoff tool first. It converts a 32bit MIPS ELF
# into a relocatable ECOFF image. We call for BUILD_CC
# on the offchance that we're cross-compiling.
@@ -43,17 +85,17 @@ src_compile() {
# 32bit copy (sashARCS for IP22/IP32)
echo -e ""
- einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 ..."
+ einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 with ${myCC} ..."
cd "${S}"
emake MODE=M32 bootloader_clean
- emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M32 bootloader
+ emake CC=${myCC} LD=${myLD} MODE=M32 bootloader
cp "${S}"/arcload.ecoff "${WORKDIR}"/sashARCS
# 64bit copy (sash64 for IP27/IP28/IP30)
echo -e ""
- einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ..."
+ einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ${myCC/mips/mips64} ..."
emake MODE=M64 bootloader_clean
- emake CC=$(tc-getCC) LD=$(tc-getLD) MODE=M64 bootloader
+ emake CC=${myCC64} LD=${myLD64} MODE=M64 bootloader
cp "${S}"/arcload "${WORKDIR}"/sash64
}
@@ -63,6 +105,9 @@ src_install() {
cp "${WORKDIR}"/sash64 "${D}"/usr/lib/arcload
cp "${S}"/arc.cf-bootcd "${D}"/usr/lib/arcload/arc-bootcd.cf
cp "${S}"/arc.cf-octane "${D}"/usr/lib/arcload/arc-octane.cf
+
+ # Add a manpage for arcload(8) from the Debian Project.
+ doman "${FILESDIR}/arcload.8"
}
pkg_postinst() {
diff --git a/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch b/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch
deleted file mode 100644
index 9248ac4ccd9c..000000000000
--- a/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -Naurp arcload-0.5.orig/Makefile arcload-0.5/Makefile
---- arcload-0.5.orig/Makefile 2006-01-17 03:53:29.000000000 -0500
-+++ arcload-0.5/Makefile 2009-03-01 20:18:14.699758276 -0500
-@@ -6,9 +6,6 @@
- # Default MODE
- MODE ?= M64
-
--CC=mips-linux-gcc
--LD=mips-linux-ld
--
- BUILD_DIRS=\
- arclib \
- arcgrub \
-@@ -16,10 +13,25 @@ BUILD_DIRS=\
- TOOL_DIRS=\
- ecoff
-
--all clean:
-+bootloader:
-+ for i in $(BUILD_DIRS); do \
-+ CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i all; \
-+ done
-+
-+tools:
- for i in $(TOOL_DIRS); do \
-- MODE=${MODE} $(MAKE) -C $$i $@; \
-+ $(MAKE) -C $$i all; \
- done
-+
-+bootloader_clean:
- for i in $(BUILD_DIRS); do \
-- CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i $@; \
-+ CC=${CC} LD=${LD} MODE=${MODE} $(MAKE) -C $$i clean; \
-+ done
-+
-+tools_clean:
-+ for i in $(TOOL_DIRS); do \
-+ CC=${CC} LD=${LD} $(MAKE) -C $$i clean; \
- done
-+
-+clean: tools_clean bootloader_clean
-+all: tools bootloader
diff --git a/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch b/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch
deleted file mode 100644
index 52ad5a107af1..000000000000
--- a/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-diff -Naurp arcload-0.5.orig/arcgrub/Makefile arcload-0.5/arcgrub/Makefile
---- arcload-0.5.orig/arcgrub/Makefile 2006-01-17 22:43:17.000000000 -0500
-+++ arcload-0.5/arcgrub/Makefile 2009-03-01 20:34:01.258690486 -0500
-@@ -2,11 +2,19 @@
- # Copyright 2004 Stanislaw Skowronek
- #
- ifeq ($(MODE),M32)
--CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE)
-+CFLAGS = -O -march=mips3 -mabi=32 \
-+ -Wall -Wno-pointer-sign \
-+ -mno-abicalls -G 0 -fno-pic -fno-builtin \
-+ -I.. -I. \
-+ -D$(MODE)
- ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE)
- OUTPUTFMT = elf32-tradbigmips
- else
--CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -I. -D$(MODE)
-+CFLAGS = -O -march=mips3 -mabi=64 \
-+ -Wall -Wno-pointer-sign \
-+ -mno-abicalls -G 0 -fno-pic -fno-builtin \
-+ -I.. -I. \
-+ -D$(MODE)
- ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE)
- OUTPUTFMT = elf64-tradbigmips
- endif
-diff -Naurp arcload-0.5.orig/arclib/Makefile arcload-0.5/arclib/Makefile
---- arcload-0.5.orig/arclib/Makefile 2006-01-19 23:09:21.000000000 -0500
-+++ arcload-0.5/arclib/Makefile 2009-03-01 20:35:21.407711034 -0500
-@@ -2,11 +2,19 @@
- # Copyright 1999 Silicon Graphics, Inc.
- #
- ifeq ($(MODE),M32)
--CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
-+CFLAGS = -O -march=mips3 -mabi=32 \
-+ -Wall -Wno-pointer-sign \
-+ -mno-abicalls -G 0 -fno-pic -fno-builtin \
-+ -I.. \
-+ -D$(MODE)
- ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic
- OUTPUTFMT = elf32-tradbigmips
- else
--CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
-+CFLAGS = -O -march=mips3 -mabi=64 \
-+ -Wall -Wno-pointer-sign \
-+ -mno-abicalls -G 0 -fno-pic -fno-builtin \
-+ -I.. \
-+ -D$(MODE)
- ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic
- OUTPUTFMT = elf64-tradbigmips
- endif
-diff -Naurp arcload-0.5.orig/ecoff/Makefile arcload-0.5/ecoff/Makefile
---- arcload-0.5.orig/ecoff/Makefile 2005-05-31 03:08:10.000000000 -0400
-+++ arcload-0.5/ecoff/Makefile 2009-03-01 20:31:38.246701883 -0500
-@@ -5,7 +5,7 @@
- all: wreckoff
-
- wreckoff: ecoff.h elf32.h endian.h list.h wreckoff.c
-- $(CC) -o $@ -O2 -Wall wreckoff.c -I..
-+ $(CC) -o $@ -O2 -Wall -Wno-pointer-sign wreckoff.c -I..
-
- clean:
- rm -f wreckoff
-diff -Naurp arcload-0.5.orig/ecoff/wreckoff.c arcload-0.5/ecoff/wreckoff.c
---- arcload-0.5.orig/ecoff/wreckoff.c 2005-05-31 03:30:28.000000000 -0400
-+++ arcload-0.5/ecoff/wreckoff.c 2009-03-01 20:31:38.246701883 -0500
-@@ -112,6 +112,7 @@ void synthesize_ecoff(FILE *f)
- int i, nsyms, nscns, vptr, rptr, sptr, align;
- int strsize, sym_sc = scNil, sym_st = 0;
- char *strtab;
-+ size_t ret = 0;
-
- /* reindex sections and symbols */
- nscns = 0;
-@@ -151,7 +152,7 @@ void synthesize_ecoff(FILE *f)
- fhdr.f_opthdr = 56;
- fhdr.f_flags = (F_EXEC | F_MIPS_NO_REORG);
- swap_filehdr(&fhdr);
-- fwrite(&fhdr, sizeof(struct filehdr), 1, f);
-+ ret = fwrite(&fhdr, sizeof(struct filehdr), 1, f);
-
- /* write a.out header */
- ahdr.magic = OMAGIC;
-@@ -196,7 +197,7 @@ void synthesize_ecoff(FILE *f)
-
- ahdr.gp_value = reginfo.ri_gp_value;
- swap_aouthdr(&ahdr);
-- fwrite(&ahdr, sizeof(struct aouthdr), 1, f);
-+ ret = fwrite(&ahdr, sizeof(struct aouthdr), 1, f);
-
- LIST_FOR(section, sections) {
- strncpy(shdr.s_name, section->name, 8);
-@@ -229,23 +230,23 @@ void synthesize_ecoff(FILE *f)
- shdr.s_flags = STYP_BSS;
-
- swap_scnhdr(&shdr);
-- fwrite(&shdr, sizeof(struct scnhdr), 1, f);
-+ ret = fwrite(&shdr, sizeof(struct scnhdr), 1, f);
- }
-
- i = 0;
- while(align--)
-- fwrite(&i, 1, 1, f);
-+ ret = fwrite(&i, 1, 1, f);
-
- /* save section contents */
- LIST_FOR(section, sections)
- if(section->data) {
- if(section->gccfix) {
-- fwrite(section->data, (section->size - 0x10), 1, f);
-+ ret = fwrite(section->data, (section->size - 0x10), 1, f);
- align = 0;
- for(i = 0; i < 4; i++)
-- fwrite(&align, 4, 1, f);
-+ ret = fwrite(&align, 4, 1, f);
- } else
-- fwrite(section->data, section->size, 1, f);
-+ ret = fwrite(section->data, section->size, 1, f);
- }
-
- /* save section relocs */
-@@ -275,7 +276,7 @@ void synthesize_ecoff(FILE *f)
- rhdr.r_vaddr = reloc->offset;
- rhdr.r = R_R(reloc->sym->index, i, 1);
- swap_reloc(&rhdr);
-- fwrite(&rhdr, sizeof(struct reloc), 1, f);
-+ ret = fwrite(&rhdr, sizeof(struct reloc), 1, f);
- }
-
- /* create strtab */
-@@ -302,10 +303,10 @@ void synthesize_ecoff(FILE *f)
- ghdr.iextMax = nsyms;
- ghdr.cbExtOffset = (sptr + sizeof(struct sgihdrr) + strsize);
- swap_sgihdrr(&ghdr);
-- fwrite(&ghdr, sizeof(struct sgihdrr), 1, f);
-+ ret = fwrite(&ghdr, sizeof(struct sgihdrr), 1, f);
-
- /* save strtab */
-- fwrite(strtab, strsize, 1, f);
-+ ret = fwrite(strtab, strsize, 1, f);
-
- /* save symbols */
- LIST_FOR(symbol, symbols)
-@@ -331,7 +332,7 @@ void synthesize_ecoff(FILE *f)
- mhdr.value = symbol->offset;
- mhdr.data = S_DATA(sym_st, sym_sc, 0xFFFFF);
- swap_sgiextr(&mhdr);
-- fwrite(&mhdr, sizeof(struct sgiextr), 1, f);
-+ ret = fwrite(&mhdr, sizeof(struct sgiextr), 1, f);
- }
- }
-
-@@ -340,8 +341,9 @@ void synthesize_ecoff(FILE *f)
- char *load_strtab(FILE *f, unsigned off, int sz)
- {
- char *p = malloc(sz);
-+ size_t ret = 0;
- fseek(f, off, SEEK_SET);
-- fread(p, sz, 1, f);
-+ ret = fread(p, sz, 1, f);
- return p;
- }
-
-@@ -359,13 +361,14 @@ void analyze_elf32(FILE *f)
- struct Reloc *reloc;
- int i, j, symtab;
- char **strtabs, **shnames;
-+ size_t ret = 0;
-
- LIST_INIT(sections);
- LIST_INIT(symbols);
-
- /* load ELF header */
- fseek(f, 0, SEEK_SET);
-- fread(&ehdr, sizeof(Elf32_Ehdr), 1, f);
-+ ret = fread(&ehdr, sizeof(Elf32_Ehdr), 1, f);
- swap_Ehdr(&ehdr);
- for(i = 0; i < 6; i++)
- if(ehdr.e_ident[i] != elf32_ident[i])
-@@ -379,7 +382,7 @@ void analyze_elf32(FILE *f)
- strtabs = calloc(sizeof(char *), ehdr.e_shnum);
- for(i = 0; i < ehdr.e_shnum; i++) {
- fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET);
-- fread(&shdr, sizeof(Elf32_Shdr), 1, f);
-+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
- swap_Shdr(&shdr);
-
- if(shdr.sh_type == SHT_STRTAB)
-@@ -396,14 +399,14 @@ void analyze_elf32(FILE *f)
- shnames=calloc(sizeof(char *),ehdr.e_shnum);
- for(i = 0; i < ehdr.e_shnum; i++) {
- fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET);
-- fread(&shdr, sizeof(Elf32_Shdr), 1, f);
-+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
- swap_Shdr(&shdr);
- shnames[i] = (strtabs[ehdr.e_shstrndx] + shdr.sh_name);
-
- if((shdr.sh_flags & SHF_ALLOC)) {
- if(shdr.sh_type == SHT_REGINFO) {
- fseek(f, shdr.sh_offset, SEEK_SET);
-- fread(&reginfo, sizeof(Elf32_RegInfo), 1, f);
-+ ret = fread(&reginfo, sizeof(Elf32_RegInfo), 1, f);
- swap_RegInfo(&reginfo);
- continue;
- }
-@@ -436,7 +439,7 @@ void analyze_elf32(FILE *f)
- /* load symbols */
- if(symtab != -1) {
- fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * symtab)), SEEK_SET);
-- fread(&shdr, sizeof(Elf32_Shdr), 1, f);
-+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
- swap_Shdr(&shdr);
-
- if(!shdr.sh_entsize)
-@@ -447,7 +450,7 @@ void analyze_elf32(FILE *f)
-
- for( i = 0; i < (shdr.sh_size / shdr.sh_entsize); i++) {
- fseek(f, (shdr.sh_offset + (shdr.sh_entsize * i)), SEEK_SET);
-- fread(&mhdr, sizeof(Elf32_Sym), 1, f);
-+ ret = fread(&mhdr, sizeof(Elf32_Sym), 1, f);
- swap_Sym(&mhdr);
- symbol = calloc(sizeof(struct Symbol), 1);
- symbol->name = (strtabs[shdr.sh_link] + mhdr.st_name);
-@@ -470,7 +473,7 @@ void analyze_elf32(FILE *f)
- /* load rels and decompose relas */
- for(i = 0; i < ehdr.e_shnum; i++) {
- fseek(f, (ehdr.e_shoff + (ehdr.e_shentsize * i)), SEEK_SET);
-- fread(&shdr, sizeof(Elf32_Shdr), 1, f);
-+ ret = fread(&shdr, sizeof(Elf32_Shdr), 1, f);
- swap_Shdr(&shdr);
-
- if((shdr.sh_type != SHT_REL) && (shdr.sh_type != SHT_RELA))
-@@ -491,13 +494,13 @@ void analyze_elf32(FILE *f)
- fseek(f, (shdr.sh_offset + (shdr.sh_entsize * j)), SEEK_SET);
-
- if(shdr.sh_type == SHT_REL) {
-- fread(&qhdr, sizeof(Elf32_Rel), 1, f);
-+ ret = fread(&qhdr, sizeof(Elf32_Rel), 1, f);
- swap_Rel(&qhdr);
- rhdr.r_offset = qhdr.r_offset;
- rhdr.r_info = qhdr.r_info;
- rhdr.r_addend = 0;
- } else {
-- fread(&rhdr, sizeof(Elf32_Rela), 1, f);
-+ ret = fread(&rhdr, sizeof(Elf32_Rela), 1, f);
- swap_Rela(&rhdr);
- }
-
-diff -Naurp arcload-0.5.orig/loader/Makefile arcload-0.5/loader/Makefile
---- arcload-0.5.orig/loader/Makefile 2006-01-19 23:10:04.000000000 -0500
-+++ arcload-0.5/loader/Makefile 2009-03-01 20:37:21.376720711 -0500
-@@ -2,12 +2,20 @@
- # Copyright 2004 Stanislaw Skowronek
- #
- ifeq ($(MODE),M32)
--CFLAGS = -O -march=mips3 -mabi=32 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
-+CFLAGS = -O -march=mips3 -mabi=32 \
-+ -Wall -Wno-pointer-sign \
-+ -mno-abicalls -G 0 -fno-pic -fno-builtin \
-+ -I.. \
-+ -D$(MODE)
- ASFLAGS= -march=mips3 -mabi=32 -mno-abicalls -G 0 -fno-pic -D$(MODE)
- OUTPUTFMT = elf32-tradbigmips
- TARGET = ../arcload.ecoff
- else
--CFLAGS = -O -march=mips3 -mabi=64 -Wall -mno-abicalls -G 0 -fno-pic -fno-builtin -I.. -D$(MODE)
-+CFLAGS = -O -march=mips3 -mabi=64 \
-+ -Wall -Wno-pointer-sign \
-+ -mno-abicalls -G 0 -fno-pic -fno-builtin \
-+ -I.. \
-+ -D$(MODE)
- ASFLAGS= -march=mips3 -mabi=64 -mno-abicalls -G 0 -fno-pic -D$(MODE)
- OUTPUTFMT = elf64-tradbigmips
- TARGET = ../arcload
diff --git a/sys-boot/arcload/files/arcload.8 b/sys-boot/arcload/files/arcload.8
new file mode 100644
index 000000000000..6d72dd5c5d78
--- /dev/null
+++ b/sys-boot/arcload/files/arcload.8
@@ -0,0 +1,65 @@
+.TH "ARCLOAD" "8" "25 November 2007" "" ""
+.SH NAME
+arcload \- bootloader for SGI/ARCS machines
+.SH SYNOPSIS
+
+\fBarcload\fR \fIdevice\fR
+
+.SH "DESCRIPTION"
+.PP
+\fBarcload\fR is a bootloader designed to load any Linux kernel on any
+SGI/ARCS machine. It supports booting the kernel from a variety of
+filesystems; currently, the following filesystems are supported:
+\fBext2\fR (\fBext3\fR), \fBfat\fR, \fBiso9660\fR, \fBjfs\fR,
+\fBminix\fR, \fBufs\fR, \fBxfs\fR and the \fB*arcfs\fR
+pseudo-filesystem.
+
+\fBarcload\fP usually resides in the volume header of a disk with an
+SGI disklabel.
+.SH "USAGE"
+.PP
+\fIdevice\fR is the device name of the disk containing the volume header
+\fBarcload\fR should go into. To use \fBarcload\fR you have to modify
+the following PROM variables:
+.P
+\fIsetenv OSLoader arcload\fR
+.P
+\fIsetenv SystemPartition dksc(c,d,8)\fR
+.P
+\fIsetenv OSLoadPartition dksc(c,d,p)\fR
+.P
+\fIsetenv OSLoadFilename label(option1,option2,...)\fR
+.P
+where \fIc\fR is the ID of the SCSI controller, \fId\fR the SCSI ID
+of the disk \fBarcload\fR resides on and \fIp\fR the partition number
+of the partition \fBarc.cf\fR and the kernels reside on (counting
+from 0). Note that \fBarc.cf\fR and the directory your kernels are in
+(usually / or /boot) have to be on the same partition. On boot,
+\fBarcload\fR looks at the \fIOSLoadFilename\fR PROM variable and
+tries to find a label with the same name in \fBarc.cf\fR.
+
+\fBarc.cf\fP can reside either in /etc or at the root of the partition pointed
+to by the \fIOSLoadFilename\fP variable.
+
+.SH "NOTES"
+\fBarcload\fR only loads ELF kernels.
+
+.SH "FILES"
+.BR /arc.cf
+\fBarcload\fR's configuration file
+.P
+.BR /usr/share/doc/arcload/examples
+configuration file examples
+.P
+.BR /usr/share/doc/arcload/README.Debian
+some notes about arcload for Debian
+.PP
+.SH "SEE ALSO"
+.PP
+dvhtool(1)
+
+.SH "AUTHORS"
+ARCLoad was written by Stanislaw Skowronek
+<skylark@linux-mips.org>. This manual page was written by Julien
+BLACHE <jblache@debian.org> for the Debian Project (but may be used by
+others), based on the arcboot(8) manpage.