Index: tches/gcc-4.0.3-cross_search_paths-1.patch
===================================================================
--- patches/gcc-4.0.3-cross_search_paths-1.patch	(revision 3ad2ac7962c7441cb92ef2854bfd08accec74550)
+++ 	(revision )
@@ -1,48 +1,0 @@
-Submitted by: Ryan Oliver <ryan.oliver@pha.com.au>
-Date: 2005-05-02
-Initial Package Version: 4.0.1
-Origin: Ryan Oliver (issue reported by Erik-Jan Post)
-Upstream Status: N/A
-Description:
-  Removes standard_exec_prefix_2 from library search path when cross-compiling.
-  Removes both standard_exec_prefix_1 and standard_exec_prefix_2 from the gcc
-  executable search path when cross-compiling.
-
-  ie: if cross_compile = 1 in the specs file, do not
-      - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} to the library search path
-      - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} or
-                   /usr/libexec/gcc/${TARGET}/${GCC_VER}
-        to the executable search path
-
-  This avoids the possibility of linking in libraries from the host if they
-  exist under those directories.
- 
-diff -Naur gcc-4.0.1.orig/gcc/gcc.c gcc-4.0.1/gcc/gcc.c
---- gcc-4.0.1.orig/gcc/gcc.c	2005-06-06 19:20:29.000000000 +0000
-+++ gcc-4.0.1/gcc/gcc.c	2005-08-27 21:16:02.000000000 +0000
-@@ -3797,16 +3797,22 @@
- 	      PREFIX_PRIORITY_LAST, 2, 0);
-   add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
- 	      PREFIX_PRIORITY_LAST, 2, 0);
--  add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
-+  if (*cross_compile == '0')
-+    {
-+      add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
- 	      PREFIX_PRIORITY_LAST, 2, 0);
--  add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
-+      add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
- 	      PREFIX_PRIORITY_LAST, 2, 0);
-+    }
- #endif
- 
-   add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
- 	      PREFIX_PRIORITY_LAST, 1, 0);
--  add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
-+  if (*cross_compile == '0')
-+    {
-+      add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
- 	      PREFIX_PRIORITY_LAST, 1, 0);
-+    }
- 
-   tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
- 			   dir_separator_str, NULL);
Index: tches/gcc-4.0.3-mips_tls-1.patch
===================================================================
--- patches/gcc-4.0.3-mips_tls-1.patch	(revision 3ad2ac7962c7441cb92ef2854bfd08accec74550)
+++ 	(revision )
@@ -1,533 +1,0 @@
-Submitted By: Jim Gifford (patches at jg555 dot com)
-Date: 2005-09-12
-Initial Package Version: 4.0.1
-Origin: Daniel Jacobowitz
-Upstream Status: GCC Dev Mailling lists
-Description: Adds support for TLS on MIPS
- 
-diff -Naur gcc-4.0.1.orig/gcc/config/mips/mips-protos.h gcc-4.0.1/gcc/config/mips/mips-protos.h
---- gcc-4.0.1.orig/gcc/config/mips/mips-protos.h	2004-12-30 03:07:56.000000000 +0000
-+++ gcc-4.0.1/gcc/config/mips/mips-protos.h	2005-09-12 23:27:07.000000000 +0000
-@@ -61,6 +61,17 @@
-        An UNSPEC wrapper around a function's address.  It represents the
-        offset of _gp from the start of the function.
- 
-+   SYMBOL_TLS
-+       A thread-local symbol.
-+
-+   SYMBOL_TLSGD
-+   SYMBOL_TLSLDM
-+   SYMBOL_DTPREL
-+   SYMBOL_GOTTPREL
-+   SYMBOL_TPREL
-+       UNSPEC wrappers around SYMBOL_TLS, corresponding to the
-+       thread-local storage relocation operators.
-+
-    SYMBOL_64_HIGH
-        For a 64-bit symbolic address X, this is the value of
-        (%highest(X) << 16) + %higher(X).
-@@ -82,6 +93,12 @@
-   SYMBOL_GOTOFF_GLOBAL,
-   SYMBOL_GOTOFF_CALL,
-   SYMBOL_GOTOFF_LOADGP,
-+  SYMBOL_TLS,
-+  SYMBOL_TLSGD,
-+  SYMBOL_TLSLDM,
-+  SYMBOL_DTPREL,
-+  SYMBOL_GOTTPREL,
-+  SYMBOL_TPREL,
-   SYMBOL_64_HIGH,
-   SYMBOL_64_MID,
-   SYMBOL_64_LOW
-diff -Naur gcc-4.0.1.orig/gcc/config/mips/mips.c gcc-4.0.1/gcc/config/mips/mips.c
---- gcc-4.0.1.orig/gcc/config/mips/mips.c	2005-05-08 11:56:53.000000000 +0000
-+++ gcc-4.0.1/gcc/config/mips/mips.c	2005-09-12 23:27:07.000000000 +0000
-@@ -236,6 +236,7 @@
- static bool mips_symbolic_address_p (enum mips_symbol_type, enum machine_mode);
- static bool mips_classify_address (struct mips_address_info *, rtx,
- 				   enum machine_mode, int);
-+static bool mips_cannot_force_const_mem (rtx);
- static int mips_symbol_insns (enum mips_symbol_type);
- static bool mips16_unextended_reference_p (enum machine_mode mode, rtx, rtx);
- static rtx mips_force_temporary (rtx, rtx);
-@@ -601,7 +602,7 @@
- /* Map hard register number to register class */
- const enum reg_class mips_regno_to_class[] =
- {
--  LEA_REGS,	LEA_REGS,	M16_NA_REGS,	M16_NA_REGS,
-+  LEA_REGS,	LEA_REGS,	M16_NA_REGS,	V1_REG,
-   M16_REGS,	M16_REGS,	M16_REGS,	M16_REGS,
-   LEA_REGS,	LEA_REGS,	LEA_REGS,	LEA_REGS,
-   LEA_REGS,	LEA_REGS,	LEA_REGS,	LEA_REGS,
-@@ -817,6 +818,12 @@
- #undef TARGET_EXPAND_BUILTIN
- #define TARGET_EXPAND_BUILTIN mips_expand_builtin
- 
-+#undef TARGET_HAVE_TLS
-+#define TARGET_HAVE_TLS HAVE_AS_TLS
-+
-+#undef TARGET_CANNOT_FORCE_CONST_MEM
-+#define TARGET_CANNOT_FORCE_CONST_MEM mips_cannot_force_const_mem
-+
- struct gcc_target targetm = TARGET_INITIALIZER;
- 
-
- /* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF.  */
-@@ -835,6 +842,9 @@
- 
-   gcc_assert (GET_CODE (x) == SYMBOL_REF);
- 
-+  if (SYMBOL_REF_TLS_MODEL (x))
-+    return SYMBOL_TLS;
-+
-   if (CONSTANT_POOL_ADDRESS_P (x))
-     {
-       if (TARGET_MIPS16)
-@@ -943,7 +953,11 @@
-   if (UNSPEC_ADDRESS_P (x))
-     *symbol_type = UNSPEC_ADDRESS_TYPE (x);
-   else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
--    *symbol_type = mips_classify_symbol (x);
-+    {
-+      *symbol_type = mips_classify_symbol (x);
-+      if (*symbol_type == SYMBOL_TLS)
-+	return false;
-+    }
-   else
-     return false;
- 
-@@ -993,6 +1007,12 @@
-     case SYMBOL_GOTOFF_GLOBAL:
-     case SYMBOL_GOTOFF_CALL:
-     case SYMBOL_GOTOFF_LOADGP:
-+    case SYMBOL_TLSGD:
-+    case SYMBOL_TLSLDM:
-+    case SYMBOL_DTPREL:
-+    case SYMBOL_TPREL:
-+    case SYMBOL_GOTTPREL:
-+    case SYMBOL_TLS:
-       return false;
-     }
-   gcc_unreachable ();
-@@ -1090,6 +1110,14 @@
-       /* The address will have to be loaded from the GOT first.  */
-       return false;
- 
-+    case SYMBOL_TLSGD:
-+    case SYMBOL_TLSLDM:
-+    case SYMBOL_DTPREL:
-+    case SYMBOL_TPREL:
-+    case SYMBOL_GOTTPREL:
-+    case SYMBOL_TLS:
-+      return false;
-+
-     case SYMBOL_GOTOFF_PAGE:
-     case SYMBOL_GOTOFF_GLOBAL:
-     case SYMBOL_GOTOFF_CALL:
-@@ -1102,6 +1130,33 @@
-   gcc_unreachable ();
- }
- 
-+/* Return true if X is a thread-local symbol.  */
-+
-+static bool
-+mips_tls_operand_p (rtx x)
-+{
-+  return GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x) != 0;
-+}
-+
-+/* Return true if X can not be forced into a constant pool.  */
-+
-+static int
-+mips_tls_symbol_ref_1 (rtx *x, void *data ATTRIBUTE_UNUSED)
-+{
-+  return mips_tls_operand_p (*x);
-+}
-+
-+/* Return true if X can not be forced into a constant pool.  */
-+
-+static bool
-+mips_cannot_force_const_mem (rtx x)
-+{
-+  if (! TARGET_HAVE_TLS)
-+    return false;
-+
-+  return for_each_rtx (&x, &mips_tls_symbol_ref_1, 0);
-+}
-+
- 
- /* Return true if X is a valid address for machine mode MODE.  If it is,
-    fill in INFO appropriately.  STRICT is true if we should only accept
-@@ -1223,8 +1278,19 @@
-     case SYMBOL_64_HIGH:
-     case SYMBOL_64_MID:
-     case SYMBOL_64_LOW:
-+    case SYMBOL_TLSGD:
-+    case SYMBOL_TLSLDM:
-+    case SYMBOL_DTPREL:
-+    case SYMBOL_GOTTPREL:
-+    case SYMBOL_TPREL:
-       /* Check whether the offset is a 16- or 32-bit value.  */
-       return mips_split_p[type] ? 2 : 1;
-+
-+    case SYMBOL_TLS:
-+      /* We don't treat a bare TLS symbol as a constant.  */
-+      return 0;
-+
-+      return 1;
-     }
-   gcc_unreachable ();
- }
-@@ -1521,6 +1587,114 @@
-   return plus_constant (reg, offset);
- }
- 
-+/* Emit a call to __tls_get_addr.  SYM is the TLS symbol we are
-+   referencing, and TYPE is the symbol type to use (either global
-+   dynamic or local dynamic).  V0 is an RTX for the return value
-+   location.  The entire insn sequence is returned.  */
-+
-+static GTY(()) rtx mips_tls_symbol;
-+
-+static rtx
-+mips_call_tls_get_addr (rtx sym, enum mips_symbol_type type, rtx v0)
-+{
-+  rtx insn, loc, tga, a0;
-+
-+  a0 = gen_rtx_REG (Pmode, GP_ARG_FIRST);
-+
-+  if (!mips_tls_symbol)
-+    mips_tls_symbol = init_one_libfunc ("__tls_get_addr");
-+
-+  loc = mips_unspec_address (sym, type);
-+
-+  start_sequence ();
-+
-+  emit_insn (gen_rtx_SET (Pmode, a0,
-+			  gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, loc)));
-+  tga = gen_rtx_MEM (Pmode, mips_tls_symbol);
-+  insn = emit_call_insn (gen_call_value (v0, tga, const0_rtx, const0_rtx));
-+  CONST_OR_PURE_CALL_P (insn) = 1;
-+  use_reg (&CALL_INSN_FUNCTION_USAGE (insn), v0);
-+  use_reg (&CALL_INSN_FUNCTION_USAGE (insn), a0);
-+  insn = get_insns ();
-+
-+  end_sequence ();
-+
-+  return insn;
-+}
-+
-+/* Generate the code to access LOC, a thread local SYMBOL_REF.  The
-+   return value will be a valid address and move_operand (either a REG
-+   or a LO_SUM).  */
-+
-+static rtx
-+mips_legitimize_tls_address (rtx loc)
-+{
-+  rtx dest, insn, v0, v1, tmp1, tmp2, eqv;
-+  enum tls_model model;
-+
-+  v0 = gen_rtx_REG (Pmode, GP_RETURN);
-+  v1 = gen_rtx_REG (Pmode, GP_RETURN + 1);
-+
-+  model = SYMBOL_REF_TLS_MODEL (loc);
-+
-+  switch (model)
-+    {
-+    case TLS_MODEL_GLOBAL_DYNAMIC:
-+      insn = mips_call_tls_get_addr (loc, SYMBOL_TLSGD, v0);
-+      dest = gen_reg_rtx (Pmode);
-+      emit_libcall_block (insn, dest, v0, loc);
-+      break;
-+
-+    case TLS_MODEL_LOCAL_DYNAMIC:
-+      insn = mips_call_tls_get_addr (loc, SYMBOL_TLSLDM, v0);
-+      tmp1 = gen_reg_rtx (Pmode);
-+
-+      /* Attach a unique REG_EQUIV, to allow the RTL optimizers to
-+	 share the LDM result with other LD model accesses.  */
-+      eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
-+			    UNSPEC_TLS_LDM);
-+      emit_libcall_block (insn, tmp1, v0, eqv);
-+
-+      tmp2 = mips_unspec_offset_high (NULL, tmp1, loc, SYMBOL_DTPREL);
-+      dest = gen_rtx_LO_SUM (Pmode, tmp2,
-+			     mips_unspec_address (loc, SYMBOL_DTPREL));
-+      break;
-+
-+    case TLS_MODEL_INITIAL_EXEC:
-+      tmp1 = gen_reg_rtx (Pmode);
-+      tmp2 = mips_unspec_address (loc, SYMBOL_GOTTPREL);
-+      if (Pmode == DImode)
-+	{
-+	  emit_insn (gen_tls_get_tp_di (v1));
-+	  emit_insn (gen_load_gotdi (tmp1, pic_offset_table_rtx, tmp2));
-+	}
-+      else
-+	{
-+	  emit_insn (gen_tls_get_tp_si (v1));
-+	  emit_insn (gen_load_gotsi (tmp1, pic_offset_table_rtx, tmp2));
-+	}
-+      dest = gen_reg_rtx (Pmode);
-+      emit_insn (gen_add3_insn (dest, tmp1, v1));
-+      break;
-+
-+    case TLS_MODEL_LOCAL_EXEC:
-+
-+      if (Pmode == DImode)
-+	emit_insn (gen_tls_get_tp_di (v1));
-+      else
-+	emit_insn (gen_tls_get_tp_si (v1));
-+
-+      tmp1 = mips_unspec_offset_high (NULL, v1, loc, SYMBOL_TPREL);
-+      dest = gen_rtx_LO_SUM (Pmode, tmp1,
-+			     mips_unspec_address (loc, SYMBOL_TPREL));
-+      break;
-+
-+    default:
-+      abort ();
-+    }
-+
-+  return dest;
-+}
- 
- /* This function is used to implement LEGITIMIZE_ADDRESS.  If *XLOC can
-    be legitimized in a way that the generic machinery might not expect,
-@@ -1532,6 +1706,12 @@
- {
-   enum mips_symbol_type symbol_type;
- 
-+  if (mips_tls_operand_p (*xloc))
-+    {
-+      *xloc = mips_legitimize_tls_address (*xloc);
-+      return true;
-+    }
-+
-   /* See if the address can split into a high part and a LO_SUM.  */
-   if (mips_symbolic_constant_p (*xloc, &symbol_type)
-       && mips_symbolic_address_p (symbol_type, mode)
-@@ -1707,6 +1887,12 @@
-       return;
-     }
- 
-+  if (mips_tls_operand_p (src))
-+    {
-+      emit_move_insn (dest, mips_legitimize_tls_address (src));
-+      return;
-+    }
-+
-   /* See if the symbol can be split.  For mips16, this is often worse than
-      forcing it in the constant pool since it needs the single-register form
-      of addiu or daddiu.  */
-@@ -4321,6 +4507,7 @@
- 			     GR_REGS);
-   mips_char_to_class['e'] = LEA_REGS;
-   mips_char_to_class['j'] = PIC_FN_ADDR_REG;
-+  mips_char_to_class['v'] = V1_REG;
-   mips_char_to_class['y'] = GR_REGS;
-   mips_char_to_class['z'] = ST_REGS;
-   mips_char_to_class['B'] = COP0_REGS;
-@@ -4509,6 +4696,22 @@
-       mips_lo_relocs[SYMBOL_GOTOFF_LOADGP] = "%lo(%neg(%gp_rel(";
-     }
- 
-+  /* Thread-local relocation operators.  */
-+  mips_lo_relocs[SYMBOL_TLSGD] = "%tlsgd(";
-+  mips_lo_relocs[SYMBOL_TLSLDM] = "%tlsldm(";
-+  mips_split_p[SYMBOL_DTPREL] = 1;
-+  mips_hi_relocs[SYMBOL_DTPREL] = "%dtprel_hi(";
-+  mips_lo_relocs[SYMBOL_DTPREL] = "%dtprel_lo(";
-+  mips_lo_relocs[SYMBOL_GOTTPREL] = "%gottprel(";
-+  mips_split_p[SYMBOL_TPREL] = 1;
-+  mips_hi_relocs[SYMBOL_TPREL] = "%tprel_hi(";
-+  mips_lo_relocs[SYMBOL_TPREL] = "%tprel_lo(";
-+
-+  /* We don't have a thread pointer access instruction on MIPS16, or
-+     appropriate TLS relocations.  */
-+  if (TARGET_MIPS16)
-+    targetm.have_tls = false;
-+
-   /* Default to working around R4000 errata only if the processor
-      was selected explicitly.  */
-   if ((target_flags_explicit & MASK_FIX_R4000) == 0
-diff -Naur gcc-4.0.1.orig/gcc/config/mips/mips.h gcc-4.0.1/gcc/config/mips/mips.h
---- gcc-4.0.1.orig/gcc/config/mips/mips.h	2005-04-15 07:00:18.000000000 +0000
-+++ gcc-4.0.1/gcc/config/mips/mips.h	2005-09-12 23:27:07.000000000 +0000
-@@ -1714,6 +1714,7 @@
-   T_REG,			/* mips16 T register ($24) */
-   M16_T_REGS,			/* mips16 registers plus T register */
-   PIC_FN_ADDR_REG,		/* SVR4 PIC function address register */
-+  V1_REG,			/* Register $v1 ($3) used for TLS access.  */
-   LEA_REGS,			/* Every GPR except $25 */
-   GR_REGS,			/* integer registers */
-   FP_REGS,			/* floating point registers */
-@@ -1752,6 +1753,7 @@
-   "T_REG",								\
-   "M16_T_REGS",								\
-   "PIC_FN_ADDR_REG",							\
-+  "V1_REG",								\
-   "LEA_REGS",								\
-   "GR_REGS",								\
-   "FP_REGS",								\
-@@ -1793,7 +1795,8 @@
-   { 0x01000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* mips16 T register */	\
-   { 0x010300fc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* mips16 and T regs */ \
-   { 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* SVR4 PIC function address register */ \
--  { 0xfdffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* Every other GPR */   \
-+  { 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* only $v1 */ \
-+  { 0xfdffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* Every other GPR except $25 */   \
-   { 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* integer registers */	\
-   { 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },	/* floating registers*/	\
-   { 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000 },	/* hi register */	\
-@@ -1849,6 +1852,7 @@
- #define GR_REG_CLASS_P(CLASS)						\
-   ((CLASS) == GR_REGS || (CLASS) == M16_REGS || (CLASS) == T_REG	\
-    || (CLASS) == M16_T_REGS || (CLASS) == M16_NA_REGS			\
-+   || (CLASS) == V1_REG							\
-    || (CLASS) == PIC_FN_ADDR_REG || (CLASS) == LEA_REGS)
- 
- /* This macro is also used later on in the file.  */
-@@ -1896,6 +1900,7 @@
-    'f'	Floating point registers
-    'h'	Hi register
-    'l'	Lo register
-+   'v'	$v1 only
-    'x'	Multiply/divide registers
-    'z'	FP Status register
-    'B'  Cop0 register
-@@ -3017,3 +3022,7 @@
- 	" TEXT_SECTION_ASM_OP);
- #endif
- #endif
-+
-+#ifndef HAVE_AS_TLS
-+#define HAVE_AS_TLS 0
-+#endif
-diff -Naur gcc-4.0.1.orig/gcc/config/mips/mips.md gcc-4.0.1/gcc/config/mips/mips.md
---- gcc-4.0.1.orig/gcc/config/mips/mips.md	2005-05-08 11:56:58.000000000 +0000
-+++ gcc-4.0.1/gcc/config/mips/mips.md	2005-09-12 23:29:17.000000000 +0000
-@@ -45,6 +45,8 @@
-    (UNSPEC_LOAD_GOT		24)
-    (UNSPEC_GP			25)
-    (UNSPEC_MFHILO		26)
-+   (UNSPEC_TLS_LDM		27)
-+   (UNSPEC_TLS_GET_TP		28)
- 
-    (UNSPEC_ADDRESS_FIRST	100)
- 
-@@ -3027,12 +3029,12 @@
- ;; We could use MEMs, but an unspec gives more optimization
- ;; opportunities.
- 
--(define_insn "*load_got<mode>"
-+(define_insn "load_got<mode>"
-   [(set (match_operand:P 0 "register_operand" "=d")
- 	(unspec:P [(match_operand:P 1 "register_operand" "d")
- 		   (match_operand:P 2 "immediate_operand" "")]
- 		  UNSPEC_LOAD_GOT))]
--  "TARGET_ABICALLS"
-+  ""
-   "<load>\t%0,%R2(%1)"
-   [(set_attr "type" "load")
-    (set_attr "mode" "<MODE>")
-@@ -5296,6 +5298,25 @@
-   [(match_dup 0)]
-   { operands[0] = mips_rewrite_small_data (operands[0]); })
- 
-
-+; Thread-Local Storage
-+
-+; The TLS base pointer is acessed via "rdhwr $v1, $29".  No current
-+; MIPS architecture defines this register, and no current
-+; implementation provides it; instead, any OS which supports TLS is
-+; expected to trap and emulate this instruction.  rdhwr is part of the
-+; MIPS 32r2 specification, but we use it on any architecture because
-+; we expect it to be emulated.  Use .set to force the assembler to
-+; accept it.
-+
-+(define_insn "tls_get_tp_<mode>"
-+  [(set (match_operand:P 0 "register_operand" "=v")
-+	(unspec:P [(const_int 0)]
-+		  UNSPEC_TLS_GET_TP))]
-+  "HAVE_AS_TLS && !TARGET_MIPS16"
-+  ".set\tpush\;.set\tmips32r2\t\;rdhwr\t%0,$29\;.set\tpop"
-+  [(set_attr "type" "unknown")
-+   (set_attr "mode" "<MODE>")])
-+
-
- ; The MIPS Paired-Single Floating Point and MIPS-3D Instructions.
- 
- (include "mips-ps-3d.md")
-diff -Naur gcc-4.0.1.orig/gcc/configure gcc-4.0.1/gcc/configure
---- gcc-4.0.1.orig/gcc/configure	2005-07-07 20:44:40.000000000 +0000
-+++ gcc-4.0.1/gcc/configure	2005-09-12 23:27:07.000000000 +0000
-@@ -13779,6 +13779,23 @@
- 	tls_first_minor=13
- 	tls_as_opt=--fatal-warnings
- 	;;
-+  mips*-*-*)
-+    conftest_s='
-+	.section .tdata,"awT",@progbits
-+x:
-+	.word 2
-+	.text
-+	addiu $4, $28, %tlsgd(x)
-+	addiu $4, $28, %tlsldm(x)
-+	lui $4, %dtprel_hi(x)
-+	addiu $4, $4, %dtprel_lo(x)
-+	lw $4, %gottprel(x)($28)
-+	lui $4, %tprel_hi(x)
-+	addiu $4, $4, %tprel_lo(x)'
-+	tls_first_major=2
-+	tls_first_minor=16
-+	tls_as_opt='-32 --fatal-warnings'
-+	;;
-   powerpc-*-*)
-     conftest_s='
- 	.section ".tdata","awT",@progbits
-diff -Naur gcc-4.0.1.orig/gcc/configure.ac gcc-4.0.1/gcc/configure.ac
---- gcc-4.0.1.orig/gcc/configure.ac	2005-06-01 08:14:33.000000000 +0000
-+++ gcc-4.0.1/gcc/configure.ac	2005-09-12 23:27:07.000000000 +0000
-@@ -2349,6 +2349,23 @@
- 	tls_first_minor=13
- 	tls_as_opt=--fatal-warnings
- 	;;
-+  mips*-*-*)
-+    conftest_s='
-+	.section .tdata,"awT",@progbits
-+x:
-+	.word 2
-+	.text
-+	addiu $4, $28, %tlsgd(x)
-+	addiu $4, $28, %tlsldm(x)
-+	lui $4, %dtprel_hi(x)
-+	addiu $4, $4, %dtprel_lo(x)
-+	lw $4, %gottprel(x)($28)
-+	lui $4, %tprel_hi(x)
-+	addiu $4, $4, %tprel_lo(x)'
-+	tls_first_major=2
-+	tls_first_minor=16
-+	tls_as_opt='-32 --fatal-warnings'
-+	;;
-   powerpc-*-*)
-     conftest_s='
- 	.section ".tdata","awT",@progbits
-diff -Naur gcc-4.0.1.orig/gcc/testsuite/gcc.dg/tls/offset-1.c gcc-4.0.1/gcc/testsuite/gcc.dg/tls/offset-1.c
---- gcc-4.0.1.orig/gcc/testsuite/gcc.dg/tls/offset-1.c	1970-01-01 00:00:00.000000000 +0000
-+++ gcc-4.0.1/gcc/testsuite/gcc.dg/tls/offset-1.c	2005-09-12 23:27:07.000000000 +0000
-@@ -0,0 +1,15 @@
-+/* { dg-do link } */
-+/* Test that we do not emit a TLS reference into a constant pool.  */
-+
-+__thread int x[2];
-+
-+int * __attribute__((noinline))
-+foo (void)
-+{
-+  return &x[1];
-+}
-+
-+int main (void)
-+{
-+  return *foo ();
-+}
Index: tches/gcc-4.0.3-posix-1.patch
===================================================================
--- patches/gcc-4.0.3-posix-1.patch	(revision 3ad2ac7962c7441cb92ef2854bfd08accec74550)
+++ 	(revision )
@@ -1,191 +1,0 @@
-Submitted By: Jim Gifford (patches at jg555 dot com)
-Date: 2005-08-27
-Initial Package Version: 4.0.1
-Origin: Jim Gifford
-Upstream Status: On Hold
-Description: Makes GCC Posix Compliant
- 
-diff -Naur gcc-4.0.1.orig/contrib/test_summary gcc-4.0.1/contrib/test_summary
---- gcc-4.0.1.orig/contrib/test_summary	2004-08-26 05:51:22.000000000 +0000
-+++ gcc-4.0.1/contrib/test_summary	2005-08-27 21:06:51.000000000 +0000
-@@ -106,7 +106,7 @@
-     srcdir = configflags;
-     sub(/\/configure .*/, "", srcdir);
-     printf "LAST_UPDATED: ";
--    system("tail -1 " srcdir "/LAST_UPDATED");
-+    system("tail -n 1 " srcdir "/LAST_UPDATED");
-     print "";
- 
-     sub(/^[^ ]*\/configure */, " ", configflags);
-diff -Naur gcc-4.0.1.orig/gcc/configure gcc-4.0.1/gcc/configure
---- gcc-4.0.1.orig/gcc/configure	2005-07-07 20:44:40.000000000 +0000
-+++ gcc-4.0.1/gcc/configure	2005-08-27 21:06:51.000000000 +0000
-@@ -13511,7 +13511,7 @@
-   # and we got the correct data, then succeed.
-   if test x$gcc_cv_objdump != x \
-   && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
--     | tail -3 > conftest.got \
-+     | tail -n 3 > conftest.got \
-   && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
-     || cmp conftest.big conftest.got > /dev/null 2>&1; }
-   then
-diff -Naur gcc-4.0.1.orig/gcc/configure.ac gcc-4.0.1/gcc/configure.ac
---- gcc-4.0.1.orig/gcc/configure.ac	2005-06-01 08:14:33.000000000 +0000
-+++ gcc-4.0.1/gcc/configure.ac	2005-08-27 21:06:51.000000000 +0000
-@@ -2214,7 +2214,7 @@
-   # and we got the correct data, then succeed.
-   if test x$gcc_cv_objdump != x \
-   && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
--     | tail -3 > conftest.got \
-+     | tail -n 3 > conftest.got \
-   && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
-     || cmp conftest.big conftest.got > /dev/null 2>&1; }
-   then
-diff -Naur gcc-4.0.1.orig/libjava/acinclude.m4 gcc-4.0.1/libjava/acinclude.m4
---- gcc-4.0.1.orig/libjava/acinclude.m4	2004-09-23 01:14:00.000000000 +0000
-+++ gcc-4.0.1/libjava/acinclude.m4	2005-08-27 21:06:51.000000000 +0000
-@@ -17,8 +17,8 @@
- AC_MSG_CHECKING(whether 'ld' is at least 2.13)
- LD_PROG=`$CC --print-prog-name=ld`
- LD_VERSION=`$LD_PROG --version`
--LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
--LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
-+LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
-+LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2`
- if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
-   LD_OK="ok"
- else
-diff -Naur gcc-4.0.1.orig/libjava/configure gcc-4.0.1/libjava/configure
---- gcc-4.0.1.orig/libjava/configure	2005-07-07 20:44:40.000000000 +0000
-+++ gcc-4.0.1/libjava/configure	2005-08-27 21:06:51.000000000 +0000
-@@ -5933,8 +5933,8 @@
- echo $ECHO_N "checking whether 'ld' is at least 2.13... $ECHO_C" >&6
- LD_PROG=`$CC --print-prog-name=ld`
- LD_VERSION=`$LD_PROG --version`
--LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
--LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
-+LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
-+LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2`
- if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
-   LD_OK="ok"
- else
-diff -Naur gcc-4.0.1.orig/libstdc++-v3/acinclude.m4 gcc-4.0.1/libstdc++-v3/acinclude.m4
---- gcc-4.0.1.orig/libstdc++-v3/acinclude.m4	2005-06-23 09:23:59.000000000 +0000
-+++ gcc-4.0.1/libstdc++-v3/acinclude.m4	2005-08-27 21:06:51.000000000 +0000
-@@ -241,7 +241,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
-   changequote(,)
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
-   changequote([,])
-   glibcxx_gnu_ld_version=`echo $ldver | \
-diff -Naur gcc-4.0.1.orig/libstdc++-v3/configure gcc-4.0.1/libstdc++-v3/configure
---- gcc-4.0.1.orig/libstdc++-v3/configure	2005-06-23 09:24:00.000000000 +0000
-+++ gcc-4.0.1/libstdc++-v3/configure	2005-08-27 21:06:52.000000000 +0000
-@@ -9880,7 +9880,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -55252,7 +55252,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -76923,7 +76923,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -79292,7 +79292,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -81537,7 +81537,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -84550,7 +84550,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -86748,7 +86748,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -88995,7 +88995,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-@@ -91603,7 +91603,7 @@
-   # Start by getting the version number.  I think the libtool test already
-   # does some of this, but throws away the result.
- 
--  ldver=`$LD --version 2>/dev/null | head -1 | \
-+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
-          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
- 
-   glibcxx_gnu_ld_version=`echo $ldver | \
-diff -Naur gcc-4.0.1.orig/ltcf-c.sh gcc-4.0.1/ltcf-c.sh
---- gcc-4.0.1.orig/ltcf-c.sh	2005-05-14 00:42:34.000000000 +0000
-+++ gcc-4.0.1/ltcf-c.sh	2005-08-27 21:07:08.000000000 +0000
-@@ -153,7 +153,7 @@
-     # If the export-symbols file already is a .def file (1st line
-     # is EXPORTS), use it as is.
-     # If DATA tags from a recent dlltool are present, honour them!
--    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
-+    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
-         cp $export_symbols $output_objdir/$soname-def;
-       else
-         echo EXPORTS > $output_objdir/$soname-def;
-diff -Naur gcc-4.0.1.orig/ltcf-gcj.sh gcc-4.0.1/ltcf-gcj.sh
---- gcc-4.0.1.orig/ltcf-gcj.sh	2005-05-14 00:42:34.000000000 +0000
-+++ gcc-4.0.1/ltcf-gcj.sh	2005-08-27 21:07:08.000000000 +0000
-@@ -156,7 +156,7 @@
-     # If the export-symbols file already is a .def file (1st line
-     # is EXPORTS), use it as is.
-     # If DATA tags from a recent dlltool are present, honour them!
--    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
-+    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
-         cp $export_symbols $output_objdir/$soname-def;
-       else
-         echo EXPORTS > $output_objdir/$soname-def;
Index: tches/gcc-4.0.3-pure64-1.patch
===================================================================
--- patches/gcc-4.0.3-pure64-1.patch	(revision 3ad2ac7962c7441cb92ef2854bfd08accec74550)
+++ 	(revision )
@@ -1,150 +1,0 @@
-Submitted By: Jim Gifford (patches at jg555 dot com)
-Date: 2005-08-27
-Initial Package Version: 4.x
-Origin: Ken Moffat and Jim Gifford
-Upstream Status: LFS Specific
-Description: Make LIB64 builds in /lib instead of /lib64 
-
-diff -Naur gcc-4.0.1.orig/gcc/config/i386/linux64.h gcc-4.0.1/gcc/config/i386/linux64.h
---- gcc-4.0.1.orig/gcc/config/i386/linux64.h	2004-11-27 22:29:34.000000000 +0000
-+++ gcc-4.0.1/gcc/config/i386/linux64.h	2005-08-28 05:07:59.000000000 +0000
-@@ -60,8 +60,8 @@
-   %{!shared: \
-     %{!static: \
-       %{rdynamic:-export-dynamic} \
--      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
--      %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
-+      %{m32:%{!dynamic-linker:-dynamic-linker /lib32/ld-linux.so.2}} \
-+      %{!m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux-x86-64.so.2}}} \
-     %{static:-static}}"
- 
- #define MULTILIB_DEFAULTS { "m64" }
-diff -Naur gcc-4.0.1.orig/gcc/config/i386/t-linux64 gcc-4.0.1/gcc/config/i386/t-linux64
---- gcc-4.0.1.orig/gcc/config/i386/t-linux64	2002-11-28 14:47:02.000000000 +0000
-+++ gcc-4.0.1/gcc/config/i386/t-linux64	2005-08-28 05:08:37.000000000 +0000
-@@ -6,7 +6,7 @@
- 
- MULTILIB_OPTIONS = m64/m32
- MULTILIB_DIRNAMES = 64 32 
--MULTILIB_OSDIRNAMES = ../lib64 ../lib
-+MULTILIB_OSDIRNAMES = ../lib ../lib32
- 
- LIBGCC = stmp-multilib
- INSTALL_LIBGCC = install-multilib
-diff -Naur gcc-4.0.1.orig/gcc/config/mips/linux64.h gcc-4.0.1/gcc/config/mips/linux64.h
---- gcc-4.0.1.orig/gcc/config/mips/linux64.h	2005-01-26 02:04:46.000000000 +0000
-+++ gcc-4.0.1/gcc/config/mips/linux64.h	2005-08-28 05:09:17.000000000 +0000
-@@ -47,9 +47,9 @@
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
-         %{!dynamic-linker: \
--	  %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
--	  %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
--	  %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
-+	  %{mabi=n32: -dynamic-linker /lib64/ld.so.1} \
-+	  %{mabi=64: -dynamic-linker /lib/ld.so.1} \
-+	  %{mabi=32: -dynamic-linker /lib32/ld.so.1}}} \
-       %{static:-static}}} \
- %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
- %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
-diff -Naur gcc-4.0.1.orig/gcc/config/mips/t-linux64 gcc-4.0.1/gcc/config/mips/t-linux64
---- gcc-4.0.1.orig/gcc/config/mips/t-linux64	2005-01-17 21:09:14.000000000 +0000
-+++ gcc-4.0.1/gcc/config/mips/t-linux64	2005-08-28 05:09:29.000000000 +0000
-@@ -1,6 +1,6 @@
- MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
- MULTILIB_DIRNAMES = n32 32 64
--MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
-+MULTILIB_OSDIRNAMES = ../lib64 ../lib32 ../lib
- 
- EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
- 
-diff -Naur gcc-4.0.1.orig/gcc/config/rs6000/linux64.h gcc-4.0.1/gcc/config/rs6000/linux64.h
---- gcc-4.0.1.orig/gcc/config/rs6000/linux64.h	2005-04-29 00:19:47.000000000 +0000
-+++ gcc-4.0.1/gcc/config/rs6000/linux64.h	2005-08-28 05:10:24.000000000 +0000
-@@ -351,11 +351,11 @@
- 
- #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
-   %{rdynamic:-export-dynamic} \
--  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
-+  %{!dynamic-linker:-dynamic-linker /lib32/ld.so.1}}}"
- 
- #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
-   %{rdynamic:-export-dynamic} \
--  %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
-+  %{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}}}"
- 
- #undef  TOC_SECTION_ASM_OP
- #define TOC_SECTION_ASM_OP \
-diff -Naur gcc-4.0.1.orig/gcc/config/rs6000/t-linux64 gcc-4.0.1/gcc/config/rs6000/t-linux64
---- gcc-4.0.1.orig/gcc/config/rs6000/t-linux64	2004-03-17 15:15:32.000000000 +0000
-+++ gcc-4.0.1/gcc/config/rs6000/t-linux64	2005-08-28 05:10:04.000000000 +0000
-@@ -13,7 +13,7 @@
- MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
- MULTILIB_EXCEPTIONS     = m64/msoft-float
- MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
--MULTILIB_OSDIRNAMES	= ../lib64 ../lib nof
-+MULTILIB_OSDIRNAMES	= ../lib ../lib32 nof
- MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
- 
- # We want fine grained libraries, so use the new code to build the
-diff -Naur gcc-4.0.1.orig/gcc/config/sparc/linux64.h gcc-4.0.1/gcc/config/sparc/linux64.h
---- gcc-4.0.1.orig/gcc/config/sparc/linux64.h	2005-04-04 15:32:00.000000000 +0000
-+++ gcc-4.0.1/gcc/config/sparc/linux64.h	2005-08-28 05:11:35.000000000 +0000
-@@ -167,21 +167,21 @@
-   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
-   { "link_arch",	 LINK_ARCH_SPEC },
-     
--#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
-+#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib32 %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-+        %{!dynamic-linker:-dynamic-linker /lib32/ld-linux.so.2}} \
-         %{static:-static}}} \
- "
- 
--#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
-+#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
-+        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-         %{static:-static}}} \
- "
- 
-@@ -257,12 +257,12 @@
- #else /* !SPARC_BI_ARCH */
- 
- #undef LINK_SPEC
--#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
-+#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
-+        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-         %{static:-static}}} \
- %{mlittle-endian:-EL} \
- %{!mno-relax:%{!r:-relax}} \
-diff -Naur gcc-4.0.1.orig/gcc/config/sparc/t-linux64 gcc-4.0.1/gcc/config/sparc/t-linux64
---- gcc-4.0.1.orig/gcc/config/sparc/t-linux64	2004-04-01 16:05:20.000000000 +0000
-+++ gcc-4.0.1/gcc/config/sparc/t-linux64	2005-08-28 05:12:02.000000000 +0000
-@@ -1,6 +1,6 @@
- MULTILIB_OPTIONS = m64/m32
- MULTILIB_DIRNAMES = 64 32
--MULTILIB_OSDIRNAMES = ../lib64 ../lib
-+MULTILIB_OSDIRNAMES = ../lib ../lib32
- 
- LIBGCC = stmp-multilib
- INSTALL_LIBGCC = install-multilib
-@@ -16,4 +16,4 @@
- 
- CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \
- 				 -print-multi-os-directory) \
--			= x../lib64; then echo -mcmodel=medany; fi`
-+			= x../lib; then echo -mcmodel=medany; fi`
Index: tches/gcc-4.0.3-specs-1.patch
===================================================================
--- patches/gcc-4.0.3-specs-1.patch	(revision 3ad2ac7962c7441cb92ef2854bfd08accec74550)
+++ 	(revision )
@@ -1,336 +1,0 @@
-Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
-Date: 2006-01-16
-Initial Package Version: 4.0.0
-Upstream Status: Not Sent - LFS Specfic
-Origin: Idea originally developed by Ryan Oliver and Greg Schafer for
-	the Pure LFS project.
-	More architectures added by Zack Winkles.
-	Further fine tunings by Greg Schafer.
-	Modified for gcc 3.3.2 by Oliver Brakmann.
-Rediffed against gcc 3.4.0 by Zack Winkles.
-	Rediffed against gcc 3.4.3 by Jim Gifford.
-	Rediffed against gcc 4.0.0 by Robert Connolly.
-Description: This patch modifies the location of the dynamic linker for
-	the GCC Pass 2 build in LFS Chapter 5.
-
-diff -Naur gcc-20050116.orig/gcc/config/alpha/linux-elf.h gcc-20050116/gcc/config/alpha/linux-elf.h
---- gcc-20050116.orig/gcc/config/alpha/linux-elf.h	2005-01-17 00:45:16.000000000 +0000
-+++ gcc-20050116/gcc/config/alpha/linux-elf.h	2005-01-17 00:46:14.560651027 +0000
-@@ -27,7 +27,7 @@
- #define SUBTARGET_EXTRA_SPECS \
- { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
- 
--#define ELF_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
-+#define ELF_DYNAMIC_LINKER	"/tools/lib/ld-linux.so.2"
- 
- #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
-   %{O*:-O3} %{!O*:-O1}						\
-diff -Naur gcc-20050116.orig/gcc/config/arm/linux-elf.h gcc-20050116/gcc/config/arm/linux-elf.h
---- gcc-20050116.orig/gcc/config/arm/linux-elf.h	2005-01-17 00:45:16.000000000 +0000
-+++ gcc-20050116/gcc/config/arm/linux-elf.h	2005-01-17 00:46:50.538578614 +0000
-@@ -87,7 +87,7 @@
-    %{shared:-shared} \
-    %{symbolic:-Bsymbolic} \
-    %{rdynamic:-export-dynamic} \
--   %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
-+   %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2} \
-    -X \
-    %{mbig-endian:-EB}" \
-    SUBTARGET_EXTRA_LINK_SPEC
-diff -Naur gcc-20050116.orig/gcc/config/frv/linux.h gcc-20050116/gcc/config/frv/linux.h
---- gcc-20050116.orig/gcc/config/frv/linux.h	2005-01-17 00:45:16.000000000 +0000
-+++ gcc-20050116/gcc/config/frv/linux.h	2005-01-17 01:33:50.600805260 +0000
-@@ -41,7 +41,7 @@
-   %{mfdpic: -m elf32frvfd -z text} %{shared} %{pie} \
-   %{!shared: %{!static: \
-    %{rdynamic:-export-dynamic} \
--   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-+   %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
-    %{static}}"
- 
- /* Support for compile-time default CPU.  */
-diff -Naur gcc-20050116.orig/gcc/config/i386/gnu.h gcc-20050116/gcc/config/i386/gnu.h
---- gcc-20050116.orig/gcc/config/i386/gnu.h	2005-01-17 00:45:16.000000000 +0000
-+++ gcc-20050116/gcc/config/i386/gnu.h	2005-01-17 01:34:11.142021939 +0000
-@@ -27,7 +27,7 @@
-   %{!shared: \
-     %{!static: \
-       %{rdynamic:-export-dynamic} \
--      %{!dynamic-linker:-dynamic-linker /lib/ld.so}} \
-+      %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so}} \
-     %{static:-static}}"
- 
- #undef	STARTFILE_SPEC
-diff -Naur gcc-20050116.orig/gcc/config/i386/linux.h gcc-20050116/gcc/config/i386/linux.h
---- gcc-20050116.orig/gcc/config/i386/linux.h	2005-01-17 00:45:16.000000000 +0000
-+++ gcc-20050116/gcc/config/i386/linux.h	2005-01-17 00:49:27.412667132 +0000
-@@ -105,7 +105,7 @@
- /* If ELF is the default format, we should not use /lib/elf.  */
- 
- #define LINK_EMULATION "elf_i386"
--#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
-+#define DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
- 
- #undef  SUBTARGET_EXTRA_SPECS
- #define SUBTARGET_EXTRA_SPECS \
-diff -Naur gcc-20050116.orig/gcc/config/i386/linux64.h gcc-20050116/gcc/config/i386/linux64.h
---- gcc-20050116.orig/gcc/config/i386/linux64.h	2005-01-17 00:45:16.000000000 +0000
-+++ gcc-20050116/gcc/config/i386/linux64.h	2005-01-17 00:50:23.055094690 +0000
-@@ -60,8 +60,8 @@
-   %{!shared: \
-     %{!static: \
-       %{rdynamic:-export-dynamic} \
--      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
--      %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
-+      %{m32:%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
-+      %{!m32:%{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux-x86-64.so.2}}} \
-     %{static:-static}}"
- 
- #define MULTILIB_DEFAULTS { "m64" }
-diff -Naur gcc-20050116.orig/gcc/config/ia64/linux.h gcc-20050116/gcc/config/ia64/linux.h
---- gcc-20050116.orig/gcc/config/ia64/linux.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/ia64/linux.h	2005-01-17 00:50:43.146472133 +0000
-@@ -43,7 +43,7 @@
-   %{!shared: \
-     %{!static: \
-       %{rdynamic:-export-dynamic} \
--      %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
-+      %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux-ia64.so.2}} \
-       %{static:-static}}"
- 
- 
-diff -Naur gcc-20050116.orig/gcc/config/linux.h gcc-20050116/gcc/config/linux.h
---- gcc-20050116.orig/gcc/config/linux.h	2005-01-17 00:45:16.000000000 +0000
-+++ gcc-20050116/gcc/config/linux.h	2005-01-17 00:51:14.101809663 +0000
-@@ -104,3 +104,7 @@
- #define TARGET_C99_FUNCTIONS 1
- 
- #define TARGET_HAS_F_SETLKW
-+
-+/* Remove /usr/include from the end of the include search path.  */
-+#undef STANDARD_INCLUDE_DIR
-+#define STANDARD_INCLUDE_DIR 0
-diff -Naur gcc-20050116.orig/gcc/config/m32r/linux.h gcc-20050116/gcc/config/m32r/linux.h
---- gcc-20050116.orig/gcc/config/m32r/linux.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/m32r/linux.h	2005-01-17 00:51:39.720640870 +0000
-@@ -66,7 +66,7 @@
-     %{!ibcs: \
-       %{!static: \
- 	%{rdynamic:-export-dynamic} \
--	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-+	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
- 	%{static:-static}}}"
- #else
- #define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \
-@@ -74,7 +74,7 @@
-     %{!ibcs: \
-       %{!static: \
- 	%{rdynamic:-export-dynamic} \
--	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-+	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
- 	%{static:-static}}}"
- #endif
- 
-diff -Naur gcc-20050116.orig/gcc/config/m68k/linux.h gcc-20050116/gcc/config/m68k/linux.h
---- gcc-20050116.orig/gcc/config/m68k/linux.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/m68k/linux.h	2005-01-17 00:52:07.633830392 +0000
-@@ -132,7 +132,7 @@
-   %{!shared: \
-     %{!static: \
-       %{rdynamic:-export-dynamic} \
--      %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
-+      %{!dynamic-linker*:-dynamic-linker /tools/lib/ld.so.1}} \
-     %{static}}"
- 
- /* For compatibility with linux/a.out */
-diff -Naur gcc-20050116.orig/gcc/config/mips/linux.h gcc-20050116/gcc/config/mips/linux.h
---- gcc-20050116.orig/gcc/config/mips/linux.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/mips/linux.h	2005-01-17 00:52:28.348034505 +0000
-@@ -115,7 +115,7 @@
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-+        %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
-         %{static:-static}}}"
- 
- #undef SUBTARGET_ASM_SPEC
-diff -Naur gcc-20050116.orig/gcc/config/mips/linux64.h gcc-20050116/gcc/config/mips/linux64.h
---- gcc-20050116.orig/gcc/config/mips/linux64.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/mips/linux64.h	2005-01-17 00:53:04.645878728 +0000
-@@ -60,9 +60,9 @@
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
-         %{!dynamic-linker: \
--	  %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
--	  %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
--	  %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
-+	  %{mabi=n32: -dynamic-linker /tools/lib32/ld.so.1} \
-+	  %{mabi=64: -dynamic-linker /tools/lib64/ld.so.1} \
-+	  %{mabi=32: -dynamic-linker /tools/lib/ld.so.1}}} \
-       %{static:-static}}} \
- %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
- %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
-diff -Naur gcc-20050116.orig/gcc/config/mn10300/linux.h gcc-20050116/gcc/config/mn10300/linux.h
---- gcc-20050116.orig/gcc/config/mn10300/linux.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/mn10300/linux.h	2005-01-17 00:53:23.477610026 +0000
-@@ -37,7 +37,7 @@
- #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
-    %{!static: \
-      %{rdynamic:-export-dynamic} \
--     %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-+     %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
-    %{static:-static}"
- 
- #undef  LIB_SPEC
-diff -Naur gcc-20050116.orig/gcc/config/pa/pa-linux.h gcc-20050116/gcc/config/pa/pa-linux.h
---- gcc-20050116.orig/gcc/config/pa/pa-linux.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/pa/pa-linux.h	2005-01-17 00:53:45.334495141 +0000
-@@ -88,7 +88,7 @@
-   %{!shared: \
-     %{!static: \
-       %{rdynamic:-export-dynamic} \
--      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-+      %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
-       %{static:-static}}"
- 
- /* glibc's profiling functions don't need gcc to allocate counters.  */
-diff -Naur gcc-20050116.orig/gcc/config/rs6000/linux64.h gcc-20050116/gcc/config/rs6000/linux64.h
---- gcc-20050116.orig/gcc/config/rs6000/linux64.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/rs6000/linux64.h	2005-01-17 00:54:28.524412534 +0000
-@@ -351,11 +351,11 @@
- 
- #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
-   %{rdynamic:-export-dynamic} \
--  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
-+  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
- 
- #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
-   %{rdynamic:-export-dynamic} \
--  %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
-+  %{!dynamic-linker:-dynamic-linker /tools/lib64/ld64.so.1}}}"
- 
- #undef  TOC_SECTION_ASM_OP
- #define TOC_SECTION_ASM_OP \
-diff -Naur gcc-20050116.orig/gcc/config/rs6000/sysv4.h gcc-20050116/gcc/config/rs6000/sysv4.h
---- gcc-20050116.orig/gcc/config/rs6000/sysv4.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/rs6000/sysv4.h	2005-01-17 01:26:39.126999460 +0000
-@@ -1131,7 +1131,7 @@
- 
- #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-   %{rdynamic:-export-dynamic} \
--  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
-+  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
- 
- #if defined(HAVE_LD_EH_FRAME_HDR)
- # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-@@ -1162,7 +1162,7 @@
- 
- #define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
-   %{rdynamic:-export-dynamic} \
--  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
-+  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
- 
- #define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__	\
- %{!undef:					                \
-diff -Naur gcc-20050116.orig/gcc/config/s390/linux.h gcc-20050116/gcc/config/s390/linux.h
---- gcc-20050116.orig/gcc/config/s390/linux.h	2005-01-17 00:45:17.000000000 +0000
-+++ gcc-20050116/gcc/config/s390/linux.h	2005-01-17 01:26:58.672523211 +0000
-@@ -86,8 +86,8 @@
-       %{!static: \
- 	%{rdynamic:-export-dynamic} \
- 	%{!dynamic-linker: \
--          %{m31:-dynamic-linker /lib/ld.so.1} \
--          %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
-+          %{m31:-dynamic-linker /tools/lib/ld.so.1} \
-+          %{m64:-dynamic-linker /tools/lib/ld64.so.1}}}}"
- 
- 
- #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
-diff -Naur gcc-20050116.orig/gcc/config/sh/linux.h gcc-20050116/gcc/config/sh/linux.h
---- gcc-20050116.orig/gcc/config/sh/linux.h	2005-01-17 00:45:18.000000000 +0000
-+++ gcc-20050116/gcc/config/sh/linux.h	2005-01-17 01:27:19.588663163 +0000
-@@ -70,7 +70,7 @@
-   "%{shared:-shared} \
-    %{!static: \
-      %{rdynamic:-export-dynamic} \
--     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-+     %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
-    %{static:-static}"
- 
- #undef LIB_SPEC
-diff -Naur gcc-20050116.orig/gcc/config/sparc/linux.h gcc-20050116/gcc/config/sparc/linux.h
---- gcc-20050116.orig/gcc/config/sparc/linux.h	2005-01-17 00:45:18.000000000 +0000
-+++ gcc-20050116/gcc/config/sparc/linux.h	2005-01-17 01:30:07.282688639 +0000
-@@ -131,13 +131,13 @@
- /* If ELF is the default format, we should not use /lib/elf.  */
- 
- #undef  LINK_SPEC
--#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
-+#define LINK_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \
-   %{!mno-relax:%{!r:-relax}} \
-   %{!shared: \
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-+        %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
-         %{static:-static}}}"
- 
- /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
-diff -Naur gcc-20050116.orig/gcc/config/sparc/linux64.h gcc-20050116/gcc/config/sparc/linux64.h
---- gcc-20050116.orig/gcc/config/sparc/linux64.h	2005-01-17 00:45:18.000000000 +0000
-+++ gcc-20050116/gcc/config/sparc/linux64.h	2005-01-17 01:31:18.242712476 +0000
-@@ -167,21 +167,21 @@
-   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
-   { "link_arch",	 LINK_ARCH_SPEC },
-     
--#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
-+#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
-+        %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
-         %{static:-static}}} \
- "
- 
--#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
-+#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
-+        %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \
-         %{static:-static}}} \
- "
- 
-@@ -257,12 +257,12 @@
- #else /* !SPARC_BI_ARCH */
- 
- #undef LINK_SPEC
--#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
-+#define LINK_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \
-   %{!shared: \
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
-+        %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \
-         %{static:-static}}} \
- %{mlittle-endian:-EL} \
- %{!mno-relax:%{!r:-relax}} \
-diff -Naur gcc-20050116.orig/gcc/config/xtensa/linux.h gcc-20050116/gcc/config/xtensa/linux.h
---- gcc-20050116.orig/gcc/config/xtensa/linux.h	2005-01-17 00:45:18.000000000 +0000
-+++ gcc-20050116/gcc/config/xtensa/linux.h	2005-01-17 01:32:08.951429623 +0000
-@@ -50,7 +50,7 @@
-     %{!ibcs: \
-       %{!static: \
-         %{rdynamic:-export-dynamic} \
--        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
-+        %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
-       %{static:-static}}}"
- 
- #undef LOCAL_LABEL_PREFIX
Index: patches/gcc-4.1.0-cross_search_paths-1.patch
===================================================================
--- patches/gcc-4.1.0-cross_search_paths-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
+++ patches/gcc-4.1.0-cross_search_paths-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
@@ -0,0 +1,49 @@
+Submitted by: Ryan Oliver <ryan.oliver@pha.com.au>
+Date: 2005-05-02
+Initial Package Version: 4.0.1
+Origin: Ryan Oliver (issue reported by Erik-Jan Post)
+        Rediffed against 4.1.0 by Chris Staub
+Upstream Status: N/A
+Description:
+  Removes standard_exec_prefix_2 from library search path when cross-compiling.
+  Removes both standard_exec_prefix_1 and standard_exec_prefix_2 from the gcc
+  executable search path when cross-compiling.
+
+  ie: if cross_compile = 1 in the specs file, do not
+      - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} to the library search path
+      - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} or
+                   /usr/libexec/gcc/${TARGET}/${GCC_VER}
+        to the executable search path
+
+  This avoids the possibility of linking in libraries from the host if they
+  exist under those directories.
+ 
+diff -Naur gcc-4.1.0.orig/gcc/gcc.c gcc-4.1.0/gcc/gcc.c
+--- gcc-4.1.0.orig/gcc/gcc.c	2006-01-21 13:29:08.000000000 -0500
++++ gcc-4.1.0/gcc/gcc.c	2006-02-28 22:20:05.000000000 -0500
+@@ -3818,16 +3818,22 @@
+ 	      PREFIX_PRIORITY_LAST, 2, 0);
+   add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
+ 	      PREFIX_PRIORITY_LAST, 2, 0);
+-  add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
++  if (*cross_compile == '0')
++    {
++      add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
+ 	      PREFIX_PRIORITY_LAST, 2, 0);
+-  add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
++      add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
+ 	      PREFIX_PRIORITY_LAST, 2, 0);
++    }
+ #endif
+ 
+   add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
+ 	      PREFIX_PRIORITY_LAST, 1, 0);
+-  add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
++  if (*cross_compile == '0')
++    {
++      add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
+ 	      PREFIX_PRIORITY_LAST, 1, 0);
++    }
+ 
+   tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
+ 			   dir_separator_str, NULL);
Index: patches/gcc-4.1.0-posix-1.patch
===================================================================
--- patches/gcc-4.1.0-posix-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
+++ patches/gcc-4.1.0-posix-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
@@ -0,0 +1,201 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-08-27
+Initial Package Version: 4.0.1
+Origin: Jim Gifford
+        Rediffed against 4.1.0 by Chris Staub
+Upstream Status: On Hold
+Description: Makes GCC Posix Compliant
+ 
+diff -Naur gcc-4.1.0.orig/contrib/test_summary gcc-4.1.0/contrib/test_summary
+--- gcc-4.1.0.orig/contrib/test_summary	2004-08-26 01:51:22.000000000 -0400
++++ gcc-4.1.0/contrib/test_summary	2006-02-28 22:08:16.000000000 -0500
+@@ -106,7 +106,7 @@
+     srcdir = configflags;
+     sub(/\/configure .*/, "", srcdir);
+     printf "LAST_UPDATED: ";
+-    system("tail -1 " srcdir "/LAST_UPDATED");
++    system("tail -n 1 " srcdir "/LAST_UPDATED");
+     print "";
+ 
+     sub(/^[^ ]*\/configure */, " ", configflags);
+diff -Naur gcc-4.1.0.orig/gcc/configure gcc-4.1.0/gcc/configure
+--- gcc-4.1.0.orig/gcc/configure	2006-02-14 11:50:45.000000000 -0500
++++ gcc-4.1.0/gcc/configure	2006-02-28 22:08:16.000000000 -0500
+@@ -14318,7 +14318,7 @@
+   # and we got the correct data, then succeed.
+   if test x$gcc_cv_objdump != x \
+   && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
+-     | tail -3 > conftest.got \
++     | tail -n 3 > conftest.got \
+   && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+     || cmp conftest.big conftest.got > /dev/null 2>&1; }
+   then
+diff -Naur gcc-4.1.0.orig/gcc/configure.ac gcc-4.1.0/gcc/configure.ac
+--- gcc-4.1.0.orig/gcc/configure.ac	2006-02-14 11:50:45.000000000 -0500
++++ gcc-4.1.0/gcc/configure.ac	2006-02-28 22:08:16.000000000 -0500
+@@ -2124,7 +2124,7 @@
+   # and we got the correct data, then succeed.
+   if test x$gcc_cv_objdump != x \
+   && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
+-     | tail -3 > conftest.got \
++     | tail -n 3 > conftest.got \
+   && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+     || cmp conftest.big conftest.got > /dev/null 2>&1; }
+   then
+diff -Naur gcc-4.1.0.orig/libjava/configure gcc-4.1.0/libjava/configure
+--- gcc-4.1.0.orig/libjava/configure	2006-02-28 03:39:11.000000000 -0500
++++ gcc-4.1.0/libjava/configure	2006-02-28 22:08:16.000000000 -0500
+@@ -6736,8 +6736,8 @@
+ echo $ECHO_N "checking whether 'ld' is at least 2.13... $ECHO_C" >&6
+ LD_PROG=`$CC --print-prog-name=ld`
+ LD_VERSION=`$LD_PROG --version`
+-LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
+-LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
++LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
++LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2`
+ if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
+   LD_OK="ok"
+ else
+diff -Naur gcc-4.1.0.orig/libjava/mingwld.m4 gcc-4.1.0/libjava/mingwld.m4
+--- gcc-4.1.0.orig/libjava/mingwld.m4	2005-08-22 18:36:35.000000000 -0400
++++ gcc-4.1.0/libjava/mingwld.m4	2006-02-28 22:08:16.000000000 -0500
+@@ -3,8 +3,8 @@
+ AC_MSG_CHECKING(whether 'ld' is at least 2.13)
+ LD_PROG=`$CC --print-prog-name=ld`
+ LD_VERSION=`$LD_PROG --version`
+-LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
+-LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
++LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
++LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2`
+ if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
+   LD_OK="ok"
+ else
+diff -Naur gcc-4.1.0.orig/libstdc++-v3/acinclude.m4 gcc-4.1.0/libstdc++-v3/acinclude.m4
+--- gcc-4.1.0.orig/libstdc++-v3/acinclude.m4	2006-01-19 17:55:55.000000000 -0500
++++ gcc-4.1.0/libstdc++-v3/acinclude.m4	2006-02-28 22:08:16.000000000 -0500
+@@ -223,7 +223,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+   changequote(,)
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n 1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+   changequote([,])
+   glibcxx_gnu_ld_version=`echo $ldver | \
+diff -Naur gcc-4.1.0.orig/libstdc++-v3/configure gcc-4.1.0/libstdc++-v3/configure
+--- gcc-4.1.0.orig/libstdc++-v3/configure	2006-01-19 17:55:55.000000000 -0500
++++ gcc-4.1.0/libstdc++-v3/configure	2006-02-28 22:08:16.000000000 -0500
+@@ -8201,7 +8201,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -53040,7 +53040,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -74372,7 +74372,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -75867,7 +75867,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -77238,7 +77238,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -79396,7 +79396,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -80720,7 +80720,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -82093,7 +82093,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -83858,7 +83858,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+@@ -85944,7 +85944,7 @@
+   # Start by getting the version number.  I think the libtool test already
+   # does some of this, but throws away the result.
+ 
+-  ldver=`$LD --version 2>/dev/null | head -1 | \
++  ldver=`$LD --version 2>/dev/null | head -n -1 | \
+          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+ 
+   glibcxx_gnu_ld_version=`echo $ldver | \
+diff -Naur gcc-4.1.0.orig/ltcf-c.sh gcc-4.1.0/ltcf-c.sh
+--- gcc-4.1.0.orig/ltcf-c.sh	2005-11-18 17:53:08.000000000 -0500
++++ gcc-4.1.0/ltcf-c.sh	2006-02-28 22:08:16.000000000 -0500
+@@ -153,7 +153,7 @@
+     # If the export-symbols file already is a .def file (1st line
+     # is EXPORTS), use it as is.
+     # If DATA tags from a recent dlltool are present, honour them!
+-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
++    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname-def;
+       else
+         echo EXPORTS > $output_objdir/$soname-def;
+diff -Naur gcc-4.1.0.orig/ltcf-gcj.sh gcc-4.1.0/ltcf-gcj.sh
+--- gcc-4.1.0.orig/ltcf-gcj.sh	2005-07-15 22:30:53.000000000 -0400
++++ gcc-4.1.0/ltcf-gcj.sh	2006-02-28 22:08:16.000000000 -0500
+@@ -156,7 +156,7 @@
+     # If the export-symbols file already is a .def file (1st line
+     # is EXPORTS), use it as is.
+     # If DATA tags from a recent dlltool are present, honour them!
+-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
++    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname-def;
+       else
+         echo EXPORTS > $output_objdir/$soname-def;
Index: patches/gcc-4.1.0-pure64-1.patch
===================================================================
--- patches/gcc-4.1.0-pure64-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
+++ patches/gcc-4.1.0-pure64-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
@@ -0,0 +1,151 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-08-27
+Initial Package Version: 4.x
+Origin: Ken Moffat and Jim Gifford
+        Rediffed against 4.1.0 by Chris Staub
+Upstream Status: LFS Specific
+Description: Make LIB64 builds in /lib instead of /lib64 
+
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/linux64.h gcc-4.1.0/gcc/config/i386/linux64.h
+--- gcc-4.1.0.orig/gcc/config/i386/linux64.h	2005-08-10 13:53:01.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/linux64.h	2006-03-01 01:13:54.000000000 -0500
+@@ -60,8 +60,8 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+-      %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++      %{m32:%{!dynamic-linker:-dynamic-linker /lib32/ld-linux.so.2}} \
++      %{!m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux-x86-64.so.2}}} \
+     %{static:-static}}"
+ 
+ /* Similar to standard Linux, but adding -ffast-math support.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/t-linux64 gcc-4.1.0/gcc/config/i386/t-linux64
+--- gcc-4.1.0.orig/gcc/config/i386/t-linux64	2005-08-10 13:53:01.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/t-linux64	2006-03-01 01:13:54.000000000 -0500
+@@ -6,7 +6,7 @@
+ 
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32 
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib
++MULTILIB_OSDIRNAMES = ../lib ../lib32
+ 
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
+diff -Naur gcc-4.1.0.orig/gcc/config/mips/linux64.h gcc-4.1.0/gcc/config/mips/linux64.h
+--- gcc-4.1.0.orig/gcc/config/mips/linux64.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/mips/linux64.h	2006-03-01 01:13:54.000000000 -0500
+@@ -47,9 +47,9 @@
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+         %{!dynamic-linker: \
+-	  %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
+-	  %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
+-	  %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
++	  %{mabi=n32: -dynamic-linker /lib64/ld.so.1} \
++	  %{mabi=64: -dynamic-linker /lib/ld.so.1} \
++	  %{mabi=32: -dynamic-linker /lib32/ld.so.1}}} \
+       %{static:-static}}} \
+ %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
+ %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
+diff -Naur gcc-4.1.0.orig/gcc/config/mips/t-linux64 gcc-4.1.0/gcc/config/mips/t-linux64
+--- gcc-4.1.0.orig/gcc/config/mips/t-linux64	2006-02-17 16:38:59.000000000 -0500
++++ gcc-4.1.0/gcc/config/mips/t-linux64	2006-03-01 01:13:54.000000000 -0500
+@@ -1,6 +1,6 @@
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+ MULTILIB_DIRNAMES = n32 32 64
+-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
++MULTILIB_OSDIRNAMES = ../lib64 ../lib32 ../lib
+ 
+ EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
+ 
+diff -Naur gcc-4.1.0.orig/gcc/config/rs6000/linux64.h gcc-4.1.0/gcc/config/rs6000/linux64.h
+--- gcc-4.1.0.orig/gcc/config/rs6000/linux64.h	2006-02-10 15:58:33.000000000 -0500
++++ gcc-4.1.0/gcc/config/rs6000/linux64.h	2006-03-01 01:13:54.000000000 -0500
+@@ -339,11 +339,11 @@
+ 
+ #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /lib32/ld.so.1}}}"
+ 
+ #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /lib/ld64.so.1}}}"
+ 
+ #undef  TOC_SECTION_ASM_OP
+ #define TOC_SECTION_ASM_OP \
+diff -Naur gcc-4.1.0.orig/gcc/config/rs6000/t-linux64 gcc-4.1.0/gcc/config/rs6000/t-linux64
+--- gcc-4.1.0.orig/gcc/config/rs6000/t-linux64	2006-02-10 15:58:33.000000000 -0500
++++ gcc-4.1.0/gcc/config/rs6000/t-linux64	2006-03-01 01:13:54.000000000 -0500
+@@ -11,7 +11,7 @@
+ MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
+ MULTILIB_EXCEPTIONS     = m64/msoft-float
+ MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES	= ../lib64 ../lib nof
++MULTILIB_OSDIRNAMES	= ../lib ../lib32 nof
+ MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
+ 
+ # We want fine grained libraries, so use the new code to build the
+diff -Naur gcc-4.1.0.orig/gcc/config/sparc/linux64.h gcc-4.1.0/gcc/config/sparc/linux64.h
+--- gcc-4.1.0.orig/gcc/config/sparc/linux64.h	2006-02-11 03:38:51.000000000 -0500
++++ gcc-4.1.0/gcc/config/sparc/linux64.h	2006-03-01 01:13:54.000000000 -0500
+@@ -162,21 +162,21 @@
+   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
+   { "link_arch",	 LINK_ARCH_SPEC },
+     
+-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
++#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib32 %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /lib32/ld-linux.so.2}} \
+         %{static:-static}}} \
+ "
+ 
+-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
++#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+         %{static:-static}}} \
+ "
+ 
+@@ -252,12 +252,12 @@
+ #else /* !SPARC_BI_ARCH */
+ 
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
++#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+         %{static:-static}}} \
+ %{mlittle-endian:-EL} \
+ %{!mno-relax:%{!r:-relax}} \
+diff -Naur gcc-4.1.0.orig/gcc/config/sparc/t-linux64 gcc-4.1.0/gcc/config/sparc/t-linux64
+--- gcc-4.1.0.orig/gcc/config/sparc/t-linux64	2004-04-01 11:05:22.000000000 -0500
++++ gcc-4.1.0/gcc/config/sparc/t-linux64	2006-03-01 01:13:54.000000000 -0500
+@@ -1,6 +1,6 @@
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32
+-MULTILIB_OSDIRNAMES = ../lib64 ../lib
++MULTILIB_OSDIRNAMES = ../lib ../lib32
+ 
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
+@@ -16,4 +16,4 @@
+ 
+ CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \
+ 				 -print-multi-os-directory) \
+-			= x../lib64; then echo -mcmodel=medany; fi`
++			= x../lib; then echo -mcmodel=medany; fi`
Index: patches/gcc-4.1.0-pure64_specs-1.patch
===================================================================
--- patches/gcc-4.1.0-pure64_specs-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
+++ patches/gcc-4.1.0-pure64_specs-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
@@ -0,0 +1,337 @@
+Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
+Date: 2006-01-16
+Initial Package Version: 4.0.0
+Upstream Status: Not Sent - LFS Specfic
+Origin: Idea originally developed by Ryan Oliver and Greg Schafer for
+	the Pure LFS project.
+	More architectures added by Zack Winkles.
+	Further fine tunings by Greg Schafer.
+	Modified for gcc 3.3.2 by Oliver Brakmann.
+        Rediffed against gcc 3.4.0 by Zack Winkles.
+	Rediffed against gcc 3.4.3 by Jim Gifford.
+	Rediffed against gcc 4.0.0 by Robert Connolly.
+        Rediffed against gcc 4.1.0 by Chris Staub
+Description: This patch modifies the location of the dynamic linker for
+	the GCC Pass 2 build in LFS Chapter 5.
+
+diff -Naur gcc-4.1.0.orig/gcc/config/alpha/linux-elf.h gcc-4.1.0/gcc/config/alpha/linux-elf.h
+--- gcc-4.1.0.orig/gcc/config/alpha/linux-elf.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/alpha/linux-elf.h	2006-03-01 01:25:20.000000000 -0500
+@@ -27,7 +27,7 @@
+ #define SUBTARGET_EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+ 
+-#define ELF_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
++#define ELF_DYNAMIC_LINKER	"/tools/lib/ld-linux.so.2"
+ 
+ #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
+   %{O*:-O3} %{!O*:-O1}						\
+diff -Naur gcc-4.1.0.orig/gcc/config/arm/linux-elf.h gcc-4.1.0/gcc/config/arm/linux-elf.h
+--- gcc-4.1.0.orig/gcc/config/arm/linux-elf.h	2005-10-09 21:04:31.000000000 -0400
++++ gcc-4.1.0/gcc/config/arm/linux-elf.h	2006-03-01 01:21:32.000000000 -0500
+@@ -51,7 +51,7 @@
+ 
+ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+ 
+-#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
++#define LINUX_TARGET_INTERPRETER "/tools/lib/ld-linux.so.2"
+ 
+ #define LINUX_TARGET_LINK_SPEC  "%{h*} %{version:-v} \
+    %{b} \
+diff -Naur gcc-4.1.0.orig/gcc/config/frv/linux.h gcc-4.1.0/gcc/config/frv/linux.h
+--- gcc-4.1.0.orig/gcc/config/frv/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/frv/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -41,7 +41,7 @@
+   %{mfdpic: -m elf32frvfd -z text} %{shared} %{pie} \
+   %{!shared: %{!static: \
+    %{rdynamic:-export-dynamic} \
+-   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++   %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+    %{static}}"
+ 
+ /* Support for compile-time default CPU.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/gnu.h gcc-4.1.0/gcc/config/i386/gnu.h
+--- gcc-4.1.0.orig/gcc/config/i386/gnu.h	2004-09-07 20:17:19.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/gnu.h	2006-03-01 01:25:20.000000000 -0500
+@@ -27,7 +27,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker:-dynamic-linker /lib/ld.so}} \
++      %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so}} \
+     %{static:-static}}"
+ 
+ #undef	STARTFILE_SPEC
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/linux.h gcc-4.1.0/gcc/config/i386/linux.h
+--- gcc-4.1.0.orig/gcc/config/i386/linux.h	2005-08-10 13:53:01.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -105,7 +105,7 @@
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #define LINK_EMULATION "elf_i386"
+-#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
+ 
+ #undef  SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/linux64.h gcc-4.1.0/gcc/config/i386/linux64.h
+--- gcc-4.1.0.orig/gcc/config/i386/linux64.h	2005-08-10 13:53:01.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/linux64.h	2006-03-01 01:25:20.000000000 -0500
+@@ -60,8 +60,8 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+-      %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++      %{m32:%{!dynamic-linker:-dynamic-linker /tools/lib32/ld-linux.so.2}} \
++      %{!m32:%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux-x86-64.so.2}}} \
+     %{static:-static}}"
+ 
+ /* Similar to standard Linux, but adding -ffast-math support.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/ia64/linux.h gcc-4.1.0/gcc/config/ia64/linux.h
+--- gcc-4.1.0.orig/gcc/config/ia64/linux.h	2004-09-07 20:17:19.000000000 -0400
++++ gcc-4.1.0/gcc/config/ia64/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -43,7 +43,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
++      %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux-ia64.so.2}} \
+       %{static:-static}}"
+ 
+ 
+diff -Naur gcc-4.1.0.orig/gcc/config/linux.h gcc-4.1.0/gcc/config/linux.h
+--- gcc-4.1.0.orig/gcc/config/linux.h	2005-08-06 09:26:35.000000000 -0400
++++ gcc-4.1.0/gcc/config/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -104,3 +104,7 @@
+ #define TARGET_C99_FUNCTIONS 1
+ 
+ #define TARGET_POSIX_IO
++
++/* Remove /usr/include from the end of the include search path.  */
++#undef STANDARD_INCLUDE_DIR
++#define STANDARD_INCLUDE_DIR 0
+diff -Naur gcc-4.1.0.orig/gcc/config/m32r/linux.h gcc-4.1.0/gcc/config/m32r/linux.h
+--- gcc-4.1.0.orig/gcc/config/m32r/linux.h	2005-07-08 06:00:15.000000000 -0400
++++ gcc-4.1.0/gcc/config/m32r/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -66,7 +66,7 @@
+     %{!ibcs: \
+       %{!static: \
+ 	%{rdynamic:-export-dynamic} \
+-	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+ 	%{static:-static}}}"
+ #else
+ #define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \
+@@ -74,7 +74,7 @@
+     %{!ibcs: \
+       %{!static: \
+ 	%{rdynamic:-export-dynamic} \
+-	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+ 	%{static:-static}}}"
+ #endif
+ 
+diff -Naur gcc-4.1.0.orig/gcc/config/m68k/linux.h gcc-4.1.0/gcc/config/m68k/linux.h
+--- gcc-4.1.0.orig/gcc/config/m68k/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/m68k/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -128,7 +128,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
++      %{!dynamic-linker*:-dynamic-linker /tools/lib/ld.so.1}} \
+     %{static}}"
+ 
+ /* For compatibility with linux/a.out */
+diff -Naur gcc-4.1.0.orig/gcc/config/mips/linux.h gcc-4.1.0/gcc/config/mips/linux.h
+--- gcc-4.1.0.orig/gcc/config/mips/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/mips/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -112,7 +112,7 @@
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+         %{static:-static}}}"
+ 
+ #undef SUBTARGET_ASM_SPEC
+diff -Naur gcc-4.1.0.orig/gcc/config/mips/linux64.h gcc-4.1.0/gcc/config/mips/linux64.h
+--- gcc-4.1.0.orig/gcc/config/mips/linux64.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/mips/linux64.h	2006-03-01 01:25:20.000000000 -0500
+@@ -47,9 +47,9 @@
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+         %{!dynamic-linker: \
+-	  %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
+-	  %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
+-	  %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
++	  %{mabi=n32: -dynamic-linker /tools/lib64/ld.so.1} \
++	  %{mabi=64: -dynamic-linker /tools/lib/ld.so.1} \
++	  %{mabi=32: -dynamic-linker /tools/lib32/ld.so.1}}} \
+       %{static:-static}}} \
+ %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
+ %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
+diff -Naur gcc-4.1.0.orig/gcc/config/mn10300/linux.h gcc-4.1.0/gcc/config/mn10300/linux.h
+--- gcc-4.1.0.orig/gcc/config/mn10300/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/mn10300/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -37,7 +37,7 @@
+ #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+-     %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++     %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+    %{static:-static}"
+ 
+ #undef  PROCESSOR_DEFAULT
+diff -Naur gcc-4.1.0.orig/gcc/config/pa/pa-linux.h gcc-4.1.0/gcc/config/pa/pa-linux.h
+--- gcc-4.1.0.orig/gcc/config/pa/pa-linux.h	2005-11-17 22:22:18.000000000 -0500
++++ gcc-4.1.0/gcc/config/pa/pa-linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -55,7 +55,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++      %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+       %{static:-static}}"
+ 
+ /* glibc's profiling functions don't need gcc to allocate counters.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/rs6000/linux64.h gcc-4.1.0/gcc/config/rs6000/linux64.h
+--- gcc-4.1.0.orig/gcc/config/rs6000/linux64.h	2006-02-10 15:58:33.000000000 -0500
++++ gcc-4.1.0/gcc/config/rs6000/linux64.h	2006-03-01 01:25:20.000000000 -0500
+@@ -339,11 +339,11 @@
+ 
+ #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib32/ld.so.1}}}"
+ 
+ #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib/ld64.so.1}}}"
+ 
+ #undef  TOC_SECTION_ASM_OP
+ #define TOC_SECTION_ASM_OP \
+diff -Naur gcc-4.1.0.orig/gcc/config/rs6000/sysv4.h gcc-4.1.0/gcc/config/rs6000/sysv4.h
+--- gcc-4.1.0.orig/gcc/config/rs6000/sysv4.h	2006-02-10 15:58:33.000000000 -0500
++++ gcc-4.1.0/gcc/config/rs6000/sysv4.h	2006-03-01 01:25:20.000000000 -0500
+@@ -1041,7 +1041,7 @@
+ 
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
+ 
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+ # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+@@ -1072,7 +1072,7 @@
+ 
+ #define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
+ 
+ #define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__	\
+ %{!undef:					                \
+diff -Naur gcc-4.1.0.orig/gcc/config/s390/linux.h gcc-4.1.0/gcc/config/s390/linux.h
+--- gcc-4.1.0.orig/gcc/config/s390/linux.h	2006-02-11 03:38:51.000000000 -0500
++++ gcc-4.1.0/gcc/config/s390/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -86,8 +86,8 @@
+       %{!static: \
+ 	%{rdynamic:-export-dynamic} \
+ 	%{!dynamic-linker: \
+-          %{m31:-dynamic-linker /lib/ld.so.1} \
+-          %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
++          %{m31:-dynamic-linker /tools/lib/ld.so.1} \
++          %{m64:-dynamic-linker /tools/lib/ld64.so.1}}}}"
+ 
+ 
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+diff -Naur gcc-4.1.0.orig/gcc/config/sh/linux.h gcc-4.1.0/gcc/config/sh/linux.h
+--- gcc-4.1.0.orig/gcc/config/sh/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/sh/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -60,7 +60,7 @@
+   "%{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+-     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++     %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+    %{static:-static}"
+ 
+ /* Output assembler code to STREAM to call the profiler.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/sparc/linux.h gcc-4.1.0/gcc/config/sparc/linux.h
+--- gcc-4.1.0.orig/gcc/config/sparc/linux.h	2006-02-11 03:38:51.000000000 -0500
++++ gcc-4.1.0/gcc/config/sparc/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -126,13 +126,13 @@
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #undef  LINK_SPEC
+-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
++#define LINK_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \
+   %{!mno-relax:%{!r:-relax}} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+         %{static:-static}}}"
+ 
+ /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
+diff -Naur gcc-4.1.0.orig/gcc/config/sparc/linux64.h gcc-4.1.0/gcc/config/sparc/linux64.h
+--- gcc-4.1.0.orig/gcc/config/sparc/linux64.h	2006-02-11 03:38:51.000000000 -0500
++++ gcc-4.1.0/gcc/config/sparc/linux64.h	2006-03-01 01:25:20.000000000 -0500
+@@ -162,21 +162,21 @@
+   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
+   { "link_arch",	 LINK_ARCH_SPEC },
+     
+-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
++#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/tools/lib32 %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib32/ld-linux.so.2}} \
+         %{static:-static}}} \
+ "
+ 
+-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
++#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/tools/lib %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+         %{static:-static}}} \
+ "
+ 
+@@ -252,12 +252,12 @@
+ #else /* !SPARC_BI_ARCH */
+ 
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
++#define LINK_SPEC "-m elf64_sparc -Y P,/tools/lib %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+         %{static:-static}}} \
+ %{mlittle-endian:-EL} \
+ %{!mno-relax:%{!r:-relax}} \
+diff -Naur gcc-4.1.0.orig/gcc/config/xtensa/linux.h gcc-4.1.0/gcc/config/xtensa/linux.h
+--- gcc-4.1.0.orig/gcc/config/xtensa/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/xtensa/linux.h	2006-03-01 01:25:20.000000000 -0500
+@@ -50,7 +50,7 @@
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+       %{static:-static}}}"
+ 
+ #undef LOCAL_LABEL_PREFIX
Index: patches/gcc-4.1.0-specs-1.patch
===================================================================
--- patches/gcc-4.1.0-specs-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
+++ patches/gcc-4.1.0-specs-1.patch	(revision e7a7a6fece3fe67080477acfee6d571022e6e0f0)
@@ -0,0 +1,337 @@
+Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
+Date: 2006-02-17
+Initial Package Version: 4.1.0
+Upstream Status: Not Sent - LFS Specific
+Origin: Idea originally developed by Ryan Oliver and Greg Schafer for
+        the Pure LFS project.
+        More architectures added by Zack Winkles.
+        Further fine tunings by Greg Schafer.
+        Modified for gcc 3.3.2 by Oliver Brakmann.
+        Rediffed against gcc 3.4.0 by Zack Winkles.
+        Rediffed against gcc 3.4.3 by Jim Gifford.
+        Rediffed against gcc 4.0.0 by Robert Connolly.
+        Rediffed against gcc 4.1.0 by Chris Staub
+Description: This patch modifies the location of the dynamic linker for
+        the GCC Pass 2 build in LFS Chapter 5.
+
+diff -Naur gcc-4.1.0.orig/gcc/config/alpha/linux-elf.h gcc-4.1.0/gcc/config/alpha/linux-elf.h
+--- gcc-4.1.0.orig/gcc/config/alpha/linux-elf.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/alpha/linux-elf.h	2006-02-28 22:02:20.000000000 -0500
+@@ -27,7 +27,7 @@
+ #define SUBTARGET_EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+ 
+-#define ELF_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
++#define ELF_DYNAMIC_LINKER	"/tools/lib/ld-linux.so.2"
+ 
+ #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
+   %{O*:-O3} %{!O*:-O1}						\
+diff -Naur gcc-4.1.0.orig/gcc/config/arm/linux-elf.h gcc-4.1.0/gcc/config/arm/linux-elf.h
+--- gcc-4.1.0.orig/gcc/config/arm/linux-elf.h	2005-10-09 21:04:31.000000000 -0400
++++ gcc-4.1.0/gcc/config/arm/linux-elf.h	2006-02-28 22:02:20.000000000 -0500
+@@ -51,7 +51,7 @@
+ 
+ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+ 
+-#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
++#define LINUX_TARGET_INTERPRETER "/tools/lib/ld-linux.so.2"
+ 
+ #define LINUX_TARGET_LINK_SPEC  "%{h*} %{version:-v} \
+    %{b} \
+diff -Naur gcc-4.1.0.orig/gcc/config/frv/linux.h gcc-4.1.0/gcc/config/frv/linux.h
+--- gcc-4.1.0.orig/gcc/config/frv/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/frv/linux.h	2006-02-28 22:02:20.000000000 -0500
+@@ -41,7 +41,7 @@
+   %{mfdpic: -m elf32frvfd -z text} %{shared} %{pie} \
+   %{!shared: %{!static: \
+    %{rdynamic:-export-dynamic} \
+-   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++   %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+    %{static}}"
+ 
+ /* Support for compile-time default CPU.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/gnu.h gcc-4.1.0/gcc/config/i386/gnu.h
+--- gcc-4.1.0.orig/gcc/config/i386/gnu.h	2004-09-07 20:17:19.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/gnu.h	2006-02-28 22:02:21.000000000 -0500
+@@ -27,7 +27,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker:-dynamic-linker /lib/ld.so}} \
++      %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so}} \
+     %{static:-static}}"
+ 
+ #undef	STARTFILE_SPEC
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/linux.h gcc-4.1.0/gcc/config/i386/linux.h
+--- gcc-4.1.0.orig/gcc/config/i386/linux.h	2005-08-10 13:53:01.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -105,7 +105,7 @@
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #define LINK_EMULATION "elf_i386"
+-#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
+ 
+ #undef  SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+diff -Naur gcc-4.1.0.orig/gcc/config/i386/linux64.h gcc-4.1.0/gcc/config/i386/linux64.h
+--- gcc-4.1.0.orig/gcc/config/i386/linux64.h	2005-08-10 13:53:01.000000000 -0400
++++ gcc-4.1.0/gcc/config/i386/linux64.h	2006-02-28 22:02:21.000000000 -0500
+@@ -60,8 +60,8 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+-      %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++      %{m32:%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
++      %{!m32:%{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux-x86-64.so.2}}} \
+     %{static:-static}}"
+ 
+ /* Similar to standard Linux, but adding -ffast-math support.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/ia64/linux.h gcc-4.1.0/gcc/config/ia64/linux.h
+--- gcc-4.1.0.orig/gcc/config/ia64/linux.h	2004-09-07 20:17:19.000000000 -0400
++++ gcc-4.1.0/gcc/config/ia64/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -43,7 +43,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
++      %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux-ia64.so.2}} \
+       %{static:-static}}"
+ 
+ 
+diff -Naur gcc-4.1.0.orig/gcc/config/linux.h gcc-4.1.0/gcc/config/linux.h
+--- gcc-4.1.0.orig/gcc/config/linux.h	2005-08-06 09:26:35.000000000 -0400
++++ gcc-4.1.0/gcc/config/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -104,3 +104,7 @@
+ #define TARGET_C99_FUNCTIONS 1
+ 
+ #define TARGET_POSIX_IO
++
++/* Remove /usr/include from the end of the include search path.  */
++#undef STANDARD_INCLUDE_DIR
++#define STANDARD_INCLUDE_DIR 0
+diff -Naur gcc-4.1.0.orig/gcc/config/m32r/linux.h gcc-4.1.0/gcc/config/m32r/linux.h
+--- gcc-4.1.0.orig/gcc/config/m32r/linux.h	2005-07-08 06:00:15.000000000 -0400
++++ gcc-4.1.0/gcc/config/m32r/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -66,7 +66,7 @@
+     %{!ibcs: \
+       %{!static: \
+ 	%{rdynamic:-export-dynamic} \
+-	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+ 	%{static:-static}}}"
+ #else
+ #define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \
+@@ -74,7 +74,7 @@
+     %{!ibcs: \
+       %{!static: \
+ 	%{rdynamic:-export-dynamic} \
+-	%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++	%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+ 	%{static:-static}}}"
+ #endif
+ 
+diff -Naur gcc-4.1.0.orig/gcc/config/m68k/linux.h gcc-4.1.0/gcc/config/m68k/linux.h
+--- gcc-4.1.0.orig/gcc/config/m68k/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/m68k/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -128,7 +128,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
++      %{!dynamic-linker*:-dynamic-linker /tools/lib/ld.so.1}} \
+     %{static}}"
+ 
+ /* For compatibility with linux/a.out */
+diff -Naur gcc-4.1.0.orig/gcc/config/mips/linux.h gcc-4.1.0/gcc/config/mips/linux.h
+--- gcc-4.1.0.orig/gcc/config/mips/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/mips/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -112,7 +112,7 @@
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+         %{static:-static}}}"
+ 
+ #undef SUBTARGET_ASM_SPEC
+diff -Naur gcc-4.1.0.orig/gcc/config/mips/linux64.h gcc-4.1.0/gcc/config/mips/linux64.h
+--- gcc-4.1.0.orig/gcc/config/mips/linux64.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/mips/linux64.h	2006-02-28 22:02:21.000000000 -0500
+@@ -47,9 +47,9 @@
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+         %{!dynamic-linker: \
+-	  %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
+-	  %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
+-	  %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
++	  %{mabi=n32: -dynamic-linker /tools/lib32/ld.so.1} \
++	  %{mabi=64: -dynamic-linker /tools/lib64/ld.so.1} \
++	  %{mabi=32: -dynamic-linker /tools/lib/ld.so.1}}} \
+       %{static:-static}}} \
+ %{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
+ %{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
+diff -Naur gcc-4.1.0.orig/gcc/config/mn10300/linux.h gcc-4.1.0/gcc/config/mn10300/linux.h
+--- gcc-4.1.0.orig/gcc/config/mn10300/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/mn10300/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -37,7 +37,7 @@
+ #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+-     %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++     %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+    %{static:-static}"
+ 
+ #undef  PROCESSOR_DEFAULT
+diff -Naur gcc-4.1.0.orig/gcc/config/pa/pa-linux.h gcc-4.1.0/gcc/config/pa/pa-linux.h
+--- gcc-4.1.0.orig/gcc/config/pa/pa-linux.h	2005-11-17 22:22:18.000000000 -0500
++++ gcc-4.1.0/gcc/config/pa/pa-linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -55,7 +55,7 @@
+   %{!shared: \
+     %{!static: \
+       %{rdynamic:-export-dynamic} \
+-      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++      %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+       %{static:-static}}"
+ 
+ /* glibc's profiling functions don't need gcc to allocate counters.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/rs6000/linux64.h gcc-4.1.0/gcc/config/rs6000/linux64.h
+--- gcc-4.1.0.orig/gcc/config/rs6000/linux64.h	2006-02-10 15:58:33.000000000 -0500
++++ gcc-4.1.0/gcc/config/rs6000/linux64.h	2006-02-28 22:02:21.000000000 -0500
+@@ -339,11 +339,11 @@
+ 
+ #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
+ 
+ #define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib64/ld64.so.1}}}"
+ 
+ #undef  TOC_SECTION_ASM_OP
+ #define TOC_SECTION_ASM_OP \
+diff -Naur gcc-4.1.0.orig/gcc/config/rs6000/sysv4.h gcc-4.1.0/gcc/config/rs6000/sysv4.h
+--- gcc-4.1.0.orig/gcc/config/rs6000/sysv4.h	2006-02-10 15:58:33.000000000 -0500
++++ gcc-4.1.0/gcc/config/rs6000/sysv4.h	2006-02-28 22:02:21.000000000 -0500
+@@ -1041,7 +1041,7 @@
+ 
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
+ 
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+ # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+@@ -1072,7 +1072,7 @@
+ 
+ #define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+-  %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
++  %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
+ 
+ #define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__	\
+ %{!undef:					                \
+diff -Naur gcc-4.1.0.orig/gcc/config/s390/linux.h gcc-4.1.0/gcc/config/s390/linux.h
+--- gcc-4.1.0.orig/gcc/config/s390/linux.h	2006-02-11 03:38:51.000000000 -0500
++++ gcc-4.1.0/gcc/config/s390/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -86,8 +86,8 @@
+       %{!static: \
+ 	%{rdynamic:-export-dynamic} \
+ 	%{!dynamic-linker: \
+-          %{m31:-dynamic-linker /lib/ld.so.1} \
+-          %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
++          %{m31:-dynamic-linker /tools/lib/ld.so.1} \
++          %{m64:-dynamic-linker /tools/lib/ld64.so.1}}}}"
+ 
+ 
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+diff -Naur gcc-4.1.0.orig/gcc/config/sh/linux.h gcc-4.1.0/gcc/config/sh/linux.h
+--- gcc-4.1.0.orig/gcc/config/sh/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/sh/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -60,7 +60,7 @@
+   "%{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+-     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++     %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+    %{static:-static}"
+ 
+ /* Output assembler code to STREAM to call the profiler.  */
+diff -Naur gcc-4.1.0.orig/gcc/config/sparc/linux.h gcc-4.1.0/gcc/config/sparc/linux.h
+--- gcc-4.1.0.orig/gcc/config/sparc/linux.h	2006-02-11 03:38:51.000000000 -0500
++++ gcc-4.1.0/gcc/config/sparc/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -126,13 +126,13 @@
+ /* If ELF is the default format, we should not use /lib/elf.  */
+ 
+ #undef  LINK_SPEC
+-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
++#define LINK_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \
+   %{!mno-relax:%{!r:-relax}} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+         %{static:-static}}}"
+ 
+ /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
+diff -Naur gcc-4.1.0.orig/gcc/config/sparc/linux64.h gcc-4.1.0/gcc/config/sparc/linux64.h
+--- gcc-4.1.0.orig/gcc/config/sparc/linux64.h	2006-02-11 03:38:51.000000000 -0500
++++ gcc-4.1.0/gcc/config/sparc/linux64.h	2006-02-28 22:02:21.000000000 -0500
+@@ -162,21 +162,21 @@
+   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
+   { "link_arch",	 LINK_ARCH_SPEC },
+     
+-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
++#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+         %{static:-static}}} \
+ "
+ 
+-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
++#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \
+         %{static:-static}}} \
+ "
+ 
+@@ -252,12 +252,12 @@
+ #else /* !SPARC_BI_ARCH */
+ 
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
++#define LINK_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \
+         %{static:-static}}} \
+ %{mlittle-endian:-EL} \
+ %{!mno-relax:%{!r:-relax}} \
+diff -Naur gcc-4.1.0.orig/gcc/config/xtensa/linux.h gcc-4.1.0/gcc/config/xtensa/linux.h
+--- gcc-4.1.0.orig/gcc/config/xtensa/linux.h	2005-06-24 21:22:41.000000000 -0400
++++ gcc-4.1.0/gcc/config/xtensa/linux.h	2006-02-28 22:02:21.000000000 -0500
+@@ -50,7 +50,7 @@
+     %{!ibcs: \
+       %{!static: \
+         %{rdynamic:-export-dynamic} \
+-        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
++        %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
+       %{static:-static}}}"
+ 
+ #undef LOCAL_LABEL_PREFIX
