debug/gdb: rename patch directories 1.12
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 11 18:28:45 2011 +0200 (2011-09-11)
branch1.12
changeset 2681d891b4cfd080
parent 2659 a871fef8a888
child 2682 61764da7b962
debug/gdb: rename patch directories

Missed renaming the patch directories after the version renames... :-(

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from e7266674d492f0c056c79dc45a53b665199ba93c)
patches/gdb/6.8/100-dwarf-stack-overflow.patch
patches/gdb/6.8/110-security-errata-20050610.patch
patches/gdb/6.8/120-tdep-opcode-include-workaround.patch
patches/gdb/6.8/130-reg-no-longer-active.patch
patches/gdb/6.8/140-sim-ppc-have-config-h.patch
patches/gdb/6.8/150-handle-stpcpy-define.patch
patches/gdb/6.8a/100-dwarf-stack-overflow.patch
patches/gdb/6.8a/110-security-errata-20050610.patch
patches/gdb/6.8a/120-tdep-opcode-include-workaround.patch
patches/gdb/6.8a/130-reg-no-longer-active.patch
patches/gdb/6.8a/140-sim-ppc-have-config-h.patch
patches/gdb/6.8a/150-handle-stpcpy-define.patch
patches/gdb/7.0.1/100-sim-ppc-have-config-h.patch
patches/gdb/7.0.1a/100-sim-ppc-have-config-h.patch
patches/gdb/7.0/100-sim-ppc-have-config-h.patch
patches/gdb/7.0a/100-sim-ppc-have-config-h.patch
patches/gdb/7.2/100-sim-ppc-lz-fix.patch
patches/gdb/7.2a/100-sim-ppc-lz-fix.patch
     1.1 --- a/patches/gdb/6.8/100-dwarf-stack-overflow.patch	Sun Sep 11 01:03:43 2011 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,52 +0,0 @@
     1.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/80_all_gdb-6.5-dwarf-stack-overflow.patch
     1.5 --= BEGIN original header =-
     1.6 -http://bugs.gentoo.org/144833
     1.7 -
     1.8 -for gdb/ChangeLog:
     1.9 -2006-08-22  Will Drewry <wad@google.com>
    1.10 -	    Tavis Ormandy <taviso@google.com>
    1.11 -
    1.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
    1.13 -	boundaries.
    1.14 -	* dwarfread.c (locval): Likewise.
    1.15 -
    1.16 --= END original header =-
    1.17 -diff -durN gdb-6.8.orig/gdb/dwarf2read.c gdb-6.8/gdb/dwarf2read.c
    1.18 ---- gdb-6.8.orig/gdb/dwarf2read.c	2008-03-10 15:18:10.000000000 +0100
    1.19 -+++ gdb-6.8/gdb/dwarf2read.c	2008-06-17 16:07:31.000000000 +0200
    1.20 -@@ -9124,8 +9124,7 @@
    1.21 -    callers will only want a very basic result and this can become a
    1.22 -    complaint.
    1.23 - 
    1.24 --   Note that stack[0] is unused except as a default error return.
    1.25 --   Note that stack overflow is not yet handled.  */
    1.26 -+   Note that stack[0] is unused except as a default error return. */
    1.27 - 
    1.28 - static CORE_ADDR
    1.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
    1.30 -@@ -9142,7 +9141,7 @@
    1.31 - 
    1.32 -   i = 0;
    1.33 -   stacki = 0;
    1.34 --  stack[stacki] = 0;
    1.35 -+  stack[++stacki] = 0;
    1.36 - 
    1.37 -   while (i < size)
    1.38 -     {
    1.39 -@@ -9324,6 +9323,16 @@
    1.40 - 		     dwarf_stack_op_name (op));
    1.41 - 	  return (stack[stacki]);
    1.42 - 	}
    1.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
    1.44 -+         outside of the allocated space. Also enforce minimum > 0.
    1.45 -+         -- wad@google.com 14 Aug 2006 */
    1.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
    1.47 -+	internal_error (__FILE__, __LINE__,
    1.48 -+	                _("location description stack too deep: %d"),
    1.49 -+	                stacki);
    1.50 -+      if (stacki <= 0)
    1.51 -+	internal_error (__FILE__, __LINE__,
    1.52 -+	                _("location description stack too shallow"));
    1.53 -     }
    1.54 -   return (stack[stacki]);
    1.55 - }
     2.1 --- a/patches/gdb/6.8/110-security-errata-20050610.patch	Sun Sep 11 01:03:43 2011 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,205 +0,0 @@
     2.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch
     2.5 --= BEGIN original header =-
     2.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
     2.7 -
     2.8 -        * gdb.base/gdbinit.exp: New testcase.
     2.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
    2.10 -
    2.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
    2.12 -            Jeff Johnston  <jjohnstn@redhat.com>
    2.13 -
    2.14 -        * Makefile.in (cli-cmds.o): Update.
    2.15 -        * configure.in: Add check for getuid.
    2.16 -        * configure: Regenerated.
    2.17 -        * config.in: Ditto.
    2.18 -        * main.c (captured_main): Pass -1 to source_command when loading
    2.19 -        gdbinit files.
    2.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
    2.21 -        (source_command): Update documentation.  Check permissions if
    2.22 -        FROM_TTY is -1.
    2.23 -
    2.24 --= END original header =-
    2.25 -diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in
    2.26 ---- gdb-6.8.orig/gdb/Makefile.in	2008-03-17 13:15:08.000000000 +0100
    2.27 -+++ gdb-6.8/gdb/Makefile.in	2008-06-17 16:07:33.000000000 +0200
    2.28 -@@ -3004,7 +3004,7 @@
    2.29 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
    2.30 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
    2.31 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
    2.32 --	$(tui_h)
    2.33 -+	$(tui_h) $(gdb_stat_h)
    2.34 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
    2.35 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
    2.36 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
    2.37 -diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c
    2.38 ---- gdb-6.8.orig/gdb/cli/cli-cmds.c	2008-01-01 23:53:14.000000000 +0100
    2.39 -+++ gdb-6.8/gdb/cli/cli-cmds.c	2008-06-17 16:07:33.000000000 +0200
    2.40 -@@ -36,6 +36,7 @@
    2.41 - #include "objfiles.h"
    2.42 - #include "source.h"
    2.43 - #include "disasm.h"
    2.44 -+#include "gdb_stat.h"
    2.45 - 
    2.46 - #include "ui-out.h"
    2.47 - 
    2.48 -@@ -459,12 +460,31 @@
    2.49 - 
    2.50 -   if (fd == -1)
    2.51 -     {
    2.52 --      if (from_tty)
    2.53 -+      if (from_tty > 0)
    2.54 - 	perror_with_name (file);
    2.55 -       else
    2.56 - 	return;
    2.57 -     }
    2.58 - 
    2.59 -+#ifdef HAVE_GETUID
    2.60 -+  if (from_tty == -1)
    2.61 -+    {
    2.62 -+      struct stat statbuf;
    2.63 -+      if (fstat (fd, &statbuf) < 0)
    2.64 -+	{
    2.65 -+	  perror_with_name (file);
    2.66 -+	  close (fd);
    2.67 -+	  return;
    2.68 -+	}
    2.69 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
    2.70 -+	{
    2.71 -+          warning (_("not using untrusted file \"%s\""), file);
    2.72 -+	  close (fd);
    2.73 -+	  return;
    2.74 -+	}
    2.75 -+    }
    2.76 -+#endif
    2.77 -+
    2.78 -   stream = fdopen (fd, FOPEN_RT);
    2.79 -   script_from_file (stream, file);
    2.80 - 
    2.81 -diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c
    2.82 ---- gdb-6.8.orig/gdb/main.c	2008-01-05 17:49:53.000000000 +0100
    2.83 -+++ gdb-6.8/gdb/main.c	2008-06-17 16:07:33.000000000 +0200
    2.84 -@@ -690,7 +690,7 @@
    2.85 - 
    2.86 -       if (!inhibit_gdbinit)
    2.87 - 	{
    2.88 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
    2.89 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
    2.90 - 	}
    2.91 - 
    2.92 -       /* Do stats; no need to do them elsewhere since we'll only
    2.93 -@@ -778,7 +778,7 @@
    2.94 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
    2.95 -     if (!inhibit_gdbinit)
    2.96 -       {
    2.97 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
    2.98 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
    2.99 -       }
   2.100 - 
   2.101 -   for (i = 0; i < ncmd; i++)
   2.102 -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp
   2.103 ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
   2.104 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 16:07:33.000000000 +0200
   2.105 -@@ -0,0 +1,98 @@
   2.106 -+#   Copyright 2005
   2.107 -+#   Free Software Foundation, Inc.
   2.108 -+
   2.109 -+# This program is free software; you can redistribute it and/or modify
   2.110 -+# it under the terms of the GNU General Public License as published by
   2.111 -+# the Free Software Foundation; either version 2 of the License, or
   2.112 -+# (at your option) any later version.
   2.113 -+# 
   2.114 -+# This program is distributed in the hope that it will be useful,
   2.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
   2.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   2.117 -+# GNU General Public License for more details.
   2.118 -+# 
   2.119 -+# You should have received a copy of the GNU General Public License
   2.120 -+# along with this program; if not, write to the Free Software
   2.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
   2.122 -+
   2.123 -+# Please email any bugs, comments, and/or additions to this file to:
   2.124 -+# bug-gdb@prep.ai.mit.edu
   2.125 -+
   2.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
   2.127 -+
   2.128 -+if $tracelevel then {
   2.129 -+    strace $tracelevel
   2.130 -+}
   2.131 -+
   2.132 -+set prms_id 0
   2.133 -+set bug_id 0
   2.134 -+
   2.135 -+# are we on a target board
   2.136 -+if [is_remote target] {
   2.137 -+    return
   2.138 -+}
   2.139 -+
   2.140 -+
   2.141 -+global verbose
   2.142 -+global GDB
   2.143 -+global GDBFLAGS
   2.144 -+global gdb_prompt
   2.145 -+global timeout
   2.146 -+global gdb_spawn_id;
   2.147 -+                                                                                
   2.148 -+gdb_stop_suppressing_tests;
   2.149 -+                                                                                
   2.150 -+verbose "Spawning $GDB -nw"
   2.151 -+                                                                                
   2.152 -+if [info exists gdb_spawn_id] {
   2.153 -+    return 0;
   2.154 -+}
   2.155 -+                                                                                
   2.156 -+if ![is_remote host] {
   2.157 -+   if { [which $GDB] == 0 } then {
   2.158 -+        perror "$GDB does not exist."
   2.159 -+        exit 1
   2.160 -+    }
   2.161 -+}
   2.162 -+
   2.163 -+set env(HOME) [pwd]
   2.164 -+remote_exec build "rm .gdbinit"
   2.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
   2.166 -+remote_exec build "chmod 646 .gdbinit"
   2.167 -+
   2.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   2.169 -+if { $res < 0 || $res == "" } {
   2.170 -+    perror "Spawning $GDB failed."
   2.171 -+    return 1;
   2.172 -+}
   2.173 -+gdb_expect 360 {
   2.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   2.175 -+        pass "untrusted .gdbinit caught."
   2.176 -+    }
   2.177 -+    -re "$gdb_prompt $"     {
   2.178 -+        fail "untrusted .gdbinit caught."
   2.179 -+    }
   2.180 -+    timeout {
   2.181 -+        fail "(timeout) untrusted .gdbinit caught."
   2.182 -+    }
   2.183 -+}
   2.184 -+
   2.185 -+remote_exec build "chmod 644 .gdbinit"
   2.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   2.187 -+if { $res < 0 || $res == "" } {
   2.188 -+    perror "Spawning $GDB failed."
   2.189 -+    return 1;
   2.190 -+}
   2.191 -+gdb_expect 360 {
   2.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   2.193 -+        fail "trusted .gdbinit allowed."
   2.194 -+    }
   2.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
   2.196 -+        pass "trusted .gdbinit allowed."
   2.197 -+    }
   2.198 -+    timeout {
   2.199 -+        fail "(timeout) trusted .gdbinit allowed."
   2.200 -+    }
   2.201 -+}
   2.202 -+
   2.203 -+remote_exec build "rm .gdbinit"
   2.204 -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample
   2.205 ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
   2.206 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 16:07:33.000000000 +0200
   2.207 -@@ -0,0 +1 @@
   2.208 -+echo "\nin gdbinit"
     3.1 --- a/patches/gdb/6.8/120-tdep-opcode-include-workaround.patch	Sun Sep 11 01:03:43 2011 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,33 +0,0 @@
     3.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch
     3.5 --= BEGIN original header =-
     3.6 -workaround build failure
     3.7 -
     3.8 -http://bugs.gentoo.org/216368
     3.9 -
    3.10 --= END original header =-
    3.11 -diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c
    3.12 ---- gdb-6.8.orig/gdb/frv-tdep.c	2008-01-11 14:19:59.000000000 +0100
    3.13 -+++ gdb-6.8/gdb/frv-tdep.c	2008-06-17 16:07:34.000000000 +0200
    3.14 -@@ -32,7 +32,7 @@
    3.15 - #include "gdb_assert.h"
    3.16 - #include "sim-regno.h"
    3.17 - #include "gdb/sim-frv.h"
    3.18 --#include "opcodes/frv-desc.h"	/* for the H_SPR_... enums */
    3.19 -+#include "../opcodes/frv-desc.h"	/* for the H_SPR_... enums */
    3.20 - #include "symtab.h"
    3.21 - #include "elf-bfd.h"
    3.22 - #include "elf/frv.h"
    3.23 -diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c
    3.24 ---- gdb-6.8.orig/gdb/mep-tdep.c	2008-01-11 14:20:02.000000000 +0100
    3.25 -+++ gdb-6.8/gdb/mep-tdep.c	2008-06-17 16:07:34.000000000 +0200
    3.26 -@@ -53,8 +53,8 @@
    3.27 - 
    3.28 - /* Get the user's customized MeP coprocessor register names from
    3.29 -    libopcodes.  */
    3.30 --#include "opcodes/mep-desc.h"
    3.31 --#include "opcodes/mep-opc.h"
    3.32 -+#include "../opcodes/mep-desc.h"
    3.33 -+#include "../opcodes/mep-opc.h"
    3.34 - 
    3.35 - 
    3.36 - /* The gdbarch_tdep structure.  */
     4.1 --- a/patches/gdb/6.8/130-reg-no-longer-active.patch	Sun Sep 11 01:03:43 2011 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,30 +0,0 @@
     4.4 -Fix bug reported by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
     4.5 -See: http://sourceware.org/ml/crossgcc/2009-05/msg00055.html
     4.6 -     https://bugzilla.redhat.com/show_bug.cgi?id=436037
     4.7 -
     4.8 -Fix from: http://cvs.fedoraproject.org/viewvc/devel/gdb/gdb-6.8-bz436037-reg-no-longer-active.patch?revision=1.1
     4.9 -
    4.10 -diff -d -urpN src.0/gdb/valops.c src.1/gdb/valops.c
    4.11 ---- src.0/gdb/valops.c	2008-07-27 04:00:03.000000000 +0200
    4.12 -+++ src.1/gdb/valops.c	2008-07-31 15:17:42.000000000 +0200
    4.13 -@@ -813,10 +813,18 @@ value_assign (struct value *toval, struc
    4.14 - 	struct frame_info *frame;
    4.15 - 	int value_reg;
    4.16 - 
    4.17 --	/* Figure out which frame this is in currently.  */
    4.18 --	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
    4.19 - 	value_reg = VALUE_REGNUM (toval);
    4.20 - 
    4.21 -+	/* Figure out which frame this is in currently.  */
    4.22 -+	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
    4.23 -+	/* "set $reg+=1" should work on programs with no debug info,
    4.24 -+	   but frame_find_by_id returns NULL here (RH bug 436037).
    4.25 -+	   Use current frame, it represents CPU state in this case.
    4.26 -+	   If frame_find_by_id is changed to do it internally
    4.27 -+	   (it is contemplated there), remove this.  */
    4.28 -+	if (!frame)
    4.29 -+	  frame = get_current_frame ();
    4.30 -+	/* Probably never happens.  */
    4.31 - 	if (!frame)
    4.32 - 	  error (_("Value being assigned to is no longer active."));
    4.33 - 	
     5.1 --- a/patches/gdb/6.8/140-sim-ppc-have-config-h.patch	Sun Sep 11 01:03:43 2011 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,183 +0,0 @@
     5.4 -Fix for canadian cross build of sim/ppc
     5.5 -
     5.6 -Orignal patch info see: http://sources.redhat.com/bugzilla/show_bug.cgi?id=9638
     5.7 -
     5.8 -diff -urN gdb-6.8-pl1/sim/ppc/Makefile.in gdb-6.8-pl2/sim/ppc/Makefile.in
     5.9 ---- gdb-6.8-pl1/sim/ppc/Makefile.in	2006-05-31 17:14:45.000000000 +0200
    5.10 -+++ gdb-6.8-pl2/sim/ppc/Makefile.in	2008-09-30 15:56:33.000000000 +0200
    5.11 -@@ -61,7 +61,7 @@
    5.12 - AR = @AR@
    5.13 - AR_FLAGS = rc
    5.14 - CC = @CC@
    5.15 --CFLAGS = @CFLAGS@
    5.16 -+CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H
    5.17 - CC_FOR_BUILD = @CC_FOR_BUILD@
    5.18 - CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
    5.19 - BISON = bison
    5.20 -@@ -115,8 +115,8 @@
    5.21 -   $(DEVZERO_CFLAGS)
    5.22 - SIM_FPU_CFLAGS = @sim_fpu_cflags@
    5.23 - 
    5.24 --STD_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
    5.25 --NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
    5.26 -+STD_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
    5.27 -+NOWARN_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
    5.28 - BUILD_CFLAGS	= $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS)
    5.29 - 
    5.30 - BUILD_LDFLAGS	=
    5.31 -diff -urN gdb-6.8-orig/sim/ppc/basics.h gdb-6.8-pl1/sim/ppc/basics.h
    5.32 ---- gdb-6.8-orig/sim/ppc/basics.h	1999-04-16 03:35:08.000000000 +0200
    5.33 -+++ gdb-6.8-pl1/sim/ppc/basics.h	2008-09-30 15:12:32.000000000 +0200
    5.34 -@@ -86,7 +86,9 @@
    5.35 - 
    5.36 - /* Basic configuration */
    5.37 - 
    5.38 -+#ifdef HAVE_CONFIG_H
    5.39 - #include "config.h"
    5.40 -+#endif
    5.41 - #include "ppc-config.h"
    5.42 - #include "inline.h"
    5.43 - 
    5.44 -diff -urN gdb-6.8-orig/sim/ppc/debug.c gdb-6.8-pl1/sim/ppc/debug.c
    5.45 ---- gdb-6.8-orig/sim/ppc/debug.c	1999-04-16 03:35:08.000000000 +0200
    5.46 -+++ gdb-6.8-pl1/sim/ppc/debug.c	2008-09-30 15:12:27.000000000 +0200
    5.47 -@@ -22,7 +22,9 @@
    5.48 - #ifndef _DEBUG_C_
    5.49 - #define _DEBUG_C_
    5.50 - 
    5.51 -+#ifdef HAVE_CONFIG_H
    5.52 - #include "config.h"
    5.53 -+#endif
    5.54 - #include "basics.h"
    5.55 - 
    5.56 - #ifdef HAVE_STDLIB_H
    5.57 -diff -urN gdb-6.8-orig/sim/ppc/dgen.c gdb-6.8-pl1/sim/ppc/dgen.c
    5.58 ---- gdb-6.8-orig/sim/ppc/dgen.c	1999-04-16 03:35:08.000000000 +0200
    5.59 -+++ gdb-6.8-pl1/sim/ppc/dgen.c	2008-09-30 15:12:22.000000000 +0200
    5.60 -@@ -27,7 +27,9 @@
    5.61 - #include <ctype.h>
    5.62 - #include <stdarg.h>
    5.63 - 
    5.64 -+#ifdef HAVE_CONFIG_H
    5.65 - #include "config.h"
    5.66 -+#endif
    5.67 - #include "misc.h"
    5.68 - #include "lf.h"
    5.69 - #include "table.h"
    5.70 -diff -urN gdb-6.8-orig/sim/ppc/filter.c gdb-6.8-pl1/sim/ppc/filter.c
    5.71 ---- gdb-6.8-orig/sim/ppc/filter.c	1999-04-16 03:35:09.000000000 +0200
    5.72 -+++ gdb-6.8-pl1/sim/ppc/filter.c	2008-09-30 15:12:15.000000000 +0200
    5.73 -@@ -21,7 +21,9 @@
    5.74 - 
    5.75 - #include <stdio.h>
    5.76 - 
    5.77 -+#ifdef HAVE_CONFIG_H
    5.78 - #include "config.h"
    5.79 -+#endif
    5.80 - 
    5.81 - #ifdef HAVE_STRING_H
    5.82 - #include <string.h>
    5.83 -diff -urN gdb-6.8-orig/sim/ppc/filter_filename.c gdb-6.8-pl1/sim/ppc/filter_filename.c
    5.84 ---- gdb-6.8-orig/sim/ppc/filter_filename.c	1999-04-16 03:35:08.000000000 +0200
    5.85 -+++ gdb-6.8-pl1/sim/ppc/filter_filename.c	2008-09-30 15:12:11.000000000 +0200
    5.86 -@@ -18,7 +18,9 @@
    5.87 -  
    5.88 -     */
    5.89 - 
    5.90 -+#ifdef HAVE_CONFIG_H
    5.91 - #include "config.h"
    5.92 -+#endif
    5.93 - #include "ppc-config.h"
    5.94 - #include "filter_filename.h"
    5.95 - 
    5.96 -diff -urN gdb-6.8-orig/sim/ppc/igen.c gdb-6.8-pl1/sim/ppc/igen.c
    5.97 ---- gdb-6.8-orig/sim/ppc/igen.c	2003-06-20 05:59:33.000000000 +0200
    5.98 -+++ gdb-6.8-pl1/sim/ppc/igen.c	2008-09-30 15:12:06.000000000 +0200
    5.99 -@@ -25,7 +25,9 @@
   5.100 - #include "misc.h"
   5.101 - #include "lf.h"
   5.102 - #include "table.h"
   5.103 -+#ifdef HAVE_CONFIG_H
   5.104 - #include "config.h"
   5.105 -+#endif
   5.106 - 
   5.107 - #include "filter.h"
   5.108 - 
   5.109 -diff -urN gdb-6.8-orig/sim/ppc/inline.c gdb-6.8-pl1/sim/ppc/inline.c
   5.110 ---- gdb-6.8-orig/sim/ppc/inline.c	1999-04-16 03:35:10.000000000 +0200
   5.111 -+++ gdb-6.8-pl1/sim/ppc/inline.c	2008-09-30 15:11:58.000000000 +0200
   5.112 -@@ -22,7 +22,9 @@
   5.113 - #ifndef _INLINE_C_
   5.114 - #define _INLINE_C_
   5.115 - 
   5.116 -+#ifdef HAVE_CONFIG_H
   5.117 - #include "config.h"
   5.118 -+#endif
   5.119 - #include "ppc-config.h"
   5.120 - 
   5.121 - #include "inline.h"
   5.122 -diff -urN gdb-6.8-orig/sim/ppc/lf.c gdb-6.8-pl1/sim/ppc/lf.c
   5.123 ---- gdb-6.8-orig/sim/ppc/lf.c	2002-05-30 17:07:06.000000000 +0200
   5.124 -+++ gdb-6.8-pl1/sim/ppc/lf.c	2008-09-30 15:33:35.000000000 +0200
   5.125 -@@ -23,7 +23,9 @@
   5.126 - #include <stdarg.h>
   5.127 - #include <ctype.h>
   5.128 - 
   5.129 -+#ifdef HAVE_CONFIG_H
   5.130 - #include "config.h"
   5.131 -+#endif
   5.132 - #include "misc.h"
   5.133 - #include "lf.h"
   5.134 - 
   5.135 -diff -urN gdb-6.8-orig/sim/ppc/misc.c gdb-6.8-pl1/sim/ppc/misc.c
   5.136 ---- gdb-6.8-orig/sim/ppc/misc.c	1999-04-16 03:35:11.000000000 +0200
   5.137 -+++ gdb-6.8-pl1/sim/ppc/misc.c	2008-09-30 15:11:54.000000000 +0200
   5.138 -@@ -23,7 +23,9 @@
   5.139 - #include <stdarg.h>
   5.140 - #include <ctype.h>
   5.141 - 
   5.142 -+#ifdef HAVE_CONFIG_H
   5.143 - #include "config.h"
   5.144 -+#endif
   5.145 - #include "misc.h"
   5.146 - 
   5.147 - #ifdef HAVE_STDLIB_H
   5.148 -diff -urN gdb-6.8-orig/sim/ppc/misc.h gdb-6.8-pl1/sim/ppc/misc.h
   5.149 ---- gdb-6.8-orig/sim/ppc/misc.h	2002-01-12 11:21:12.000000000 +0100
   5.150 -+++ gdb-6.8-pl1/sim/ppc/misc.h	2008-09-30 15:11:49.000000000 +0200
   5.151 -@@ -21,7 +21,9 @@
   5.152 - 
   5.153 - /* Frustrating header junk */
   5.154 - 
   5.155 -+#ifdef HAVE_CONFIG_H
   5.156 - #include "config.h"
   5.157 -+#endif
   5.158 - 
   5.159 - #include <stdio.h>
   5.160 - #include <ctype.h>
   5.161 -diff -urN gdb-6.8-orig/sim/ppc/sim-endian.c gdb-6.8-pl1/sim/ppc/sim-endian.c
   5.162 ---- gdb-6.8-orig/sim/ppc/sim-endian.c	1999-04-16 03:35:11.000000000 +0200
   5.163 -+++ gdb-6.8-pl1/sim/ppc/sim-endian.c	2008-09-30 15:11:44.000000000 +0200
   5.164 -@@ -22,7 +22,9 @@
   5.165 - #ifndef _SIM_ENDIAN_C_
   5.166 - #define _SIM_ENDIAN_C_
   5.167 - 
   5.168 -+#ifdef HAVE_CONFIG_H
   5.169 - #include "config.h"
   5.170 -+#endif
   5.171 - #include "basics.h"
   5.172 - 
   5.173 - 
   5.174 -diff -urN gdb-6.8-orig/sim/ppc/table.c gdb-6.8-pl1/sim/ppc/table.c
   5.175 ---- gdb-6.8-orig/sim/ppc/table.c	2002-01-12 11:21:12.000000000 +0100
   5.176 -+++ gdb-6.8-pl1/sim/ppc/table.c	2008-09-30 15:11:38.000000000 +0200
   5.177 -@@ -25,7 +25,9 @@
   5.178 - #include <fcntl.h>
   5.179 - #include <ctype.h>
   5.180 - 
   5.181 -+#ifdef HAVE_CONFIG_H
   5.182 - #include "config.h"
   5.183 -+#endif
   5.184 - #include "misc.h"
   5.185 - #include "lf.h"
   5.186 - #include "table.h"
     6.1 --- a/patches/gdb/6.8/150-handle-stpcpy-define.patch	Sun Sep 11 01:03:43 2011 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,12 +0,0 @@
     6.4 -diff -ru gdb-6.8.orig/bfd/sysdep.h gdb-6.8/bfd/sysdep.h
     6.5 ---- gdb-6.8.orig/bfd/sysdep.h	2007-07-03 16:26:42.000000000 +0200
     6.6 -+++ gdb-6.8/bfd/sysdep.h	2011-08-21 13:33:47.000000000 +0200
     6.7 -@@ -131,7 +131,7 @@
     6.8 - extern PTR realloc ();
     6.9 - #endif
    6.10 - 
    6.11 --#if !HAVE_DECL_STPCPY
    6.12 -+#if !HAVE_DECL_STPCPY && !defined(stpcpy)
    6.13 - extern char *stpcpy (char *__dest, const char *__src);
    6.14 - #endif
    6.15 - 
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/patches/gdb/6.8a/100-dwarf-stack-overflow.patch	Sun Sep 11 18:28:45 2011 +0200
     7.3 @@ -0,0 +1,52 @@
     7.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/80_all_gdb-6.5-dwarf-stack-overflow.patch
     7.5 +-= BEGIN original header =-
     7.6 +http://bugs.gentoo.org/144833
     7.7 +
     7.8 +for gdb/ChangeLog:
     7.9 +2006-08-22  Will Drewry <wad@google.com>
    7.10 +	    Tavis Ormandy <taviso@google.com>
    7.11 +
    7.12 +	* dwarf2read.c (decode_locdesc): Enforce location description stack
    7.13 +	boundaries.
    7.14 +	* dwarfread.c (locval): Likewise.
    7.15 +
    7.16 +-= END original header =-
    7.17 +diff -durN gdb-6.8.orig/gdb/dwarf2read.c gdb-6.8/gdb/dwarf2read.c
    7.18 +--- gdb-6.8.orig/gdb/dwarf2read.c	2008-03-10 15:18:10.000000000 +0100
    7.19 ++++ gdb-6.8/gdb/dwarf2read.c	2008-06-17 16:07:31.000000000 +0200
    7.20 +@@ -9124,8 +9124,7 @@
    7.21 +    callers will only want a very basic result and this can become a
    7.22 +    complaint.
    7.23 + 
    7.24 +-   Note that stack[0] is unused except as a default error return.
    7.25 +-   Note that stack overflow is not yet handled.  */
    7.26 ++   Note that stack[0] is unused except as a default error return. */
    7.27 + 
    7.28 + static CORE_ADDR
    7.29 + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
    7.30 +@@ -9142,7 +9141,7 @@
    7.31 + 
    7.32 +   i = 0;
    7.33 +   stacki = 0;
    7.34 +-  stack[stacki] = 0;
    7.35 ++  stack[++stacki] = 0;
    7.36 + 
    7.37 +   while (i < size)
    7.38 +     {
    7.39 +@@ -9324,6 +9323,16 @@
    7.40 + 		     dwarf_stack_op_name (op));
    7.41 + 	  return (stack[stacki]);
    7.42 + 	}
    7.43 ++      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
    7.44 ++         outside of the allocated space. Also enforce minimum > 0.
    7.45 ++         -- wad@google.com 14 Aug 2006 */
    7.46 ++      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
    7.47 ++	internal_error (__FILE__, __LINE__,
    7.48 ++	                _("location description stack too deep: %d"),
    7.49 ++	                stacki);
    7.50 ++      if (stacki <= 0)
    7.51 ++	internal_error (__FILE__, __LINE__,
    7.52 ++	                _("location description stack too shallow"));
    7.53 +     }
    7.54 +   return (stack[stacki]);
    7.55 + }
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/patches/gdb/6.8a/110-security-errata-20050610.patch	Sun Sep 11 18:28:45 2011 +0200
     8.3 @@ -0,0 +1,205 @@
     8.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch
     8.5 +-= BEGIN original header =-
     8.6 +2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
     8.7 +
     8.8 +        * gdb.base/gdbinit.exp: New testcase.
     8.9 +        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
    8.10 +
    8.11 +2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
    8.12 +            Jeff Johnston  <jjohnstn@redhat.com>
    8.13 +
    8.14 +        * Makefile.in (cli-cmds.o): Update.
    8.15 +        * configure.in: Add check for getuid.
    8.16 +        * configure: Regenerated.
    8.17 +        * config.in: Ditto.
    8.18 +        * main.c (captured_main): Pass -1 to source_command when loading
    8.19 +        gdbinit files.
    8.20 +        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
    8.21 +        (source_command): Update documentation.  Check permissions if
    8.22 +        FROM_TTY is -1.
    8.23 +
    8.24 +-= END original header =-
    8.25 +diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in
    8.26 +--- gdb-6.8.orig/gdb/Makefile.in	2008-03-17 13:15:08.000000000 +0100
    8.27 ++++ gdb-6.8/gdb/Makefile.in	2008-06-17 16:07:33.000000000 +0200
    8.28 +@@ -3004,7 +3004,7 @@
    8.29 + 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
    8.30 + 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
    8.31 + 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
    8.32 +-	$(tui_h)
    8.33 ++	$(tui_h) $(gdb_stat_h)
    8.34 + 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
    8.35 + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
    8.36 + 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
    8.37 +diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c
    8.38 +--- gdb-6.8.orig/gdb/cli/cli-cmds.c	2008-01-01 23:53:14.000000000 +0100
    8.39 ++++ gdb-6.8/gdb/cli/cli-cmds.c	2008-06-17 16:07:33.000000000 +0200
    8.40 +@@ -36,6 +36,7 @@
    8.41 + #include "objfiles.h"
    8.42 + #include "source.h"
    8.43 + #include "disasm.h"
    8.44 ++#include "gdb_stat.h"
    8.45 + 
    8.46 + #include "ui-out.h"
    8.47 + 
    8.48 +@@ -459,12 +460,31 @@
    8.49 + 
    8.50 +   if (fd == -1)
    8.51 +     {
    8.52 +-      if (from_tty)
    8.53 ++      if (from_tty > 0)
    8.54 + 	perror_with_name (file);
    8.55 +       else
    8.56 + 	return;
    8.57 +     }
    8.58 + 
    8.59 ++#ifdef HAVE_GETUID
    8.60 ++  if (from_tty == -1)
    8.61 ++    {
    8.62 ++      struct stat statbuf;
    8.63 ++      if (fstat (fd, &statbuf) < 0)
    8.64 ++	{
    8.65 ++	  perror_with_name (file);
    8.66 ++	  close (fd);
    8.67 ++	  return;
    8.68 ++	}
    8.69 ++      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
    8.70 ++	{
    8.71 ++          warning (_("not using untrusted file \"%s\""), file);
    8.72 ++	  close (fd);
    8.73 ++	  return;
    8.74 ++	}
    8.75 ++    }
    8.76 ++#endif
    8.77 ++
    8.78 +   stream = fdopen (fd, FOPEN_RT);
    8.79 +   script_from_file (stream, file);
    8.80 + 
    8.81 +diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c
    8.82 +--- gdb-6.8.orig/gdb/main.c	2008-01-05 17:49:53.000000000 +0100
    8.83 ++++ gdb-6.8/gdb/main.c	2008-06-17 16:07:33.000000000 +0200
    8.84 +@@ -690,7 +690,7 @@
    8.85 + 
    8.86 +       if (!inhibit_gdbinit)
    8.87 + 	{
    8.88 +-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
    8.89 ++	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
    8.90 + 	}
    8.91 + 
    8.92 +       /* Do stats; no need to do them elsewhere since we'll only
    8.93 +@@ -778,7 +778,7 @@
    8.94 +       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
    8.95 +     if (!inhibit_gdbinit)
    8.96 +       {
    8.97 +-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
    8.98 ++	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
    8.99 +       }
   8.100 + 
   8.101 +   for (i = 0; i < ncmd; i++)
   8.102 +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp
   8.103 +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
   8.104 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 16:07:33.000000000 +0200
   8.105 +@@ -0,0 +1,98 @@
   8.106 ++#   Copyright 2005
   8.107 ++#   Free Software Foundation, Inc.
   8.108 ++
   8.109 ++# This program is free software; you can redistribute it and/or modify
   8.110 ++# it under the terms of the GNU General Public License as published by
   8.111 ++# the Free Software Foundation; either version 2 of the License, or
   8.112 ++# (at your option) any later version.
   8.113 ++# 
   8.114 ++# This program is distributed in the hope that it will be useful,
   8.115 ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
   8.116 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   8.117 ++# GNU General Public License for more details.
   8.118 ++# 
   8.119 ++# You should have received a copy of the GNU General Public License
   8.120 ++# along with this program; if not, write to the Free Software
   8.121 ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
   8.122 ++
   8.123 ++# Please email any bugs, comments, and/or additions to this file to:
   8.124 ++# bug-gdb@prep.ai.mit.edu
   8.125 ++
   8.126 ++# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
   8.127 ++
   8.128 ++if $tracelevel then {
   8.129 ++    strace $tracelevel
   8.130 ++}
   8.131 ++
   8.132 ++set prms_id 0
   8.133 ++set bug_id 0
   8.134 ++
   8.135 ++# are we on a target board
   8.136 ++if [is_remote target] {
   8.137 ++    return
   8.138 ++}
   8.139 ++
   8.140 ++
   8.141 ++global verbose
   8.142 ++global GDB
   8.143 ++global GDBFLAGS
   8.144 ++global gdb_prompt
   8.145 ++global timeout
   8.146 ++global gdb_spawn_id;
   8.147 ++                                                                                
   8.148 ++gdb_stop_suppressing_tests;
   8.149 ++                                                                                
   8.150 ++verbose "Spawning $GDB -nw"
   8.151 ++                                                                                
   8.152 ++if [info exists gdb_spawn_id] {
   8.153 ++    return 0;
   8.154 ++}
   8.155 ++                                                                                
   8.156 ++if ![is_remote host] {
   8.157 ++   if { [which $GDB] == 0 } then {
   8.158 ++        perror "$GDB does not exist."
   8.159 ++        exit 1
   8.160 ++    }
   8.161 ++}
   8.162 ++
   8.163 ++set env(HOME) [pwd]
   8.164 ++remote_exec build "rm .gdbinit"
   8.165 ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
   8.166 ++remote_exec build "chmod 646 .gdbinit"
   8.167 ++
   8.168 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   8.169 ++if { $res < 0 || $res == "" } {
   8.170 ++    perror "Spawning $GDB failed."
   8.171 ++    return 1;
   8.172 ++}
   8.173 ++gdb_expect 360 {
   8.174 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   8.175 ++        pass "untrusted .gdbinit caught."
   8.176 ++    }
   8.177 ++    -re "$gdb_prompt $"     {
   8.178 ++        fail "untrusted .gdbinit caught."
   8.179 ++    }
   8.180 ++    timeout {
   8.181 ++        fail "(timeout) untrusted .gdbinit caught."
   8.182 ++    }
   8.183 ++}
   8.184 ++
   8.185 ++remote_exec build "chmod 644 .gdbinit"
   8.186 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
   8.187 ++if { $res < 0 || $res == "" } {
   8.188 ++    perror "Spawning $GDB failed."
   8.189 ++    return 1;
   8.190 ++}
   8.191 ++gdb_expect 360 {
   8.192 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
   8.193 ++        fail "trusted .gdbinit allowed."
   8.194 ++    }
   8.195 ++    -re "in gdbinit.*$gdb_prompt $"     {
   8.196 ++        pass "trusted .gdbinit allowed."
   8.197 ++    }
   8.198 ++    timeout {
   8.199 ++        fail "(timeout) trusted .gdbinit allowed."
   8.200 ++    }
   8.201 ++}
   8.202 ++
   8.203 ++remote_exec build "rm .gdbinit"
   8.204 +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample
   8.205 +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
   8.206 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 16:07:33.000000000 +0200
   8.207 +@@ -0,0 +1 @@
   8.208 ++echo "\nin gdbinit"
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/patches/gdb/6.8a/120-tdep-opcode-include-workaround.patch	Sun Sep 11 18:28:45 2011 +0200
     9.3 @@ -0,0 +1,33 @@
     9.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch
     9.5 +-= BEGIN original header =-
     9.6 +workaround build failure
     9.7 +
     9.8 +http://bugs.gentoo.org/216368
     9.9 +
    9.10 +-= END original header =-
    9.11 +diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c
    9.12 +--- gdb-6.8.orig/gdb/frv-tdep.c	2008-01-11 14:19:59.000000000 +0100
    9.13 ++++ gdb-6.8/gdb/frv-tdep.c	2008-06-17 16:07:34.000000000 +0200
    9.14 +@@ -32,7 +32,7 @@
    9.15 + #include "gdb_assert.h"
    9.16 + #include "sim-regno.h"
    9.17 + #include "gdb/sim-frv.h"
    9.18 +-#include "opcodes/frv-desc.h"	/* for the H_SPR_... enums */
    9.19 ++#include "../opcodes/frv-desc.h"	/* for the H_SPR_... enums */
    9.20 + #include "symtab.h"
    9.21 + #include "elf-bfd.h"
    9.22 + #include "elf/frv.h"
    9.23 +diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c
    9.24 +--- gdb-6.8.orig/gdb/mep-tdep.c	2008-01-11 14:20:02.000000000 +0100
    9.25 ++++ gdb-6.8/gdb/mep-tdep.c	2008-06-17 16:07:34.000000000 +0200
    9.26 +@@ -53,8 +53,8 @@
    9.27 + 
    9.28 + /* Get the user's customized MeP coprocessor register names from
    9.29 +    libopcodes.  */
    9.30 +-#include "opcodes/mep-desc.h"
    9.31 +-#include "opcodes/mep-opc.h"
    9.32 ++#include "../opcodes/mep-desc.h"
    9.33 ++#include "../opcodes/mep-opc.h"
    9.34 + 
    9.35 + 
    9.36 + /* The gdbarch_tdep structure.  */
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/patches/gdb/6.8a/130-reg-no-longer-active.patch	Sun Sep 11 18:28:45 2011 +0200
    10.3 @@ -0,0 +1,30 @@
    10.4 +Fix bug reported by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
    10.5 +See: http://sourceware.org/ml/crossgcc/2009-05/msg00055.html
    10.6 +     https://bugzilla.redhat.com/show_bug.cgi?id=436037
    10.7 +
    10.8 +Fix from: http://cvs.fedoraproject.org/viewvc/devel/gdb/gdb-6.8-bz436037-reg-no-longer-active.patch?revision=1.1
    10.9 +
   10.10 +diff -d -urpN src.0/gdb/valops.c src.1/gdb/valops.c
   10.11 +--- src.0/gdb/valops.c	2008-07-27 04:00:03.000000000 +0200
   10.12 ++++ src.1/gdb/valops.c	2008-07-31 15:17:42.000000000 +0200
   10.13 +@@ -813,10 +813,18 @@ value_assign (struct value *toval, struc
   10.14 + 	struct frame_info *frame;
   10.15 + 	int value_reg;
   10.16 + 
   10.17 +-	/* Figure out which frame this is in currently.  */
   10.18 +-	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
   10.19 + 	value_reg = VALUE_REGNUM (toval);
   10.20 + 
   10.21 ++	/* Figure out which frame this is in currently.  */
   10.22 ++	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
   10.23 ++	/* "set $reg+=1" should work on programs with no debug info,
   10.24 ++	   but frame_find_by_id returns NULL here (RH bug 436037).
   10.25 ++	   Use current frame, it represents CPU state in this case.
   10.26 ++	   If frame_find_by_id is changed to do it internally
   10.27 ++	   (it is contemplated there), remove this.  */
   10.28 ++	if (!frame)
   10.29 ++	  frame = get_current_frame ();
   10.30 ++	/* Probably never happens.  */
   10.31 + 	if (!frame)
   10.32 + 	  error (_("Value being assigned to is no longer active."));
   10.33 + 	
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/patches/gdb/6.8a/140-sim-ppc-have-config-h.patch	Sun Sep 11 18:28:45 2011 +0200
    11.3 @@ -0,0 +1,183 @@
    11.4 +Fix for canadian cross build of sim/ppc
    11.5 +
    11.6 +Orignal patch info see: http://sources.redhat.com/bugzilla/show_bug.cgi?id=9638
    11.7 +
    11.8 +diff -urN gdb-6.8-pl1/sim/ppc/Makefile.in gdb-6.8-pl2/sim/ppc/Makefile.in
    11.9 +--- gdb-6.8-pl1/sim/ppc/Makefile.in	2006-05-31 17:14:45.000000000 +0200
   11.10 ++++ gdb-6.8-pl2/sim/ppc/Makefile.in	2008-09-30 15:56:33.000000000 +0200
   11.11 +@@ -61,7 +61,7 @@
   11.12 + AR = @AR@
   11.13 + AR_FLAGS = rc
   11.14 + CC = @CC@
   11.15 +-CFLAGS = @CFLAGS@
   11.16 ++CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H
   11.17 + CC_FOR_BUILD = @CC_FOR_BUILD@
   11.18 + CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
   11.19 + BISON = bison
   11.20 +@@ -115,8 +115,8 @@
   11.21 +   $(DEVZERO_CFLAGS)
   11.22 + SIM_FPU_CFLAGS = @sim_fpu_cflags@
   11.23 + 
   11.24 +-STD_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   11.25 +-NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   11.26 ++STD_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   11.27 ++NOWARN_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   11.28 + BUILD_CFLAGS	= $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS)
   11.29 + 
   11.30 + BUILD_LDFLAGS	=
   11.31 +diff -urN gdb-6.8-orig/sim/ppc/basics.h gdb-6.8-pl1/sim/ppc/basics.h
   11.32 +--- gdb-6.8-orig/sim/ppc/basics.h	1999-04-16 03:35:08.000000000 +0200
   11.33 ++++ gdb-6.8-pl1/sim/ppc/basics.h	2008-09-30 15:12:32.000000000 +0200
   11.34 +@@ -86,7 +86,9 @@
   11.35 + 
   11.36 + /* Basic configuration */
   11.37 + 
   11.38 ++#ifdef HAVE_CONFIG_H
   11.39 + #include "config.h"
   11.40 ++#endif
   11.41 + #include "ppc-config.h"
   11.42 + #include "inline.h"
   11.43 + 
   11.44 +diff -urN gdb-6.8-orig/sim/ppc/debug.c gdb-6.8-pl1/sim/ppc/debug.c
   11.45 +--- gdb-6.8-orig/sim/ppc/debug.c	1999-04-16 03:35:08.000000000 +0200
   11.46 ++++ gdb-6.8-pl1/sim/ppc/debug.c	2008-09-30 15:12:27.000000000 +0200
   11.47 +@@ -22,7 +22,9 @@
   11.48 + #ifndef _DEBUG_C_
   11.49 + #define _DEBUG_C_
   11.50 + 
   11.51 ++#ifdef HAVE_CONFIG_H
   11.52 + #include "config.h"
   11.53 ++#endif
   11.54 + #include "basics.h"
   11.55 + 
   11.56 + #ifdef HAVE_STDLIB_H
   11.57 +diff -urN gdb-6.8-orig/sim/ppc/dgen.c gdb-6.8-pl1/sim/ppc/dgen.c
   11.58 +--- gdb-6.8-orig/sim/ppc/dgen.c	1999-04-16 03:35:08.000000000 +0200
   11.59 ++++ gdb-6.8-pl1/sim/ppc/dgen.c	2008-09-30 15:12:22.000000000 +0200
   11.60 +@@ -27,7 +27,9 @@
   11.61 + #include <ctype.h>
   11.62 + #include <stdarg.h>
   11.63 + 
   11.64 ++#ifdef HAVE_CONFIG_H
   11.65 + #include "config.h"
   11.66 ++#endif
   11.67 + #include "misc.h"
   11.68 + #include "lf.h"
   11.69 + #include "table.h"
   11.70 +diff -urN gdb-6.8-orig/sim/ppc/filter.c gdb-6.8-pl1/sim/ppc/filter.c
   11.71 +--- gdb-6.8-orig/sim/ppc/filter.c	1999-04-16 03:35:09.000000000 +0200
   11.72 ++++ gdb-6.8-pl1/sim/ppc/filter.c	2008-09-30 15:12:15.000000000 +0200
   11.73 +@@ -21,7 +21,9 @@
   11.74 + 
   11.75 + #include <stdio.h>
   11.76 + 
   11.77 ++#ifdef HAVE_CONFIG_H
   11.78 + #include "config.h"
   11.79 ++#endif
   11.80 + 
   11.81 + #ifdef HAVE_STRING_H
   11.82 + #include <string.h>
   11.83 +diff -urN gdb-6.8-orig/sim/ppc/filter_filename.c gdb-6.8-pl1/sim/ppc/filter_filename.c
   11.84 +--- gdb-6.8-orig/sim/ppc/filter_filename.c	1999-04-16 03:35:08.000000000 +0200
   11.85 ++++ gdb-6.8-pl1/sim/ppc/filter_filename.c	2008-09-30 15:12:11.000000000 +0200
   11.86 +@@ -18,7 +18,9 @@
   11.87 +  
   11.88 +     */
   11.89 + 
   11.90 ++#ifdef HAVE_CONFIG_H
   11.91 + #include "config.h"
   11.92 ++#endif
   11.93 + #include "ppc-config.h"
   11.94 + #include "filter_filename.h"
   11.95 + 
   11.96 +diff -urN gdb-6.8-orig/sim/ppc/igen.c gdb-6.8-pl1/sim/ppc/igen.c
   11.97 +--- gdb-6.8-orig/sim/ppc/igen.c	2003-06-20 05:59:33.000000000 +0200
   11.98 ++++ gdb-6.8-pl1/sim/ppc/igen.c	2008-09-30 15:12:06.000000000 +0200
   11.99 +@@ -25,7 +25,9 @@
  11.100 + #include "misc.h"
  11.101 + #include "lf.h"
  11.102 + #include "table.h"
  11.103 ++#ifdef HAVE_CONFIG_H
  11.104 + #include "config.h"
  11.105 ++#endif
  11.106 + 
  11.107 + #include "filter.h"
  11.108 + 
  11.109 +diff -urN gdb-6.8-orig/sim/ppc/inline.c gdb-6.8-pl1/sim/ppc/inline.c
  11.110 +--- gdb-6.8-orig/sim/ppc/inline.c	1999-04-16 03:35:10.000000000 +0200
  11.111 ++++ gdb-6.8-pl1/sim/ppc/inline.c	2008-09-30 15:11:58.000000000 +0200
  11.112 +@@ -22,7 +22,9 @@
  11.113 + #ifndef _INLINE_C_
  11.114 + #define _INLINE_C_
  11.115 + 
  11.116 ++#ifdef HAVE_CONFIG_H
  11.117 + #include "config.h"
  11.118 ++#endif
  11.119 + #include "ppc-config.h"
  11.120 + 
  11.121 + #include "inline.h"
  11.122 +diff -urN gdb-6.8-orig/sim/ppc/lf.c gdb-6.8-pl1/sim/ppc/lf.c
  11.123 +--- gdb-6.8-orig/sim/ppc/lf.c	2002-05-30 17:07:06.000000000 +0200
  11.124 ++++ gdb-6.8-pl1/sim/ppc/lf.c	2008-09-30 15:33:35.000000000 +0200
  11.125 +@@ -23,7 +23,9 @@
  11.126 + #include <stdarg.h>
  11.127 + #include <ctype.h>
  11.128 + 
  11.129 ++#ifdef HAVE_CONFIG_H
  11.130 + #include "config.h"
  11.131 ++#endif
  11.132 + #include "misc.h"
  11.133 + #include "lf.h"
  11.134 + 
  11.135 +diff -urN gdb-6.8-orig/sim/ppc/misc.c gdb-6.8-pl1/sim/ppc/misc.c
  11.136 +--- gdb-6.8-orig/sim/ppc/misc.c	1999-04-16 03:35:11.000000000 +0200
  11.137 ++++ gdb-6.8-pl1/sim/ppc/misc.c	2008-09-30 15:11:54.000000000 +0200
  11.138 +@@ -23,7 +23,9 @@
  11.139 + #include <stdarg.h>
  11.140 + #include <ctype.h>
  11.141 + 
  11.142 ++#ifdef HAVE_CONFIG_H
  11.143 + #include "config.h"
  11.144 ++#endif
  11.145 + #include "misc.h"
  11.146 + 
  11.147 + #ifdef HAVE_STDLIB_H
  11.148 +diff -urN gdb-6.8-orig/sim/ppc/misc.h gdb-6.8-pl1/sim/ppc/misc.h
  11.149 +--- gdb-6.8-orig/sim/ppc/misc.h	2002-01-12 11:21:12.000000000 +0100
  11.150 ++++ gdb-6.8-pl1/sim/ppc/misc.h	2008-09-30 15:11:49.000000000 +0200
  11.151 +@@ -21,7 +21,9 @@
  11.152 + 
  11.153 + /* Frustrating header junk */
  11.154 + 
  11.155 ++#ifdef HAVE_CONFIG_H
  11.156 + #include "config.h"
  11.157 ++#endif
  11.158 + 
  11.159 + #include <stdio.h>
  11.160 + #include <ctype.h>
  11.161 +diff -urN gdb-6.8-orig/sim/ppc/sim-endian.c gdb-6.8-pl1/sim/ppc/sim-endian.c
  11.162 +--- gdb-6.8-orig/sim/ppc/sim-endian.c	1999-04-16 03:35:11.000000000 +0200
  11.163 ++++ gdb-6.8-pl1/sim/ppc/sim-endian.c	2008-09-30 15:11:44.000000000 +0200
  11.164 +@@ -22,7 +22,9 @@
  11.165 + #ifndef _SIM_ENDIAN_C_
  11.166 + #define _SIM_ENDIAN_C_
  11.167 + 
  11.168 ++#ifdef HAVE_CONFIG_H
  11.169 + #include "config.h"
  11.170 ++#endif
  11.171 + #include "basics.h"
  11.172 + 
  11.173 + 
  11.174 +diff -urN gdb-6.8-orig/sim/ppc/table.c gdb-6.8-pl1/sim/ppc/table.c
  11.175 +--- gdb-6.8-orig/sim/ppc/table.c	2002-01-12 11:21:12.000000000 +0100
  11.176 ++++ gdb-6.8-pl1/sim/ppc/table.c	2008-09-30 15:11:38.000000000 +0200
  11.177 +@@ -25,7 +25,9 @@
  11.178 + #include <fcntl.h>
  11.179 + #include <ctype.h>
  11.180 + 
  11.181 ++#ifdef HAVE_CONFIG_H
  11.182 + #include "config.h"
  11.183 ++#endif
  11.184 + #include "misc.h"
  11.185 + #include "lf.h"
  11.186 + #include "table.h"
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/patches/gdb/6.8a/150-handle-stpcpy-define.patch	Sun Sep 11 18:28:45 2011 +0200
    12.3 @@ -0,0 +1,12 @@
    12.4 +diff -ru gdb-6.8.orig/bfd/sysdep.h gdb-6.8/bfd/sysdep.h
    12.5 +--- gdb-6.8.orig/bfd/sysdep.h	2007-07-03 16:26:42.000000000 +0200
    12.6 ++++ gdb-6.8/bfd/sysdep.h	2011-08-21 13:33:47.000000000 +0200
    12.7 +@@ -131,7 +131,7 @@
    12.8 + extern PTR realloc ();
    12.9 + #endif
   12.10 + 
   12.11 +-#if !HAVE_DECL_STPCPY
   12.12 ++#if !HAVE_DECL_STPCPY && !defined(stpcpy)
   12.13 + extern char *stpcpy (char *__dest, const char *__src);
   12.14 + #endif
   12.15 + 
    13.1 --- a/patches/gdb/7.0.1/100-sim-ppc-have-config-h.patch	Sun Sep 11 01:03:43 2011 +0200
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,183 +0,0 @@
    13.4 -Fix for canadian cross build of sim/ppc
    13.5 -
    13.6 -Orignal patch info see: http://sources.redhat.com/bugzilla/show_bug.cgi?id=9638
    13.7 -
    13.8 -diff -urN gdb-6.8-pl1/sim/ppc/Makefile.in gdb-6.8-pl2/sim/ppc/Makefile.in
    13.9 ---- gdb-6.8-pl1/sim/ppc/Makefile.in	2006-05-31 17:14:45.000000000 +0200
   13.10 -+++ gdb-6.8-pl2/sim/ppc/Makefile.in	2008-09-30 15:56:33.000000000 +0200
   13.11 -@@ -61,7 +61,7 @@
   13.12 - AR = @AR@
   13.13 - AR_FLAGS = rc
   13.14 - CC = @CC@
   13.15 --CFLAGS = @CFLAGS@
   13.16 -+CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H
   13.17 - CC_FOR_BUILD = @CC_FOR_BUILD@
   13.18 - CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
   13.19 - BISON = bison
   13.20 -@@ -115,8 +115,8 @@
   13.21 -   $(DEVZERO_CFLAGS)
   13.22 - SIM_FPU_CFLAGS = @sim_fpu_cflags@
   13.23 - 
   13.24 --STD_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   13.25 --NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   13.26 -+STD_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   13.27 -+NOWARN_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   13.28 - BUILD_CFLAGS	= $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS)
   13.29 - 
   13.30 - BUILD_LDFLAGS	=
   13.31 -diff -urN gdb-6.8-orig/sim/ppc/basics.h gdb-6.8-pl1/sim/ppc/basics.h
   13.32 ---- gdb-6.8-orig/sim/ppc/basics.h	1999-04-16 03:35:08.000000000 +0200
   13.33 -+++ gdb-6.8-pl1/sim/ppc/basics.h	2008-09-30 15:12:32.000000000 +0200
   13.34 -@@ -86,7 +86,9 @@
   13.35 - 
   13.36 - /* Basic configuration */
   13.37 - 
   13.38 -+#ifdef HAVE_CONFIG_H
   13.39 - #include "config.h"
   13.40 -+#endif
   13.41 - #include "ppc-config.h"
   13.42 - #include "inline.h"
   13.43 - 
   13.44 -diff -urN gdb-6.8-orig/sim/ppc/debug.c gdb-6.8-pl1/sim/ppc/debug.c
   13.45 ---- gdb-6.8-orig/sim/ppc/debug.c	1999-04-16 03:35:08.000000000 +0200
   13.46 -+++ gdb-6.8-pl1/sim/ppc/debug.c	2008-09-30 15:12:27.000000000 +0200
   13.47 -@@ -22,7 +22,9 @@
   13.48 - #ifndef _DEBUG_C_
   13.49 - #define _DEBUG_C_
   13.50 - 
   13.51 -+#ifdef HAVE_CONFIG_H
   13.52 - #include "config.h"
   13.53 -+#endif
   13.54 - #include "basics.h"
   13.55 - 
   13.56 - #ifdef HAVE_STDLIB_H
   13.57 -diff -urN gdb-6.8-orig/sim/ppc/dgen.c gdb-6.8-pl1/sim/ppc/dgen.c
   13.58 ---- gdb-6.8-orig/sim/ppc/dgen.c	1999-04-16 03:35:08.000000000 +0200
   13.59 -+++ gdb-6.8-pl1/sim/ppc/dgen.c	2008-09-30 15:12:22.000000000 +0200
   13.60 -@@ -27,7 +27,9 @@
   13.61 - #include <ctype.h>
   13.62 - #include <stdarg.h>
   13.63 - 
   13.64 -+#ifdef HAVE_CONFIG_H
   13.65 - #include "config.h"
   13.66 -+#endif
   13.67 - #include "misc.h"
   13.68 - #include "lf.h"
   13.69 - #include "table.h"
   13.70 -diff -urN gdb-6.8-orig/sim/ppc/filter.c gdb-6.8-pl1/sim/ppc/filter.c
   13.71 ---- gdb-6.8-orig/sim/ppc/filter.c	1999-04-16 03:35:09.000000000 +0200
   13.72 -+++ gdb-6.8-pl1/sim/ppc/filter.c	2008-09-30 15:12:15.000000000 +0200
   13.73 -@@ -21,7 +21,9 @@
   13.74 - 
   13.75 - #include <stdio.h>
   13.76 - 
   13.77 -+#ifdef HAVE_CONFIG_H
   13.78 - #include "config.h"
   13.79 -+#endif
   13.80 - 
   13.81 - #ifdef HAVE_STRING_H
   13.82 - #include <string.h>
   13.83 -diff -urN gdb-6.8-orig/sim/ppc/filter_filename.c gdb-6.8-pl1/sim/ppc/filter_filename.c
   13.84 ---- gdb-6.8-orig/sim/ppc/filter_filename.c	1999-04-16 03:35:08.000000000 +0200
   13.85 -+++ gdb-6.8-pl1/sim/ppc/filter_filename.c	2008-09-30 15:12:11.000000000 +0200
   13.86 -@@ -18,7 +18,9 @@
   13.87 -  
   13.88 -     */
   13.89 - 
   13.90 -+#ifdef HAVE_CONFIG_H
   13.91 - #include "config.h"
   13.92 -+#endif
   13.93 - #include "ppc-config.h"
   13.94 - #include "filter_filename.h"
   13.95 - 
   13.96 -diff -urN gdb-6.8-orig/sim/ppc/igen.c gdb-6.8-pl1/sim/ppc/igen.c
   13.97 ---- gdb-6.8-orig/sim/ppc/igen.c	2003-06-20 05:59:33.000000000 +0200
   13.98 -+++ gdb-6.8-pl1/sim/ppc/igen.c	2008-09-30 15:12:06.000000000 +0200
   13.99 -@@ -25,7 +25,9 @@
  13.100 - #include "misc.h"
  13.101 - #include "lf.h"
  13.102 - #include "table.h"
  13.103 -+#ifdef HAVE_CONFIG_H
  13.104 - #include "config.h"
  13.105 -+#endif
  13.106 - 
  13.107 - #include "filter.h"
  13.108 - 
  13.109 -diff -urN gdb-6.8-orig/sim/ppc/inline.c gdb-6.8-pl1/sim/ppc/inline.c
  13.110 ---- gdb-6.8-orig/sim/ppc/inline.c	1999-04-16 03:35:10.000000000 +0200
  13.111 -+++ gdb-6.8-pl1/sim/ppc/inline.c	2008-09-30 15:11:58.000000000 +0200
  13.112 -@@ -22,7 +22,9 @@
  13.113 - #ifndef _INLINE_C_
  13.114 - #define _INLINE_C_
  13.115 - 
  13.116 -+#ifdef HAVE_CONFIG_H
  13.117 - #include "config.h"
  13.118 -+#endif
  13.119 - #include "ppc-config.h"
  13.120 - 
  13.121 - #include "inline.h"
  13.122 -diff -urN gdb-6.8-orig/sim/ppc/lf.c gdb-6.8-pl1/sim/ppc/lf.c
  13.123 ---- gdb-6.8-orig/sim/ppc/lf.c	2002-05-30 17:07:06.000000000 +0200
  13.124 -+++ gdb-6.8-pl1/sim/ppc/lf.c	2008-09-30 15:33:35.000000000 +0200
  13.125 -@@ -23,7 +23,9 @@
  13.126 - #include <stdarg.h>
  13.127 - #include <ctype.h>
  13.128 - 
  13.129 -+#ifdef HAVE_CONFIG_H
  13.130 - #include "config.h"
  13.131 -+#endif
  13.132 - #include "misc.h"
  13.133 - #include "lf.h"
  13.134 - 
  13.135 -diff -urN gdb-6.8-orig/sim/ppc/misc.c gdb-6.8-pl1/sim/ppc/misc.c
  13.136 ---- gdb-6.8-orig/sim/ppc/misc.c	1999-04-16 03:35:11.000000000 +0200
  13.137 -+++ gdb-6.8-pl1/sim/ppc/misc.c	2008-09-30 15:11:54.000000000 +0200
  13.138 -@@ -23,7 +23,9 @@
  13.139 - #include <stdarg.h>
  13.140 - #include <ctype.h>
  13.141 - 
  13.142 -+#ifdef HAVE_CONFIG_H
  13.143 - #include "config.h"
  13.144 -+#endif
  13.145 - #include "misc.h"
  13.146 - 
  13.147 - #ifdef HAVE_STDLIB_H
  13.148 -diff -urN gdb-6.8-orig/sim/ppc/misc.h gdb-6.8-pl1/sim/ppc/misc.h
  13.149 ---- gdb-6.8-orig/sim/ppc/misc.h	2002-01-12 11:21:12.000000000 +0100
  13.150 -+++ gdb-6.8-pl1/sim/ppc/misc.h	2008-09-30 15:11:49.000000000 +0200
  13.151 -@@ -21,7 +21,9 @@
  13.152 - 
  13.153 - /* Frustrating header junk */
  13.154 - 
  13.155 -+#ifdef HAVE_CONFIG_H
  13.156 - #include "config.h"
  13.157 -+#endif
  13.158 - 
  13.159 - #include <stdio.h>
  13.160 - #include <ctype.h>
  13.161 -diff -urN gdb-6.8-orig/sim/ppc/sim-endian.c gdb-6.8-pl1/sim/ppc/sim-endian.c
  13.162 ---- gdb-6.8-orig/sim/ppc/sim-endian.c	1999-04-16 03:35:11.000000000 +0200
  13.163 -+++ gdb-6.8-pl1/sim/ppc/sim-endian.c	2008-09-30 15:11:44.000000000 +0200
  13.164 -@@ -22,7 +22,9 @@
  13.165 - #ifndef _SIM_ENDIAN_C_
  13.166 - #define _SIM_ENDIAN_C_
  13.167 - 
  13.168 -+#ifdef HAVE_CONFIG_H
  13.169 - #include "config.h"
  13.170 -+#endif
  13.171 - #include "basics.h"
  13.172 - 
  13.173 - 
  13.174 -diff -urN gdb-6.8-orig/sim/ppc/table.c gdb-6.8-pl1/sim/ppc/table.c
  13.175 ---- gdb-6.8-orig/sim/ppc/table.c	2002-01-12 11:21:12.000000000 +0100
  13.176 -+++ gdb-6.8-pl1/sim/ppc/table.c	2008-09-30 15:11:38.000000000 +0200
  13.177 -@@ -25,7 +25,9 @@
  13.178 - #include <fcntl.h>
  13.179 - #include <ctype.h>
  13.180 - 
  13.181 -+#ifdef HAVE_CONFIG_H
  13.182 - #include "config.h"
  13.183 -+#endif
  13.184 - #include "misc.h"
  13.185 - #include "lf.h"
  13.186 - #include "table.h"
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/patches/gdb/7.0.1a/100-sim-ppc-have-config-h.patch	Sun Sep 11 18:28:45 2011 +0200
    14.3 @@ -0,0 +1,183 @@
    14.4 +Fix for canadian cross build of sim/ppc
    14.5 +
    14.6 +Orignal patch info see: http://sources.redhat.com/bugzilla/show_bug.cgi?id=9638
    14.7 +
    14.8 +diff -urN gdb-6.8-pl1/sim/ppc/Makefile.in gdb-6.8-pl2/sim/ppc/Makefile.in
    14.9 +--- gdb-6.8-pl1/sim/ppc/Makefile.in	2006-05-31 17:14:45.000000000 +0200
   14.10 ++++ gdb-6.8-pl2/sim/ppc/Makefile.in	2008-09-30 15:56:33.000000000 +0200
   14.11 +@@ -61,7 +61,7 @@
   14.12 + AR = @AR@
   14.13 + AR_FLAGS = rc
   14.14 + CC = @CC@
   14.15 +-CFLAGS = @CFLAGS@
   14.16 ++CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H
   14.17 + CC_FOR_BUILD = @CC_FOR_BUILD@
   14.18 + CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
   14.19 + BISON = bison
   14.20 +@@ -115,8 +115,8 @@
   14.21 +   $(DEVZERO_CFLAGS)
   14.22 + SIM_FPU_CFLAGS = @sim_fpu_cflags@
   14.23 + 
   14.24 +-STD_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   14.25 +-NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   14.26 ++STD_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   14.27 ++NOWARN_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   14.28 + BUILD_CFLAGS	= $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS)
   14.29 + 
   14.30 + BUILD_LDFLAGS	=
   14.31 +diff -urN gdb-6.8-orig/sim/ppc/basics.h gdb-6.8-pl1/sim/ppc/basics.h
   14.32 +--- gdb-6.8-orig/sim/ppc/basics.h	1999-04-16 03:35:08.000000000 +0200
   14.33 ++++ gdb-6.8-pl1/sim/ppc/basics.h	2008-09-30 15:12:32.000000000 +0200
   14.34 +@@ -86,7 +86,9 @@
   14.35 + 
   14.36 + /* Basic configuration */
   14.37 + 
   14.38 ++#ifdef HAVE_CONFIG_H
   14.39 + #include "config.h"
   14.40 ++#endif
   14.41 + #include "ppc-config.h"
   14.42 + #include "inline.h"
   14.43 + 
   14.44 +diff -urN gdb-6.8-orig/sim/ppc/debug.c gdb-6.8-pl1/sim/ppc/debug.c
   14.45 +--- gdb-6.8-orig/sim/ppc/debug.c	1999-04-16 03:35:08.000000000 +0200
   14.46 ++++ gdb-6.8-pl1/sim/ppc/debug.c	2008-09-30 15:12:27.000000000 +0200
   14.47 +@@ -22,7 +22,9 @@
   14.48 + #ifndef _DEBUG_C_
   14.49 + #define _DEBUG_C_
   14.50 + 
   14.51 ++#ifdef HAVE_CONFIG_H
   14.52 + #include "config.h"
   14.53 ++#endif
   14.54 + #include "basics.h"
   14.55 + 
   14.56 + #ifdef HAVE_STDLIB_H
   14.57 +diff -urN gdb-6.8-orig/sim/ppc/dgen.c gdb-6.8-pl1/sim/ppc/dgen.c
   14.58 +--- gdb-6.8-orig/sim/ppc/dgen.c	1999-04-16 03:35:08.000000000 +0200
   14.59 ++++ gdb-6.8-pl1/sim/ppc/dgen.c	2008-09-30 15:12:22.000000000 +0200
   14.60 +@@ -27,7 +27,9 @@
   14.61 + #include <ctype.h>
   14.62 + #include <stdarg.h>
   14.63 + 
   14.64 ++#ifdef HAVE_CONFIG_H
   14.65 + #include "config.h"
   14.66 ++#endif
   14.67 + #include "misc.h"
   14.68 + #include "lf.h"
   14.69 + #include "table.h"
   14.70 +diff -urN gdb-6.8-orig/sim/ppc/filter.c gdb-6.8-pl1/sim/ppc/filter.c
   14.71 +--- gdb-6.8-orig/sim/ppc/filter.c	1999-04-16 03:35:09.000000000 +0200
   14.72 ++++ gdb-6.8-pl1/sim/ppc/filter.c	2008-09-30 15:12:15.000000000 +0200
   14.73 +@@ -21,7 +21,9 @@
   14.74 + 
   14.75 + #include <stdio.h>
   14.76 + 
   14.77 ++#ifdef HAVE_CONFIG_H
   14.78 + #include "config.h"
   14.79 ++#endif
   14.80 + 
   14.81 + #ifdef HAVE_STRING_H
   14.82 + #include <string.h>
   14.83 +diff -urN gdb-6.8-orig/sim/ppc/filter_filename.c gdb-6.8-pl1/sim/ppc/filter_filename.c
   14.84 +--- gdb-6.8-orig/sim/ppc/filter_filename.c	1999-04-16 03:35:08.000000000 +0200
   14.85 ++++ gdb-6.8-pl1/sim/ppc/filter_filename.c	2008-09-30 15:12:11.000000000 +0200
   14.86 +@@ -18,7 +18,9 @@
   14.87 +  
   14.88 +     */
   14.89 + 
   14.90 ++#ifdef HAVE_CONFIG_H
   14.91 + #include "config.h"
   14.92 ++#endif
   14.93 + #include "ppc-config.h"
   14.94 + #include "filter_filename.h"
   14.95 + 
   14.96 +diff -urN gdb-6.8-orig/sim/ppc/igen.c gdb-6.8-pl1/sim/ppc/igen.c
   14.97 +--- gdb-6.8-orig/sim/ppc/igen.c	2003-06-20 05:59:33.000000000 +0200
   14.98 ++++ gdb-6.8-pl1/sim/ppc/igen.c	2008-09-30 15:12:06.000000000 +0200
   14.99 +@@ -25,7 +25,9 @@
  14.100 + #include "misc.h"
  14.101 + #include "lf.h"
  14.102 + #include "table.h"
  14.103 ++#ifdef HAVE_CONFIG_H
  14.104 + #include "config.h"
  14.105 ++#endif
  14.106 + 
  14.107 + #include "filter.h"
  14.108 + 
  14.109 +diff -urN gdb-6.8-orig/sim/ppc/inline.c gdb-6.8-pl1/sim/ppc/inline.c
  14.110 +--- gdb-6.8-orig/sim/ppc/inline.c	1999-04-16 03:35:10.000000000 +0200
  14.111 ++++ gdb-6.8-pl1/sim/ppc/inline.c	2008-09-30 15:11:58.000000000 +0200
  14.112 +@@ -22,7 +22,9 @@
  14.113 + #ifndef _INLINE_C_
  14.114 + #define _INLINE_C_
  14.115 + 
  14.116 ++#ifdef HAVE_CONFIG_H
  14.117 + #include "config.h"
  14.118 ++#endif
  14.119 + #include "ppc-config.h"
  14.120 + 
  14.121 + #include "inline.h"
  14.122 +diff -urN gdb-6.8-orig/sim/ppc/lf.c gdb-6.8-pl1/sim/ppc/lf.c
  14.123 +--- gdb-6.8-orig/sim/ppc/lf.c	2002-05-30 17:07:06.000000000 +0200
  14.124 ++++ gdb-6.8-pl1/sim/ppc/lf.c	2008-09-30 15:33:35.000000000 +0200
  14.125 +@@ -23,7 +23,9 @@
  14.126 + #include <stdarg.h>
  14.127 + #include <ctype.h>
  14.128 + 
  14.129 ++#ifdef HAVE_CONFIG_H
  14.130 + #include "config.h"
  14.131 ++#endif
  14.132 + #include "misc.h"
  14.133 + #include "lf.h"
  14.134 + 
  14.135 +diff -urN gdb-6.8-orig/sim/ppc/misc.c gdb-6.8-pl1/sim/ppc/misc.c
  14.136 +--- gdb-6.8-orig/sim/ppc/misc.c	1999-04-16 03:35:11.000000000 +0200
  14.137 ++++ gdb-6.8-pl1/sim/ppc/misc.c	2008-09-30 15:11:54.000000000 +0200
  14.138 +@@ -23,7 +23,9 @@
  14.139 + #include <stdarg.h>
  14.140 + #include <ctype.h>
  14.141 + 
  14.142 ++#ifdef HAVE_CONFIG_H
  14.143 + #include "config.h"
  14.144 ++#endif
  14.145 + #include "misc.h"
  14.146 + 
  14.147 + #ifdef HAVE_STDLIB_H
  14.148 +diff -urN gdb-6.8-orig/sim/ppc/misc.h gdb-6.8-pl1/sim/ppc/misc.h
  14.149 +--- gdb-6.8-orig/sim/ppc/misc.h	2002-01-12 11:21:12.000000000 +0100
  14.150 ++++ gdb-6.8-pl1/sim/ppc/misc.h	2008-09-30 15:11:49.000000000 +0200
  14.151 +@@ -21,7 +21,9 @@
  14.152 + 
  14.153 + /* Frustrating header junk */
  14.154 + 
  14.155 ++#ifdef HAVE_CONFIG_H
  14.156 + #include "config.h"
  14.157 ++#endif
  14.158 + 
  14.159 + #include <stdio.h>
  14.160 + #include <ctype.h>
  14.161 +diff -urN gdb-6.8-orig/sim/ppc/sim-endian.c gdb-6.8-pl1/sim/ppc/sim-endian.c
  14.162 +--- gdb-6.8-orig/sim/ppc/sim-endian.c	1999-04-16 03:35:11.000000000 +0200
  14.163 ++++ gdb-6.8-pl1/sim/ppc/sim-endian.c	2008-09-30 15:11:44.000000000 +0200
  14.164 +@@ -22,7 +22,9 @@
  14.165 + #ifndef _SIM_ENDIAN_C_
  14.166 + #define _SIM_ENDIAN_C_
  14.167 + 
  14.168 ++#ifdef HAVE_CONFIG_H
  14.169 + #include "config.h"
  14.170 ++#endif
  14.171 + #include "basics.h"
  14.172 + 
  14.173 + 
  14.174 +diff -urN gdb-6.8-orig/sim/ppc/table.c gdb-6.8-pl1/sim/ppc/table.c
  14.175 +--- gdb-6.8-orig/sim/ppc/table.c	2002-01-12 11:21:12.000000000 +0100
  14.176 ++++ gdb-6.8-pl1/sim/ppc/table.c	2008-09-30 15:11:38.000000000 +0200
  14.177 +@@ -25,7 +25,9 @@
  14.178 + #include <fcntl.h>
  14.179 + #include <ctype.h>
  14.180 + 
  14.181 ++#ifdef HAVE_CONFIG_H
  14.182 + #include "config.h"
  14.183 ++#endif
  14.184 + #include "misc.h"
  14.185 + #include "lf.h"
  14.186 + #include "table.h"
    15.1 --- a/patches/gdb/7.0/100-sim-ppc-have-config-h.patch	Sun Sep 11 01:03:43 2011 +0200
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,183 +0,0 @@
    15.4 -Fix for canadian cross build of sim/ppc
    15.5 -
    15.6 -Orignal patch info see: http://sources.redhat.com/bugzilla/show_bug.cgi?id=9638
    15.7 -
    15.8 -diff -urN gdb-6.8-pl1/sim/ppc/Makefile.in gdb-6.8-pl2/sim/ppc/Makefile.in
    15.9 ---- gdb-6.8-pl1/sim/ppc/Makefile.in	2006-05-31 17:14:45.000000000 +0200
   15.10 -+++ gdb-6.8-pl2/sim/ppc/Makefile.in	2008-09-30 15:56:33.000000000 +0200
   15.11 -@@ -61,7 +61,7 @@
   15.12 - AR = @AR@
   15.13 - AR_FLAGS = rc
   15.14 - CC = @CC@
   15.15 --CFLAGS = @CFLAGS@
   15.16 -+CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H
   15.17 - CC_FOR_BUILD = @CC_FOR_BUILD@
   15.18 - CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
   15.19 - BISON = bison
   15.20 -@@ -115,8 +115,8 @@
   15.21 -   $(DEVZERO_CFLAGS)
   15.22 - SIM_FPU_CFLAGS = @sim_fpu_cflags@
   15.23 - 
   15.24 --STD_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   15.25 --NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   15.26 -+STD_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   15.27 -+NOWARN_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   15.28 - BUILD_CFLAGS	= $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS)
   15.29 - 
   15.30 - BUILD_LDFLAGS	=
   15.31 -diff -urN gdb-6.8-orig/sim/ppc/basics.h gdb-6.8-pl1/sim/ppc/basics.h
   15.32 ---- gdb-6.8-orig/sim/ppc/basics.h	1999-04-16 03:35:08.000000000 +0200
   15.33 -+++ gdb-6.8-pl1/sim/ppc/basics.h	2008-09-30 15:12:32.000000000 +0200
   15.34 -@@ -86,7 +86,9 @@
   15.35 - 
   15.36 - /* Basic configuration */
   15.37 - 
   15.38 -+#ifdef HAVE_CONFIG_H
   15.39 - #include "config.h"
   15.40 -+#endif
   15.41 - #include "ppc-config.h"
   15.42 - #include "inline.h"
   15.43 - 
   15.44 -diff -urN gdb-6.8-orig/sim/ppc/debug.c gdb-6.8-pl1/sim/ppc/debug.c
   15.45 ---- gdb-6.8-orig/sim/ppc/debug.c	1999-04-16 03:35:08.000000000 +0200
   15.46 -+++ gdb-6.8-pl1/sim/ppc/debug.c	2008-09-30 15:12:27.000000000 +0200
   15.47 -@@ -22,7 +22,9 @@
   15.48 - #ifndef _DEBUG_C_
   15.49 - #define _DEBUG_C_
   15.50 - 
   15.51 -+#ifdef HAVE_CONFIG_H
   15.52 - #include "config.h"
   15.53 -+#endif
   15.54 - #include "basics.h"
   15.55 - 
   15.56 - #ifdef HAVE_STDLIB_H
   15.57 -diff -urN gdb-6.8-orig/sim/ppc/dgen.c gdb-6.8-pl1/sim/ppc/dgen.c
   15.58 ---- gdb-6.8-orig/sim/ppc/dgen.c	1999-04-16 03:35:08.000000000 +0200
   15.59 -+++ gdb-6.8-pl1/sim/ppc/dgen.c	2008-09-30 15:12:22.000000000 +0200
   15.60 -@@ -27,7 +27,9 @@
   15.61 - #include <ctype.h>
   15.62 - #include <stdarg.h>
   15.63 - 
   15.64 -+#ifdef HAVE_CONFIG_H
   15.65 - #include "config.h"
   15.66 -+#endif
   15.67 - #include "misc.h"
   15.68 - #include "lf.h"
   15.69 - #include "table.h"
   15.70 -diff -urN gdb-6.8-orig/sim/ppc/filter.c gdb-6.8-pl1/sim/ppc/filter.c
   15.71 ---- gdb-6.8-orig/sim/ppc/filter.c	1999-04-16 03:35:09.000000000 +0200
   15.72 -+++ gdb-6.8-pl1/sim/ppc/filter.c	2008-09-30 15:12:15.000000000 +0200
   15.73 -@@ -21,7 +21,9 @@
   15.74 - 
   15.75 - #include <stdio.h>
   15.76 - 
   15.77 -+#ifdef HAVE_CONFIG_H
   15.78 - #include "config.h"
   15.79 -+#endif
   15.80 - 
   15.81 - #ifdef HAVE_STRING_H
   15.82 - #include <string.h>
   15.83 -diff -urN gdb-6.8-orig/sim/ppc/filter_filename.c gdb-6.8-pl1/sim/ppc/filter_filename.c
   15.84 ---- gdb-6.8-orig/sim/ppc/filter_filename.c	1999-04-16 03:35:08.000000000 +0200
   15.85 -+++ gdb-6.8-pl1/sim/ppc/filter_filename.c	2008-09-30 15:12:11.000000000 +0200
   15.86 -@@ -18,7 +18,9 @@
   15.87 -  
   15.88 -     */
   15.89 - 
   15.90 -+#ifdef HAVE_CONFIG_H
   15.91 - #include "config.h"
   15.92 -+#endif
   15.93 - #include "ppc-config.h"
   15.94 - #include "filter_filename.h"
   15.95 - 
   15.96 -diff -urN gdb-6.8-orig/sim/ppc/igen.c gdb-6.8-pl1/sim/ppc/igen.c
   15.97 ---- gdb-6.8-orig/sim/ppc/igen.c	2003-06-20 05:59:33.000000000 +0200
   15.98 -+++ gdb-6.8-pl1/sim/ppc/igen.c	2008-09-30 15:12:06.000000000 +0200
   15.99 -@@ -25,7 +25,9 @@
  15.100 - #include "misc.h"
  15.101 - #include "lf.h"
  15.102 - #include "table.h"
  15.103 -+#ifdef HAVE_CONFIG_H
  15.104 - #include "config.h"
  15.105 -+#endif
  15.106 - 
  15.107 - #include "filter.h"
  15.108 - 
  15.109 -diff -urN gdb-6.8-orig/sim/ppc/inline.c gdb-6.8-pl1/sim/ppc/inline.c
  15.110 ---- gdb-6.8-orig/sim/ppc/inline.c	1999-04-16 03:35:10.000000000 +0200
  15.111 -+++ gdb-6.8-pl1/sim/ppc/inline.c	2008-09-30 15:11:58.000000000 +0200
  15.112 -@@ -22,7 +22,9 @@
  15.113 - #ifndef _INLINE_C_
  15.114 - #define _INLINE_C_
  15.115 - 
  15.116 -+#ifdef HAVE_CONFIG_H
  15.117 - #include "config.h"
  15.118 -+#endif
  15.119 - #include "ppc-config.h"
  15.120 - 
  15.121 - #include "inline.h"
  15.122 -diff -urN gdb-6.8-orig/sim/ppc/lf.c gdb-6.8-pl1/sim/ppc/lf.c
  15.123 ---- gdb-6.8-orig/sim/ppc/lf.c	2002-05-30 17:07:06.000000000 +0200
  15.124 -+++ gdb-6.8-pl1/sim/ppc/lf.c	2008-09-30 15:33:35.000000000 +0200
  15.125 -@@ -23,7 +23,9 @@
  15.126 - #include <stdarg.h>
  15.127 - #include <ctype.h>
  15.128 - 
  15.129 -+#ifdef HAVE_CONFIG_H
  15.130 - #include "config.h"
  15.131 -+#endif
  15.132 - #include "misc.h"
  15.133 - #include "lf.h"
  15.134 - 
  15.135 -diff -urN gdb-6.8-orig/sim/ppc/misc.c gdb-6.8-pl1/sim/ppc/misc.c
  15.136 ---- gdb-6.8-orig/sim/ppc/misc.c	1999-04-16 03:35:11.000000000 +0200
  15.137 -+++ gdb-6.8-pl1/sim/ppc/misc.c	2008-09-30 15:11:54.000000000 +0200
  15.138 -@@ -23,7 +23,9 @@
  15.139 - #include <stdarg.h>
  15.140 - #include <ctype.h>
  15.141 - 
  15.142 -+#ifdef HAVE_CONFIG_H
  15.143 - #include "config.h"
  15.144 -+#endif
  15.145 - #include "misc.h"
  15.146 - 
  15.147 - #ifdef HAVE_STDLIB_H
  15.148 -diff -urN gdb-6.8-orig/sim/ppc/misc.h gdb-6.8-pl1/sim/ppc/misc.h
  15.149 ---- gdb-6.8-orig/sim/ppc/misc.h	2002-01-12 11:21:12.000000000 +0100
  15.150 -+++ gdb-6.8-pl1/sim/ppc/misc.h	2008-09-30 15:11:49.000000000 +0200
  15.151 -@@ -21,7 +21,9 @@
  15.152 - 
  15.153 - /* Frustrating header junk */
  15.154 - 
  15.155 -+#ifdef HAVE_CONFIG_H
  15.156 - #include "config.h"
  15.157 -+#endif
  15.158 - 
  15.159 - #include <stdio.h>
  15.160 - #include <ctype.h>
  15.161 -diff -urN gdb-6.8-orig/sim/ppc/sim-endian.c gdb-6.8-pl1/sim/ppc/sim-endian.c
  15.162 ---- gdb-6.8-orig/sim/ppc/sim-endian.c	1999-04-16 03:35:11.000000000 +0200
  15.163 -+++ gdb-6.8-pl1/sim/ppc/sim-endian.c	2008-09-30 15:11:44.000000000 +0200
  15.164 -@@ -22,7 +22,9 @@
  15.165 - #ifndef _SIM_ENDIAN_C_
  15.166 - #define _SIM_ENDIAN_C_
  15.167 - 
  15.168 -+#ifdef HAVE_CONFIG_H
  15.169 - #include "config.h"
  15.170 -+#endif
  15.171 - #include "basics.h"
  15.172 - 
  15.173 - 
  15.174 -diff -urN gdb-6.8-orig/sim/ppc/table.c gdb-6.8-pl1/sim/ppc/table.c
  15.175 ---- gdb-6.8-orig/sim/ppc/table.c	2002-01-12 11:21:12.000000000 +0100
  15.176 -+++ gdb-6.8-pl1/sim/ppc/table.c	2008-09-30 15:11:38.000000000 +0200
  15.177 -@@ -25,7 +25,9 @@
  15.178 - #include <fcntl.h>
  15.179 - #include <ctype.h>
  15.180 - 
  15.181 -+#ifdef HAVE_CONFIG_H
  15.182 - #include "config.h"
  15.183 -+#endif
  15.184 - #include "misc.h"
  15.185 - #include "lf.h"
  15.186 - #include "table.h"
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/patches/gdb/7.0a/100-sim-ppc-have-config-h.patch	Sun Sep 11 18:28:45 2011 +0200
    16.3 @@ -0,0 +1,183 @@
    16.4 +Fix for canadian cross build of sim/ppc
    16.5 +
    16.6 +Orignal patch info see: http://sources.redhat.com/bugzilla/show_bug.cgi?id=9638
    16.7 +
    16.8 +diff -urN gdb-6.8-pl1/sim/ppc/Makefile.in gdb-6.8-pl2/sim/ppc/Makefile.in
    16.9 +--- gdb-6.8-pl1/sim/ppc/Makefile.in	2006-05-31 17:14:45.000000000 +0200
   16.10 ++++ gdb-6.8-pl2/sim/ppc/Makefile.in	2008-09-30 15:56:33.000000000 +0200
   16.11 +@@ -61,7 +61,7 @@
   16.12 + AR = @AR@
   16.13 + AR_FLAGS = rc
   16.14 + CC = @CC@
   16.15 +-CFLAGS = @CFLAGS@
   16.16 ++CFLAGS = @CFLAGS@ -DHAVE_CONFIG_H
   16.17 + CC_FOR_BUILD = @CC_FOR_BUILD@
   16.18 + CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
   16.19 + BISON = bison
   16.20 +@@ -115,8 +115,8 @@
   16.21 +   $(DEVZERO_CFLAGS)
   16.22 + SIM_FPU_CFLAGS = @sim_fpu_cflags@
   16.23 + 
   16.24 +-STD_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   16.25 +-NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   16.26 ++STD_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
   16.27 ++NOWARN_CFLAGS	= $(CFLAGS) -DHAVE_CONFIG_H $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)  $(SIM_FPU_CFLAGS)
   16.28 + BUILD_CFLAGS	= $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARNING_CFLAGS)
   16.29 + 
   16.30 + BUILD_LDFLAGS	=
   16.31 +diff -urN gdb-6.8-orig/sim/ppc/basics.h gdb-6.8-pl1/sim/ppc/basics.h
   16.32 +--- gdb-6.8-orig/sim/ppc/basics.h	1999-04-16 03:35:08.000000000 +0200
   16.33 ++++ gdb-6.8-pl1/sim/ppc/basics.h	2008-09-30 15:12:32.000000000 +0200
   16.34 +@@ -86,7 +86,9 @@
   16.35 + 
   16.36 + /* Basic configuration */
   16.37 + 
   16.38 ++#ifdef HAVE_CONFIG_H
   16.39 + #include "config.h"
   16.40 ++#endif
   16.41 + #include "ppc-config.h"
   16.42 + #include "inline.h"
   16.43 + 
   16.44 +diff -urN gdb-6.8-orig/sim/ppc/debug.c gdb-6.8-pl1/sim/ppc/debug.c
   16.45 +--- gdb-6.8-orig/sim/ppc/debug.c	1999-04-16 03:35:08.000000000 +0200
   16.46 ++++ gdb-6.8-pl1/sim/ppc/debug.c	2008-09-30 15:12:27.000000000 +0200
   16.47 +@@ -22,7 +22,9 @@
   16.48 + #ifndef _DEBUG_C_
   16.49 + #define _DEBUG_C_
   16.50 + 
   16.51 ++#ifdef HAVE_CONFIG_H
   16.52 + #include "config.h"
   16.53 ++#endif
   16.54 + #include "basics.h"
   16.55 + 
   16.56 + #ifdef HAVE_STDLIB_H
   16.57 +diff -urN gdb-6.8-orig/sim/ppc/dgen.c gdb-6.8-pl1/sim/ppc/dgen.c
   16.58 +--- gdb-6.8-orig/sim/ppc/dgen.c	1999-04-16 03:35:08.000000000 +0200
   16.59 ++++ gdb-6.8-pl1/sim/ppc/dgen.c	2008-09-30 15:12:22.000000000 +0200
   16.60 +@@ -27,7 +27,9 @@
   16.61 + #include <ctype.h>
   16.62 + #include <stdarg.h>
   16.63 + 
   16.64 ++#ifdef HAVE_CONFIG_H
   16.65 + #include "config.h"
   16.66 ++#endif
   16.67 + #include "misc.h"
   16.68 + #include "lf.h"
   16.69 + #include "table.h"
   16.70 +diff -urN gdb-6.8-orig/sim/ppc/filter.c gdb-6.8-pl1/sim/ppc/filter.c
   16.71 +--- gdb-6.8-orig/sim/ppc/filter.c	1999-04-16 03:35:09.000000000 +0200
   16.72 ++++ gdb-6.8-pl1/sim/ppc/filter.c	2008-09-30 15:12:15.000000000 +0200
   16.73 +@@ -21,7 +21,9 @@
   16.74 + 
   16.75 + #include <stdio.h>
   16.76 + 
   16.77 ++#ifdef HAVE_CONFIG_H
   16.78 + #include "config.h"
   16.79 ++#endif
   16.80 + 
   16.81 + #ifdef HAVE_STRING_H
   16.82 + #include <string.h>
   16.83 +diff -urN gdb-6.8-orig/sim/ppc/filter_filename.c gdb-6.8-pl1/sim/ppc/filter_filename.c
   16.84 +--- gdb-6.8-orig/sim/ppc/filter_filename.c	1999-04-16 03:35:08.000000000 +0200
   16.85 ++++ gdb-6.8-pl1/sim/ppc/filter_filename.c	2008-09-30 15:12:11.000000000 +0200
   16.86 +@@ -18,7 +18,9 @@
   16.87 +  
   16.88 +     */
   16.89 + 
   16.90 ++#ifdef HAVE_CONFIG_H
   16.91 + #include "config.h"
   16.92 ++#endif
   16.93 + #include "ppc-config.h"
   16.94 + #include "filter_filename.h"
   16.95 + 
   16.96 +diff -urN gdb-6.8-orig/sim/ppc/igen.c gdb-6.8-pl1/sim/ppc/igen.c
   16.97 +--- gdb-6.8-orig/sim/ppc/igen.c	2003-06-20 05:59:33.000000000 +0200
   16.98 ++++ gdb-6.8-pl1/sim/ppc/igen.c	2008-09-30 15:12:06.000000000 +0200
   16.99 +@@ -25,7 +25,9 @@
  16.100 + #include "misc.h"
  16.101 + #include "lf.h"
  16.102 + #include "table.h"
  16.103 ++#ifdef HAVE_CONFIG_H
  16.104 + #include "config.h"
  16.105 ++#endif
  16.106 + 
  16.107 + #include "filter.h"
  16.108 + 
  16.109 +diff -urN gdb-6.8-orig/sim/ppc/inline.c gdb-6.8-pl1/sim/ppc/inline.c
  16.110 +--- gdb-6.8-orig/sim/ppc/inline.c	1999-04-16 03:35:10.000000000 +0200
  16.111 ++++ gdb-6.8-pl1/sim/ppc/inline.c	2008-09-30 15:11:58.000000000 +0200
  16.112 +@@ -22,7 +22,9 @@
  16.113 + #ifndef _INLINE_C_
  16.114 + #define _INLINE_C_
  16.115 + 
  16.116 ++#ifdef HAVE_CONFIG_H
  16.117 + #include "config.h"
  16.118 ++#endif
  16.119 + #include "ppc-config.h"
  16.120 + 
  16.121 + #include "inline.h"
  16.122 +diff -urN gdb-6.8-orig/sim/ppc/lf.c gdb-6.8-pl1/sim/ppc/lf.c
  16.123 +--- gdb-6.8-orig/sim/ppc/lf.c	2002-05-30 17:07:06.000000000 +0200
  16.124 ++++ gdb-6.8-pl1/sim/ppc/lf.c	2008-09-30 15:33:35.000000000 +0200
  16.125 +@@ -23,7 +23,9 @@
  16.126 + #include <stdarg.h>
  16.127 + #include <ctype.h>
  16.128 + 
  16.129 ++#ifdef HAVE_CONFIG_H
  16.130 + #include "config.h"
  16.131 ++#endif
  16.132 + #include "misc.h"
  16.133 + #include "lf.h"
  16.134 + 
  16.135 +diff -urN gdb-6.8-orig/sim/ppc/misc.c gdb-6.8-pl1/sim/ppc/misc.c
  16.136 +--- gdb-6.8-orig/sim/ppc/misc.c	1999-04-16 03:35:11.000000000 +0200
  16.137 ++++ gdb-6.8-pl1/sim/ppc/misc.c	2008-09-30 15:11:54.000000000 +0200
  16.138 +@@ -23,7 +23,9 @@
  16.139 + #include <stdarg.h>
  16.140 + #include <ctype.h>
  16.141 + 
  16.142 ++#ifdef HAVE_CONFIG_H
  16.143 + #include "config.h"
  16.144 ++#endif
  16.145 + #include "misc.h"
  16.146 + 
  16.147 + #ifdef HAVE_STDLIB_H
  16.148 +diff -urN gdb-6.8-orig/sim/ppc/misc.h gdb-6.8-pl1/sim/ppc/misc.h
  16.149 +--- gdb-6.8-orig/sim/ppc/misc.h	2002-01-12 11:21:12.000000000 +0100
  16.150 ++++ gdb-6.8-pl1/sim/ppc/misc.h	2008-09-30 15:11:49.000000000 +0200
  16.151 +@@ -21,7 +21,9 @@
  16.152 + 
  16.153 + /* Frustrating header junk */
  16.154 + 
  16.155 ++#ifdef HAVE_CONFIG_H
  16.156 + #include "config.h"
  16.157 ++#endif
  16.158 + 
  16.159 + #include <stdio.h>
  16.160 + #include <ctype.h>
  16.161 +diff -urN gdb-6.8-orig/sim/ppc/sim-endian.c gdb-6.8-pl1/sim/ppc/sim-endian.c
  16.162 +--- gdb-6.8-orig/sim/ppc/sim-endian.c	1999-04-16 03:35:11.000000000 +0200
  16.163 ++++ gdb-6.8-pl1/sim/ppc/sim-endian.c	2008-09-30 15:11:44.000000000 +0200
  16.164 +@@ -22,7 +22,9 @@
  16.165 + #ifndef _SIM_ENDIAN_C_
  16.166 + #define _SIM_ENDIAN_C_
  16.167 + 
  16.168 ++#ifdef HAVE_CONFIG_H
  16.169 + #include "config.h"
  16.170 ++#endif
  16.171 + #include "basics.h"
  16.172 + 
  16.173 + 
  16.174 +diff -urN gdb-6.8-orig/sim/ppc/table.c gdb-6.8-pl1/sim/ppc/table.c
  16.175 +--- gdb-6.8-orig/sim/ppc/table.c	2002-01-12 11:21:12.000000000 +0100
  16.176 ++++ gdb-6.8-pl1/sim/ppc/table.c	2008-09-30 15:11:38.000000000 +0200
  16.177 +@@ -25,7 +25,9 @@
  16.178 + #include <fcntl.h>
  16.179 + #include <ctype.h>
  16.180 + 
  16.181 ++#ifdef HAVE_CONFIG_H
  16.182 + #include "config.h"
  16.183 ++#endif
  16.184 + #include "misc.h"
  16.185 + #include "lf.h"
  16.186 + #include "table.h"
    17.1 --- a/patches/gdb/7.2/100-sim-ppc-lz-fix.patch	Sun Sep 11 01:03:43 2011 +0200
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,15 +0,0 @@
    17.4 -Fix for psim build failure due to -lz
    17.5 -
    17.6 -See http://sourceware.org/bugzilla/show_bug.cgi?id=12202
    17.7 -
    17.8 ---- gdb-7.2.orig/sim/ppc/Makefile.in
    17.9 -+++ gdb-7.2/sim/ppc/Makefile.in
   17.10 -@@ -551,7 +551,7 @@
   17.11 - PACKAGE_OBJ = @sim_pk_obj@
   17.12 -
   17.13 -
   17.14 --psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(LIBINTL_DEP)
   17.15 -+psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
   17.16 - 	$(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
   17.17 -
   17.18 - run: psim
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/patches/gdb/7.2a/100-sim-ppc-lz-fix.patch	Sun Sep 11 18:28:45 2011 +0200
    18.3 @@ -0,0 +1,15 @@
    18.4 +Fix for psim build failure due to -lz
    18.5 +
    18.6 +See http://sourceware.org/bugzilla/show_bug.cgi?id=12202
    18.7 +
    18.8 +--- gdb-7.2.orig/sim/ppc/Makefile.in
    18.9 ++++ gdb-7.2/sim/ppc/Makefile.in
   18.10 +@@ -551,7 +551,7 @@
   18.11 + PACKAGE_OBJ = @sim_pk_obj@
   18.12 +
   18.13 +
   18.14 +-psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(LIBINTL_DEP)
   18.15 ++psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
   18.16 + 	$(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
   18.17 +
   18.18 + run: psim