From 1e85be0ecf15d71f003abfde365c9d072e6a9ccc Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 17 Sep 2012 17:40:21 -0400
Subject: [PATCH] Update to r1063, version qemu 1.2 shipped with

---
 .gitignore                                   |  1 +
 0001-Use-64bit-gcc-for-32bit-ppc-sparc.patch | 38 ++++++++++++++++++++
 openbios-no-werror.patch                     | 13 -------
 openbios-ppc.patch                           | 27 --------------
 openbios-sparc.patch                         | 13 -------
 openbios.spec                                | 29 ++++++++-------
 sources                                      |  2 +-
 7 files changed, 54 insertions(+), 69 deletions(-)
 create mode 100644 0001-Use-64bit-gcc-for-32bit-ppc-sparc.patch
 delete mode 100644 openbios-no-werror.patch
 delete mode 100644 openbios-ppc.patch
 delete mode 100644 openbios-sparc.patch

diff --git a/.gitignore b/.gitignore
index 9878106..4d13978 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /openbios-1.0-svn1061.tar.gz
+/openbios-1.0-svn1063.tar.gz
diff --git a/0001-Use-64bit-gcc-for-32bit-ppc-sparc.patch b/0001-Use-64bit-gcc-for-32bit-ppc-sparc.patch
new file mode 100644
index 0000000..13887b6
--- /dev/null
+++ b/0001-Use-64bit-gcc-for-32bit-ppc-sparc.patch
@@ -0,0 +1,38 @@
+From edd8b56b3181853ebba727e4ab3a09f86092bb9b Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 17 Sep 2012 17:07:19 -0400
+Subject: [PATCH] Use 64bit gcc for 32bit ppc + sparc
+
+Fedora only packages the 64 bit cross compilers, so it's our only
+option. Not intended for upstream.
+
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ config/scripts/switch-arch | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch
+index a9c911b..c1d1dbb 100755
+--- a/config/scripts/switch-arch
++++ b/config/scripts/switch-arch
+@@ -230,7 +230,7 @@ for ARCH in $arch_list; do
+         ;;
+ 
+         ppc)
+-        select_prefix powerpc
++        select_prefix powerpc64
+         if [ "$unix" = "no" ]; then
+             CFLAGS="-m32 -msoft-float -fno-builtin-bcopy -fno-builtin-log2"
+             AS_FLAGS="-m32"
+@@ -248,7 +248,7 @@ for ARCH in $arch_list; do
+         ;;
+ 
+         sparc32)
+-        select_prefix sparc
++        select_prefix sparc64
+         CFLAGS="-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin"
+         AS_FLAGS="-Wa,-xarch=v8 -Wa,-32"
+         ;;
+-- 
+1.7.11.2
+
diff --git a/openbios-no-werror.patch b/openbios-no-werror.patch
deleted file mode 100644
index 8c31123..0000000
--- a/openbios-no-werror.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: Makefile.target
-===================================================================
---- Makefile.target	(revision 1061)
-+++ Makefile.target	(working copy)
-@@ -30,7 +30,7 @@
- CFLAGS+= -Wall -Wredundant-decls -Wshadow -Wpointer-arith
- CFLAGS+= -Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
- CFLAGS+= -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes -Wnested-externs
--CFLAGS+= -Werror
-+#CFLAGS+= -Werror
- # Flags for dependency generation
- CFLAGS+= -MMD -MP -MT $@ -MF '$(*D)/$(*F).d'
- INCLUDES := -I$(SRCDIR)/include -I$(SRCDIR)/kernel/include -I$(ODIR)/target/include
diff --git a/openbios-ppc.patch b/openbios-ppc.patch
deleted file mode 100644
index 6280eef..0000000
--- a/openbios-ppc.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Index: config/scripts/switch-arch
-===================================================================
---- config/scripts/switch-arch	(revision 1061)
-+++ config/scripts/switch-arch	(working copy)
-@@ -230,9 +230,9 @@
-         ;;
- 
-         ppc)
--        select_prefix powerpc
-+        select_prefix powerpc64
-         if [ "$unix" = "no" ]; then
--            CFLAGS="-msoft-float -fno-builtin-bcopy -fno-builtin-log2"
-+            CFLAGS="-msoft-float -fno-builtin-bcopy -fno-builtin-log2 -m32"
-         else
-             CFLAGS="-fno-builtin"
-         fi
-Index: arch/ppc/qemu/ldscript
-===================================================================
---- arch/ppc/qemu/ldscript	(revision 1061)
-+++ arch/ppc/qemu/ldscript	(working copy)
-@@ -1,5 +1,5 @@
- OUTPUT_FORMAT(elf32-powerpc)
--OUTPUT_ARCH(powerpc)
-+OUTPUT_ARCH(powerpc:common)
- 
- /* Initial load address
-  */
diff --git a/openbios-sparc.patch b/openbios-sparc.patch
deleted file mode 100644
index 99a8f13..0000000
--- a/openbios-sparc.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: config/scripts/switch-arch
-===================================================================
---- config/scripts/switch-arch	(revision 1061)
-+++ config/scripts/switch-arch	(working copy)
-@@ -247,7 +247,7 @@
-         ;;
- 
-         sparc32)
--        select_prefix sparc
-+        select_prefix sparc64
-         CFLAGS="-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin"
-         AS_FLAGS="-Wa,-xarch=v8 -Wa,-32"
-         ;;
diff --git a/openbios.spec b/openbios.spec
index afd026d..6f48ded 100644
--- a/openbios.spec
+++ b/openbios.spec
@@ -1,11 +1,11 @@
-%global svnrel 1061
+%global svnrel 1063
 
 # Disable unhelpful RPM test.
 %global _binaries_in_noarch_packages_terminate_build 0
 
 Name:           openbios
 Version:        1.0
-Release:        5.svn%{svnrel}%{?dist}
+Release:        6.svn%{svnrel}%{?dist}
 Summary:        OpenBIOS implementation of IEEE 1275-1994
 
 License:        GPLv2
@@ -21,16 +21,9 @@ BuildArch:      noarch
 # rm -r %{name}-%{version}
 Source0:        %{name}-%{version}-svn%{svnrel}.tar.gz
 
-# Remove -Werror from flags (not for upstream).
-Patch0:         openbios-no-werror.patch
-
-# Fix for ppc 32 bit support.
-# Not suitable for upstream because it's specific to Fedora cross-gcc.
-Patch1:         openbios-ppc.patch
-
-# Fix for sparc 32 bit support.
-# Not suitable for upstream because it's specific to Fedora cross-gcc.
-Patch2:         openbios-sparc.patch
+# Use 64bit gcc for 32bit ppc + sparc
+# keep: Not suitable for upstream, change is specific to Fedora cross-gcc
+Patch0:         0001-Use-64bit-gcc-for-32bit-ppc-sparc.patch
 
 # Note that these packages build 32 bit binaries with the -m32 flag.
 BuildRequires:  gcc-powerpc64-linux-gnu
@@ -38,6 +31,11 @@ BuildRequires:  gcc-sparc64-linux-gnu
 
 BuildRequires:  libxslt
 
+Obsoletes:      openbios-common
+Obsoletes:      openbios-ppc
+Obsoletes:      openbios-sparc32
+Obsoletes:      openbios-sparc64
+
 
 %description
 The OpenBIOS project provides you with most free and open source Open
@@ -65,9 +63,7 @@ such as coreboot or U-Boot.
 
 %prep
 %setup -q
-%patch0 -p0
-%patch1 -p0
-%patch2 -p0
+%patch0 -p1
 
 
 %build
@@ -96,5 +92,8 @@ cp -a obj-sparc64/openbios-builtin.elf $qemudir/openbios-sparc64
 
 
 %changelog
+* Mon Sep 17 2012 Cole Robinson <crobinso@redhat.com> - 1.0-6.svn1063
+- Update to r1063, version qemu 1.2 shipped with
+
 * Tue Jul 31 2012 Richard W.M. Jones <rjones@redhat.com> - 1.0-5.svn1061
 - Initial release in Fedora.
diff --git a/sources b/sources
index c4ffbe7..32e386a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-96351b8ef6720438e812dd5ff209bfc5  openbios-1.0-svn1061.tar.gz
+cdfcdad2e02cd945c9d4fbfacecf8f92  openbios-1.0-svn1063.tar.gz