diff options
author | Friedrich Oslage <bluebird@gentoo.org> | 2008-08-18 22:44:48 +0000 |
---|---|---|
committer | Friedrich Oslage <bluebird@gentoo.org> | 2008-08-18 22:44:48 +0000 |
commit | 93a9ebcb75e18b2b91be9f6dccf014f33803c796 (patch) | |
tree | f17c18db4cbf6347776b823b7b86fb7def95508c /sys-boot | |
parent | media-plugins/gst-plugins-gio: add ~x86 keyword (diff) | |
download | gentoo-2-93a9ebcb75e18b2b91be9f6dccf014f33803c796.tar.gz gentoo-2-93a9ebcb75e18b2b91be9f6dccf014f33803c796.tar.bz2 gentoo-2-93a9ebcb75e18b2b91be9f6dccf014f33803c796.zip |
Fix building with gcc-4.3 (again)
(Portage version: 2.2_rc8/cvs/Linux 2.6.27-rc3-00414-gb09c3e3 sparc64)
Diffstat (limited to 'sys-boot')
-rw-r--r-- | sys-boot/silo/ChangeLog | 5 | ||||
-rw-r--r-- | sys-boot/silo/files/gcc-4.3-compile.patch | 107 |
2 files changed, 108 insertions, 4 deletions
diff --git a/sys-boot/silo/ChangeLog b/sys-boot/silo/ChangeLog index edbd29c03c96..29a779fb9e7b 100644 --- a/sys-boot/silo/ChangeLog +++ b/sys-boot/silo/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for sys-boot/silo # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/silo/ChangeLog,v 1.40 2008/08/06 19:13:53 bluebird Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/silo/ChangeLog,v 1.41 2008/08/18 22:44:47 bluebird Exp $ + + 18 Aug 2008; <bluebird@gentoo.org> files/gcc-4.3-compile.patch: + Fix building with gcc-4.3 (again) *silo-1.4.14 (06 Aug 2008) diff --git a/sys-boot/silo/files/gcc-4.3-compile.patch b/sys-boot/silo/files/gcc-4.3-compile.patch index 74c37558553e..d7fa3ea07bfc 100644 --- a/sys-boot/silo/files/gcc-4.3-compile.patch +++ b/sys-boot/silo/files/gcc-4.3-compile.patch @@ -1,6 +1,107 @@ ---- silo.orig/second/Makefile -+++ silo/second/Makefile -@@ -58,13 +58,13 @@ +diff --git a/common/printf.c b/common/printf.c +--- a/common/printf.c ++++ b/common/printf.c +@@ -21,6 +21,7 @@ + USA. */ + + #include "promlib.h" ++#include <stringops.h> + + /* + * This part is rewritten by Igor Timkin <ivt@msu.su>. Than I +@@ -147,3 +148,88 @@ void prom_printf (char *fmt,...) + vprintf (fmt, x1); + va_end (x1); + } ++ ++static int sprintn (char *str, long long n, int b) ++{ ++ static char prbuf[33]; ++ register char *cp; ++ int count = 0; ++ ++ if (b == 10 && n < 0) { ++ memset (str + count, '-', 1); ++ count++; ++ n = -n; ++ } ++ cp = prbuf; ++ do ++ *cp++ = "0123456789ABCDEF"[(unsigned int) (((unsigned long)n) % b)]; ++ while ((n = ((unsigned long long)n) / b & 0x0FFFFFFFFFFFFFFFULL)); ++ do { ++ memset (str + count, *--cp, 1); ++ count++; ++ } while (cp > prbuf); ++ ++ return count; ++} ++ ++int vsprintf (char *str, char *fmt, va_list adx) ++{ ++ register int c; ++ char *s; ++ int count = 0; ++ ++ for (;;) { ++ while ((c = *fmt++) != '%') { ++ memset (str + count, c, 1); ++ if (c == '\0') { ++ return count; ++ } ++ } ++ c = *fmt++; ++ if (c == 'd' || c == 'o' || c == 'x' || c == 'X') { ++ count += sprintn (str + count, (long long) va_arg (adx, unsigned), ++ c == 'o' ? 8 : (c == 'd' ? 10 : 16)); ++ } else if (c == 'c') { ++ memset (str + count, va_arg (adx, unsigned), 1); ++ count++; ++ } else if (c == 's') { ++ if ((s = va_arg (adx, char *)) == NULL) ++ s = (char *)"(null)"; ++ while ((c = *s++)) { ++ memset (str + count, c, 1); ++ count++; ++ } ++ } else if (c == 'l' || c == 'O') { ++ count += sprintn (str + count, (long long) va_arg (adx, long), c == 'l' ? 10 : 8); ++ } else if (c == 'L') { ++ int hex = 0; ++ if (*fmt == 'x') { ++ fmt++; ++ hex = 1; ++ } ++ count += sprintn (str + count, (long long) va_arg (adx, long long), hex ? 16 : 10); ++ } else { ++ /* This is basically what libc's printf does */ ++ memset (str + count, '%', 1); ++ count++; ++ memset (str + count, c, 1); ++ count++; ++ } ++ } ++ ++ return count; ++} ++ ++/* Write formatted output into S, according to the format string FORMAT. */ ++/* VARARGS2 */ ++int sprintf (char *s, const char *format, ...) ++{ ++ va_list arg; ++ int done; ++ ++ va_start (arg, format); ++ done = vsprintf (s, format, arg); ++ va_end (arg); ++ ++ return done; ++} +diff --git a/second/Makefile b/second/Makefile +--- a/second/Makefile ++++ b/second/Makefile +@@ -58,13 +58,13 @@ fs/libfs.a: $(FS_OBJS) $(AR) rc $@ $(FS_OBJS) second: $(OBJS) mark.o |