Index: tches/binutils-2.16.94-genscripts_multilib-1.patch
===================================================================
--- patches/binutils-2.16.94-genscripts_multilib-1.patch	(revision 768c7e1dc91b494bc512b141f1cd868adbc46dd8)
+++ 	(revision )
@@ -1,65 +1,0 @@
-Submitted By: Ryan Oliver (ryan dot oliver at pha dot com dot au)
-Origin: Ryan Oliver
-Date: 2005-04-03
-Initial package version: 2.15 (problem also exists in 2.14 series)
-Description:
-        Updated patch, use this for all binutils 2.15 series instead of the
-        binutils-2.15.90.0.1-genscripts-multilib.patch
-
-        If --with-libpath= was specified during configure (or LIB_PATH was
-        supplied during make) we want to have these libraries added to the
-        linker scripts search paths, and in the case of multi-lib have them
-        processed to provide both lib and lib64 search paths.
-        This patch produces this behaviour when building a cross-binutils.
-
-        Also to fix an annoyance we remove whatever was specified (if anything)
-        by --libdir= from the linker script search path. This is so when cross-
-        compiling a 64bit target-native biarch toolchain we can specify the
-        installation directory for binutils produced libraries to be */lib64
-        without having this directory added to the 32bit emulation search path.
-
-        By rights we should really check if ${libdir} matches a search path in
-        any of the supported emulations for this target (as opposed to only the
-        one genscripts.sh is currently processing) and if so ignore ${libpath}.
-
-	This patch differs from the preceding genscripts-multilib patch as now
-	USE_LIBPATH will always be set if LIB_PATH is non empty
-
-diff -uNr binutils-2.15.91.0.1-orig/ld/genscripts.sh binutils-2.15.91.0.1/ld/genscripts.sh
---- binutils-2.15.91.0.1-orig/ld/genscripts.sh	2004-05-28 04:26:04.000000000 +1000
-+++ binutils-2.15.91.0.1/ld/genscripts.sh	2005-04-03 16:14:51.000000000 +1000
-@@ -110,7 +110,8 @@
- esac
- 
- # If the emulparams file sets NATIVE, make sure USE_LIBPATH is set also.
--if test "x$NATIVE" = "xyes" ; then
-+# Also set USE_LIBPATH if LIB_PATH has been set
-+if [ "x$NATIVE" = "xyes" -o "x${LIB_PATH}" != "x" ] ; then
-   USE_LIBPATH=yes
- fi
- 
-@@ -125,17 +126,17 @@
- #
- # If the emulparams file set LIBPATH_SUFFIX, prepend an extra copy of
- # the library path with the suffix applied.
--
--if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
-+if [ "x${USE_LIBPATH}" = xyes ] ; then
-   LIB_PATH2=
-+  if [ "x${LIB_PATH}" = "x" ] ; then 
-+    libs="${NATIVE_LIB_DIRS}"
-+  else
-+    libs=`echo ${LIB_PATH} | sed 's/:/ /g'`
-+    LIB_PATH=
-+  fi
- 
--  libs=${NATIVE_LIB_DIRS}
-   if [ "x${use_sysroot}" != "xyes" ] ; then
-     case " ${libs} " in
--      *" ${libdir} "*) ;;
--      *) libs="${libdir} ${libs}" ;;
--    esac
--    case " ${libs} " in
-       *" ${tool_lib} "*) ;;
-       *) libs="${tool_lib} ${libs}" ;;
-     esac
Index: tches/binutils-2.16.94-posix-1.patch
===================================================================
--- patches/binutils-2.16.94-posix-1.patch	(revision 768c7e1dc91b494bc512b141f1cd868adbc46dd8)
+++ 	(revision )
@@ -1,98 +1,0 @@
-Submitted By: Jim Gifford (patches at jg555 dot com)
-Date: 2005-05-06
-Initial Package Version: 2.16
-Origin: http://ttervo.vectorstar.net/nptl/posix-patches/binutils-2.14.90.0.7-posix-head-tail.patch
-Upstream Status: Accepted/but Suspended
-Description: Makes Posix Compliant
-	     Rediffed against 2.16 by Jeremy Huntwork
-
-diff -Naur binutils-2.16-ORIG/gas/Makefile.am binutils-2.16/gas/Makefile.am
---- binutils-2.16-ORIG/gas/Makefile.am	2005-03-22 10:31:44.000000000 -0500
-+++ binutils-2.16/gas/Makefile.am	2005-05-06 17:08:11.859876859 -0400
-@@ -762,13 +762,13 @@
- against=stage2
- 
- # This rule is derived from corresponding code in the Makefile.in for gcc.
--# The "tail +16c" is to bypass headers which may include timestamps or
-+# The "tail -c +16" is to bypass headers which may include timestamps or
- # temporary assembly file names.
- comparison:
- 	x=0 ; \
- 	for file in *.o ; do \
--	  tail +16c ./$$file > tmp-foo1; \
--	  if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
-+	  tail -c +16 ./$$file > tmp-foo1; \
-+	  if tail -c +16 ${against}/$$file > tmp-foo2 2>/dev/null ; then \
- 	    if cmp tmp-foo1 tmp-foo2 ; then \
- 	      true ; \
- 	    else \
-diff -Naur binutils-2.16-ORIG/gas/Makefile.in binutils-2.16/gas/Makefile.in
---- binutils-2.16-ORIG/gas/Makefile.in	2005-04-29 09:57:16.000000000 -0400
-+++ binutils-2.16/gas/Makefile.in	2005-05-06 17:08:11.868875659 -0400
-@@ -3164,13 +3164,13 @@
- 	if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
- 
- # This rule is derived from corresponding code in the Makefile.in for gcc.
--# The "tail +16c" is to bypass headers which may include timestamps or
-+# The "tail -c +16" is to bypass headers which may include timestamps or
- # temporary assembly file names.
- comparison:
- 	x=0 ; \
- 	for file in *.o ; do \
--	  tail +16c ./$$file > tmp-foo1; \
--	  if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
-+	  tail -c +16 ./$$file > tmp-foo1; \
-+	  if tail -c +16 ${against}/$$file > tmp-foo2 2>/dev/null ; then \
- 	    if cmp tmp-foo1 tmp-foo2 ; then \
- 	      true ; \
- 	    else \
-diff -Naur binutils-2.16-ORIG/ld/testsuite/ld-bootstrap/bootstrap.exp binutils-2.16/ld/testsuite/ld-bootstrap/bootstrap.exp
---- binutils-2.16-ORIG/ld/testsuite/ld-bootstrap/bootstrap.exp	2005-03-03 06:52:06.000000000 -0500
-+++ binutils-2.16/ld/testsuite/ld-bootstrap/bootstrap.exp	2005-05-06 17:08:11.870875393 -0400
-@@ -149,8 +149,8 @@
-         # Although this works, a way to set the date would be better.
-         # Removing or zeroing the date stamp in the binary produced by
-         # the linker is not possible as it is required by the target OS.
--        exec tail +140 tmpdir/ld2 >tmpdir/ld2tail
--        exec tail +140 tmpdir/ld3 >tmpdir/ld3tail
-+        exec tail -n +140 tmpdir/ld2 >tmpdir/ld2tail
-+        exec tail -n +140 tmpdir/ld3 >tmpdir/ld3tail
-         catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
-         exec rm tmpdir/ld2tail tmpdir/ld3tail
-     } else {
-diff -Naur binutils-2.16-ORIG/ltcf-c.sh binutils-2.16/ltcf-c.sh
---- binutils-2.16-ORIG/ltcf-c.sh	2004-10-05 09:34:42.000000000 -0400
-+++ binutils-2.16/ltcf-c.sh	2005-05-06 17:08:11.873874993 -0400
-@@ -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 binutils-2.16-ORIG/ltcf-gcj.sh binutils-2.16/ltcf-gcj.sh
---- binutils-2.16-ORIG/ltcf-gcj.sh	2004-07-21 15:21:41.000000000 -0400
-+++ binutils-2.16/ltcf-gcj.sh	2005-05-06 17:08:11.876874593 -0400
-@@ -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;
-diff -Naur binutils-2.16-ORIG/src-release binutils-2.16/src-release
---- binutils-2.16-ORIG/src-release	2004-12-03 05:30:06.000000000 -0500
-+++ binutils-2.16/src-release	2005-05-06 17:08:11.878874327 -0400
-@@ -69,7 +69,7 @@
- 	elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
- 	  sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
- 	elif test -f $(TOOL)/version.in; then \
--	  head -1 $(TOOL)/version.in; \
-+	  head -n 1 $(TOOL)/version.in; \
- 	elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
- 	  sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
- 	else \
Index: patches/binutils-2.17-genscripts_multilib-1.patch
===================================================================
--- patches/binutils-2.17-genscripts_multilib-1.patch	(revision 422c69964b13c2c38030c8df0f5e19b1ff8b2620)
+++ patches/binutils-2.17-genscripts_multilib-1.patch	(revision 422c69964b13c2c38030c8df0f5e19b1ff8b2620)
@@ -0,0 +1,65 @@
+Submitted By: Ryan Oliver (ryan dot oliver at pha dot com dot au)
+Origin: Ryan Oliver
+Date: 2005-04-03
+Initial package version: 2.15 (problem also exists in 2.14 series)
+Description:
+        Updated patch, use this for all binutils 2.15 series instead of the
+        binutils-2.15.90.0.1-genscripts-multilib.patch
+
+        If --with-libpath= was specified during configure (or LIB_PATH was
+        supplied during make) we want to have these libraries added to the
+        linker scripts search paths, and in the case of multi-lib have them
+        processed to provide both lib and lib64 search paths.
+        This patch produces this behaviour when building a cross-binutils.
+
+        Also to fix an annoyance we remove whatever was specified (if anything)
+        by --libdir= from the linker script search path. This is so when cross-
+        compiling a 64bit target-native biarch toolchain we can specify the
+        installation directory for binutils produced libraries to be */lib64
+        without having this directory added to the 32bit emulation search path.
+
+        By rights we should really check if ${libdir} matches a search path in
+        any of the supported emulations for this target (as opposed to only the
+        one genscripts.sh is currently processing) and if so ignore ${libpath}.
+
+	This patch differs from the preceding genscripts-multilib patch as now
+	USE_LIBPATH will always be set if LIB_PATH is non empty
+
+diff -uNr binutils-2.15.91.0.1-orig/ld/genscripts.sh binutils-2.15.91.0.1/ld/genscripts.sh
+--- binutils-2.15.91.0.1-orig/ld/genscripts.sh	2004-05-28 04:26:04.000000000 +1000
++++ binutils-2.15.91.0.1/ld/genscripts.sh	2005-04-03 16:14:51.000000000 +1000
+@@ -110,7 +110,8 @@
+ esac
+ 
+ # If the emulparams file sets NATIVE, make sure USE_LIBPATH is set also.
+-if test "x$NATIVE" = "xyes" ; then
++# Also set USE_LIBPATH if LIB_PATH has been set
++if [ "x$NATIVE" = "xyes" -o "x${LIB_PATH}" != "x" ] ; then
+   USE_LIBPATH=yes
+ fi
+ 
+@@ -125,17 +126,17 @@
+ #
+ # If the emulparams file set LIBPATH_SUFFIX, prepend an extra copy of
+ # the library path with the suffix applied.
+-
+-if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
++if [ "x${USE_LIBPATH}" = xyes ] ; then
+   LIB_PATH2=
++  if [ "x${LIB_PATH}" = "x" ] ; then 
++    libs="${NATIVE_LIB_DIRS}"
++  else
++    libs=`echo ${LIB_PATH} | sed 's/:/ /g'`
++    LIB_PATH=
++  fi
+ 
+-  libs=${NATIVE_LIB_DIRS}
+   if [ "x${use_sysroot}" != "xyes" ] ; then
+     case " ${libs} " in
+-      *" ${libdir} "*) ;;
+-      *) libs="${libdir} ${libs}" ;;
+-    esac
+-    case " ${libs} " in
+       *" ${tool_lib} "*) ;;
+       *) libs="${tool_lib} ${libs}" ;;
+     esac
Index: patches/binutils-2.17-posix-1.patch
===================================================================
--- patches/binutils-2.17-posix-1.patch	(revision 422c69964b13c2c38030c8df0f5e19b1ff8b2620)
+++ patches/binutils-2.17-posix-1.patch	(revision 422c69964b13c2c38030c8df0f5e19b1ff8b2620)
@@ -0,0 +1,98 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-05-06
+Initial Package Version: 2.16
+Origin: http://ttervo.vectorstar.net/nptl/posix-patches/binutils-2.14.90.0.7-posix-head-tail.patch
+Upstream Status: Accepted/but Suspended
+Description: Makes Posix Compliant
+	     Rediffed against 2.16 by Jeremy Huntwork
+
+diff -Naur binutils-2.16-ORIG/gas/Makefile.am binutils-2.16/gas/Makefile.am
+--- binutils-2.16-ORIG/gas/Makefile.am	2005-03-22 10:31:44.000000000 -0500
++++ binutils-2.16/gas/Makefile.am	2005-05-06 17:08:11.859876859 -0400
+@@ -762,13 +762,13 @@
+ against=stage2
+ 
+ # This rule is derived from corresponding code in the Makefile.in for gcc.
+-# The "tail +16c" is to bypass headers which may include timestamps or
++# The "tail -c +16" is to bypass headers which may include timestamps or
+ # temporary assembly file names.
+ comparison:
+ 	x=0 ; \
+ 	for file in *.o ; do \
+-	  tail +16c ./$$file > tmp-foo1; \
+-	  if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
++	  tail -c +16 ./$$file > tmp-foo1; \
++	  if tail -c +16 ${against}/$$file > tmp-foo2 2>/dev/null ; then \
+ 	    if cmp tmp-foo1 tmp-foo2 ; then \
+ 	      true ; \
+ 	    else \
+diff -Naur binutils-2.16-ORIG/gas/Makefile.in binutils-2.16/gas/Makefile.in
+--- binutils-2.16-ORIG/gas/Makefile.in	2005-04-29 09:57:16.000000000 -0400
++++ binutils-2.16/gas/Makefile.in	2005-05-06 17:08:11.868875659 -0400
+@@ -3164,13 +3164,13 @@
+ 	if [ -f stage3/as-new$(EXEEXT) -a ! -f stage3/as$(EXEEXT) ] ; then (cd stage3 ; ln -s as-new as$(EXEEXT)) ; fi
+ 
+ # This rule is derived from corresponding code in the Makefile.in for gcc.
+-# The "tail +16c" is to bypass headers which may include timestamps or
++# The "tail -c +16" is to bypass headers which may include timestamps or
+ # temporary assembly file names.
+ comparison:
+ 	x=0 ; \
+ 	for file in *.o ; do \
+-	  tail +16c ./$$file > tmp-foo1; \
+-	  if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
++	  tail -c +16 ./$$file > tmp-foo1; \
++	  if tail -c +16 ${against}/$$file > tmp-foo2 2>/dev/null ; then \
+ 	    if cmp tmp-foo1 tmp-foo2 ; then \
+ 	      true ; \
+ 	    else \
+diff -Naur binutils-2.16-ORIG/ld/testsuite/ld-bootstrap/bootstrap.exp binutils-2.16/ld/testsuite/ld-bootstrap/bootstrap.exp
+--- binutils-2.16-ORIG/ld/testsuite/ld-bootstrap/bootstrap.exp	2005-03-03 06:52:06.000000000 -0500
++++ binutils-2.16/ld/testsuite/ld-bootstrap/bootstrap.exp	2005-05-06 17:08:11.870875393 -0400
+@@ -149,8 +149,8 @@
+         # Although this works, a way to set the date would be better.
+         # Removing or zeroing the date stamp in the binary produced by
+         # the linker is not possible as it is required by the target OS.
+-        exec tail +140 tmpdir/ld2 >tmpdir/ld2tail
+-        exec tail +140 tmpdir/ld3 >tmpdir/ld3tail
++        exec tail -n +140 tmpdir/ld2 >tmpdir/ld2tail
++        exec tail -n +140 tmpdir/ld3 >tmpdir/ld3tail
+         catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
+         exec rm tmpdir/ld2tail tmpdir/ld3tail
+     } else {
+diff -Naur binutils-2.16-ORIG/ltcf-c.sh binutils-2.16/ltcf-c.sh
+--- binutils-2.16-ORIG/ltcf-c.sh	2004-10-05 09:34:42.000000000 -0400
++++ binutils-2.16/ltcf-c.sh	2005-05-06 17:08:11.873874993 -0400
+@@ -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 binutils-2.16-ORIG/ltcf-gcj.sh binutils-2.16/ltcf-gcj.sh
+--- binutils-2.16-ORIG/ltcf-gcj.sh	2004-07-21 15:21:41.000000000 -0400
++++ binutils-2.16/ltcf-gcj.sh	2005-05-06 17:08:11.876874593 -0400
+@@ -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;
+diff -Naur binutils-2.16-ORIG/src-release binutils-2.16/src-release
+--- binutils-2.16-ORIG/src-release	2004-12-03 05:30:06.000000000 -0500
++++ binutils-2.16/src-release	2005-05-06 17:08:11.878874327 -0400
+@@ -69,7 +69,7 @@
+ 	elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
+ 	  sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
+ 	elif test -f $(TOOL)/version.in; then \
+-	  head -1 $(TOOL)/version.in; \
++	  head -n 1 $(TOOL)/version.in; \
+ 	elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
+ 	  sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
+ 	else \
