Index: scripts/patch/gcc-patch.sh
===================================================================
--- scripts/patch/gcc-patch.sh	(revision b2d50f5498aefea4743abb08f2e2c900c08a7306)
+++ scripts/patch/gcc-patch.sh	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -68,5 +68,9 @@
     Makefile.in Makefile.tpl README README.SCO BUGS FAQ LAST_UPDATED
     MD5SUMS NEWS bugs.html faq.html gcc/BASE-VER gcc/DEV-PHASE
-    gcc/f/BUGS gcc/f/NEWS gcc/gengtype-lex.c"
+    gcc/f/BUGS gcc/f/NEWS gcc/gengtype-lex.c INSTALL/binaries.html
+    INSTALL/build.html INSTALL/configure.html INSTALL/download.html
+    INSTALL/finalinstall.html INSTALL/gfdl.html INSTALL/index.html
+    INSTALL/old.html INSTALL/prerequisites.html INSTALL/specific.html
+    INSTALL/test.html"
   for file in ${REMOVE}; do
     rm -f $file
Index: scripts/patch/gcc/4.4.0/40-powepc-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.0/40-powepc-fixes.patch	(revision b2d50f5498aefea4743abb08f2e2c900c08a7306)
+++ 	(revision )
@@ -1,25 +1,0 @@
-A Temporary Work around for
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37739
-
-diff -Naur gcc-4.4.0.orig/gcc/config.host gcc-4.4.0/gcc/config.host
---- gcc-4.4.0.orig/gcc/config.host	2009-03-24 03:33:57.000000000 -0700
-+++ gcc-4.4.0/gcc/config.host	2009-07-19 14:09:55.000000000 -0700
-@@ -135,17 +135,7 @@
- 	  # On powerpc*-*-linux* use -Wl,--relax to link cc1,
- 	  # if ld is new enough, otherwise force -O1 in CFLAGS.
- 	  host_ppc_relax_xmake_file=
--	  host_ld_ver=`${CC} -Wl,--version 2>/dev/null | sed 1q`
--	  if echo "$host_ld_ver" | grep GNU > /dev/null; then
--	    host_ld_date=`echo $host_ld_ver \
--			  | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
--	    if test 0"$host_ld_date" -gt 20080806; then
--	      host_ppc_relax_xmake_file=rs6000/x-linux-relax
--	    fi
--	  fi
--	  if test -z "${host_ppc_relax_xmake_file}"; then
--	    host_ppc_relax_xmake_file=x-cflags-O1
--	  fi
-+	  host_ppc_relax_xmake_file=x-cflags-O1
- 	  host_xmake_file="${host_xmake_file} ${host_ppc_relax_xmake_file}"
- 	fi
- 	;;
Index: scripts/patch/gcc/4.4.1/01-cloog-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.1/01-cloog-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
+++ scripts/patch/gcc/4.4.1/01-cloog-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -0,0 +1,173 @@
+2009-01-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* Makefile.in (BACKENDLIBS): Link against -ldl instead of -lcloog -lppl.
+	(graphite.o): Force -O, remove -fkeep-inline-functions.
+	* graphite.c: Include <dlfcn.h>.  Reference libcloog and libppl symbols
+	through pointers in cloog_pointers variable.
+	(init_cloog_pointers): New function.
+	(gcc_type_for_iv_of_clast_loop): Rename stmt_for argument to stmt_fora.
+	(graphite_transform_loops): Call init_cloog_pointers.
+
+diff -Naur gcc-4.4.0.orig/gcc/graphite.c gcc-4.4.0/gcc/graphite.c
+--- gcc-4.4.0.orig/gcc/graphite.c	2009-03-18 09:59:55.000000000 -0700
++++ gcc-4.4.0/gcc/graphite.c	2009-07-14 09:26:53.000000000 -0700
+@@ -59,6 +59,110 @@
+ #include "cloog/cloog.h"
+ #include "graphite.h"
+ 
++#include <dlfcn.h>
++#define DYNSYMS \
++  DYNSYM (cloog_block_alloc); \
++  DYNSYM (cloog_block_list_free); \
++  DYNSYM (cloog_block_list_malloc); \
++  DYNSYM (cloog_clast_create); \
++  DYNSYM (cloog_clast_free); \
++  DYNSYM (cloog_domain_free); \
++  DYNSYM (cloog_domain_matrix2domain); \
++  DYNSYM (cloog_initialize); \
++  DYNSYM (cloog_loop_malloc); \
++  DYNSYM (cloog_matrix_alloc); \
++  DYNSYM (cloog_matrix_copy); \
++  DYNSYM (cloog_matrix_free); \
++  DYNSYM (cloog_matrix_print); \
++  DYNSYM (cloog_names_malloc); \
++  DYNSYM (cloog_names_scalarize); \
++  DYNSYM (cloog_options_free); \
++  DYNSYM (cloog_options_malloc); \
++  DYNSYM (cloog_program_dump_cloog); \
++  DYNSYM (cloog_program_extract_scalars); \
++  DYNSYM (cloog_program_free); \
++  DYNSYM (cloog_program_generate); \
++  DYNSYM (cloog_program_malloc); \
++  DYNSYM (cloog_program_print); \
++  DYNSYM (cloog_program_scatter); \
++  DYNSYM (cloog_statement_alloc); \
++  DYNSYM (ppl_finalize); \
++  DYNSYM (pprint); \
++  DYNSYM (stmt_block); \
++  DYNSYM (stmt_for); \
++  DYNSYM (stmt_guard); \
++  DYNSYM (stmt_root); \
++  DYNSYM (stmt_user);
++static struct
++{
++  bool inited;
++  void *h;
++#define DYNSYM(x) __typeof (x) *p_##x
++  DYNSYMS
++#undef DYNSYM
++} cloog_pointers;
++
++#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc)
++#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free)
++#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc)
++#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create)
++#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free)
++#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free)
++#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain)
++#define cloog_initialize (*cloog_pointers.p_cloog_initialize)
++#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc)
++#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc)
++#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy)
++#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free)
++#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print)
++#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc)
++#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize)
++#define cloog_options_free (*cloog_pointers.p_cloog_options_free)
++#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc)
++#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog)
++#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars)
++#define cloog_program_free (*cloog_pointers.p_cloog_program_free)
++#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate)
++#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc)
++#define cloog_program_print (*cloog_pointers.p_cloog_program_print)
++#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter)
++#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc)
++#define ppl_finalize (*cloog_pointers.p_ppl_finalize)
++#define pprint (*cloog_pointers.p_pprint)
++#define stmt_block (*cloog_pointers.p_stmt_block)
++#define stmt_for (*cloog_pointers.p_stmt_for)
++#define stmt_guard (*cloog_pointers.p_stmt_guard)
++#define stmt_root (*cloog_pointers.p_stmt_root)
++#define stmt_user (*cloog_pointers.p_stmt_user)
++
++#define cloog_finalize (*cloog_pointers.p_ppl_finalize)
++
++static bool
++init_cloog_pointers (void)
++{
++  void *h;
++
++  if (cloog_pointers.inited)
++    return cloog_pointers.h != NULL;
++  h = dlopen ("libcloog.so.0", RTLD_LAZY);
++  cloog_pointers.h = h;
++  if (h == NULL)
++    return false;
++#define DYNSYM(x) \
++  do \
++    { \
++      union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \
++      u.q = dlsym (h, #x); \
++      if (u.q == NULL) \
++	return false; \
++      cloog_pointers.p_##x = u.p; \
++    } \
++  while (0)
++  DYNSYMS
++#undef DYNSYM
++  return true;
++}
++
+ static VEC (scop_p, heap) *current_scops;
+ 
+ /* Converts a GMP constant V to a tree and returns it.  */
+@@ -4075,10 +4179,10 @@
+    STMT.  */
+ 
+ static tree
+-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for)
++gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora)
+ {
+-  struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for);
+-  const char *cloog_iv = stmt_for->iterator;
++  struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora);
++  const char *cloog_iv = stmt_fora->iterator;
+   CloogStatement *cs = stmt->statement;
+   graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs);
+ 
+@@ -6109,6 +6213,12 @@
+   if (number_of_loops () <= 1)
+     return;
+ 
++  if (!init_cloog_pointers ())
++    {
++      sorry ("Graphite loop optimizations cannot be used");
++      return;
++    }
++
+   current_scops = VEC_alloc (scop_p, heap, 3);
+   recompute_all_dominators ();
+ 
+diff -Naur gcc-4.4.0.orig/gcc/Makefile.in gcc-4.4.0/gcc/Makefile.in
+--- gcc-4.4.0.orig/gcc/Makefile.in	2009-07-14 09:25:46.000000000 -0700
++++ gcc-4.4.0/gcc/Makefile.in	2009-07-14 09:26:53.000000000 -0700
+@@ -914,7 +914,7 @@
+ # How to link with both our special library facilities
+ # and the system's installed libraries.
+ LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
+-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
++BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl)
+ # Any system libraries needed just for GNAT.
+ SYSLIBS = @GNAT_LIBEXC@
+ 
+@@ -3061,6 +3061,9 @@
+ 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
+ 		$(out_file) $(OUTPUT_OPTION)
+ 
++graphite.o : \
++  ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
++
+ # Build auxiliary files that support ecoff format.
+ mips-tfile: mips-tfile.o version.o $(LIBDEPS)
+ 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
Index: scripts/patch/gcc/4.4.1/05-java-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.1/05-java-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
+++ scripts/patch/gcc/4.4.1/05-java-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -0,0 +1,49 @@
+Java can only be built as 1 ABI at the moment. So this switch will all
+the disabling of only the java multilib build
+
+diff -Naur gcc-4.4.0.orig/libjava/configure gcc-4.4.0/libjava/configure
+--- gcc-4.4.0.orig/libjava/configure	2009-07-14 09:25:46.000000000 -0700
++++ gcc-4.4.0/libjava/configure	2009-07-14 09:33:34.000000000 -0700
+@@ -1021,6 +1021,8 @@
+                           default=yes
+   --enable-java-maintainer-mode
+                           allow rebuilding of .class and .h files
++  --enable-libjava-multilib
++                          build libjava as multilib
+   --disable-dependency-tracking  speeds up one-time build
+   --enable-dependency-tracking   do not reject slow dependency extractors
+   --enable-maintainer-mode  enable make rules and dependencies not useful
+@@ -1973,6 +1975,16 @@
+ fi
+ 
+ 
++# Check whether --enable-libjava-multilib was given.
++if test "${enable_libjava_multilib+set}" = set; then
++  enableval=$enable_libjava_multilib;
++fi
++
++if test "$enable_libjava_multilib" = no; then
++  multilib=no
++  ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ 
+ 
+diff -Naur gcc-4.4.0.orig/libjava/configure.ac gcc-4.4.0/libjava/configure.ac
+--- gcc-4.4.0.orig/libjava/configure.ac	2009-07-14 09:25:46.000000000 -0700
++++ gcc-4.4.0/libjava/configure.ac	2009-07-14 09:33:34.000000000 -0700
+@@ -139,6 +139,13 @@
+ 	[allow rebuilding of .class and .h files]))
+ AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
+ 
++AC_ARG_ENABLE(libjava-multilib,
++	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
++if test "$enable_libjava_multilib" = no; then
++  multilib=no
++  ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ GCC_NO_EXECUTABLES
+ 
Index: scripts/patch/gcc/4.4.1/10-libgomp_multilib-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.1/10-libgomp_multilib-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
+++ scripts/patch/gcc/4.4.1/10-libgomp_multilib-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -0,0 +1,18 @@
+2008-06-09  Jakub Jelinek  <jakub@redhat.com>
+
+	* omp.h.in (omp_nest_lock_t): Fix up for Linux multilibs.
+
+diff -Naur gcc-4.4.0.orig/libgomp/omp.h.in gcc-4.4.0/libgomp/omp.h.in
+--- gcc-4.4.0.orig/libgomp/omp.h.in	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/libgomp/omp.h.in	2009-07-14 09:41:08.000000000 -0700
+@@ -39,8 +39,8 @@
+ 
+ typedef struct
+ {
+-  unsigned char _x[@OMP_NEST_LOCK_SIZE@] 
+-    __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
++  unsigned char _x[8 + sizeof (void *)] 
++    __attribute__((__aligned__(sizeof (void *))));
+ } omp_nest_lock_t;
+ #endif
+ 
Index: scripts/patch/gcc/4.4.1/15-libtool-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.1/15-libtool-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
+++ scripts/patch/gcc/4.4.1/15-libtool-fixes.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -0,0 +1,29 @@
+This patch works around rpath in GCC
+
+diff -Naur gcc-4.4.0.orig/ltmain.sh gcc-4.4.0/ltmain.sh
+--- gcc-4.4.0.orig/ltmain.sh	2008-09-26 09:21:02.000000000 -0700
++++ gcc-4.4.0/ltmain.sh	2009-07-14 10:03:39.000000000 -0700
+@@ -6886,6 +6886,7 @@
+ 	  rpath="$finalize_rpath"
+ 	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+ 	  for libdir in $rpath; do
++	    case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
+ 	      if test -n "$hardcode_libdir_separator"; then
+ 		if test -z "$hardcode_libdirs"; then
+@@ -7575,6 +7576,7 @@
+       rpath=
+       hardcode_libdirs=
+       for libdir in $compile_rpath $finalize_rpath; do
++	case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
+ 	if test -n "$hardcode_libdir_flag_spec"; then
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
+@@ -7626,6 +7628,7 @@
+       rpath=
+       hardcode_libdirs=
+       for libdir in $finalize_rpath; do
++	case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
+ 	if test -n "$hardcode_libdir_flag_spec"; then
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
Index: scripts/patch/gcc/4.4.1/20-powerpc-biarch.patch
===================================================================
--- scripts/patch/gcc/4.4.1/20-powerpc-biarch.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
+++ scripts/patch/gcc/4.4.1/20-powerpc-biarch.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -0,0 +1,24 @@
+This patch works changes the biarch of PPC to the match other archs
+
+diff -Naur gcc-4.4.0.orig/gcc/config/rs6000/t-linux64 gcc-4.4.0/gcc/config/rs6000/t-linux64
+--- gcc-4.4.0.orig/gcc/config/rs6000/t-linux64	2007-09-27 12:56:06.000000000 -0700
++++ gcc-4.4.0/gcc/config/rs6000/t-linux64	2009-07-14 10:14:54.000000000 -0700
+@@ -14,13 +14,13 @@
+ # it doesn't tell anything about the 32bit libraries on those systems.  Set
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+ 
+-MULTILIB_OPTIONS        = m64/m32 msoft-float
++MULTILIB_OPTIONS        = m64/m32
+ MULTILIB_DIRNAMES       = 64 32 nof
+ MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
+-MULTILIB_EXCEPTIONS     = m64/msoft-float
+-MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
+-MULTILIB_OSDIRNAMES	= ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
+-MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
++MULTILIB_EXCEPTIONS     =
++MULTILIB_EXCLUSIONS     =
++MULTILIB_OSDIRNAMES	= ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
++MULTILIB_MATCHES        = 
+ 
+ softfp_wrap_start := '\#ifndef __powerpc64__'
+ softfp_wrap_end := '\#endif'
Index: scripts/patch/gcc/4.4.1/25-hash-style.patch
===================================================================
--- scripts/patch/gcc/4.4.1/25-hash-style.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
+++ scripts/patch/gcc/4.4.1/25-hash-style.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -0,0 +1,145 @@
+2006-07-11  Jakub Jelinek  <jakub@redhat.com>
+
+	* config/i386/linux.h (LINK_SPEC): Add --hash-style=both.
+	* config/i386/linux64.h (LINK_SPEC): Likewise.
+	* config/rs6000/sysv4.h (LINK_OS_LINUX_SPEC): Likewise.
+	* config/rs6000/linux64.h (LINK_OS_LINUX_SPEC32,
+	LINK_OS_LINUX_SPEC64): Likewise.
+	* config/s390/linux.h (LINK_SPEC): Likewise.
+	* config/ia64/linux.h (LINK_SPEC): Likewise.
+	* config/sparc/linux.h (LINK_SPEC): Likewise.
+	* config/sparc/linux64.h (LINK_SPEC, LINK_ARCH32_SPEC,
+	LINK_ARCH64_SPEC): Likewise.
+	* config/alpha/linux-elf.h (LINK_SPEC): Likewise.
+
+diff -Naur gcc-4.4.0.orig/gcc/config/alpha/linux-elf.h gcc-4.4.0/gcc/config/alpha/linux-elf.h
+--- gcc-4.4.0.orig/gcc/config/alpha/linux-elf.h	2007-08-02 03:49:31.000000000 -0700
++++ gcc-4.4.0/gcc/config/alpha/linux-elf.h	2009-07-14 10:22:11.000000000 -0700
+@@ -39,7 +39,7 @@
+ 
+ #define ELF_DYNAMIC_LINKER	LINUX_DYNAMIC_LINKER
+ 
+-#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
++#define LINK_SPEC "-m elf64alpha --hash-style=both %{G*} %{relax:-relax}	\
+   %{O*:-O3} %{!O*:-O1}						\
+   %{shared:-shared}						\
+   %{!shared:							\
+diff -Naur gcc-4.4.0.orig/gcc/config/i386/linux64.h gcc-4.4.0/gcc/config/i386/linux64.h
+--- gcc-4.4.0.orig/gcc/config/i386/linux64.h	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/i386/linux64.h	2009-07-14 10:22:11.000000000 -0700
+@@ -75,7 +75,7 @@
+ #endif
+ 
+ #undef	LINK_SPEC
+-#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \
++#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} --hash-style=both \
+   %{shared:-shared} \
+   %{!shared: \
+     %{!static: \
+diff -Naur gcc-4.4.0.orig/gcc/config/i386/linux.h gcc-4.4.0/gcc/config/i386/linux.h
+--- gcc-4.4.0.orig/gcc/config/i386/linux.h	2009-07-14 09:25:45.000000000 -0700
++++ gcc-4.4.0/gcc/config/i386/linux.h	2009-07-14 10:22:11.000000000 -0700
+@@ -113,7 +113,7 @@
+   { "dynamic_linker", LINUX_DYNAMIC_LINKER }
+ 
+ #undef	LINK_SPEC
+-#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
++#define LINK_SPEC "-m %(link_emulation) --hash-style=both %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+diff -Naur gcc-4.4.0.orig/gcc/config/ia64/linux.h gcc-4.4.0/gcc/config/ia64/linux.h
+--- gcc-4.4.0.orig/gcc/config/ia64/linux.h	2009-02-12 08:30:53.000000000 -0800
++++ gcc-4.4.0/gcc/config/ia64/linux.h	2009-07-14 10:22:11.000000000 -0700
+@@ -40,7 +40,7 @@
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
+ 
+ #undef LINK_SPEC
+-#define LINK_SPEC "\
++#define LINK_SPEC "--hash-style=both \
+   %{shared:-shared} \
+   %{!shared: \
+     %{!static: \
+diff -Naur gcc-4.4.0.orig/gcc/config/rs6000/linux64.h gcc-4.4.0/gcc/config/rs6000/linux64.h
+--- gcc-4.4.0.orig/gcc/config/rs6000/linux64.h	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/rs6000/linux64.h	2009-07-14 10:22:11.000000000 -0700
+@@ -357,11 +357,11 @@
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
+ 
+ 
+-#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
++#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux --hash-style=both %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER32 "}}}"
+ 
+-#define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
++#define LINK_OS_LINUX_SPEC64 "-m elf64ppc --hash-style=both %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER64 "}}}"
+ 
+diff -Naur gcc-4.4.0.orig/gcc/config/rs6000/sysv4.h gcc-4.4.0/gcc/config/rs6000/sysv4.h
+--- gcc-4.4.0.orig/gcc/config/rs6000/sysv4.h	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/rs6000/sysv4.h	2009-07-14 10:22:11.000000000 -0700
+@@ -911,7 +911,7 @@
+ #define LINUX_DYNAMIC_LINKER \
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+ 
+-#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
++#define LINK_OS_LINUX_SPEC "-m elf32ppclinux --hash-style=both %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}"
+ 
+diff -Naur gcc-4.4.0.orig/gcc/config/s390/linux.h gcc-4.4.0/gcc/config/s390/linux.h
+--- gcc-4.4.0.orig/gcc/config/s390/linux.h	2007-08-02 03:49:31.000000000 -0700
++++ gcc-4.4.0/gcc/config/s390/linux.h	2009-07-14 10:22:11.000000000 -0700
+@@ -77,7 +77,7 @@
+ 
+ #undef  LINK_SPEC
+ #define LINK_SPEC \
+-  "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
++  "%{m31:-m elf_s390}%{m64:-m elf64_s390} --hash-style=both \
+    %{shared:-shared} \
+    %{!shared: \
+       %{static:-static} \
+diff -Naur gcc-4.4.0.orig/gcc/config/sparc/linux64.h gcc-4.4.0/gcc/config/sparc/linux64.h
+--- gcc-4.4.0.orig/gcc/config/sparc/linux64.h	2009-02-20 07:20:38.000000000 -0800
++++ gcc-4.4.0/gcc/config/sparc/linux64.h	2009-07-14 10:22:11.000000000 -0700
+@@ -121,7 +121,7 @@
+   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
+   { "link_arch",	 LINK_ARCH_SPEC },
+ 
+-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,%R/usr/lib %{shared:-shared} \
++#define LINK_ARCH32_SPEC "-m elf32_sparc --hash-style=both -Y P,%R/usr/lib %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+@@ -130,7 +130,7 @@
+         %{static:-static}}} \
+ "
+ 
+-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
++#define LINK_ARCH64_SPEC "-m elf64_sparc --hash-style=both -Y P,%R/usr/lib64 %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+@@ -211,7 +211,7 @@
+ #else /* !SPARC_BI_ARCH */
+ 
+ #undef LINK_SPEC
+-#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
++#define LINK_SPEC "-m elf64_sparc --hash-style=both -Y P,%R/usr/lib64 %{shared:-shared} \
+   %{!shared: \
+     %{!ibcs: \
+       %{!static: \
+diff -Naur gcc-4.4.0.orig/gcc/config/sparc/linux.h gcc-4.4.0/gcc/config/sparc/linux.h
+--- gcc-4.4.0.orig/gcc/config/sparc/linux.h	2009-02-20 07:20:38.000000000 -0800
++++ gcc-4.4.0/gcc/config/sparc/linux.h	2009-07-14 10:22:11.000000000 -0700
+@@ -86,7 +86,7 @@
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+ 
+ #undef  LINK_SPEC
+-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
++#define LINK_SPEC "-m elf32_sparc --hash-style=both -Y P,/usr/lib %{shared:-shared} \
+   %{!mno-relax:%{!r:-relax}} \
+   %{!shared: \
+     %{!ibcs: \
Index: scripts/patch/gcc/4.4.1/30-note-gnu-stack.patch
===================================================================
--- scripts/patch/gcc/4.4.1/30-note-gnu-stack.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
+++ scripts/patch/gcc/4.4.1/30-note-gnu-stack.patch	(revision ee54da9070bc6996e24a4d21347f11ab8e5cebb1)
@@ -0,0 +1,217 @@
+# DP: Add .note.GNU-stack sections for gcc's crt files, libffi and boehm-gc
+# DP: Taken from FC.
+
+gcc/
+
+2004-09-20  Jakub Jelinek  <jakub@redhat.com>
+
+	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
+	on ppc64-linux.
+
+	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
+	ia64-linux.
+	* config/ia64/crtbegin.asm: Likewise.
+	* config/ia64/crtend.asm: Likewise.
+	* config/ia64/crti.asm: Likewise.
+	* config/ia64/crtn.asm: Likewise.
+
+2004-05-14  Jakub Jelinek  <jakub@redhat.com>
+
+	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
+
+boehm-gc/
+
+2005-02-08  Jakub Jelinek  <jakub@redhat.com>
+
+	* ia64_save_regs_in_stack.s: Moved to...
+	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
+	on Linux.
+
+libffi/
+
+2007-05-11  Daniel Jacobowitz  <dan@debian.org>
+
+	* src/arm/sysv.S: Fix ARM comment marker.
+
+2005-02-08  Jakub Jelinek  <jakub@redhat.com>
+
+	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
+	* src/s390/sysv.S: Likewise.
+	* src/powerpc/linux64.S: Likewise.
+	* src/powerpc/linux64_closure.S: Likewise.
+	* src/powerpc/ppc_closure.S: Likewise.
+	* src/powerpc/sysv.S: Likewise.
+	* src/x86/unix64.S: Likewise.
+	* src/x86/sysv.S: Likewise.
+	* src/sparc/v8.S: Likewise.
+	* src/sparc/v9.S: Likewise.
+	* src/m68k/sysv.S: Likewise.
+	* src/ia64/unix.S: Likewise.
+	* src/arm/sysv.S: Likewise.
+
+diff -Naur gcc-4.4.0.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.4.0/boehm-gc/ia64_save_regs_in_stack.s
+--- gcc-4.4.0.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-14 21:57:59.000000000 -0700
++++ gcc-4.4.0/boehm-gc/ia64_save_regs_in_stack.s	2009-07-14 10:45:25.000000000 -0700
+@@ -1,12 +0,0 @@
+-        .text
+-        .align 16
+-        .global GC_save_regs_in_stack
+-        .proc GC_save_regs_in_stack
+-GC_save_regs_in_stack:
+-        .body
+-        flushrs
+-        ;;
+-        mov r8=ar.bsp
+-        br.ret.sptk.few rp
+-        .endp GC_save_regs_in_stack
+-
+diff -Naur gcc-4.4.0.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.4.0/boehm-gc/ia64_save_regs_in_stack.S
+--- gcc-4.4.0.orig/boehm-gc/ia64_save_regs_in_stack.S	1969-12-31 16:00:00.000000000 -0800
++++ gcc-4.4.0/boehm-gc/ia64_save_regs_in_stack.S	2009-07-14 10:45:25.000000000 -0700
+@@ -0,0 +1,15 @@
++        .text
++        .align 16
++        .global GC_save_regs_in_stack
++        .proc GC_save_regs_in_stack
++GC_save_regs_in_stack:
++        .body
++        flushrs
++        ;;
++        mov r8=ar.bsp
++        br.ret.sptk.few rp
++        .endp GC_save_regs_in_stack
++
++#ifdef __linux__
++	.section .note.GNU-stack,"",@progbits
++#endif
+diff -Naur gcc-4.4.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.4.0/gcc/config/ia64/crtbegin.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crtbegin.asm	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/ia64/crtbegin.asm	2009-07-14 10:45:25.000000000 -0700
+@@ -252,3 +252,7 @@
+ .weak __cxa_finalize
+ #endif
+ .weak _Jv_RegisterClasses
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -Naur gcc-4.4.0.orig/gcc/config/ia64/crtend.asm gcc-4.4.0/gcc/config/ia64/crtend.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crtend.asm	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/ia64/crtend.asm	2009-07-14 10:45:25.000000000 -0700
+@@ -119,3 +119,7 @@
+ 
+ 	br.ret.sptk.many rp
+ 	.endp __do_global_ctors_aux
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -Naur gcc-4.4.0.orig/gcc/config/ia64/crti.asm gcc-4.4.0/gcc/config/ia64/crti.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crti.asm	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/ia64/crti.asm	2009-07-14 10:45:25.000000000 -0700
+@@ -51,3 +51,7 @@
+ 	.body
+ 
+ # end of crti.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -Naur gcc-4.4.0.orig/gcc/config/ia64/crtn.asm gcc-4.4.0/gcc/config/ia64/crtn.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/crtn.asm	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/ia64/crtn.asm	2009-07-14 10:45:25.000000000 -0700
+@@ -41,3 +41,7 @@
+ 	br.ret.sptk.many b0
+ 
+ # end of crtn.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -Naur gcc-4.4.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.4.0/gcc/config/ia64/lib1funcs.asm
+--- gcc-4.4.0.orig/gcc/config/ia64/lib1funcs.asm	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/gcc/config/ia64/lib1funcs.asm	2009-07-14 10:45:25.000000000 -0700
+@@ -793,3 +793,7 @@
+ 	.endp __floattitf
+ #endif
+ #endif
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+diff -Naur gcc-4.4.0.orig/gcc/config/ia64/linux.h gcc-4.4.0/gcc/config/ia64/linux.h
+--- gcc-4.4.0.orig/gcc/config/ia64/linux.h	2009-02-12 08:30:53.000000000 -0800
++++ gcc-4.4.0/gcc/config/ia64/linux.h	2009-07-14 10:45:25.000000000 -0700
+@@ -5,6 +5,8 @@
+ 
+ #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
+ 
++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
++
+ /* This is for -profile to use -lc_p instead of -lc.  */
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{profile:-p} %{G*}"
+diff -Naur gcc-4.4.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.4.0/gcc/config/rs6000/ppc-asm.h
+--- gcc-4.4.0.orig/gcc/config/rs6000/ppc-asm.h	2008-10-13 08:44:26.000000000 -0700
++++ gcc-4.4.0/gcc/config/rs6000/ppc-asm.h	2009-07-14 10:45:25.000000000 -0700
+@@ -172,7 +172,7 @@
+ 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
+ #endif
+ 
+-#if defined __linux__ && !defined __powerpc64__
++#if defined __linux__
+ 	.section .note.GNU-stack
+ 	.previous
+ #endif
+diff -Naur gcc-4.4.0.orig/libffi/src/ia64/unix.S gcc-4.4.0/libffi/src/ia64/unix.S
+--- gcc-4.4.0.orig/libffi/src/ia64/unix.S	2005-03-30 13:49:19.000000000 -0800
++++ gcc-4.4.0/libffi/src/ia64/unix.S	2009-07-14 10:45:25.000000000 -0700
+@@ -553,3 +553,7 @@
+ 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
+ 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
+ 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
++
++#if defined __ELF__ && defined __linux__
++	.section	.note.GNU-stack,"",@progbits
++#endif
+diff -Naur gcc-4.4.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.4.0/libffi/src/powerpc/linux64_closure.S
+--- gcc-4.4.0.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 14:18:24.000000000 -0700
++++ gcc-4.4.0/libffi/src/powerpc/linux64_closure.S	2009-07-14 10:45:25.000000000 -0700
+@@ -204,3 +204,7 @@
+ 	.align 3
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++	.section	.note.GNU-stack,"",@progbits
++#endif
+diff -Naur gcc-4.4.0.orig/libffi/src/powerpc/linux64.S gcc-4.4.0/libffi/src/powerpc/linux64.S
+--- gcc-4.4.0.orig/libffi/src/powerpc/linux64.S	2007-11-16 15:24:53.000000000 -0800
++++ gcc-4.4.0/libffi/src/powerpc/linux64.S	2009-07-14 10:45:25.000000000 -0700
+@@ -179,3 +179,7 @@
+ 	.align 3
+ .LEFDE1:
+ #endif
++
++#if defined __ELF__ && defined __linux__
++	.section	.note.GNU-stack,"",@progbits
++#endif
+diff -Naur gcc-4.4.0.orig/src/boehm-gc/ia64_save_regs_in_stack.S gcc-4.4.0/src/boehm-gc/ia64_save_regs_in_stack.S
+--- gcc-4.4.0.orig/src/boehm-gc/ia64_save_regs_in_stack.S	1969-12-31 16:00:00.000000000 -0800
++++ gcc-4.4.0/src/boehm-gc/ia64_save_regs_in_stack.S	2009-07-14 10:45:19.000000000 -0700
+@@ -0,0 +1,15 @@
++        .text
++        .align 16
++        .global GC_save_regs_in_stack
++        .proc GC_save_regs_in_stack
++GC_save_regs_in_stack:
++        .body
++        flushrs
++        ;;
++        mov r8=ar.bsp
++        br.ret.sptk.few rp
++        .endp GC_save_regs_in_stack
++
++#ifdef __linux__
++	.section .note.GNU-stack,"",@progbits
++#endif
