On Fri, Aug 12, 2005 at 09:00:53AM +0200, Andreas Jochens wrote: > On 05-Aug-11 19:50, Ethan Benson wrote: > > > > I already have a more comprehensive ppc64 patch pending to be merged > > next time I have the chance. thus this will be fixed in next stable > > yaboot release. > > Could you send me a copy of your ppc64 patch?
its actually not tested on 32 bit toolchain and older toolchain (like
2.95) yet, which is why I haven't merged it, if you can help out there
that would be appreciated as well.
here is the pending patch I have though.
Date: Fri, 05 Aug 2005 13:21:54 -0700
From: Geoff Levand <[EMAIL PROTECTED]>
Subject: yaboot ppc64 fixes
To: [EMAIL PROTECTED]
Here are some changes I needed to get yaboot to build with
powerpc64-unknown-linux-gnu-gcc 4.0.1.
-Geoff
05.08.05.13.02.29-yaboot-1.3.13.orig__to__yaboot-1.3.13.diff
Fixups to use powerpc64-unknown-linux-gnu-gcc 4.0.1
Makefile | 8 ++++----
include/ext2fs/bitops.h | 4 +++-
include/linux/types.h | 2 +-
include/setjmp.h | 2 +-
lib/malloc.c | 1 +
lib/strstr.c | 3 ++-
second/fs_ext2.c | 2 +-
second/prom.c | 1 +
8 files changed, 14 insertions(+), 9 deletions(-)
diff -ruN yaboot-1.3.13.orig/include/ext2fs/bitops.h
yaboot-1.3.13/include/ext2fs/bitops.h
--- yaboot-1.3.13.orig/include/ext2fs/bitops.h 2005-08-05 08:43:27.000000000
-0700
+++ yaboot-1.3.13/include/ext2fs/bitops.h 2005-08-05 10:59:51.000000000
-0700
@@ -410,9 +410,11 @@
#endif /* !_EXT2_HAVE_ASM_SWAB */
#if !defined(_EXT2_HAVE_ASM_FINDBIT_)
+extern int ffs(char);
+
_INLINE_ int ext2fs_find_first_bit_set(void * addr, unsigned size)
{
- char *cp = (unsigned char *) addr;
+ char *cp = addr;
int res = 0, d0;
if (!size)
diff -ruN yaboot-1.3.13.orig/include/linux/types.h
yaboot-1.3.13/include/linux/types.h
--- yaboot-1.3.13.orig/include/linux/types.h 2005-08-05 08:43:27.000000000
-0700
+++ yaboot-1.3.13/include/linux/types.h 2005-08-05 10:48:51.000000000 -0700
@@ -1 +1 @@
-#include "../types.h"
\ No newline at end of file
+#include "../types.h"
diff -ruN yaboot-1.3.13.orig/include/setjmp.h yaboot-1.3.13/include/setjmp.h
--- yaboot-1.3.13.orig/include/setjmp.h 2005-08-05 08:43:26.000000000 -0700
+++ yaboot-1.3.13/include/setjmp.h 2005-08-05 10:52:26.000000000 -0700
@@ -36,4 +36,4 @@
extern void longjmp (jmp_buf __env, int __val);
-#endif
\ No newline at end of file
+#endif
diff -ruN yaboot-1.3.13.orig/lib/malloc.c yaboot-1.3.13/lib/malloc.c
--- yaboot-1.3.13.orig/lib/malloc.c 2005-08-05 08:43:26.000000000 -0700
+++ yaboot-1.3.13/lib/malloc.c 2005-08-05 11:00:47.000000000 -0700
@@ -21,6 +21,7 @@
#include "types.h"
#include "stddef.h"
+#include "string.h"
/* Imported functions */
extern void prom_printf (char *fmt, ...);
diff -ruN yaboot-1.3.13.orig/lib/strstr.c yaboot-1.3.13/lib/strstr.c
--- yaboot-1.3.13.orig/lib/strstr.c 2005-08-05 08:43:26.000000000 -0700
+++ yaboot-1.3.13/lib/strstr.c 2005-08-05 11:01:57.000000000 -0700
@@ -76,7 +76,8 @@
a = *++haystack;
if (a == '\0')
goto ret0;
-shloop: }
+shloop: (void)0;
+ }
while (a != b);
jin: a = *++haystack;
diff -ruN yaboot-1.3.13.orig/Makefile yaboot-1.3.13/Makefile
--- yaboot-1.3.13.orig/Makefile 2005-08-05 08:43:26.000000000 -0700
+++ yaboot-1.3.13/Makefile 2005-08-05 13:00:35.000000000 -0700
@@ -30,7 +30,7 @@
# The flags for the yaboot binary.
#
-YBCFLAGS = -Os $(CFLAGS) -nostdinc -Wall -isystem `gcc
-print-file-name=include` -fsigned-char
+YBCFLAGS = -m32 -Os $(CFLAGS) -nostdinc -Wall -isystem `$(CC) -m32
-print-file-name=include` -fsigned-char
YBCFLAGS += -DVERSION=\"${VERSION}\" #"
YBCFLAGS += -DTEXTADDR=$(TEXTADDR) -DDEBUG=$(DEBUG)
YBCFLAGS += -DMALLOCADDR=$(MALLOCADDR) -DMALLOCSIZE=$(MALLOCSIZE)
@@ -59,7 +59,7 @@
# Link flags
#
-LFLAGS = -Ttext $(TEXTADDR) -Bstatic
+LFLAGS = -melf32ppc -Ttext $(TEXTADDR) -Bstatic
# Libraries
#
@@ -99,7 +99,7 @@
AS := $(CROSS)as
OBJCOPY := $(CROSS)objcopy
-lgcc = `$(CC) -print-libgcc-file-name`
+lgcc = `$(CC) -m32 -print-libgcc-file-name`
all: yaboot addnote mkofboot
diff -ruN yaboot-1.3.13.orig/second/fs_ext2.c yaboot-1.3.13/second/fs_ext2.c
--- yaboot-1.3.13.orig/second/fs_ext2.c 2005-08-05 08:43:26.000000000 -0700
+++ yaboot-1.3.13/second/fs_ext2.c 2005-08-05 11:04:57.000000000 -0700
@@ -448,7 +448,7 @@
read_last_logical = file->pos / bs;
read_total = 0;
read_max = size;
- read_buffer = (unsigned char*)buffer;
+ read_buffer = buffer;
read_result = 0;
retval = ext2fs_block_iterate(fs, file->inode, 0, 0, read_iterator, 0);
diff -ruN yaboot-1.3.13.orig/second/prom.c yaboot-1.3.13/second/prom.c
--- yaboot-1.3.13.orig/second/prom.c 2005-08-05 08:43:26.000000000 -0700
+++ yaboot-1.3.13/second/prom.c 2005-08-05 10:47:56.000000000 -0700
@@ -28,6 +28,7 @@
#include "stdarg.h"
#include "stddef.h"
#include "stdlib.h"
+#include "string.h"
#include "types.h"
#include "ctype.h"
#include "asm/processor.h"
-EOF
--
Ethan Benson
http://www.alaska.net/~erbenson/
pgpyuIFCmRMI2.pgp
Description: PGP signature

