diff options
author | Joshua Kinard <kumba@gentoo.org> | 2009-03-02 02:21:30 +0000 |
---|---|---|
committer | Joshua Kinard <kumba@gentoo.org> | 2009-03-02 02:21:30 +0000 |
commit | 4a19894b6ee4df20be8418b93f7410a71a16165b (patch) | |
tree | 31402202f62b64cebb2841e3252f853340f5b5c6 /sys-boot/arcload | |
parent | Add new rc10 (diff) | |
download | historical-4a19894b6ee4df20be8418b93f7410a71a16165b.tar.gz historical-4a19894b6ee4df20be8418b93f7410a71a16165b.tar.bz2 historical-4a19894b6ee4df20be8418b93f7410a71a16165b.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.
Package-Manager: portage-2.1.6.7/cvs/Linux mips64
Diffstat (limited to 'sys-boot/arcload')
-rw-r--r-- | sys-boot/arcload/ChangeLog | 14 | ||||
-rw-r--r-- | sys-boot/arcload/Manifest | 8 | ||||
-rw-r--r-- | sys-boot/arcload/arcload-0.43-r1.ebuild | 24 | ||||
-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.patch | 42 | ||||
-rw-r--r-- | sys-boot/arcload/files/arcload-0.50-shut-gcc4x-up.patch | 273 |
6 files changed, 383 insertions, 34 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/Manifest b/sys-boot/arcload/Manifest index ba47ccf2c9a3..16d33f003d52 100644 --- a/sys-boot/arcload/Manifest +++ b/sys-boot/arcload/Manifest @@ -1,7 +1,9 @@ AUX arcload-0.43-tweaks1.patch 615 RMD160 d4088d6772162776d9d3fd3874c31205ac02a147 SHA1 f893d7197c2fc8e9255cf51e7e789dc4cb3dbc4e SHA256 fa3a79492d83429085a9cae98bb75a2093a188424fb626bd651c1e5014cf14e9 +AUX arcload-0.50-makefile-targets.patch 928 RMD160 32bf3d05a62197e3390974926bb8d61f8b8a8405 SHA1 52761bb480a0940080c7e48a3eabba965d649447 SHA256 6f1b14403ee85e1f5397b8b4e1d873cbc67624ae3c0f09ae840788988784d846 +AUX arcload-0.50-shut-gcc4x-up.patch 9385 RMD160 54afe747c639e2c3e307d9af5cc4f7a6a2673bb3 SHA1 6167486331ba43c7edf7baacf709211d2dc52fc5 SHA256 7fd5e671b5181f19bd5615d715f43c71ee95ed216fc989a93d276b08052f2335 DIST arcload-0.43.tar.bz2 22419 RMD160 6d70c4aa670d659db9613982765a47fe287bd3f9 SHA1 bdc580e900a7d57cc3087be0bfbb3b82c06015ca SHA256 9ba041871a2945a12351bbdb9db6946d423d11f02cc2e710a084d6c5062cc6e5 DIST arcload-0.5.tar.bz2 47690 RMD160 38cbc843c6375e0954e408947ac3e58eb598e301 SHA1 ea1ff3971a2db2aa46f6448cfafbbe8a2a0c30dd SHA256 69cc45f7d27b30256875ccda115b6f74dd3bd894033f0f81b6f87ea1d8f7a0ac -EBUILD arcload-0.43-r1.ebuild 2507 RMD160 db8528c38508ecc69523c282460ce26c5727b993 SHA1 a2e657df54acef6ce07576100cf6c6d1c3319320 SHA256 ddd02c96b9c789338254bc6295c6d53d56c416846048520845826720364ab2fb -EBUILD arcload-0.50.ebuild 2391 RMD160 353ff96c274af889391111f28e9d5a8a86999bfc SHA1 9b688b588ac5f593f2a38e1a8169d57b1e62d03a SHA256 be175371e4222b102c392ccd18302037e39df55fab59fb2e041724f724a351eb -MISC ChangeLog 2046 RMD160 87f4311fc1c41c6cb4a46267e39b41ae9fb1ee77 SHA1 49215a696fc62774bb45d83996027157459b9c95 SHA256 1553236ac55f3213d38d1d57dc3691a8809567ef17b44c57e6cd93cfe68bffb6 +EBUILD arcload-0.43-r1.ebuild 2534 RMD160 726bdc0cd3874e5222eb1eb8b0ad51dff076b1e5 SHA1 492eb62e37c2becbc73d11fc53ceafadeba26c02 SHA256 53ce1580b39da0da1b51a9d257f8b47062a693c6b04ddd256480957acd7c07a8 +EBUILD arcload-0.50-r1.ebuild 3228 RMD160 5b2f03612fe5872afc169fa2eca6fc812abd35f3 SHA1 a44f4312d53f98e7c7042197cc565069bd0b565a SHA256 599a2b5f22b26ae903bcbfd74af0ed24a47fceb160187634864c72846aab7858 +MISC ChangeLog 2483 RMD160 cd0530c0a290d8997057ec8b8ba7ade431c8c0e6 SHA1 dcf6802025bc55c5356d7041a4e0eb80c75b040c SHA256 3ddb04bea504e734a4781fb24794d1deeb8485cb63d3f07761c0d5d23948aa4b MISC metadata.xml 366 RMD160 2c8bf63ab6ff84d6c29d8292a2db92707256811e SHA1 8faa6b966f813cffd55ad67231cc91daae372788 SHA256 55ae163fcb166b30a903a043aea6f2a27cb3782004bf5034363ee552a04e0661 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(®info, sizeof(Elf32_RegInfo), 1, f); ++ ret = fread(®info, sizeof(Elf32_RegInfo), 1, f); + swap_RegInfo(®info); + 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 |