summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Kinard <kumba@gentoo.org>2009-03-02 02:21:30 +0000
committerJoshua Kinard <kumba@gentoo.org>2009-03-02 02:21:30 +0000
commitd0337696a99e2d032a084a4d5aa04f0342d0086f (patch)
tree19ceb44c13e5a1b1db923d08e578d7467d395f19 /sys-boot/arcload
parentAdd new rc10 (diff)
downloadgentoo-2-d0337696a99e2d032a084a4d5aa04f0342d0086f.tar.gz
gentoo-2-d0337696a99e2d032a084a4d5aa04f0342d0086f.tar.bz2
gentoo-2-d0337696a99e2d032a084a4d5aa04f0342d0086f.zip
Make arcload cross-compilable by altering the Makefile targets, and quiet down gcc-4.x's warnings. Modified ebuild accordingly and fixed minor QA Issues. Changed mips keyword to unstable.
(Portage version: 2.1.6.7/cvs/Linux mips64)
Diffstat (limited to 'sys-boot/arcload')
-rw-r--r--sys-boot/arcload/ChangeLog14
-rw-r--r--sys-boot/arcload/arcload-0.43-r1.ebuild24
-rw-r--r--sys-boot/arcload/arcload-0.50-r1.ebuild (renamed from sys-boot/arcload/arcload-0.50.ebuild)56
-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
5 files changed, 378 insertions, 31 deletions
diff --git a/sys-boot/arcload/ChangeLog b/sys-boot/arcload/ChangeLog
index 304e65ea7363..3285f4f27ad9 100644
--- a/sys-boot/arcload/ChangeLog
+++ b/sys-boot/arcload/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for sys-boot/arcload
-# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/ChangeLog,v 1.10 2007/07/02 15:29:42 peper Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/ChangeLog,v 1.11 2009/03/02 02:21:30 kumba Exp $
+
+ 02 Mar 2009; Joshua Kinard <kumba@gentoo.org>
+ +files/arcload-0.50-makefile-targets.patch,
+ +files/arcload-0.50-shut-gcc4x-up.patch, arcload-0.43-r1.ebuild,
+ -arcload-0.50.ebuild, +arcload-0.50-r1.ebuild:
+ Make arcload cross-compilable by altering the Makefile targets, and quiet
+ down gcc-4.x's warnings. Modified ebuild accordingly and fixed minor QA
+ Issues. Changed mips keyword to unstable.
+
+*arcload-0.50-r1 (02 Mar 2009)
02 Jul 2007; Piotr Jaroszyński <peper@gentoo.org> arcload-0.43-r1.ebuild,
arcload-0.50.ebuild:
diff --git a/sys-boot/arcload/arcload-0.43-r1.ebuild b/sys-boot/arcload/arcload-0.43-r1.ebuild
index 61abc543251c..8ec9d46d5bcb 100644
--- a/sys-boot/arcload/arcload-0.43-r1.ebuild
+++ b/sys-boot/arcload/arcload-0.43-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.43-r1.ebuild,v 1.4 2007/07/15 02:25:03 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.43-r1.ebuild,v 1.5 2009/03/02 02:21:30 kumba Exp $
inherit eutils toolchain-funcs
@@ -9,9 +9,10 @@ HOMEPAGE="http://www.linux-mips.org/wiki/index.php/ARCLoad"
SRC_URI="ftp://ftp.linux-mips.org/pub/linux/mips/people/skylark/${P}.tar.bz2"
LICENSE="as-is"
SLOT="0"
-KEYWORDS="-* mips"
+KEYWORDS="-* ~mips"
IUSE=""
DEPEND="sys-boot/dvhtool"
+RDEPEND=""
RESTRICT="strip"
pkg_setup() {
@@ -31,31 +32,30 @@ src_unpack() {
# Adds in detection support for the R14000, and
# tweaks detectbaud() in loader/detect.c to return
# a default of 9600bps when the function fails
- epatch ${FILESDIR}/${P}-tweaks1.patch
+ epatch "${FILESDIR}"/${P}-tweaks1.patch
}
src_compile() {
echo -e ""
einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 ..."
- cd ${S}
+ cd "${S}"
make MODE=M32 clean || die
make CC=$(tc-getCC) LD=$(tc-getLD) MODE=M32 || die
- cp ${S}/arcload.ecoff ${WORKDIR}/sashARCS
+ cp "${S}"/arcload.ecoff "${WORKDIR}"/sashARCS
echo -e ""
einfo ">>> Building 64-bit version (sash64) for IP27/IP28/IP30 ..."
make MODE=M64 clean || die
make CC=$(tc-getCC) LD=$(tc-getLD) MODE=M64 || die
- cp ${S}/arcload ${WORKDIR}/sash64
+ cp $"{S}"/arcload "${WORKDIR}"/sash64
}
src_install() {
- cd ${S}
dodir /usr/lib/arcload
- cp ${WORKDIR}/sashARCS ${D}/usr/lib/arcload
- 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
+ cp "${WORKDIR}"/sashARCS "${D}"/usr/lib/arcload
+ 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
}
pkg_postinst() {
diff --git a/sys-boot/arcload/arcload-0.50.ebuild b/sys-boot/arcload/arcload-0.50-r1.ebuild
index b5eb3a238856..d6fb11fe8671 100644
--- a/sys-boot/arcload/arcload-0.50.ebuild
+++ b/sys-boot/arcload/arcload-0.50-r1.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.50.ebuild,v 1.5 2007/07/15 02:25:03 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/arcload/arcload-0.50-r1.ebuild,v 1.1 2009/03/02 02:21:30 kumba Exp $
-inherit eutils toolchain-funcs
+inherit eutils toolchain-funcs versionator
# Hack until upstream renames from 0.5 to 0.50
MY_PV="${PV/50/5}"
@@ -12,9 +12,10 @@ 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"
LICENSE="as-is"
SLOT="0"
-KEYWORDS="-* mips"
+KEYWORDS="-* ~mips"
IUSE=""
DEPEND="sys-boot/dvhtool"
+RDEPEND=""
RESTRICT="strip"
S="${WORKDIR}/${PN}-${MY_PV}"
@@ -29,28 +30,49 @@ pkg_setup() {
fi
}
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # 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
+
+ # 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
+}
+
src_compile() {
+ # 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.
+ echo -e ""
+ einfo ">>> Building the 'wreckoff' utility with $(tc-getBUILD_CC) ..."
+ make CC=$(tc-getBUILD_CC) tools_clean tools || die
+
+ # 32bit copy (sashARCS for IP22/IP32)
echo -e ""
einfo ">>> Building 32-bit version (sashARCS) for IP22/IP32 ..."
- cd ${S}
- make MODE=M32 clean || die
- make CC=$(tc-getCC) LD=$(tc-getLD) MODE=M32 || die
- cp ${S}/arcload.ecoff ${WORKDIR}/sashARCS
+ cd "${S}"
+ make MODE=M32 bootloader_clean || die
+ make CC=$(tc-getCC) LD=$(tc-getLD) MODE=M32 bootloader || die
+ 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 ..."
- make MODE=M64 clean || die
- make CC=$(tc-getCC) LD=$(tc-getLD) MODE=M64 || die
- cp ${S}/arcload ${WORKDIR}/sash64
+ make MODE=M64 bootloader_clean || die
+ make CC=$(tc-getCC) LD=$(tc-getLD) MODE=M64 bootloader || die
+ cp "${S}"/arcload "${WORKDIR}"/sash64
}
src_install() {
- cd ${S}
dodir /usr/lib/arcload
- cp ${WORKDIR}/sashARCS ${D}/usr/lib/arcload
- 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
+ cp "${WORKDIR}"/sashARCS "${D}"/usr/lib/arcload
+ 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
}
pkg_postinst() {
@@ -65,7 +87,7 @@ pkg_postinst() {
einfo "\t3) Edit /usr/lib/arcload/arc-*.cf to fit your specific system"
einfo "\t (See ${HOMEPAGE} for"
einfo "\t an explanation of the format of the config file)"
- einfo "\t4) Copy the config file to the volume header with 'dvhtool' (make sure it is copied as 'arc.cf')"
+ einfo "\t4) Copy the config file to the volume header with 'dvhtool' as 'arc.cf'"
einfo "\t5) Copy any kernels to the volume header that you want to be bootable"
einfo "\t6) Reboot, and enjoy!"
echo -e ""
diff --git a/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch b/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch
new file mode 100644
index 000000000000..9248ac4ccd9c
--- /dev/null
+++ b/sys-boot/arcload/files/arcload-0.50-makefile-targets.patch
@@ -0,0 +1,42 @@
+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
new file mode 100644
index 000000000000..52ad5a107af1
--- /dev/null
+++ b/sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch
@@ -0,0 +1,273 @@
+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