Index: tches/gcc-4.1.0-PR20425-1.patch
===================================================================
--- patches/gcc-4.1.0-PR20425-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,1102 +1,0 @@
-Submitted By: Ryan Oliver <ryan at pha dot com dot au>
-Date: 2006-03-10
-Initial Package Version: 4.1.0
-Origin: GCC SVN Revision 108635 (diffed against 4.1.0 release)
-Upstream Status: In GCC trunk
-Description: Fix for PR20425
-
-From http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00818.html
----------------------------------8<------------------------------------
-This gives the gcc driver a new path iteration function, for_each_path,
-and uses it everywhere, making path iteration a little more consistent.
-for_each_path uses the same path ordering as the existing find_file
-function.  I've also tweaked some of the existing find_a_file calls for
-consistency, and uncovered and fixed some other bugs..
-
-Functional changes are:
-
-o  %D library paths are printed in the same order as gcc uses elsewhere
-   when searching library directories, ie. all multilib paths are first.
-   http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02044.html effectively
-   reverted by the rewrite because I believe the same speedup is gained
-   by searching the right dirs first.
-
-o  gcc -print-search-dirs prints library multilib paths followed by
-   non-multilib paths where before we just printed non-multilib paths.
-
-o  LIBRARY_PATH_ENV similarly includes multilib directories.
-
-o  All searches of startfile_prefixes now look in multilib dirs first
-   followed by non-multilib dirs.  This changes the dirs we search for
-   spec files, and %include and %include_noerr in specs.  Previously
-   we only searched the non-multilib dirs for specs files.  I think this
-   change is worthwhile just for consistency, and the extension is
-   reasonable.  For instance, it would allow different spec files to be
-   used for gcc -m64 vs. gcc -m32.  However, if others think this wrong,
-   I won't argue.  Consistency isn't everything.
-
-o  Some attempt made to prevent searching of duplicate paths.  The old
-   find_file would search some paths twice (when multilib_dir was NULL
-   but multilib_os_dir non-NULL).  We still search twice in some cases,
-   eg. /usr/lib/../lib and /usr/lib are considered different paths.
-
-o  find_a_file with last param (do_multi) true now searches both
-   multilib and non-multilib paths.  Before, do_multi (well, the old
-   param name was multilib) meant just search multilib paths.  This
-   isn't a user-visible change as the only place where find_a_file was
-   invoked with the last param true was from find_file, where we
-   immediately followed with a non-multilib find_a_file.
-
-o  Memory leaks fixed in is_directory.
-
-o  LIBRARY_PATH_ENV and COMPILER_PATH now only have existing
-   directories, making LIBRARY_PATH_ENV closer to %D paths.  The
-   following lines (which I remove) in is_directory meant that
-   is_directory didn't do much for LIBRARY_PATH_ENV, except on
-   SMALL_ARG_MAX machines.
-
-  4278        ian #ifndef SMALL_ARG_MAX
-  4278        ian   if (! linker)
-  4278        ian     return 1;
-  4278        ian #endif
-
-   I'll also remove mention of SMALL_ARG_MAX in config and doc files
-   when I commit this change as this is the only place it is used.
-
-o  gcc -Bnon-dir-prefix- now works properly.  The previously mentioned
-   is_directory peculiarity affected the following code.
-
- 43664      nickc /* Catch the case where the user has forgotten to append a
- 46063      jsm28    directory separator to the path.  Note, they may be using
- 43664      nickc    -B to add an executable name prefix, eg "i386-elf-", in
- 43664      nickc    order to distinguish between multiple installations of
- 43664      nickc    GCC in the same directory.  Hence we must check to see
- 43664      nickc    if appending a directory separator actually makes a
- 43664      nickc    valid directory name.  */
- 43664      nickc if (! IS_DIR_SEPARATOR (value [len - 1])
- 43664      nickc     && is_directory (value, "", 0))
- 43664      nickc   {
- 43767      ghazi     char *tmp = xmalloc (len + 2);
- 43767      ghazi     strcpy (tmp, value);
- 43767      ghazi     tmp[len] = DIR_SEPARATOR;
- 43767      ghazi     tmp[++ len] = 0;
- 43767      ghazi     value = tmp;
- 43664      nickc   }
-
-Bootstrapped and regression tested powerpc64-linux and powerpc-linux on
-a previous iteration of this patch missing is_directory fixes.
-Currently running tests on this patch.
----------------------------------8<------------------------------------
-
-diff -uNr gcc-4.1.0/gcc/ChangeLog gcc-4.1.0-PR20425/gcc/ChangeLog
---- gcc-4.1.0/gcc/ChangeLog	2006-02-28 19:28:30.000000000 +1100
-+++ gcc-4.1.0-PR20425/gcc/ChangeLog	2006-03-10 23:56:57.000000000 +1100
-@@ -1,3 +1,31 @@
-+2006-03-10  Ryan Oliver <ryan@linuxfromscratch.org>
-+	Backport:
-+	2005-12-16  Alan Modra  <amodra@bigpond.net.au>
-+	PR driver/20425
-+	* gcc.c (for_each_path): New function.
-+	(add_to_obstack, file_at_path): New functions.
-+	(struct file_at_path_info, struct add_to_obstack_info): New.
-+	(build_search_list): Rewrite using for_each_path.  Constify struct
-+	path_prefix pointer.  Add do_multi param.  Adjust all callers.
-+	(find_a_file): Similarly, but just change existing param to bool.
-+	(putenv_from_prefixes): Add do_multi param, make "paths" const.
-+	(do_spec_path): Delete.
-+	(struct spec_path_info): New.
-+	(spec_path): New function.
-+	(do_spec_1): Use for_each_path for %D and %I.
-+	(find_file): Adjust for find_a_file changes.
-+	(main): Search multilibs for specs.  Print multilib lib path for
-+	-print-search-dirs.  Likewise add multilibs to LIBRARY_PATH_ENV.
-+	(read_specs): Search multilibs for %include and %include_noerr.
-+	(is_directory): Remove second string param.  Change last param
-+	to a bool.  Don't use concat.  Remove SMALL_ARG_MAX test, always
-+	check path is a dir.  Update all callers.
-+	* doc/hostconfig.texi (SMALL_ARG_MAX): Remove mention.
-+	* system.h (SMALL_ARG_MAX): Poison.
-+	* config.gcc: Don't define SMALL_ARG_MAX.
-+	* config.host: Likewise.
-+	* config.build: Likewise.
-+
- 2006-02-28  Release Manager
- 
- 	* GCC 4.1.0 released.
-diff -uNr gcc-4.1.0/gcc/config.build gcc-4.1.0-PR20425/gcc/config.build
---- gcc-4.1.0/gcc/config.build	2005-06-25 12:02:01.000000000 +1000
-+++ gcc-4.1.0-PR20425/gcc/config.build	2006-03-10 23:47:02.000000000 +1100
-@@ -90,15 +90,10 @@
-     build_install_headers_dir=install-headers-cpio
-     ;;
-   i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4* )
--    build_xm_defines="SMALL_ARG_MAX"
-     build_install_headers_dir=install-headers-cpio
-     ;;
--  i[34567]86-*-solaris2*)
--    build_xm_defines="SMALL_ARG_MAX"
--    ;;
-   i[34567]86-*-sysv4*) 
-     # Intel x86 running system V r4
--    build_xm_defines="SMALL_ARG_MAX"
-     build_install_headers_dir=install-headers-cpio
-     ;;
-   i[34567]86-*-udk*) 
-diff -uNr gcc-4.1.0/gcc/config.gcc gcc-4.1.0-PR20425/gcc/config.gcc
---- gcc-4.1.0/gcc/config.gcc	2006-02-07 03:07:46.000000000 +1100
-+++ gcc-4.1.0-PR20425/gcc/config.gcc	2006-03-10 23:47:20.000000000 +1100
-@@ -994,7 +994,6 @@
- 	then
- 		tm_file="${tm_file} usegas.h"
- 	fi
--	xm_defines="SMALL_ARG_MAX"
- 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ptx4.h i386/ptx4-i.h"
- 	tmake_file=t-svr4
- 	extra_parts="crtbegin.o crtend.o"
-@@ -1125,7 +1124,6 @@
- 	use_fixproto=yes
- 	;;
- i[34567]86-*-solaris2*)
--	xm_defines="SMALL_ARG_MAX"
- 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h"
- 	case ${target} in
- 	*-*-solaris2.[0-6] | *-*-solaris2.[0-6].*)
-@@ -1192,7 +1190,6 @@
- 	use_fixproto=yes
-        ;;
- i[34567]86-*-sysv4*)		# Intel 80386's running system V.4
--	xm_defines="SMALL_ARG_MAX"
- 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv4-cpp.h"
- 	if test x$stabs = xyes
- 	then
-diff -uNr gcc-4.1.0/gcc/config.host gcc-4.1.0-PR20425/gcc/config.host
---- gcc-4.1.0/gcc/config.host	2006-02-06 03:18:20.000000000 +1100
-+++ gcc-4.1.0-PR20425/gcc/config.host	2006-03-10 23:47:52.000000000 +1100
-@@ -135,17 +135,10 @@
-   i370-*-opened* | i370-*-mvs* ) # IBM 360/370/390 Architecture
-     host_xm_defines='FATAL_EXIT_CODE=12'
-     ;;
--  i[34567]86-sequent-ptx4*)
--    host_xm_defines="SMALL_ARG_MAX"
--    ;;
-   i[34567]86-*-solaris2*)
--    host_xm_defines="SMALL_ARG_MAX"
-     out_host_hook_obj=host-solaris.o
-     host_xmake_file=x-solaris
-     ;;
--  i[34567]86-*-sysv4*) # Intel 80386's running System V Release 4
--    host_xm_defines="SMALL_ARG_MAX"
--    ;;
-   i[34567]86-pc-msdosdjgpp*)
-     host_xm_file=i386/xm-djgpp.h
-     host_exeext=.exe
-diff -uNr gcc-4.1.0/gcc/doc/hostconfig.texi gcc-4.1.0-PR20425/gcc/doc/hostconfig.texi
---- gcc-4.1.0/gcc/doc/hostconfig.texi	2004-11-24 15:31:58.000000000 +1100
-+++ gcc-4.1.0-PR20425/gcc/doc/hostconfig.texi	2006-03-10 23:48:20.000000000 +1100
-@@ -208,11 +208,6 @@
- If defined, a C statement (sans semicolon) that performs host-dependent
- initialization when a compilation driver is being initialized.
- 
--@item SMALL_ARG_MAX
--Define this macro if the host system has a small limit on the total
--size of an argument vector.  This causes the driver to take more care
--not to pass unnecessary arguments to subprocesses.
--
- @item HOST_LONG_LONG_FORMAT
- If defined, the string used to indicate an argument of type @code{long
- long} to functions like @code{printf}.  The default value is
-diff -uNr gcc-4.1.0/gcc/gcc.c gcc-4.1.0-PR20425/gcc/gcc.c
---- gcc-4.1.0/gcc/gcc.c	2006-01-22 05:29:08.000000000 +1100
-+++ gcc-4.1.0-PR20425/gcc/gcc.c	2006-03-10 22:14:35.000000000 +1100
-@@ -287,10 +287,12 @@
- static void read_specs (const char *, int);
- static void set_spec (const char *, const char *);
- static struct compiler *lookup_compiler (const char *, size_t, const char *);
--static char *build_search_list (struct path_prefix *, const char *, int);
--static void putenv_from_prefixes (struct path_prefix *, const char *);
-+static char *build_search_list (const struct path_prefix *, const char *,
-+				bool, bool);
-+static void putenv_from_prefixes (const struct path_prefix *, const char *,
-+				  bool);
- static int access_check (const char *, int);
--static char *find_a_file (struct path_prefix *, const char *, int, int);
-+static char *find_a_file (const struct path_prefix *, const char *, int, bool);
- static void add_prefix (struct path_prefix *, const char *, const char *,
- 			int, int, int);
- static void add_sysrooted_prefix (struct path_prefix *, const char *,
-@@ -313,13 +315,12 @@
- static const char *handle_spec_function (const char *);
- static char *save_string (const char *, int);
- static void set_collect_gcc_options (void);
--static void do_spec_path (struct prefix_list *, const char *, int, int, int, const char *, const char *);
- static int do_spec_1 (const char *, int, const char *);
- static int do_spec_2 (const char *);
- static void do_option_spec (const char *, const char *);
- static void do_self_spec (const char *);
- static const char *find_file (const char *);
--static int is_directory (const char *, const char *, int);
-+static int is_directory (const char *, bool);
- static const char *validate_switches (const char *);
- static void validate_all_switches (void);
- static inline void validate_switches_from_spec (const char *);
-@@ -2036,7 +2037,7 @@
- 		       (long) (p1 - buffer + 1));
- 
- 	      p[-2] = '\0';
--	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, 0);
-+	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
- 	      read_specs (new_filename ? new_filename : p1, FALSE);
- 	      continue;
- 	    }
-@@ -2055,7 +2056,7 @@
- 		       (long) (p1 - buffer + 1));
- 
- 	      p[-2] = '\0';
--	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, 0);
-+	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
- 	      if (new_filename)
- 		read_specs (new_filename, FALSE);
- 	      else if (verbose_flag)
-@@ -2352,65 +2353,214 @@
-   failure_delete_queue = 0;
- }
- 
-
--/* Build a list of search directories from PATHS.
--   PREFIX is a string to prepend to the list.
--   If CHECK_DIR_P is nonzero we ensure the directory exists.
--   This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
--   It is also used by the --print-search-dirs flag.  */
--
--static char *
--build_search_list (struct path_prefix *paths, const char *prefix,
--		   int check_dir_p)
-+/* Call CALLBACK for each path in PATHS, breaking out early if CALLBACK
-+   returns non-NULL.
-+   If DO_MULTI is true iterate over the paths twice, first with multilib
-+   suffix then without, otherwise iterate over the paths once without
-+   adding a multilib suffix.  When DO_MULTI is true, some attempt is made
-+   to avoid visiting the same path twice, but we could do better.  For
-+   instance, /usr/lib/../lib is considered different from /usr/lib.
-+   At least EXTRA_SPACE chars past the end of the path passed to
-+   CALLBACK are available for use by the callback.
-+   CALLBACK_INFO allows extra parameters to be passed to CALLBACK.
-+
-+   Returns the value returned by CALLBACK.  */
-+
-+static void *
-+for_each_path (const struct path_prefix *paths,
-+	       bool do_multi,
-+	       size_t extra_space,
-+	       void *(*callback) (char *, void *),
-+	       void *callback_info)
- {
--  int suffix_len = (machine_suffix) ? strlen (machine_suffix) : 0;
--  int just_suffix_len
--    = (just_machine_suffix) ? strlen (just_machine_suffix) : 0;
--  int first_time = TRUE;
--  struct prefix_list *pprefix;
--
--  obstack_grow (&collect_obstack, prefix, strlen (prefix));
--  obstack_1grow (&collect_obstack, '=');
-+  struct prefix_list *pl;
-+  const char *multi_dir = NULL;
-+  const char *multi_os_dir = NULL;
-+  const char *multi_suffix;
-+  const char *just_multi_suffix;
-+  char *path = NULL;
-+  void *ret = NULL;
-+  bool skip_multi_dir = false;
-+  bool skip_multi_os_dir = false;
-+
-+  multi_suffix = machine_suffix;
-+  just_multi_suffix = just_machine_suffix;
-+  if (do_multi && multilib_dir && strcmp (multilib_dir, ".") != 0)
-+    {
-+      multi_dir = concat (multilib_dir, dir_separator_str, NULL);
-+      multi_suffix = concat (multi_suffix, multi_dir, NULL);
-+      just_multi_suffix = concat (just_multi_suffix, multi_dir, NULL);
-+    }
-+  if (do_multi && multilib_os_dir && strcmp (multilib_os_dir, ".") != 0)
-+    multi_os_dir = concat (multilib_os_dir, dir_separator_str, NULL);
- 
--  for (pprefix = paths->plist; pprefix != 0; pprefix = pprefix->next)
-+  while (1)
-     {
--      int len = strlen (pprefix->prefix);
-+      size_t multi_dir_len = 0;
-+      size_t multi_os_dir_len = 0;
-+      size_t suffix_len;
-+      size_t just_suffix_len;
-+      size_t len;
-+
-+      if (multi_dir)
-+	multi_dir_len = strlen (multi_dir);
-+      if (multi_os_dir)
-+	multi_os_dir_len = strlen (multi_os_dir);
-+      suffix_len = strlen (multi_suffix);
-+      just_suffix_len = strlen (just_multi_suffix);
-+
-+      if (path == NULL)
-+	{
-+	  len = paths->max_len + extra_space + 1;
-+	  if (suffix_len > multi_os_dir_len)
-+	    len += suffix_len;
-+	  else
-+	    len += multi_os_dir_len;
-+	  path = xmalloc (len);
-+	}
- 
--      if (machine_suffix
--	  && (! check_dir_p
--	      || is_directory (pprefix->prefix, machine_suffix, 0)))
-+      for (pl = paths->plist; pl != 0; pl = pl->next)
- 	{
--	  if (!first_time)
--	    obstack_1grow (&collect_obstack, PATH_SEPARATOR);
-+	  len = strlen (pl->prefix);
-+	  memcpy (path, pl->prefix, len);
- 
--	  first_time = FALSE;
--	  obstack_grow (&collect_obstack, pprefix->prefix, len);
--	  obstack_grow (&collect_obstack, machine_suffix, suffix_len);
--	}
-+	  /* Look first in MACHINE/VERSION subdirectory.  */
-+	  if (!skip_multi_dir)
-+	    {
-+	      memcpy (path + len, multi_suffix, suffix_len + 1);
-+	      ret = callback (path, callback_info);
-+	      if (ret)
-+		break;
-+	    }
- 
--      if (just_machine_suffix
--	  && pprefix->require_machine_suffix == 2
--	  && (! check_dir_p
--	      || is_directory (pprefix->prefix, just_machine_suffix, 0)))
--	{
--	  if (! first_time)
--	    obstack_1grow (&collect_obstack, PATH_SEPARATOR);
-+	  /* Some paths are tried with just the machine (ie. target)
-+	     subdir.  This is used for finding as, ld, etc.  */
-+	  if (!skip_multi_dir
-+	      && pl->require_machine_suffix == 2)
-+	    {
-+	      memcpy (path + len, just_multi_suffix, just_suffix_len + 1);
-+	      ret = callback (path, callback_info);
-+	      if (ret)
-+		break;
-+	    }
-+
-+	  /* Now try the base path.  */
-+	  if (!pl->require_machine_suffix
-+	      && !(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
-+	    {
-+	      const char *this_multi;
-+	      size_t this_multi_len;
-+
-+	      if (pl->os_multilib)
-+		{
-+		  this_multi = multi_os_dir;
-+		  this_multi_len = multi_os_dir_len;
-+		}
-+	      else
-+		{
-+		  this_multi = multi_dir;
-+		  this_multi_len = multi_dir_len;
-+		}
- 
--	  first_time = FALSE;
--	  obstack_grow (&collect_obstack, pprefix->prefix, len);
--	  obstack_grow (&collect_obstack, just_machine_suffix,
--			just_suffix_len);
-+	      if (this_multi_len)
-+		memcpy (path + len, this_multi, this_multi_len + 1);
-+	      else
-+		path[len] = '\0';
-+
-+	      ret = callback (path, callback_info);
-+	      if (ret)
-+		break;
-+	    }
- 	}
-+      if (pl)
-+	break;
- 
--      if (! pprefix->require_machine_suffix)
--	{
--	  if (! first_time)
--	    obstack_1grow (&collect_obstack, PATH_SEPARATOR);
-+      if (multi_dir == NULL && multi_os_dir == NULL)
-+	break;
- 
--	  first_time = FALSE;
--	  obstack_grow (&collect_obstack, pprefix->prefix, len);
-+      /* Run through the paths again, this time without multilibs.
-+	 Don't repeat any we have already seen.  */
-+      if (multi_dir)
-+	{
-+	  free ((char *) multi_dir);
-+	  multi_dir = NULL;
-+	  free ((char *) multi_suffix);
-+	  multi_suffix = machine_suffix;
-+	  free ((char *) just_multi_suffix);
-+	  just_multi_suffix = just_machine_suffix;
-+	}
-+      else
-+	skip_multi_dir = true;
-+      if (multi_os_dir)
-+	{
-+	  free ((char *) multi_os_dir);
-+	  multi_os_dir = NULL;
- 	}
-+      else
-+	skip_multi_os_dir = true;
-     }
- 
-+  if (multi_dir)
-+    {
-+      free ((char *) multi_dir);
-+      free ((char *) multi_suffix);
-+      free ((char *) just_multi_suffix);
-+    }
-+  if (multi_os_dir)
-+    free ((char *) multi_os_dir);
-+  if (ret != path)
-+    free (path);
-+  return ret;
-+}
-+
-+/* Callback for build_search_list.  Adds path to obstack being built.  */
-+
-+struct add_to_obstack_info {
-+  struct obstack *ob;
-+  bool check_dir;
-+  bool first_time;
-+};
-+
-+static void *
-+add_to_obstack (char *path, void *data)
-+{
-+  struct add_to_obstack_info *info = data;
-+
-+  if (info->check_dir && !is_directory (path, false))
-+    return NULL;
-+
-+  if (!info->first_time)
-+    obstack_1grow (info->ob, PATH_SEPARATOR);
-+
-+  obstack_grow (info->ob, path, strlen (path));
-+
-+  info->first_time = false;
-+  return NULL;
-+}
-+
-+/* Build a list of search directories from PATHS.
-+   PREFIX is a string to prepend to the list.
-+   If CHECK_DIR_P is true we ensure the directory exists.
-+   If DO_MULTI is true, multilib paths are output first, then
-+   non-multilib paths.
-+   This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
-+   It is also used by the --print-search-dirs flag.  */
-+
-+static char *
-+build_search_list (const struct path_prefix *paths, const char *prefix,
-+		   bool check_dir, bool do_multi)
-+{
-+  struct add_to_obstack_info info;
-+
-+  info.ob = &collect_obstack;
-+  info.check_dir = check_dir;
-+  info.first_time = true;
-+
-+  obstack_grow (&collect_obstack, prefix, strlen (prefix));
-+  obstack_1grow (&collect_obstack, '=');
-+
-+  for_each_path (paths, do_multi, 0, add_to_obstack, &info);
-+
-   obstack_1grow (&collect_obstack, '\0');
-   return XOBFINISH (&collect_obstack, char *);
- }
-@@ -2419,9 +2569,10 @@
-    for collect.  */
- 
- static void
--putenv_from_prefixes (struct path_prefix *paths, const char *env_var)
-+putenv_from_prefixes (const struct path_prefix *paths, const char *env_var,
-+		      bool do_multi)
- {
--  putenv (build_search_list (paths, env_var, 1));
-+  putenv (build_search_list (paths, env_var, true, do_multi));
- }
- 
-
- /* Check whether NAME can be accessed in MODE.  This is like access,
-@@ -2442,20 +2593,53 @@
-   return access (name, mode);
- }
- 
-+/* Callback for find_a_file.  Appends the file name to the directory
-+   path.  If the resulting file exists in the right mode, return the
-+   full pathname to the file.  */
-+
-+struct file_at_path_info {
-+  const char *name;
-+  const char *suffix;
-+  int name_len;
-+  int suffix_len;
-+  int mode;
-+};
-+
-+static void *
-+file_at_path (char *path, void *data)
-+{
-+  struct file_at_path_info *info = data;
-+  size_t len = strlen (path);
-+
-+  memcpy (path + len, info->name, info->name_len);
-+  len += info->name_len;
-+
-+  /* Some systems have a suffix for executable files.
-+     So try appending that first.  */
-+  if (info->suffix_len)
-+    {
-+      memcpy (path + len, info->suffix, info->suffix_len + 1);
-+      if (access_check (path, info->mode) == 0)
-+	return path;
-+    }
-+
-+  path[len] = '\0';
-+  if (access_check (path, info->mode) == 0)
-+    return path;
-+
-+  return NULL;
-+}
-+
- /* Search for NAME using the prefix list PREFIXES.  MODE is passed to
--   access to check permissions.
-+   access to check permissions.  If DO_MULTI is true, search multilib
-+   paths then non-multilib paths, otherwise do not search multilib paths.
-    Return 0 if not found, otherwise return its name, allocated with malloc.  */
- 
- static char *
--find_a_file (struct path_prefix *pprefix, const char *name, int mode,
--	     int multilib)
-+find_a_file (const struct path_prefix *pprefix, const char *name, int mode,
-+	     bool do_multi)
- {
--  char *temp;
--  const char *const file_suffix =
--    ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "");
--  struct prefix_list *pl;
--  int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
--  const char *multilib_name, *multilib_os_name;
-+  struct file_at_path_info info;
- 
- #ifdef DEFAULT_ASSEMBLER
-   if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0)
-@@ -2467,112 +2651,24 @@
-     return xstrdup (DEFAULT_LINKER);
- #endif
- 
--  if (machine_suffix)
--    len += strlen (machine_suffix);
--
--  multilib_name = name;
--  multilib_os_name = name;
--  if (multilib && multilib_os_dir)
--    {
--      int len1 = multilib_dir ? strlen (multilib_dir) + 1 : 0;
--      int len2 = strlen (multilib_os_dir) + 1;
--
--      len += len1 > len2 ? len1 : len2;
--      if (multilib_dir)
--	multilib_name = ACONCAT ((multilib_dir, dir_separator_str, name,
--				  NULL));
--      if (strcmp (multilib_os_dir, ".") != 0)
--	multilib_os_name = ACONCAT ((multilib_os_dir, dir_separator_str, name,
--				    NULL));
--    }
--
--  temp = xmalloc (len);
--
-   /* Determine the filename to execute (special case for absolute paths).  */
- 
-   if (IS_ABSOLUTE_PATH (name))
-     {
-       if (access (name, mode) == 0)
--	{
--	  strcpy (temp, name);
--	  return temp;
--	}
--    }
--  else
--    for (pl = pprefix->plist; pl; pl = pl->next)
--      {
--	const char *this_name
--	  = pl->os_multilib ? multilib_os_name : multilib_name;
-+	return xstrdup (name);
- 
--	if (machine_suffix)
--	  {
--	    /* Some systems have a suffix for executable files.
--	       So try appending that first.  */
--	    if (file_suffix[0] != 0)
--	      {
--		strcpy (temp, pl->prefix);
--		strcat (temp, machine_suffix);
--		strcat (temp, multilib_name);
--		strcat (temp, file_suffix);
--		if (access_check (temp, mode) == 0)
--		  return temp;
--	      }
--
--	    /* Now try just the multilib_name.  */
--	    strcpy (temp, pl->prefix);
--	    strcat (temp, machine_suffix);
--	    strcat (temp, multilib_name);
--	    if (access_check (temp, mode) == 0)
--	      return temp;
--	  }
--
--	/* Certain prefixes are tried with just the machine type,
--	   not the version.  This is used for finding as, ld, etc.  */
--	if (just_machine_suffix && pl->require_machine_suffix == 2)
--	  {
--	    /* Some systems have a suffix for executable files.
--	       So try appending that first.  */
--	    if (file_suffix[0] != 0)
--	      {
--		strcpy (temp, pl->prefix);
--		strcat (temp, just_machine_suffix);
--		strcat (temp, multilib_name);
--		strcat (temp, file_suffix);
--		if (access_check (temp, mode) == 0)
--		  return temp;
--	      }
--
--	    strcpy (temp, pl->prefix);
--	    strcat (temp, just_machine_suffix);
--	    strcat (temp, multilib_name);
--	    if (access_check (temp, mode) == 0)
--	      return temp;
--	  }
--
--	/* Certain prefixes can't be used without the machine suffix
--	   when the machine or version is explicitly specified.  */
--	if (! pl->require_machine_suffix)
--	  {
--	    /* Some systems have a suffix for executable files.
--	       So try appending that first.  */
--	    if (file_suffix[0] != 0)
--	      {
--		strcpy (temp, pl->prefix);
--		strcat (temp, this_name);
--		strcat (temp, file_suffix);
--		if (access_check (temp, mode) == 0)
--		  return temp;
--	      }
-+      return NULL;
-+    }
- 
--	    strcpy (temp, pl->prefix);
--	    strcat (temp, this_name);
--	    if (access_check (temp, mode) == 0)
--	      return temp;
--	  }
--      }
-+  info.name = name;
-+  info.suffix = (mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "";
-+  info.name_len = strlen (info.name);
-+  info.suffix_len = strlen (info.suffix);
-+  info.mode = mode;
- 
--  free (temp);
--  return 0;
-+  return for_each_path (pprefix, do_multi, info.name_len + info.suffix_len,
-+			file_at_path, &info);
- }
- 
- /* Ranking of prefixes in the sort list. -B prefixes are put before
-@@ -2691,7 +2787,7 @@
- 
-   commands[0].prog = argbuf[0]; /* first command.  */
-   commands[0].argv = &argbuf[0];
--  string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, 0);
-+  string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, false);
- 
-   if (string)
-     commands[0].argv[0] = string;
-@@ -2706,7 +2802,7 @@
- 	commands[n_commands].prog = argbuf[i + 1];
- 	commands[n_commands].argv = &argbuf[i + 1];
- 	string = find_a_file (&exec_prefixes, commands[n_commands].prog,
--			      X_OK, 0);
-+			      X_OK, false);
- 	if (string)
- 	  commands[n_commands].argv[0] = string;
- 	n_commands++;
-@@ -3643,7 +3739,7 @@
- 		   if appending a directory separator actually makes a
- 		   valid directory name.  */
- 		if (! IS_DIR_SEPARATOR (value [len - 1])
--		    && is_directory (value, "", 0))
-+		    && is_directory (value, false))
- 		  {
- 		    char *tmp = xmalloc (len + 2);
- 		    strcpy (tmp, value);
-@@ -4391,108 +4487,55 @@
-     }
- }
- 
--void
--do_spec_path (struct prefix_list *pl, const char *option,
--	      int omit_if_relative, int separate_options,
--	      int only_subdir,
--	      const char *dir_for_machine_suffix,
--	      const char *dir_for_no_suffix)
--{
--  static size_t bufsize = 0;
--  static char *buffer;
--  int idx;
--  bool multilib_p = false;
--
--  /* Used on systems which record the specified -L dirs
--     and use them to search for dynamic linking.  */
--  /* Relative directories always come from -B,
--     and it is better not to use them for searching
--     at run time.  In particular, stage1 loses.  */
--  if (omit_if_relative
--      && !IS_ABSOLUTE_PATH (pl->prefix))
--    return;
-+/* Callback for processing %D and %I specs.  */
- 
--  /* Try subdirectory if there is one.  */
--  if (machine_suffix && dir_for_machine_suffix)
--    {
--      if (strlen (pl->prefix) + strlen (machine_suffix)
--	  >= bufsize)
--	bufsize = (strlen (pl->prefix)
--		  + strlen (machine_suffix)) * 2 + 1;
--      buffer = xrealloc (buffer, bufsize);
--      strcpy (buffer, pl->prefix);
--      strcat (buffer, machine_suffix);
--      if (is_directory (buffer, dir_for_machine_suffix, 1))
--	{
--	  multilib_p = true;
--	  do_spec_1 (option, separate_options, NULL);
--	  if (separate_options)
--	    do_spec_1 (" ", 0, NULL);
--	  do_spec_1 (buffer, 1, NULL);
--	  do_spec_1 (dir_for_machine_suffix, 1, NULL);
--	  /* Make this a separate argument.  */
--	  do_spec_1 (" ", 0, NULL);
--	}
--    }
--  if (!pl->require_machine_suffix && dir_for_no_suffix)
-+struct spec_path_info {
-+  const char *option;
-+  const char *append;
-+  size_t append_len;
-+  bool omit_relative;
-+  bool separate_options;
-+};
-+
-+static void *
-+spec_path (char *path, void *data)
-+{
-+  struct spec_path_info *info = data;
-+  size_t len = 0;
-+  char save = 0;
-+
-+  if (info->omit_relative && !IS_ABSOLUTE_PATH (path))
-+    return NULL;
-+
-+  if (info->append_len != 0)
-     {
--      if (is_directory (pl->prefix, dir_for_no_suffix, 1))
--	{
--	  multilib_p = true;
--	  do_spec_1 (option, separate_options, NULL);
--	  if (separate_options)
--	    do_spec_1 (" ", 0, NULL);
--	  do_spec_1 (pl->prefix, 1, NULL);
--	  do_spec_1 (dir_for_no_suffix, 1, NULL);
--	  /* Make this a separate argument.  */
--	  do_spec_1 (" ", 0, NULL);
--	}
-+      len = strlen (path);
-+      memcpy (path + len, info->append, info->append_len + 1);
-     }
- 
--  if (only_subdir || multilib_p)
--    return;
-+  if (!is_directory (path, true))
-+    return NULL;
-+
-+  do_spec_1 (info->option, 1, NULL);
-+  if (info->separate_options)
-+    do_spec_1 (" ", 0, NULL);
- 
--  if (machine_suffix)
-+  if (info->append_len == 0)
-     {
--      if (is_directory (pl->prefix, machine_suffix, 1))
--	{
--	  do_spec_1 (option, separate_options, NULL);
--	  if (separate_options)
--	    do_spec_1 (" ", 0, NULL);
--	  do_spec_1 (pl->prefix, 1, NULL);
--	  /* Remove slash from machine_suffix.  */
--	  if (strlen (machine_suffix) >= bufsize)
--	    bufsize = strlen (machine_suffix) * 2 + 1;
--	  buffer = xrealloc (buffer, bufsize);
--	  strcpy (buffer, machine_suffix);
--	  idx = strlen (buffer);
--	  if (IS_DIR_SEPARATOR (buffer[idx - 1]))
--	    buffer[idx - 1] = 0;
--	  do_spec_1 (buffer, 1, NULL);
--	  /* Make this a separate argument.  */
--	  do_spec_1 (" ", 0, NULL);
--	}
--    }
--  if (!pl->require_machine_suffix)
--    {
--      if (is_directory (pl->prefix, "", 1))
--	{
--	  do_spec_1 (option, separate_options, NULL);
--	  if (separate_options)
--	    do_spec_1 (" ", 0, NULL);
--	  /* Remove slash from pl->prefix.  */
--	  if (strlen (pl->prefix) >= bufsize)
--	    bufsize = strlen (pl->prefix) * 2 + 1;
--	  buffer = xrealloc (buffer, bufsize);
--	  strcpy (buffer, pl->prefix);
--	  idx = strlen (buffer);
--	  if (IS_DIR_SEPARATOR (buffer[idx - 1]))
--	    buffer[idx - 1] = 0;
--	  do_spec_1 (buffer, 1, NULL);
--	  /* Make this a separate argument.  */
--	  do_spec_1 (" ", 0, NULL);
--	}
-+      len = strlen (path);
-+      save = path[len - 1];
-+      if (IS_DIR_SEPARATOR (path[len - 1]))
-+	path[len - 1] = '\0';
-     }
-+
-+  do_spec_1 (path, 1, NULL);
-+  do_spec_1 (" ", 0, NULL);
-+
-+  /* Must not damage the original path.  */
-+  if (info->append_len == 0)
-+    path[len - 1] = save;
-+
-+  return NULL;
- }
- 
- /* Process the sub-spec SPEC as a portion of a larger spec.
-@@ -4630,23 +4673,23 @@
- 	     that we search for startfiles.  */
- 	  case 'D':
- 	    {
--	      struct prefix_list *pl = startfile_prefixes.plist;
--
--	      for (; pl; pl = pl->next)
--		{
--		  const char *no_suffix_multilib_dir;
-+	      struct spec_path_info info;
- 
--		  no_suffix_multilib_dir = pl->os_multilib ? multilib_os_dir
--					   : multilib_dir;
--		  /* Do not separate options, include non-multilibbed variant.  */
--		  do_spec_path (pl, "-L",
-+	      info.option = "-L";
-+	      info.append_len = 0;
- #ifdef RELATIVE_PREFIX_NOT_LINKDIR
--				1,
-+	      /* Used on systems which record the specified -L dirs
-+		 and use them to search for dynamic linking.
-+		 Relative directories always come from -B,
-+		 and it is better not to use them for searching
-+		 at run time.  In particular, stage1 loses.  */
-+	      info.omit_relative = true;
- #else
--				0,
-+	      info.omit_relative = false;
- #endif
--				0, 0, multilib_dir, no_suffix_multilib_dir);
--		}
-+	      info.separate_options = false;
-+
-+	      for_each_path (&startfile_prefixes, true, 0, spec_path, &info);
- 	    }
- 	    break;
- 
-@@ -4883,7 +4926,7 @@
- 
- 	  case 'I':
- 	    {
--	      struct prefix_list *pl = include_prefixes.plist;
-+	      struct spec_path_info info;
- 
- 	      if (gcc_exec_prefix)
- 		{
-@@ -4906,9 +4949,14 @@
- 		  do_spec_1 (" ", 0, NULL);
- 		}
- 
--	      for (; pl; pl = pl->next)
--		/* Separate options, don't include non-suffixed variant.  */
--		do_spec_path (pl, "-isystem", 0, 1, 1, "include", "include");
-+	      info.option = "-isystem";
-+	      info.append = "include";
-+	      info.append_len = strlen (info.append);
-+	      info.omit_relative = false;
-+	      info.separate_options = true;
-+
-+	      for_each_path (&include_prefixes, false, info.append_len,
-+			     spec_path, &info);
- 	    }
- 	    break;
- 
-@@ -5894,48 +5942,27 @@
- static const char *
- find_file (const char *name)
- {
--  char *newname;
--
--  /* Try multilib_dir if it is defined.  */
--  if (multilib_os_dir != NULL)
--    {
--      newname = find_a_file (&startfile_prefixes, name, R_OK, 1);
--
--      /* If we don't find it in the multi library dir, then fall
--	 through and look for it in the normal places.  */
--      if (newname != NULL)
--	return newname;
--    }
--
--  newname = find_a_file (&startfile_prefixes, name, R_OK, 0);
-+  char *newname = find_a_file (&startfile_prefixes, name, R_OK, true);
-   return newname ? newname : name;
- }
- 
- /* Determine whether a directory exists.  If LINKER, return 0 for
--   certain fixed names not needed by the linker.  If not LINKER, it is
--   only important to return 0 if the host machine has a small ARG_MAX
--   limit.  */
-+   certain fixed names not needed by the linker.  */
- 
- static int
--is_directory (const char *path1, const char *path2, int linker)
-+is_directory (const char *path1, bool linker)
- {
--  int len1 = strlen (path1);
--  int len2 = strlen (path2);
--  char *path = alloca (3 + len1 + len2);
-+  int len1;
-+  char *path;
-   char *cp;
-   struct stat st;
- 
--#ifndef SMALL_ARG_MAX
--  if (! linker)
--    return 1;
--#endif
--
--  /* Construct the path from the two parts.  Ensure the string ends with "/.".
--     The resulting path will be a directory even if the given path is a
--     symbolic link.  */
-+  /* Ensure the string ends with "/.".  The resulting path will be a
-+     directory even if the given path is a symbolic link.  */
-+  len1 = strlen (path1);
-+  path = alloca (3 + len1);
-   memcpy (path, path1, len1);
--  memcpy (path + len1, path2, len2);
--  cp = path + len1 + len2;
-+  cp = path + len1;
-   if (!IS_DIR_SEPARATOR (cp[-1]))
-     *cp++ = DIR_SEPARATOR;
-   *cp++ = '.';
-@@ -5943,13 +5970,13 @@
- 
-   /* Exclude directories that the linker is known to search.  */
-   if (linker
-+      && IS_DIR_SEPARATOR (path[0])
-       && ((cp - path == 6
--	   && strcmp (path, concat (dir_separator_str, "lib",
--				    dir_separator_str, ".", NULL)) == 0)
-+	   && strncmp (path + 1, "lib", 3) == 0)
- 	  || (cp - path == 10
--	      && strcmp (path, concat (dir_separator_str, "usr",
--				       dir_separator_str, "lib",
--				       dir_separator_str, ".", NULL)) == 0)))
-+	      && strncmp (path + 1, "usr", 3) == 0
-+	      && IS_DIR_SEPARATOR (path[4])
-+	      && strncmp (path + 5, "lib", 3) == 0)))
-     return 0;
- 
-   return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
-@@ -6139,7 +6166,7 @@
- 			   spec_version, dir_separator_str, NULL);
-   just_machine_suffix = concat (spec_machine, dir_separator_str, NULL);
- 
--  specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, 0);
-+  specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, true);
-   /* Read the specs file unless it is a default one.  */
-   if (specs_file != 0 && strcmp (specs_file, "specs"))
-     read_specs (specs_file, TRUE);
-@@ -6275,7 +6302,7 @@
-   for (uptr = user_specs_head; uptr; uptr = uptr->next)
-     {
-       char *filename = find_a_file (&startfile_prefixes, uptr->filename,
--				    R_OK, 0);
-+				    R_OK, true);
-       read_specs (filename ? filename : uptr->filename, FALSE);
-     }
- 
-@@ -6304,8 +6331,10 @@
-   if (print_search_dirs)
-     {
-       printf (_("install: %s%s\n"), standard_exec_prefix, machine_suffix);
--      printf (_("programs: %s\n"), build_search_list (&exec_prefixes, "", 0));
--      printf (_("libraries: %s\n"), build_search_list (&startfile_prefixes, "", 0));
-+      printf (_("programs: %s\n"),
-+	      build_search_list (&exec_prefixes, "", false, false));
-+      printf (_("libraries: %s\n"),
-+	      build_search_list (&startfile_prefixes, "", false, true));
-       return (0);
-     }
- 
-@@ -6622,14 +6651,14 @@
-       /* We'll use ld if we can't find collect2.  */
-       if (! strcmp (linker_name_spec, "collect2"))
- 	{
--	  char *s = find_a_file (&exec_prefixes, "collect2", X_OK, 0);
-+	  char *s = find_a_file (&exec_prefixes, "collect2", X_OK, false);
- 	  if (s == NULL)
- 	    linker_name_spec = "ld";
- 	}
-       /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
- 	 for collect.  */
--      putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH");
--      putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV);
-+      putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH", false);
-+      putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV, true);
- 
-       value = do_spec (link_command_spec);
-       if (value < 0)
-diff -uNr gcc-4.1.0/gcc/system.h gcc-4.1.0-PR20425/gcc/system.h
---- gcc-4.1.0/gcc/system.h	2005-08-16 10:13:53.000000000 +1000
-+++ gcc-4.1.0-PR20425/gcc/system.h	2006-03-10 23:51:31.000000000 +1100
-@@ -728,7 +728,8 @@
-         TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT	   \
-         LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE		   \
- 	TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC	   \
--	PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF
-+	PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF		   \
-+	SMALL_ARG_MAX
- 
- /* Hooks that are no longer used.  */
-  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
Index: tches/gcc-4.1.0-PR26763-1.patch
===================================================================
--- patches/gcc-4.1.0-PR26763-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,104 +1,0 @@
-Submitted By: Jim Gifford (patches at jg555 dot com)
-Date: 2006-04-17
-Initial Package Version: 4.1.0
-Origin: Maintainers
-Upstream Status: Fixed in SVN
-Description: 
-Fixes an optimization error that can result incorrectly code. See PR's below
-
-Issues in CLFS book, this patch fixes the incorrect disk checksums in silo.
-
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27176
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763
- 
-diff -Naur gcc-4.1.0.orig/ChangeLog gcc-4.1.0/ChangeLog
---- gcc-4.1.0.orig/ChangeLog	2006-02-28 08:30:33.000000000 +0000
-+++ gcc-4.1.0/ChangeLog	2006-04-17 19:32:36.000000000 +0000
-@@ -1,3 +1,12 @@
-+2006-04-05  Richard Guenther  <rguenther@suse.de>
-+
-+	PR tree-optimization/26763
-+	* fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
-+	only for EQ_EXPR and NE_EXPR.
-+
-+	* gcc.dg/torture/pr26763-1.c: New testcase.
-+	* gcc.dg/torture/pr26763-2.c: Likewise.
-+
- 2006-02-28  Release Manager
- 
- 	* GCC 4.1.0 released.
-diff -Naur gcc-4.1.0.orig/gcc/fold-const.c gcc-4.1.0/gcc/fold-const.c
---- gcc-4.1.0.orig/gcc/fold-const.c	2006-02-03 18:02:04.000000000 +0000
-+++ gcc-4.1.0/gcc/fold-const.c	2006-04-17 19:33:55.000000000 +0000
-@@ -8897,8 +8897,9 @@
- 
-       /* If this is a comparison of two exprs that look like an
- 	 ARRAY_REF of the same object, then we can fold this to a
--	 comparison of the two offsets.  */
--      if (TREE_CODE_CLASS (code) == tcc_comparison)
-+	 comparison of the two offsets.  This is only safe for
-+	 EQ_EXPR and NE_EXPR because of overflow issues.  */
-+      if (code == EQ_EXPR || code == NE_EXPR)
- 	{
- 	  tree base0, offset0, base1, offset1;
- 
-diff -Naur gcc-4.1.0.orig/gcc/testsuite/ChangeLog gcc-4.1.0/gcc/testsuite/ChangeLog
---- gcc-4.1.0.orig/gcc/testsuite/ChangeLog	2006-02-28 08:27:59.000000000 +0000
-+++ gcc-4.1.0/gcc/testsuite/ChangeLog	2006-04-17 19:35:18.000000000 +0000
-@@ -1,3 +1,12 @@
-+2006-04-05  Richard Guenther  <rguenther@suse.de>
-+
-+	PR tree-optimization/26763
-+	* fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
-+	only for EQ_EXPR and NE_EXPR.
-+
-+	* gcc.dg/torture/pr26763-1.c: New testcase.
-+	* gcc.dg/torture/pr26763-2.c: Likewise.
-+
- 2006-02-28  Release Manager
- 
- 	* GCC 4.1.0 released.
-diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-1.ch gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-1.ch
---- gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-1.ch	1970-01-01 00:00:00.000000000 +0000
-+++ gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-1.ch	2006-04-17 19:36:55.000000000 +0000
-@@ -0,0 +1,18 @@
-+/* { dg-do run } */
-+
-+extern void abort(void);
-+
-+int try (int *a)
-+{
-+  return a + -1 > a;
-+}
-+
-+int main(void)
-+{
-+  int bla[100];
-+
-+  if (try (bla + 50))
-+    abort ();
-+
-+  return 0;
-+}
-diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-2.c gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-2.c
---- gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-2.c	1970-01-01 00:00:00.000000000 +0000
-+++ gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-2.c	2006-04-17 19:37:11.000000000 +0000
-@@ -0,0 +1,18 @@
-+/* { dg-do run } */
-+
-+extern void abort(void);
-+
-+int try (char *a, int d)
-+{
-+  return a + d > a;
-+}
-+
-+int main(void)
-+{
-+  char bla[100];
-+
-+  if (try (bla + 50, -1))
-+    abort ();
-+
-+  return 0;
-+}
Index: tches/gcc-4.1.0-cross_search_paths-1.patch
===================================================================
--- patches/gcc-4.1.0-cross_search_paths-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,49 +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)
-        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: tches/gcc-4.1.0-posix-1.patch
===================================================================
--- patches/gcc-4.1.0-posix-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,201 +1,0 @@
-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: tches/gcc-4.1.0-pure64-1.patch
===================================================================
--- patches/gcc-4.1.0-pure64-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,151 +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
-        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: tches/gcc-4.1.0-pure64_specs-1.patch
===================================================================
--- patches/gcc-4.1.0-pure64_specs-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,337 +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.
-        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: tches/gcc-4.1.0-sparc_tls-1.patch
===================================================================
--- patches/gcc-4.1.0-sparc_tls-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,24 +1,0 @@
-Submitted By: Ryan Oliver <ryan at pha dot com dot au>
-Date: 2006-04-30
-Initial Package Version: 4.1.0
-Origin: Jakub
-Upstream Status: In GCC Trunk
-Description: Fixed in GCC SVN Revision #110522
-	* config/sparc/sparc.c (sparc_output_scratch_registers): Use
-	#ignore instead of #scratch for %g7 .register directive.
-
---- trunk/gcc/config/sparc/sparc.c	2006/01/31 22:33:27	110451
-+++ trunk/gcc/config/sparc/sparc.c	2006/02/02 22:49:01	110522
-@@ -3693,7 +3693,10 @@
- 	  && ! sparc_hard_reg_printed [i])
- 	{
- 	  sparc_hard_reg_printed [i] = 1;
--	  fprintf (file, "\t.register\t%%g%d, #scratch\n", i);
-+	  /* %g7 is used as TLS base register, use #ignore
-+	     for it instead of #scratch.  */
-+	  fprintf (file, "\t.register\t%%g%d, #%s\n", i,
-+		   i == 7 ? "ignore" : "scratch");
- 	}
-       if (i == 3) i = 5;
-     }
-
Index: tches/gcc-4.1.0-specs-1.patch
===================================================================
--- patches/gcc-4.1.0-specs-1.patch	(revision 1e414b988ecc99b9538c16c8a10ab3f051315eeb)
+++ 	(revision )
@@ -1,337 +1,0 @@
-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
Index: patches/gcc-4.1.1-PR20425-1.patch
===================================================================
--- patches/gcc-4.1.1-PR20425-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-PR20425-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -0,0 +1,1069 @@
+Submitted By: Ryan Oliver <ryan at pha dot com dot au>
+Date: 2006-03-10
+Initial Package Version: 4.1.0
+Origin: GCC SVN Revision 108635 (diffed against 4.1.0 release)
+Upstream Status: In GCC trunk
+Description: Fix for PR20425
+
+Modified by Jim Gifford for 4.1.1
+
+From http://gcc.gnu.org/ml/gcc-patches/2005-12/msg00818.html
+---------------------------------8<------------------------------------
+This gives the gcc driver a new path iteration function, for_each_path,
+and uses it everywhere, making path iteration a little more consistent.
+for_each_path uses the same path ordering as the existing find_file
+function.  I've also tweaked some of the existing find_a_file calls for
+consistency, and uncovered and fixed some other bugs..
+
+Functional changes are:
+
+o  %D library paths are printed in the same order as gcc uses elsewhere
+   when searching library directories, ie. all multilib paths are first.
+   http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02044.html effectively
+   reverted by the rewrite because I believe the same speedup is gained
+   by searching the right dirs first.
+
+o  gcc -print-search-dirs prints library multilib paths followed by
+   non-multilib paths where before we just printed non-multilib paths.
+
+o  LIBRARY_PATH_ENV similarly includes multilib directories.
+
+o  All searches of startfile_prefixes now look in multilib dirs first
+   followed by non-multilib dirs.  This changes the dirs we search for
+   spec files, and %include and %include_noerr in specs.  Previously
+   we only searched the non-multilib dirs for specs files.  I think this
+   change is worthwhile just for consistency, and the extension is
+   reasonable.  For instance, it would allow different spec files to be
+   used for gcc -m64 vs. gcc -m32.  However, if others think this wrong,
+   I won't argue.  Consistency isn't everything.
+
+o  Some attempt made to prevent searching of duplicate paths.  The old
+   find_file would search some paths twice (when multilib_dir was NULL
+   but multilib_os_dir non-NULL).  We still search twice in some cases,
+   eg. /usr/lib/../lib and /usr/lib are considered different paths.
+
+o  find_a_file with last param (do_multi) true now searches both
+   multilib and non-multilib paths.  Before, do_multi (well, the old
+   param name was multilib) meant just search multilib paths.  This
+   isn't a user-visible change as the only place where find_a_file was
+   invoked with the last param true was from find_file, where we
+   immediately followed with a non-multilib find_a_file.
+
+o  Memory leaks fixed in is_directory.
+
+o  LIBRARY_PATH_ENV and COMPILER_PATH now only have existing
+   directories, making LIBRARY_PATH_ENV closer to %D paths.  The
+   following lines (which I remove) in is_directory meant that
+   is_directory didn't do much for LIBRARY_PATH_ENV, except on
+   SMALL_ARG_MAX machines.
+
+  4278        ian #ifndef SMALL_ARG_MAX
+  4278        ian   if (! linker)
+  4278        ian     return 1;
+  4278        ian #endif
+
+   I'll also remove mention of SMALL_ARG_MAX in config and doc files
+   when I commit this change as this is the only place it is used.
+
+o  gcc -Bnon-dir-prefix- now works properly.  The previously mentioned
+   is_directory peculiarity affected the following code.
+
+ 43664      nickc /* Catch the case where the user has forgotten to append a
+ 46063      jsm28    directory separator to the path.  Note, they may be using
+ 43664      nickc    -B to add an executable name prefix, eg "i386-elf-", in
+ 43664      nickc    order to distinguish between multiple installations of
+ 43664      nickc    GCC in the same directory.  Hence we must check to see
+ 43664      nickc    if appending a directory separator actually makes a
+ 43664      nickc    valid directory name.  */
+ 43664      nickc if (! IS_DIR_SEPARATOR (value [len - 1])
+ 43664      nickc     && is_directory (value, "", 0))
+ 43664      nickc   {
+ 43767      ghazi     char *tmp = xmalloc (len + 2);
+ 43767      ghazi     strcpy (tmp, value);
+ 43767      ghazi     tmp[len] = DIR_SEPARATOR;
+ 43767      ghazi     tmp[++ len] = 0;
+ 43767      ghazi     value = tmp;
+ 43664      nickc   }
+
+Bootstrapped and regression tested powerpc64-linux and powerpc-linux on
+a previous iteration of this patch missing is_directory fixes.
+Currently running tests on this patch.
+---------------------------------8<------------------------------------
+
+diff -uNr gcc-4.1.0/gcc/config.build gcc-4.1.0-PR20425/gcc/config.build
+--- gcc-4.1.0/gcc/config.build	2005-06-25 12:02:01.000000000 +1000
++++ gcc-4.1.0-PR20425/gcc/config.build	2006-03-10 23:47:02.000000000 +1100
+@@ -90,15 +90,10 @@
+     build_install_headers_dir=install-headers-cpio
+     ;;
+   i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4* )
+-    build_xm_defines="SMALL_ARG_MAX"
+     build_install_headers_dir=install-headers-cpio
+     ;;
+-  i[34567]86-*-solaris2*)
+-    build_xm_defines="SMALL_ARG_MAX"
+-    ;;
+   i[34567]86-*-sysv4*) 
+     # Intel x86 running system V r4
+-    build_xm_defines="SMALL_ARG_MAX"
+     build_install_headers_dir=install-headers-cpio
+     ;;
+   i[34567]86-*-udk*) 
+diff -uNr gcc-4.1.0/gcc/config.gcc gcc-4.1.0-PR20425/gcc/config.gcc
+--- gcc-4.1.0/gcc/config.gcc	2006-02-07 03:07:46.000000000 +1100
++++ gcc-4.1.0-PR20425/gcc/config.gcc	2006-03-10 23:47:20.000000000 +1100
+@@ -994,7 +994,6 @@
+ 	then
+ 		tm_file="${tm_file} usegas.h"
+ 	fi
+-	xm_defines="SMALL_ARG_MAX"
+ 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ptx4.h i386/ptx4-i.h"
+ 	tmake_file=t-svr4
+ 	extra_parts="crtbegin.o crtend.o"
+@@ -1125,7 +1124,6 @@
+ 	use_fixproto=yes
+ 	;;
+ i[34567]86-*-solaris2*)
+-	xm_defines="SMALL_ARG_MAX"
+ 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h"
+ 	case ${target} in
+ 	*-*-solaris2.[0-6] | *-*-solaris2.[0-6].*)
+@@ -1192,7 +1190,6 @@
+ 	use_fixproto=yes
+        ;;
+ i[34567]86-*-sysv4*)		# Intel 80386's running system V.4
+-	xm_defines="SMALL_ARG_MAX"
+ 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv4-cpp.h"
+ 	if test x$stabs = xyes
+ 	then
+diff -uNr gcc-4.1.0/gcc/config.host gcc-4.1.0-PR20425/gcc/config.host
+--- gcc-4.1.0/gcc/config.host	2006-02-06 03:18:20.000000000 +1100
++++ gcc-4.1.0-PR20425/gcc/config.host	2006-03-10 23:47:52.000000000 +1100
+@@ -135,17 +135,10 @@
+   i370-*-opened* | i370-*-mvs* ) # IBM 360/370/390 Architecture
+     host_xm_defines='FATAL_EXIT_CODE=12'
+     ;;
+-  i[34567]86-sequent-ptx4*)
+-    host_xm_defines="SMALL_ARG_MAX"
+-    ;;
+   i[34567]86-*-solaris2*)
+-    host_xm_defines="SMALL_ARG_MAX"
+     out_host_hook_obj=host-solaris.o
+     host_xmake_file=x-solaris
+     ;;
+-  i[34567]86-*-sysv4*) # Intel 80386's running System V Release 4
+-    host_xm_defines="SMALL_ARG_MAX"
+-    ;;
+   i[34567]86-pc-msdosdjgpp*)
+     host_xm_file=i386/xm-djgpp.h
+     host_exeext=.exe
+diff -uNr gcc-4.1.0/gcc/doc/hostconfig.texi gcc-4.1.0-PR20425/gcc/doc/hostconfig.texi
+--- gcc-4.1.0/gcc/doc/hostconfig.texi	2004-11-24 15:31:58.000000000 +1100
++++ gcc-4.1.0-PR20425/gcc/doc/hostconfig.texi	2006-03-10 23:48:20.000000000 +1100
+@@ -208,11 +208,6 @@
+ If defined, a C statement (sans semicolon) that performs host-dependent
+ initialization when a compilation driver is being initialized.
+ 
+-@item SMALL_ARG_MAX
+-Define this macro if the host system has a small limit on the total
+-size of an argument vector.  This causes the driver to take more care
+-not to pass unnecessary arguments to subprocesses.
+-
+ @item HOST_LONG_LONG_FORMAT
+ If defined, the string used to indicate an argument of type @code{long
+ long} to functions like @code{printf}.  The default value is
+diff -uNr gcc-4.1.0/gcc/gcc.c gcc-4.1.0-PR20425/gcc/gcc.c
+--- gcc-4.1.0/gcc/gcc.c	2006-01-22 05:29:08.000000000 +1100
++++ gcc-4.1.0-PR20425/gcc/gcc.c	2006-03-10 22:14:35.000000000 +1100
+@@ -287,10 +287,12 @@
+ static void read_specs (const char *, int);
+ static void set_spec (const char *, const char *);
+ static struct compiler *lookup_compiler (const char *, size_t, const char *);
+-static char *build_search_list (struct path_prefix *, const char *, int);
+-static void putenv_from_prefixes (struct path_prefix *, const char *);
++static char *build_search_list (const struct path_prefix *, const char *,
++				bool, bool);
++static void putenv_from_prefixes (const struct path_prefix *, const char *,
++				  bool);
+ static int access_check (const char *, int);
+-static char *find_a_file (struct path_prefix *, const char *, int, int);
++static char *find_a_file (const struct path_prefix *, const char *, int, bool);
+ static void add_prefix (struct path_prefix *, const char *, const char *,
+ 			int, int, int);
+ static void add_sysrooted_prefix (struct path_prefix *, const char *,
+@@ -313,13 +315,12 @@
+ static const char *handle_spec_function (const char *);
+ static char *save_string (const char *, int);
+ static void set_collect_gcc_options (void);
+-static void do_spec_path (struct prefix_list *, const char *, int, int, int, const char *, const char *);
+ static int do_spec_1 (const char *, int, const char *);
+ static int do_spec_2 (const char *);
+ static void do_option_spec (const char *, const char *);
+ static void do_self_spec (const char *);
+ static const char *find_file (const char *);
+-static int is_directory (const char *, const char *, int);
++static int is_directory (const char *, bool);
+ static const char *validate_switches (const char *);
+ static void validate_all_switches (void);
+ static inline void validate_switches_from_spec (const char *);
+@@ -2036,7 +2037,7 @@
+ 		       (long) (p1 - buffer + 1));
+ 
+ 	      p[-2] = '\0';
+-	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, 0);
++	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
+ 	      read_specs (new_filename ? new_filename : p1, FALSE);
+ 	      continue;
+ 	    }
+@@ -2055,7 +2056,7 @@
+ 		       (long) (p1 - buffer + 1));
+ 
+ 	      p[-2] = '\0';
+-	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, 0);
++	      new_filename = find_a_file (&startfile_prefixes, p1, R_OK, true);
+ 	      if (new_filename)
+ 		read_specs (new_filename, FALSE);
+ 	      else if (verbose_flag)
+@@ -2352,65 +2353,214 @@
+   failure_delete_queue = 0;
+ }
+ 
+
+-/* Build a list of search directories from PATHS.
+-   PREFIX is a string to prepend to the list.
+-   If CHECK_DIR_P is nonzero we ensure the directory exists.
+-   This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
+-   It is also used by the --print-search-dirs flag.  */
+-
+-static char *
+-build_search_list (struct path_prefix *paths, const char *prefix,
+-		   int check_dir_p)
++/* Call CALLBACK for each path in PATHS, breaking out early if CALLBACK
++   returns non-NULL.
++   If DO_MULTI is true iterate over the paths twice, first with multilib
++   suffix then without, otherwise iterate over the paths once without
++   adding a multilib suffix.  When DO_MULTI is true, some attempt is made
++   to avoid visiting the same path twice, but we could do better.  For
++   instance, /usr/lib/../lib is considered different from /usr/lib.
++   At least EXTRA_SPACE chars past the end of the path passed to
++   CALLBACK are available for use by the callback.
++   CALLBACK_INFO allows extra parameters to be passed to CALLBACK.
++
++   Returns the value returned by CALLBACK.  */
++
++static void *
++for_each_path (const struct path_prefix *paths,
++	       bool do_multi,
++	       size_t extra_space,
++	       void *(*callback) (char *, void *),
++	       void *callback_info)
+ {
+-  int suffix_len = (machine_suffix) ? strlen (machine_suffix) : 0;
+-  int just_suffix_len
+-    = (just_machine_suffix) ? strlen (just_machine_suffix) : 0;
+-  int first_time = TRUE;
+-  struct prefix_list *pprefix;
+-
+-  obstack_grow (&collect_obstack, prefix, strlen (prefix));
+-  obstack_1grow (&collect_obstack, '=');
++  struct prefix_list *pl;
++  const char *multi_dir = NULL;
++  const char *multi_os_dir = NULL;
++  const char *multi_suffix;
++  const char *just_multi_suffix;
++  char *path = NULL;
++  void *ret = NULL;
++  bool skip_multi_dir = false;
++  bool skip_multi_os_dir = false;
++
++  multi_suffix = machine_suffix;
++  just_multi_suffix = just_machine_suffix;
++  if (do_multi && multilib_dir && strcmp (multilib_dir, ".") != 0)
++    {
++      multi_dir = concat (multilib_dir, dir_separator_str, NULL);
++      multi_suffix = concat (multi_suffix, multi_dir, NULL);
++      just_multi_suffix = concat (just_multi_suffix, multi_dir, NULL);
++    }
++  if (do_multi && multilib_os_dir && strcmp (multilib_os_dir, ".") != 0)
++    multi_os_dir = concat (multilib_os_dir, dir_separator_str, NULL);
+ 
+-  for (pprefix = paths->plist; pprefix != 0; pprefix = pprefix->next)
++  while (1)
+     {
+-      int len = strlen (pprefix->prefix);
++      size_t multi_dir_len = 0;
++      size_t multi_os_dir_len = 0;
++      size_t suffix_len;
++      size_t just_suffix_len;
++      size_t len;
++
++      if (multi_dir)
++	multi_dir_len = strlen (multi_dir);
++      if (multi_os_dir)
++	multi_os_dir_len = strlen (multi_os_dir);
++      suffix_len = strlen (multi_suffix);
++      just_suffix_len = strlen (just_multi_suffix);
++
++      if (path == NULL)
++	{
++	  len = paths->max_len + extra_space + 1;
++	  if (suffix_len > multi_os_dir_len)
++	    len += suffix_len;
++	  else
++	    len += multi_os_dir_len;
++	  path = xmalloc (len);
++	}
+ 
+-      if (machine_suffix
+-	  && (! check_dir_p
+-	      || is_directory (pprefix->prefix, machine_suffix, 0)))
++      for (pl = paths->plist; pl != 0; pl = pl->next)
+ 	{
+-	  if (!first_time)
+-	    obstack_1grow (&collect_obstack, PATH_SEPARATOR);
++	  len = strlen (pl->prefix);
++	  memcpy (path, pl->prefix, len);
+ 
+-	  first_time = FALSE;
+-	  obstack_grow (&collect_obstack, pprefix->prefix, len);
+-	  obstack_grow (&collect_obstack, machine_suffix, suffix_len);
+-	}
++	  /* Look first in MACHINE/VERSION subdirectory.  */
++	  if (!skip_multi_dir)
++	    {
++	      memcpy (path + len, multi_suffix, suffix_len + 1);
++	      ret = callback (path, callback_info);
++	      if (ret)
++		break;
++	    }
+ 
+-      if (just_machine_suffix
+-	  && pprefix->require_machine_suffix == 2
+-	  && (! check_dir_p
+-	      || is_directory (pprefix->prefix, just_machine_suffix, 0)))
+-	{
+-	  if (! first_time)
+-	    obstack_1grow (&collect_obstack, PATH_SEPARATOR);
++	  /* Some paths are tried with just the machine (ie. target)
++	     subdir.  This is used for finding as, ld, etc.  */
++	  if (!skip_multi_dir
++	      && pl->require_machine_suffix == 2)
++	    {
++	      memcpy (path + len, just_multi_suffix, just_suffix_len + 1);
++	      ret = callback (path, callback_info);
++	      if (ret)
++		break;
++	    }
++
++	  /* Now try the base path.  */
++	  if (!pl->require_machine_suffix
++	      && !(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
++	    {
++	      const char *this_multi;
++	      size_t this_multi_len;
++
++	      if (pl->os_multilib)
++		{
++		  this_multi = multi_os_dir;
++		  this_multi_len = multi_os_dir_len;
++		}
++	      else
++		{
++		  this_multi = multi_dir;
++		  this_multi_len = multi_dir_len;
++		}
+ 
+-	  first_time = FALSE;
+-	  obstack_grow (&collect_obstack, pprefix->prefix, len);
+-	  obstack_grow (&collect_obstack, just_machine_suffix,
+-			just_suffix_len);
++	      if (this_multi_len)
++		memcpy (path + len, this_multi, this_multi_len + 1);
++	      else
++		path[len] = '\0';
++
++	      ret = callback (path, callback_info);
++	      if (ret)
++		break;
++	    }
+ 	}
++      if (pl)
++	break;
+ 
+-      if (! pprefix->require_machine_suffix)
+-	{
+-	  if (! first_time)
+-	    obstack_1grow (&collect_obstack, PATH_SEPARATOR);
++      if (multi_dir == NULL && multi_os_dir == NULL)
++	break;
+ 
+-	  first_time = FALSE;
+-	  obstack_grow (&collect_obstack, pprefix->prefix, len);
++      /* Run through the paths again, this time without multilibs.
++	 Don't repeat any we have already seen.  */
++      if (multi_dir)
++	{
++	  free ((char *) multi_dir);
++	  multi_dir = NULL;
++	  free ((char *) multi_suffix);
++	  multi_suffix = machine_suffix;
++	  free ((char *) just_multi_suffix);
++	  just_multi_suffix = just_machine_suffix;
++	}
++      else
++	skip_multi_dir = true;
++      if (multi_os_dir)
++	{
++	  free ((char *) multi_os_dir);
++	  multi_os_dir = NULL;
+ 	}
++      else
++	skip_multi_os_dir = true;
+     }
+ 
++  if (multi_dir)
++    {
++      free ((char *) multi_dir);
++      free ((char *) multi_suffix);
++      free ((char *) just_multi_suffix);
++    }
++  if (multi_os_dir)
++    free ((char *) multi_os_dir);
++  if (ret != path)
++    free (path);
++  return ret;
++}
++
++/* Callback for build_search_list.  Adds path to obstack being built.  */
++
++struct add_to_obstack_info {
++  struct obstack *ob;
++  bool check_dir;
++  bool first_time;
++};
++
++static void *
++add_to_obstack (char *path, void *data)
++{
++  struct add_to_obstack_info *info = data;
++
++  if (info->check_dir && !is_directory (path, false))
++    return NULL;
++
++  if (!info->first_time)
++    obstack_1grow (info->ob, PATH_SEPARATOR);
++
++  obstack_grow (info->ob, path, strlen (path));
++
++  info->first_time = false;
++  return NULL;
++}
++
++/* Build a list of search directories from PATHS.
++   PREFIX is a string to prepend to the list.
++   If CHECK_DIR_P is true we ensure the directory exists.
++   If DO_MULTI is true, multilib paths are output first, then
++   non-multilib paths.
++   This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
++   It is also used by the --print-search-dirs flag.  */
++
++static char *
++build_search_list (const struct path_prefix *paths, const char *prefix,
++		   bool check_dir, bool do_multi)
++{
++  struct add_to_obstack_info info;
++
++  info.ob = &collect_obstack;
++  info.check_dir = check_dir;
++  info.first_time = true;
++
++  obstack_grow (&collect_obstack, prefix, strlen (prefix));
++  obstack_1grow (&collect_obstack, '=');
++
++  for_each_path (paths, do_multi, 0, add_to_obstack, &info);
++
+   obstack_1grow (&collect_obstack, '\0');
+   return XOBFINISH (&collect_obstack, char *);
+ }
+@@ -2419,9 +2569,10 @@
+    for collect.  */
+ 
+ static void
+-putenv_from_prefixes (struct path_prefix *paths, const char *env_var)
++putenv_from_prefixes (const struct path_prefix *paths, const char *env_var,
++		      bool do_multi)
+ {
+-  putenv (build_search_list (paths, env_var, 1));
++  putenv (build_search_list (paths, env_var, true, do_multi));
+ }
+ 
+
+ /* Check whether NAME can be accessed in MODE.  This is like access,
+@@ -2442,20 +2593,53 @@
+   return access (name, mode);
+ }
+ 
++/* Callback for find_a_file.  Appends the file name to the directory
++   path.  If the resulting file exists in the right mode, return the
++   full pathname to the file.  */
++
++struct file_at_path_info {
++  const char *name;
++  const char *suffix;
++  int name_len;
++  int suffix_len;
++  int mode;
++};
++
++static void *
++file_at_path (char *path, void *data)
++{
++  struct file_at_path_info *info = data;
++  size_t len = strlen (path);
++
++  memcpy (path + len, info->name, info->name_len);
++  len += info->name_len;
++
++  /* Some systems have a suffix for executable files.
++     So try appending that first.  */
++  if (info->suffix_len)
++    {
++      memcpy (path + len, info->suffix, info->suffix_len + 1);
++      if (access_check (path, info->mode) == 0)
++	return path;
++    }
++
++  path[len] = '\0';
++  if (access_check (path, info->mode) == 0)
++    return path;
++
++  return NULL;
++}
++
+ /* Search for NAME using the prefix list PREFIXES.  MODE is passed to
+-   access to check permissions.
++   access to check permissions.  If DO_MULTI is true, search multilib
++   paths then non-multilib paths, otherwise do not search multilib paths.
+    Return 0 if not found, otherwise return its name, allocated with malloc.  */
+ 
+ static char *
+-find_a_file (struct path_prefix *pprefix, const char *name, int mode,
+-	     int multilib)
++find_a_file (const struct path_prefix *pprefix, const char *name, int mode,
++	     bool do_multi)
+ {
+-  char *temp;
+-  const char *const file_suffix =
+-    ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "");
+-  struct prefix_list *pl;
+-  int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1;
+-  const char *multilib_name, *multilib_os_name;
++  struct file_at_path_info info;
+ 
+ #ifdef DEFAULT_ASSEMBLER
+   if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0)
+@@ -2467,112 +2651,24 @@
+     return xstrdup (DEFAULT_LINKER);
+ #endif
+ 
+-  if (machine_suffix)
+-    len += strlen (machine_suffix);
+-
+-  multilib_name = name;
+-  multilib_os_name = name;
+-  if (multilib && multilib_os_dir)
+-    {
+-      int len1 = multilib_dir ? strlen (multilib_dir) + 1 : 0;
+-      int len2 = strlen (multilib_os_dir) + 1;
+-
+-      len += len1 > len2 ? len1 : len2;
+-      if (multilib_dir)
+-	multilib_name = ACONCAT ((multilib_dir, dir_separator_str, name,
+-				  NULL));
+-      if (strcmp (multilib_os_dir, ".") != 0)
+-	multilib_os_name = ACONCAT ((multilib_os_dir, dir_separator_str, name,
+-				    NULL));
+-    }
+-
+-  temp = xmalloc (len);
+-
+   /* Determine the filename to execute (special case for absolute paths).  */
+ 
+   if (IS_ABSOLUTE_PATH (name))
+     {
+       if (access (name, mode) == 0)
+-	{
+-	  strcpy (temp, name);
+-	  return temp;
+-	}
+-    }
+-  else
+-    for (pl = pprefix->plist; pl; pl = pl->next)
+-      {
+-	const char *this_name
+-	  = pl->os_multilib ? multilib_os_name : multilib_name;
++	return xstrdup (name);
+ 
+-	if (machine_suffix)
+-	  {
+-	    /* Some systems have a suffix for executable files.
+-	       So try appending that first.  */
+-	    if (file_suffix[0] != 0)
+-	      {
+-		strcpy (temp, pl->prefix);
+-		strcat (temp, machine_suffix);
+-		strcat (temp, multilib_name);
+-		strcat (temp, file_suffix);
+-		if (access_check (temp, mode) == 0)
+-		  return temp;
+-	      }
+-
+-	    /* Now try just the multilib_name.  */
+-	    strcpy (temp, pl->prefix);
+-	    strcat (temp, machine_suffix);
+-	    strcat (temp, multilib_name);
+-	    if (access_check (temp, mode) == 0)
+-	      return temp;
+-	  }
+-
+-	/* Certain prefixes are tried with just the machine type,
+-	   not the version.  This is used for finding as, ld, etc.  */
+-	if (just_machine_suffix && pl->require_machine_suffix == 2)
+-	  {
+-	    /* Some systems have a suffix for executable files.
+-	       So try appending that first.  */
+-	    if (file_suffix[0] != 0)
+-	      {
+-		strcpy (temp, pl->prefix);
+-		strcat (temp, just_machine_suffix);
+-		strcat (temp, multilib_name);
+-		strcat (temp, file_suffix);
+-		if (access_check (temp, mode) == 0)
+-		  return temp;
+-	      }
+-
+-	    strcpy (temp, pl->prefix);
+-	    strcat (temp, just_machine_suffix);
+-	    strcat (temp, multilib_name);
+-	    if (access_check (temp, mode) == 0)
+-	      return temp;
+-	  }
+-
+-	/* Certain prefixes can't be used without the machine suffix
+-	   when the machine or version is explicitly specified.  */
+-	if (! pl->require_machine_suffix)
+-	  {
+-	    /* Some systems have a suffix for executable files.
+-	       So try appending that first.  */
+-	    if (file_suffix[0] != 0)
+-	      {
+-		strcpy (temp, pl->prefix);
+-		strcat (temp, this_name);
+-		strcat (temp, file_suffix);
+-		if (access_check (temp, mode) == 0)
+-		  return temp;
+-	      }
++      return NULL;
++    }
+ 
+-	    strcpy (temp, pl->prefix);
+-	    strcat (temp, this_name);
+-	    if (access_check (temp, mode) == 0)
+-	      return temp;
+-	  }
+-      }
++  info.name = name;
++  info.suffix = (mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : "";
++  info.name_len = strlen (info.name);
++  info.suffix_len = strlen (info.suffix);
++  info.mode = mode;
+ 
+-  free (temp);
+-  return 0;
++  return for_each_path (pprefix, do_multi, info.name_len + info.suffix_len,
++			file_at_path, &info);
+ }
+ 
+ /* Ranking of prefixes in the sort list. -B prefixes are put before
+@@ -2691,7 +2787,7 @@
+ 
+   commands[0].prog = argbuf[0]; /* first command.  */
+   commands[0].argv = &argbuf[0];
+-  string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, 0);
++  string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, false);
+ 
+   if (string)
+     commands[0].argv[0] = string;
+@@ -2706,7 +2802,7 @@
+ 	commands[n_commands].prog = argbuf[i + 1];
+ 	commands[n_commands].argv = &argbuf[i + 1];
+ 	string = find_a_file (&exec_prefixes, commands[n_commands].prog,
+-			      X_OK, 0);
++			      X_OK, false);
+ 	if (string)
+ 	  commands[n_commands].argv[0] = string;
+ 	n_commands++;
+@@ -3643,7 +3739,7 @@
+ 		   if appending a directory separator actually makes a
+ 		   valid directory name.  */
+ 		if (! IS_DIR_SEPARATOR (value [len - 1])
+-		    && is_directory (value, "", 0))
++		    && is_directory (value, false))
+ 		  {
+ 		    char *tmp = xmalloc (len + 2);
+ 		    strcpy (tmp, value);
+@@ -4391,108 +4487,55 @@
+     }
+ }
+ 
+-void
+-do_spec_path (struct prefix_list *pl, const char *option,
+-	      int omit_if_relative, int separate_options,
+-	      int only_subdir,
+-	      const char *dir_for_machine_suffix,
+-	      const char *dir_for_no_suffix)
+-{
+-  static size_t bufsize = 0;
+-  static char *buffer;
+-  int idx;
+-  bool multilib_p = false;
+-
+-  /* Used on systems which record the specified -L dirs
+-     and use them to search for dynamic linking.  */
+-  /* Relative directories always come from -B,
+-     and it is better not to use them for searching
+-     at run time.  In particular, stage1 loses.  */
+-  if (omit_if_relative
+-      && !IS_ABSOLUTE_PATH (pl->prefix))
+-    return;
++/* Callback for processing %D and %I specs.  */
+ 
+-  /* Try subdirectory if there is one.  */
+-  if (machine_suffix && dir_for_machine_suffix)
+-    {
+-      if (strlen (pl->prefix) + strlen (machine_suffix)
+-	  >= bufsize)
+-	bufsize = (strlen (pl->prefix)
+-		  + strlen (machine_suffix)) * 2 + 1;
+-      buffer = xrealloc (buffer, bufsize);
+-      strcpy (buffer, pl->prefix);
+-      strcat (buffer, machine_suffix);
+-      if (is_directory (buffer, dir_for_machine_suffix, 1))
+-	{
+-	  multilib_p = true;
+-	  do_spec_1 (option, separate_options, NULL);
+-	  if (separate_options)
+-	    do_spec_1 (" ", 0, NULL);
+-	  do_spec_1 (buffer, 1, NULL);
+-	  do_spec_1 (dir_for_machine_suffix, 1, NULL);
+-	  /* Make this a separate argument.  */
+-	  do_spec_1 (" ", 0, NULL);
+-	}
+-    }
+-  if (!pl->require_machine_suffix && dir_for_no_suffix)
++struct spec_path_info {
++  const char *option;
++  const char *append;
++  size_t append_len;
++  bool omit_relative;
++  bool separate_options;
++};
++
++static void *
++spec_path (char *path, void *data)
++{
++  struct spec_path_info *info = data;
++  size_t len = 0;
++  char save = 0;
++
++  if (info->omit_relative && !IS_ABSOLUTE_PATH (path))
++    return NULL;
++
++  if (info->append_len != 0)
+     {
+-      if (is_directory (pl->prefix, dir_for_no_suffix, 1))
+-	{
+-	  multilib_p = true;
+-	  do_spec_1 (option, separate_options, NULL);
+-	  if (separate_options)
+-	    do_spec_1 (" ", 0, NULL);
+-	  do_spec_1 (pl->prefix, 1, NULL);
+-	  do_spec_1 (dir_for_no_suffix, 1, NULL);
+-	  /* Make this a separate argument.  */
+-	  do_spec_1 (" ", 0, NULL);
+-	}
++      len = strlen (path);
++      memcpy (path + len, info->append, info->append_len + 1);
+     }
+ 
+-  if (only_subdir || multilib_p)
+-    return;
++  if (!is_directory (path, true))
++    return NULL;
++
++  do_spec_1 (info->option, 1, NULL);
++  if (info->separate_options)
++    do_spec_1 (" ", 0, NULL);
+ 
+-  if (machine_suffix)
++  if (info->append_len == 0)
+     {
+-      if (is_directory (pl->prefix, machine_suffix, 1))
+-	{
+-	  do_spec_1 (option, separate_options, NULL);
+-	  if (separate_options)
+-	    do_spec_1 (" ", 0, NULL);
+-	  do_spec_1 (pl->prefix, 1, NULL);
+-	  /* Remove slash from machine_suffix.  */
+-	  if (strlen (machine_suffix) >= bufsize)
+-	    bufsize = strlen (machine_suffix) * 2 + 1;
+-	  buffer = xrealloc (buffer, bufsize);
+-	  strcpy (buffer, machine_suffix);
+-	  idx = strlen (buffer);
+-	  if (IS_DIR_SEPARATOR (buffer[idx - 1]))
+-	    buffer[idx - 1] = 0;
+-	  do_spec_1 (buffer, 1, NULL);
+-	  /* Make this a separate argument.  */
+-	  do_spec_1 (" ", 0, NULL);
+-	}
+-    }
+-  if (!pl->require_machine_suffix)
+-    {
+-      if (is_directory (pl->prefix, "", 1))
+-	{
+-	  do_spec_1 (option, separate_options, NULL);
+-	  if (separate_options)
+-	    do_spec_1 (" ", 0, NULL);
+-	  /* Remove slash from pl->prefix.  */
+-	  if (strlen (pl->prefix) >= bufsize)
+-	    bufsize = strlen (pl->prefix) * 2 + 1;
+-	  buffer = xrealloc (buffer, bufsize);
+-	  strcpy (buffer, pl->prefix);
+-	  idx = strlen (buffer);
+-	  if (IS_DIR_SEPARATOR (buffer[idx - 1]))
+-	    buffer[idx - 1] = 0;
+-	  do_spec_1 (buffer, 1, NULL);
+-	  /* Make this a separate argument.  */
+-	  do_spec_1 (" ", 0, NULL);
+-	}
++      len = strlen (path);
++      save = path[len - 1];
++      if (IS_DIR_SEPARATOR (path[len - 1]))
++	path[len - 1] = '\0';
+     }
++
++  do_spec_1 (path, 1, NULL);
++  do_spec_1 (" ", 0, NULL);
++
++  /* Must not damage the original path.  */
++  if (info->append_len == 0)
++    path[len - 1] = save;
++
++  return NULL;
+ }
+ 
+ /* Process the sub-spec SPEC as a portion of a larger spec.
+@@ -4630,23 +4673,23 @@
+ 	     that we search for startfiles.  */
+ 	  case 'D':
+ 	    {
+-	      struct prefix_list *pl = startfile_prefixes.plist;
+-
+-	      for (; pl; pl = pl->next)
+-		{
+-		  const char *no_suffix_multilib_dir;
++	      struct spec_path_info info;
+ 
+-		  no_suffix_multilib_dir = pl->os_multilib ? multilib_os_dir
+-					   : multilib_dir;
+-		  /* Do not separate options, include non-multilibbed variant.  */
+-		  do_spec_path (pl, "-L",
++	      info.option = "-L";
++	      info.append_len = 0;
+ #ifdef RELATIVE_PREFIX_NOT_LINKDIR
+-				1,
++	      /* Used on systems which record the specified -L dirs
++		 and use them to search for dynamic linking.
++		 Relative directories always come from -B,
++		 and it is better not to use them for searching
++		 at run time.  In particular, stage1 loses.  */
++	      info.omit_relative = true;
+ #else
+-				0,
++	      info.omit_relative = false;
+ #endif
+-				0, 0, multilib_dir, no_suffix_multilib_dir);
+-		}
++	      info.separate_options = false;
++
++	      for_each_path (&startfile_prefixes, true, 0, spec_path, &info);
+ 	    }
+ 	    break;
+ 
+@@ -4883,7 +4926,7 @@
+ 
+ 	  case 'I':
+ 	    {
+-	      struct prefix_list *pl = include_prefixes.plist;
++	      struct spec_path_info info;
+ 
+ 	      if (gcc_exec_prefix)
+ 		{
+@@ -4906,9 +4949,14 @@
+ 		  do_spec_1 (" ", 0, NULL);
+ 		}
+ 
+-	      for (; pl; pl = pl->next)
+-		/* Separate options, don't include non-suffixed variant.  */
+-		do_spec_path (pl, "-isystem", 0, 1, 1, "include", "include");
++	      info.option = "-isystem";
++	      info.append = "include";
++	      info.append_len = strlen (info.append);
++	      info.omit_relative = false;
++	      info.separate_options = true;
++
++	      for_each_path (&include_prefixes, false, info.append_len,
++			     spec_path, &info);
+ 	    }
+ 	    break;
+ 
+@@ -5894,48 +5942,27 @@
+ static const char *
+ find_file (const char *name)
+ {
+-  char *newname;
+-
+-  /* Try multilib_dir if it is defined.  */
+-  if (multilib_os_dir != NULL)
+-    {
+-      newname = find_a_file (&startfile_prefixes, name, R_OK, 1);
+-
+-      /* If we don't find it in the multi library dir, then fall
+-	 through and look for it in the normal places.  */
+-      if (newname != NULL)
+-	return newname;
+-    }
+-
+-  newname = find_a_file (&startfile_prefixes, name, R_OK, 0);
++  char *newname = find_a_file (&startfile_prefixes, name, R_OK, true);
+   return newname ? newname : name;
+ }
+ 
+ /* Determine whether a directory exists.  If LINKER, return 0 for
+-   certain fixed names not needed by the linker.  If not LINKER, it is
+-   only important to return 0 if the host machine has a small ARG_MAX
+-   limit.  */
++   certain fixed names not needed by the linker.  */
+ 
+ static int
+-is_directory (const char *path1, const char *path2, int linker)
++is_directory (const char *path1, bool linker)
+ {
+-  int len1 = strlen (path1);
+-  int len2 = strlen (path2);
+-  char *path = alloca (3 + len1 + len2);
++  int len1;
++  char *path;
+   char *cp;
+   struct stat st;
+ 
+-#ifndef SMALL_ARG_MAX
+-  if (! linker)
+-    return 1;
+-#endif
+-
+-  /* Construct the path from the two parts.  Ensure the string ends with "/.".
+-     The resulting path will be a directory even if the given path is a
+-     symbolic link.  */
++  /* Ensure the string ends with "/.".  The resulting path will be a
++     directory even if the given path is a symbolic link.  */
++  len1 = strlen (path1);
++  path = alloca (3 + len1);
+   memcpy (path, path1, len1);
+-  memcpy (path + len1, path2, len2);
+-  cp = path + len1 + len2;
++  cp = path + len1;
+   if (!IS_DIR_SEPARATOR (cp[-1]))
+     *cp++ = DIR_SEPARATOR;
+   *cp++ = '.';
+@@ -5943,13 +5970,13 @@
+ 
+   /* Exclude directories that the linker is known to search.  */
+   if (linker
++      && IS_DIR_SEPARATOR (path[0])
+       && ((cp - path == 6
+-	   && strcmp (path, concat (dir_separator_str, "lib",
+-				    dir_separator_str, ".", NULL)) == 0)
++	   && strncmp (path + 1, "lib", 3) == 0)
+ 	  || (cp - path == 10
+-	      && strcmp (path, concat (dir_separator_str, "usr",
+-				       dir_separator_str, "lib",
+-				       dir_separator_str, ".", NULL)) == 0)))
++	      && strncmp (path + 1, "usr", 3) == 0
++	      && IS_DIR_SEPARATOR (path[4])
++	      && strncmp (path + 5, "lib", 3) == 0)))
+     return 0;
+ 
+   return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
+@@ -6139,7 +6166,7 @@
+ 			   spec_version, dir_separator_str, NULL);
+   just_machine_suffix = concat (spec_machine, dir_separator_str, NULL);
+ 
+-  specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, 0);
++  specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, true);
+   /* Read the specs file unless it is a default one.  */
+   if (specs_file != 0 && strcmp (specs_file, "specs"))
+     read_specs (specs_file, TRUE);
+@@ -6275,7 +6302,7 @@
+   for (uptr = user_specs_head; uptr; uptr = uptr->next)
+     {
+       char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+-				    R_OK, 0);
++				    R_OK, true);
+       read_specs (filename ? filename : uptr->filename, FALSE);
+     }
+ 
+@@ -6304,8 +6331,10 @@
+   if (print_search_dirs)
+     {
+       printf (_("install: %s%s\n"), standard_exec_prefix, machine_suffix);
+-      printf (_("programs: %s\n"), build_search_list (&exec_prefixes, "", 0));
+-      printf (_("libraries: %s\n"), build_search_list (&startfile_prefixes, "", 0));
++      printf (_("programs: %s\n"),
++	      build_search_list (&exec_prefixes, "", false, false));
++      printf (_("libraries: %s\n"),
++	      build_search_list (&startfile_prefixes, "", false, true));
+       return (0);
+     }
+ 
+@@ -6622,14 +6651,14 @@
+       /* We'll use ld if we can't find collect2.  */
+       if (! strcmp (linker_name_spec, "collect2"))
+ 	{
+-	  char *s = find_a_file (&exec_prefixes, "collect2", X_OK, 0);
++	  char *s = find_a_file (&exec_prefixes, "collect2", X_OK, false);
+ 	  if (s == NULL)
+ 	    linker_name_spec = "ld";
+ 	}
+       /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
+ 	 for collect.  */
+-      putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH");
+-      putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV);
++      putenv_from_prefixes (&exec_prefixes, "COMPILER_PATH", false);
++      putenv_from_prefixes (&startfile_prefixes, LIBRARY_PATH_ENV, true);
+ 
+       value = do_spec (link_command_spec);
+       if (value < 0)
+diff -uNr gcc-4.1.0/gcc/system.h gcc-4.1.0-PR20425/gcc/system.h
+--- gcc-4.1.0/gcc/system.h	2005-08-16 10:13:53.000000000 +1000
++++ gcc-4.1.0-PR20425/gcc/system.h	2006-03-10 23:51:31.000000000 +1100
+@@ -728,7 +728,8 @@
+         TARGET_ESC TARGET_FF TARGET_NEWLINE TARGET_TAB TARGET_VT	   \
+         LINK_LIBGCC_SPECIAL DONT_ACCESS_GBLS_AFTER_EPILOGUE		   \
+ 	TARGET_OPTIONS TARGET_SWITCHES EXTRA_CC_MODES FINALIZE_PIC	   \
+-	PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF
++	PREDICATE_CODES SPECIAL_MODE_PREDICATES HOST_PTR_PRINTF		   \
++	SMALL_ARG_MAX
+ 
+ /* Hooks that are no longer used.  */
+  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\
Index: patches/gcc-4.1.1-cross_search_paths-1.patch
===================================================================
--- patches/gcc-4.1.1-cross_search_paths-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-cross_search_paths-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -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.1-posix-1.patch
===================================================================
--- patches/gcc-4.1.1-posix-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-posix-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -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.1-powerpc64_multilib-1.patch
===================================================================
--- patches/gcc-4.1.1-powerpc64_multilib-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-powerpc64_multilib-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -0,0 +1,33 @@
+Submitted By: Ken Moffat (ken at linuxfromscratch dot org)
+Origin: fedora
+        Rediffed against 4.1.0 by Chris Staub
+Date: 2005-11-22
+Initial package version: 4.0.2
+Description: In a native ppc64 build, this fixes a linkage failure while
+installing a 32-bit nof/ (no -hardware- floating point) library, and also gets
+rid of 1500 failures in the g++ testsuite.  From fedora gcc-4.0.1, rediffed to
+apply with -p1.
+
+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:08:12.000000000 -0500
+@@ -6,13 +6,13 @@
+ 
+ TARGET_LIBGCC2_CFLAGS += -mno-minimal-toc
+ 
+-MULTILIB_OPTIONS        = m64/m32 msoft-float
+-MULTILIB_DIRNAMES       = 64 32 nof
++MULTILIB_OPTIONS        = m64/m32
++MULTILIB_DIRNAMES       = 64 32
+ MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
+-MULTILIB_EXCEPTIONS     = m64/msoft-float
+-MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES	= ../lib64 ../lib nof
+-MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
++MULTILIB_EXCEPTIONS     =
++MULTILIB_EXCLUSIONS     =
++MULTILIB_OSDIRNAMES	= ../lib64 ../lib
++MULTILIB_MATCHES        =
+ 
+ # We want fine grained libraries, so use the new code to build the
+ # floating point emulation libraries.
Index: patches/gcc-4.1.1-pure64-1.patch
===================================================================
--- patches/gcc-4.1.1-pure64-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-pure64-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -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.1-pure64_specs-1.patch
===================================================================
--- patches/gcc-4.1.1-pure64_specs-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-pure64_specs-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -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.1-sparc_tls-1.patch
===================================================================
--- patches/gcc-4.1.1-sparc_tls-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-sparc_tls-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -0,0 +1,24 @@
+Submitted By: Ryan Oliver <ryan at pha dot com dot au>
+Date: 2006-04-30
+Initial Package Version: 4.1.0
+Origin: Jakub
+Upstream Status: In GCC Trunk
+Description: Fixed in GCC SVN Revision #110522
+	* config/sparc/sparc.c (sparc_output_scratch_registers): Use
+	#ignore instead of #scratch for %g7 .register directive.
+
+--- trunk/gcc/config/sparc/sparc.c	2006/01/31 22:33:27	110451
++++ trunk/gcc/config/sparc/sparc.c	2006/02/02 22:49:01	110522
+@@ -3693,7 +3693,10 @@
+ 	  && ! sparc_hard_reg_printed [i])
+ 	{
+ 	  sparc_hard_reg_printed [i] = 1;
+-	  fprintf (file, "\t.register\t%%g%d, #scratch\n", i);
++	  /* %g7 is used as TLS base register, use #ignore
++	     for it instead of #scratch.  */
++	  fprintf (file, "\t.register\t%%g%d, #%s\n", i,
++		   i == 7 ? "ignore" : "scratch");
+ 	}
+       if (i == 3) i = 5;
+     }
+
Index: patches/gcc-4.1.1-specs-1.patch
===================================================================
--- patches/gcc-4.1.1-specs-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
+++ patches/gcc-4.1.1-specs-1.patch	(revision 89d1048f1a532a3fc040b127344c20b077bcd9a7)
@@ -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
