aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-07-10 10:24:58 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-07-10 10:25:54 +0000
commitf91410ab72605dbd93d2199cd1be894f87c974d2 (patch)
treeb95fde420bf71c9d850f11b023e676e70046547e /testing
parent7382a645b0bb941a0b677c7d40d42bb9703bc5d2 (diff)
downloadaports-f91410ab72605dbd93d2199cd1be894f87c974d2.tar.bz2
aports-f91410ab72605dbd93d2199cd1be894f87c974d2.tar.xz
testing/gcc: test 4.6.1
Diffstat (limited to 'testing')
-rw-r--r--testing/gcc/08_all_cross-compile.patch40
-rw-r--r--testing/gcc/11_all_default-warn-format-security.patch49
-rw-r--r--testing/gcc/12_all_default-warn-trampolines.patch25
-rw-r--r--testing/gcc/15_all_libgomp-Werror.patch16
-rw-r--r--testing/gcc/34_all_ia64_note.GNU-stack.patch89
-rw-r--r--testing/gcc/51_all_libiberty-pic.patch10
-rw-r--r--testing/gcc/74_all_gcc46_cloog-dl.patch532
-rw-r--r--testing/gcc/APKBUILD341
-rw-r--r--testing/gcc/boehem-gc-uclibc.patch11
-rw-r--r--testing/gcc/gcc-4.6-dynamic-linker.patch459
-rw-r--r--testing/gcc/gcc-4.6-pr32219.patch25
-rw-r--r--testing/gcc/gcc-pure64.patch12
-rw-r--r--testing/gcc/gcc-spec-env.patch42
-rw-r--r--testing/gcc/pt_gnu_eh_frame.patch12
-rw-r--r--testing/gcc/uclibc-getipinfo.patch19
15 files changed, 1682 insertions, 0 deletions
diff --git a/testing/gcc/08_all_cross-compile.patch b/testing/gcc/08_all_cross-compile.patch
new file mode 100644
index 0000000000..4203e3a623
--- /dev/null
+++ b/testing/gcc/08_all_cross-compile.patch
@@ -0,0 +1,40 @@
+Some notes on the 'bootstrap with or without libc headers' debate:
+http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
+http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
+
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11354,7 +11354,7 @@ then
+ *)
+ ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1759,7 +1759,7 @@ then
+ *)
+ ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+--- a/gcc/unwind-dw2.c
++++ b/gcc/unwind-dw2.c
+@@ -329,9 +329,11 @@ _Unwind_GetTextRelBase (struct _Unwind_Context *context)
+ }
+ #endif
+
++#ifndef inhibit_libc
+ #ifdef MD_UNWIND_SUPPORT
+ #include MD_UNWIND_SUPPORT
+ #endif
++#endif
+
+ /* Extract any interesting information from the CIE for the translation
+ unit F belongs to. Return a pointer to the byte after the augmentation,
diff --git a/testing/gcc/11_all_default-warn-format-security.patch b/testing/gcc/11_all_default-warn-format-security.patch
new file mode 100644
index 0000000000..5dbab43f1d
--- /dev/null
+++ b/testing/gcc/11_all_default-warn-format-security.patch
@@ -0,0 +1,49 @@
+Enable -Wformat and -Wformat-security by default.
+
+
+--- a/gcc/c-family/c-common.c
++++ b/gcc/c-family/c-common.c
+@@ -201,7 +201,7 @@ int warn_unknown_pragmas; /* Tri state variable. */
+ /* Warn about format/argument anomalies in calls to formatted I/O functions
+ (*printf, *scanf, strftime, strfmon, etc.). */
+
+-int warn_format;
++int warn_format = 1;
+
+ /* C/ObjC language option variables. */
+
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -384,7 +384,7 @@ C ObjC C++ ObjC++ Var(warn_format_contains_nul) Warning
+ Warn about format strings that contain NUL bytes
+
+ Wformat-security
+-C ObjC C++ ObjC++ Var(warn_format_security) Warning
++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning
+ Warn about possible security problems with format functions
+
+ Wformat-y2k
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -3111,6 +3111,9 @@ aspects of format checking, the options @option{-Wformat-y2k},
+ @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
+ @option{-Wformat=2} are available, but are not included in @option{-Wall}.
+
++In Gentoo this option is enabled by default for C, C++, ObjC, ObjC++.
++To disable, use @option{-Wformat=0}.
++
+ @item -Wformat-y2k
+ @opindex Wformat-y2k
+ @opindex Wno-format-y2k
+@@ -3164,6 +3167,11 @@ currently a subset of what @option{-Wformat-nonliteral} warns about, but
+ in future warnings may be added to @option{-Wformat-security} that are not
+ included in @option{-Wformat-nonliteral}.)
+
++In Gentoo this option is enabled by default for C, C++, ObjC, ObjC++.
++To disable, use @option{-Wno-format-security}, or disable all format warnings
++with @option{-Wformat=0}. To make format security warnings fatal, specify
++@option{-Werror=format-security}.
++
+ @item -Wformat=2
+ @opindex Wformat=2
+ @opindex Wno-format=2
diff --git a/testing/gcc/12_all_default-warn-trampolines.patch b/testing/gcc/12_all_default-warn-trampolines.patch
new file mode 100644
index 0000000000..a5606c5ecd
--- /dev/null
+++ b/testing/gcc/12_all_default-warn-trampolines.patch
@@ -0,0 +1,25 @@
+Enable -Wtrampolines by default.
+
+
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -611,7 +611,7 @@ Common Var(warn_system_headers) Warning
+ Do not suppress warnings from system headers
+
+ Wtrampolines
+-Common Var(warn_trampolines) Warning
++Common Var(warn_trampolines) Init(1) Warning
+ Warn whenever a trampoline is generated
+
+ Wtype-limits
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -3766,6 +3766,8 @@ headers---for that, @option{-Wunknown-pragmas} must also be used.
+ @opindex Wno-trampolines
+ Warn about trampolines generated for pointers to nested functions.
+
++ In Gentoo, @option{-Wtrampolines} is enabled by default.
++
+ A trampoline is a small piece of data or code that is created at run
+ time on the stack when the address of a nested function is taken, and
+ is used to call the nested function indirectly. For some targets, it
diff --git a/testing/gcc/15_all_libgomp-Werror.patch b/testing/gcc/15_all_libgomp-Werror.patch
new file mode 100644
index 0000000000..3456e8ae82
--- /dev/null
+++ b/testing/gcc/15_all_libgomp-Werror.patch
@@ -0,0 +1,16 @@
+libgomp does not respect --disable-werror
+
+https://bugs.gentoo.org/229059
+http://gcc.gnu.org/PR38436
+
+--- a/libgomp/configure
++++ b/libgomp/configure
+@@ -4284,7 +4284,7 @@ save_CFLAGS="$CFLAGS"
+
+ # Add -Wall -Werror if we are using GCC.
+ if test "x$GCC" = "xyes"; then
+- XCFLAGS="$XCFLAGS -Wall -Werror"
++ XCFLAGS="$XCFLAGS -Wall"
+ fi
+
+ # Find other programs we need.
diff --git a/testing/gcc/34_all_ia64_note.GNU-stack.patch b/testing/gcc/34_all_ia64_note.GNU-stack.patch
new file mode 100644
index 0000000000..b156eacb29
--- /dev/null
+++ b/testing/gcc/34_all_ia64_note.GNU-stack.patch
@@ -0,0 +1,89 @@
+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.
+
+
+--- a/gcc/config/ia64/crtbegin.asm
++++ b/gcc/config/ia64/crtbegin.asm
+@@ -252,3 +252,7 @@ __do_jv_register_classes:
+ .weak __cxa_finalize
+ #endif
+ .weak _Jv_RegisterClasses
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- a/gcc/config/ia64/crtend.asm
++++ b/gcc/config/ia64/crtend.asm
+@@ -119,3 +119,7 @@ __do_global_ctors_aux:
+
+ br.ret.sptk.many rp
+ .endp __do_global_ctors_aux
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- a/gcc/config/ia64/crti.asm
++++ b/gcc/config/ia64/crti.asm
+@@ -51,3 +51,7 @@ _fini:
+ .body
+
+ # end of crti.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- a/gcc/config/ia64/crtn.asm
++++ b/gcc/config/ia64/crtn.asm
+@@ -41,3 +41,7 @@
+ br.ret.sptk.many b0
+
+ # end of crtn.asm
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- a/gcc/config/ia64/lib1funcs.asm
++++ b/gcc/config/ia64/lib1funcs.asm
+@@ -793,3 +793,7 @@ __floattitf:
+ .endp __floattitf
+ #endif
+ #endif
++
++#ifdef __linux__
++.section .note.GNU-stack; .previous
++#endif
+--- a/gcc/config/ia64/linux.h
++++ b/gcc/config/ia64/linux.h
+@@ -29,6 +29,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ #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*}"
+--- a/gcc/config/rs6000/ppc-asm.h
++++ b/gcc/config/rs6000/ppc-asm.h
+@@ -352,7 +352,7 @@ GLUE(.L,name): \
+ #endif
+ #endif
+
+-#if defined __linux__ && !defined __powerpc64__
++#if defined __linux__
+ .section .note.GNU-stack
+ .previous
+ #endif
diff --git a/testing/gcc/51_all_libiberty-pic.patch b/testing/gcc/51_all_libiberty-pic.patch
new file mode 100644
index 0000000000..b6160a7307
--- /dev/null
+++ b/testing/gcc/51_all_libiberty-pic.patch
@@ -0,0 +1,10 @@
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -246,6 +246,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+ $(RANLIB) $(TARGETLIB); \
++ cp $(TARGETLIB) ../ ; \
+ cd ..; \
+ else true; fi
+
diff --git a/testing/gcc/74_all_gcc46_cloog-dl.patch b/testing/gcc/74_all_gcc46_cloog-dl.patch
new file mode 100644
index 0000000000..21ceb25b7c
--- /dev/null
+++ b/testing/gcc/74_all_gcc46_cloog-dl.patch
@@ -0,0 +1,532 @@
+When graphite support is enabled, C++ libraries (libppl, libcloog, libgmpxx,
+libstdc++-v3) are linked into cc1. Because of libstdc++ symbol versioning
+this has the unfortunate side effect of making it difficult to switch to a
+previous version of GCC using gcc-config once these libraries have be built
+with the newer version. (http://bugs.gentoo.org/315377#c3)
+
+Instead, dlopen libcloog as necessary. This patch originated in Fedora and
+was modified to work on FreeBSD (http://bugs.gentoo.org/317211).
+
+2011-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ * Makefile.in (BACKENDLIBS): Link against -ldl instead of
+ -lcloog -lppl.
+ (graphite.o, graphite%.o): Force -O, remove -fkeep-inline-functions.
+ (GRAPHITE_CLOOG_UTIL_H, GRAPHITE_POLY_H): New.
+ (graphite*.o): Adjust dependencies.
+ * graphite-cloog-compat.h: Include <dlfcn.h>. Reference libcloog and
+ libppl symbols through pointers in cloog_pointers__ variable.
+ * graphite.c (init_cloog_pointers): New function.
+ (graphite_transform_loops): Call init_cloog_pointers.
+ * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Rename
+ stmt_for argument to stmt_fora.
+ * graphite-poly.h: Include graphite-cloog-util.h.
+
+2011-04-02 Ryan Hill <dirtyepic@gentoo.org>
+
+ * configure.ac (DL_LIB): Check how to dlopen.
+ * configure: Regenerate.
+ * Makefile.in (BACKENDLIBS): Use DL_LIB.
+ * graphite-cloog-compat.h: Add missing symbols.
+
+
+
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -984,6 +984,8 @@ GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h $(CONFIG_H) $(SYSTEM_H) \
+ PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
+ PLUGIN_VERSION_H = plugin-version.h configargs.h
+ LIBFUNCS_H = libfuncs.h $(HASHTAB_H)
++GRAPHITE_CLOOG_UTIL_H = graphite-cloog-util.h graphite-cloog-compat.h
++GRAPHITE_POLY_H = graphite-poly.h $(GRAPHITE_CLOOG_UTIL_H)
+
+ #
+ # Now figure out from those variables how to compile and link.
+@@ -1037,7 +1039,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
+ # and the system's installed libraries.
+ LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) \
+ $(HOST_LIBS)
+-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
++BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),@DL_LIB@) $(PLUGINLIBS) $(HOST_LIBS) \
+ $(ZLIB)
+ # Any system libraries needed just for GNAT.
+ SYSLIBS = @GNAT_LIBEXC@
+@@ -2668,40 +2670,40 @@ sese.o : sese.c sese.h $(CONFIG_H) $(SYSTEM_H) coretypes.h tree-pretty-print.h \
+ $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) tree-pass.h value-prof.h
+ graphite.o : graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \
+ $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \
+- $(DBGCNT_H) graphite-ppl.h graphite-poly.h graphite-scop-detection.h \
++ $(DBGCNT_H) graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h \
+ graphite-clast-to-gimple.h graphite-sese-to-poly.h
+ graphite-blocking.o : graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
+- sese.h graphite-ppl.h graphite-poly.h
++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
+ graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
+- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \
+- graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \
++ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h $(GRAPHITE_CLOOG_UTIL_H) \
++ graphite-ppl.h $(GRAPHITE_POLY_H) graphite-clast-to-gimple.h \
+ graphite-dependences.h graphite-cloog-compat.h
+ graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
+- coretypes.h graphite-cloog-util.h graphite-cloog-compat.h
++ coretypes.h $(GRAPHITE_CLOOG_UTIL_H) graphite-cloog-compat.h
+ graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
+- sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \
+- graphite-cloog-util.h
++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-dependences.h \
++ $(GRAPHITE_CLOOG_UTIL_H)
+ graphite-flattening.o : graphite-flattening.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
+- sese.h graphite-ppl.h graphite-poly.h
++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
+ graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
+- sese.h graphite-ppl.h graphite-poly.h
++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H)
+ graphite-poly.o : graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) gimple-pretty-print.h \
+- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h graphite-poly.h \
+- graphite-dependences.h graphite-cloog-util.h
++ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \
++ graphite-dependences.h $(GRAPHITE_CLOOG_UTIL_H)
+ graphite-ppl.o : graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+- graphite-cloog-util.h graphite-ppl.h
++ $(GRAPHITE_CLOOG_UTIL_H) graphite-ppl.h
+ graphite-scop-detection.o : graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \
+- sese.h graphite-ppl.h graphite-poly.h graphite-scop-detection.h
++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h
+ graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \
+ $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \
+- $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h graphite-poly.h \
++ $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \
+ graphite-sese-to-poly.h
+ tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
+@@ -3482,6 +3484,11 @@ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
+ $(out_file) $(OUTPUT_OPTION)
+
++graphite%.o : \
++ ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
++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)
+ $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -602,6 +602,7 @@ ac_subst_vars='LTLIBOBJS
+ LIBOBJS
+ enable_plugin
+ pluginlibs
++DL_LIB
+ CLOOGINC
+ CLOOGLIBS
+ PPLINC
+@@ -17505,7 +17506,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 17508 "configure"
++#line 17509 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -17611,7 +17612,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-#line 17614 "configure"
++#line 17615 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -26284,6 +26285,7 @@ $as_echo "unable to check" >&6; }
+ fi
+
+ # Check -ldl
++ DL_LIB=
+ saved_LIBS="$LIBS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+ $as_echo_n "checking for library containing dlopen... " >&6; }
+@@ -26343,7 +26345,9 @@ fi
+
+ if test x"$ac_cv_search_dlopen" = x"-ldl"; then
+ pluginlibs="$pluginlibs -ldl"
++ DL_LIB=$ac_cv_search_dlopen
+ fi
++
+ LIBS="$saved_LIBS"
+
+ # Check that we can build shared objects with -fPIC -shared
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4841,11 +4841,14 @@ if test x"$enable_plugin" = x"yes"; then
+ fi
+
+ # Check -ldl
++ DL_LIB=
+ saved_LIBS="$LIBS"
+ AC_SEARCH_LIBS([dlopen], [dl])
+ if test x"$ac_cv_search_dlopen" = x"-ldl"; then
+ pluginlibs="$pluginlibs -ldl"
++ DL_LIB=$ac_cv_search_dlopen
+ fi
++ AC_SUBST(DL_LIB)
+ LIBS="$saved_LIBS"
+
+ # Check that we can build shared objects with -fPIC -shared
+--- a/gcc/graphite-clast-to-gimple.c
++++ b/gcc/graphite-clast-to-gimple.c
+@@ -738,10 +738,10 @@ clast_get_body_of_loop (struct clast_stmt *stmt)
+ from STMT_FOR. */
+
+ static tree
+-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for, int level,
++gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora, int level,
+ tree lb_type, tree ub_type)
+ {
+- struct clast_stmt *stmt = (struct clast_stmt *) stmt_for;
++ struct clast_stmt *stmt = (struct clast_stmt *) stmt_fora;
+ struct clast_user_stmt *body = clast_get_body_of_loop (stmt);
+ CloogStatement *cs = body->statement;
+ poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
+--- a/gcc/graphite-cloog-compat.h
++++ b/gcc/graphite-cloog-compat.h
+@@ -272,4 +272,269 @@ static inline int cloog_matrix_nrows (CloogMatrix * m)
+ return m->NbRows;
+ }
+ #endif /* CLOOG_ORG */
++
++#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 (cloog_domain_union); \
++ DYNSYM (cloog_matrix_read); \
++ DYNSYM (cloog_new_pol); \
++ DYNSYM (cloog_vector_gcd); \
++ DYNSYM (ppl_finalize); \
++ DYNSYM (ppl_assign_Coefficient_from_mpz_t); \
++ DYNSYM (ppl_assign_Linear_Expression_from_Linear_Expression); \
++ DYNSYM (ppl_Coefficient_to_mpz_t); \
++ DYNSYM (ppl_Constraint_coefficient); \
++ DYNSYM (ppl_Constraint_inhomogeneous_term); \
++ DYNSYM (ppl_Constraint_space_dimension); \
++ DYNSYM (ppl_Constraint_System_begin); \
++ DYNSYM (ppl_Constraint_System_const_iterator_dereference); \
++ DYNSYM (ppl_Constraint_System_const_iterator_equal_test); \
++ DYNSYM (ppl_Constraint_System_const_iterator_increment); \
++ DYNSYM (ppl_Constraint_System_end); \
++ DYNSYM (ppl_Constraint_System_insert_Constraint); \
++ DYNSYM (ppl_Constraint_System_space_dimension); \
++ DYNSYM (ppl_Constraint_type); \
++ DYNSYM (ppl_delete_Coefficient); \
++ DYNSYM (ppl_delete_Constraint); \
++ DYNSYM (ppl_delete_Constraint_System_const_iterator); \
++ DYNSYM (ppl_delete_Linear_Expression); \
++ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron); \
++ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron_iterator); \
++ DYNSYM (ppl_delete_Polyhedron); \
++ DYNSYM (ppl_Linear_Expression_add_to_coefficient); \
++ DYNSYM (ppl_Linear_Expression_add_to_inhomogeneous); \
++ DYNSYM (ppl_Linear_Expression_coefficient); \
++ DYNSYM (ppl_Linear_Expression_inhomogeneous_term); \
++ DYNSYM (ppl_Linear_Expression_space_dimension); \
++ DYNSYM (ppl_new_Coefficient); \
++ DYNSYM (ppl_new_Coefficient_from_mpz_t); \
++ DYNSYM (ppl_new_Constraint); \
++ DYNSYM (ppl_new_Constraint_System); \
++ DYNSYM (ppl_new_Constraint_System_const_iterator); \
++ DYNSYM (ppl_new_C_Polyhedron_from_C_Polyhedron); \
++ DYNSYM (ppl_new_C_Polyhedron_from_space_dimension); \
++ DYNSYM (ppl_new_C_Polyhedron_recycle_Constraint_System); \
++ DYNSYM (ppl_new_Linear_Expression); \
++ DYNSYM (ppl_new_Linear_Expression_from_Constraint); \
++ DYNSYM (ppl_new_Linear_Expression_from_Linear_Expression); \
++ DYNSYM (ppl_new_Linear_Expression_with_dimension); \
++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron); \
++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron); \
++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension); \
++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_iterator); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_constraint); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_difference_assign); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_intersection_assign); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_is_empty); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_end); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_increment); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_maximize); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_minimize); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_size); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_space_dimension); \
++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign); \
++ DYNSYM (ppl_Polyhedron_add_constraint); \
++ DYNSYM (ppl_Polyhedron_add_constraints); \
++ DYNSYM (ppl_Polyhedron_add_space_dimensions_and_embed); \
++ DYNSYM (ppl_Polyhedron_get_constraints); \
++ DYNSYM (ppl_Polyhedron_map_space_dimensions); \
++ DYNSYM (ppl_Polyhedron_remove_space_dimensions); \
++ DYNSYM (ppl_Polyhedron_space_dimension); \
++ DYNSYM (ppl_subtract_Linear_Expression_from_Linear_Expression); \
++ DYNSYM (pprint); \
++ DYNSYM (stmt_block); \
++ DYNSYM (stmt_for); \
++ DYNSYM (stmt_guard); \
++ DYNSYM (stmt_root); \
++ DYNSYM (stmt_user); \
++ DYNSYM (ppl_delete_Constraint_System); \
++ DYNSYM (ppl_initialize); \
++ DYNSYM (ppl_new_Constraint_System_from_Constraint); \
++ DYNSYM (ppl_new_C_Polyhedron_from_Constraint_System); \
++ DYNSYM (ppl_Polyhedron_affine_image); \
++ DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron); \
++ DYNSYM (ppl_new_PIP_Problem_from_constraints); \
++ DYNSYM (ppl_PIP_Problem_is_satisfiable); \
++ DYNSYM (ppl_delete_PIP_Problem);
++extern 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)
++#ifndef CLOOG_ORG
++#undef cloog_loop_malloc
++#define cloog_loop_malloc(STATE) (*cloog_pointers__.p_cloog_loop_malloc) ()
++#else
++#define cloog_loop_malloc (*cloog_pointers__.p_cloog_loop_malloc)
++#endif
++#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)
++#ifndef CLOOG_ORG
++#undef cloog_options_malloc
++#define cloog_options_malloc(STATE) (*cloog_pointers__.p_cloog_options_malloc) ()
++#undef cloog_program_dump_cloog
++#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST) \
++ (*cloog_pointers__.p_cloog_program_dump_cloog) (DUMPFILE, PROGRAM)
++#undef cloog_program_extract_scalars
++#define cloog_program_extract_scalars(PROG, SCATT, OPT) \
++ (*cloog_pointers__.p_cloog_program_extract_scalars) (PROG, SCATT)
++#else
++#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)
++#endif
++#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)
++#ifndef CLOOG_ORG
++#undef cloog_program_scatter
++#define cloog_program_scatter(PROG, SCATT, OPT) \
++ (*cloog_pointers__.p_cloog_program_scatter) (PROG, SCATT)
++#undef cloog_statement_alloc
++#define cloog_statement_alloc(STATE, INDEX) \
++ (*cloog_pointers__.p_cloog_statement_alloc) (INDEX)
++#else
++#define cloog_program_scatter (*cloog_pointers__.p_cloog_program_scatter)
++#define cloog_statement_alloc (*cloog_pointers__.p_cloog_statement_alloc)
++#endif
++#define cloog_domain_union (*cloog_pointers__.p_cloog_domain_union)
++#define cloog_matrix_read (*cloog_pointers__.p_cloog_matrix_read)
++#define cloog_new_pol (*cloog_pointers__.p_cloog_new_pol)
++#define cloog_vector_gcd (*cloog_pointers__.p_cloog_vector_gcd)
++#define ppl_finalize (*cloog_pointers__.p_ppl_finalize)
++#define ppl_assign_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_assign_Coefficient_from_mpz_t)
++#define ppl_assign_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_assign_Linear_Expression_from_Linear_Expression)
++#define ppl_Coefficient_to_mpz_t (*cloog_pointers__.p_ppl_Coefficient_to_mpz_t)
++#define ppl_Constraint_coefficient (*cloog_pointers__.p_ppl_Constraint_coefficient)
++#define ppl_Constraint_inhomogeneous_term (*cloog_pointers__.p_ppl_Constraint_inhomogeneous_term)
++#define ppl_Constraint_space_dimension (*cloog_pointers__.p_ppl_Constraint_space_dimension)
++#define ppl_Constraint_System_begin (*cloog_pointers__.p_ppl_Constraint_System_begin)
++#define ppl_Constraint_System_const_iterator_dereference (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_dereference)
++#define ppl_Constraint_System_const_iterator_equal_test (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_equal_test)
++#define ppl_Constraint_System_const_iterator_increment (*cloog_pointers__.p_ppl_Constraint_System_const_iterator_increment)
++#define ppl_Constraint_System_end (*cloog_pointers__.p_ppl_Constraint_System_end)
++#define ppl_Constraint_System_insert_Constraint (*cloog_pointers__.p_ppl_Constraint_System_insert_Constraint)
++#define ppl_Constraint_System_space_dimension (*cloog_pointers__.p_ppl_Constraint_System_space_dimension)
++#define ppl_Constraint_type (*cloog_pointers__.p_ppl_Constraint_type)
++#define ppl_delete_Coefficient (*cloog_pointers__.p_ppl_delete_Coefficient)
++#define ppl_delete_Constraint (*cloog_pointers__.p_ppl_delete_Constraint)
++#define ppl_delete_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_delete_Constraint_System_const_iterator)
++#define ppl_delete_Linear_Expression (*cloog_pointers__.p_ppl_delete_Linear_Expression)
++#define ppl_delete_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron)
++#define ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_delete_Pointset_Powerset_C_Polyhedron_iterator)
++#define ppl_delete_Polyhedron (*cloog_pointers__.p_ppl_delete_Polyhedron)
++#define ppl_Linear_Expression_add_to_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_add_to_coefficient)
++#define ppl_Linear_Expression_add_to_inhomogeneous (*cloog_pointers__.p_ppl_Linear_Expression_add_to_inhomogeneous)
++#define ppl_Linear_Expression_coefficient (*cloog_pointers__.p_ppl_Linear_Expression_coefficient)
++#define ppl_Linear_Expression_inhomogeneous_term (*cloog_pointers__.p_ppl_Linear_Expression_inhomogeneous_term)
++#define ppl_Linear_Expression_space_dimension (*cloog_pointers__.p_ppl_Linear_Expression_space_dimension)
++#define ppl_new_Coefficient (*cloog_pointers__.p_ppl_new_Coefficient)
++#define ppl_new_Coefficient_from_mpz_t (*cloog_pointers__.p_ppl_new_Coefficient_from_mpz_t)
++#define ppl_new_Constraint (*cloog_pointers__.p_ppl_new_Constraint)
++#define ppl_new_Constraint_System (*cloog_pointers__.p_ppl_new_Constraint_System)
++#define ppl_new_Constraint_System_const_iterator (*cloog_pointers__.p_ppl_new_Constraint_System_const_iterator)
++#define ppl_new_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_C_Polyhedron)
++#define ppl_new_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_space_dimension)
++#define ppl_new_C_Polyhedron_recycle_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_recycle_Constraint_System)
++#define ppl_new_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression)
++#define ppl_new_Linear_Expression_from_Constraint (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Constraint)
++#define ppl_new_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_new_Linear_Expression_from_Linear_Expression)
++#define ppl_new_Linear_Expression_with_dimension (*cloog_pointers__.p_ppl_new_Linear_Expression_with_dimension)
++#define ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron)
++#define ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron)
++#define ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension)
++#define ppl_new_Pointset_Powerset_C_Polyhedron_iterator (*cloog_pointers__.p_ppl_new_Pointset_Powerset_C_Polyhedron_iterator)
++#define ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_constraint)
++#define ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed)
++#define ppl_Pointset_Powerset_C_Polyhedron_difference_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_difference_assign)
++#define ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_intersection_assign)
++#define ppl_Pointset_Powerset_C_Polyhedron_is_empty (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_is_empty)
++#define ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_begin)
++#define ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference)
++#define ppl_Pointset_Powerset_C_Polyhedron_iterator_end (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_end)
++#define ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test)
++#define ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_iterator_increment)
++#define ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions)
++#define ppl_Pointset_Powerset_C_Polyhedron_maximize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_maximize)
++#define ppl_Pointset_Powerset_C_Polyhedron_minimize (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_minimize)
++#define ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions)
++#define ppl_Pointset_Powerset_C_Polyhedron_size (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_size)
++#define ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_space_dimension)
++#define ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (*cloog_pointers__.p_ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign)
++#define ppl_Polyhedron_add_constraint (*cloog_pointers__.p_ppl_Polyhedron_add_constraint)
++#define ppl_Polyhedron_add_constraints (*cloog_pointers__.p_ppl_Polyhedron_add_constraints)
++#define ppl_Polyhedron_add_space_dimensions_and_embed (*cloog_pointers__.p_ppl_Polyhedron_add_space_dimensions_and_embed)
++#define ppl_Polyhedron_get_constraints (*cloog_pointers__.p_ppl_Polyhedron_get_constraints)
++#define ppl_Polyhedron_map_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_map_space_dimensions)
++#define ppl_Polyhedron_remove_space_dimensions (*cloog_pointers__.p_ppl_Polyhedron_remove_space_dimensions)
++#define ppl_Polyhedron_space_dimension (*cloog_pointers__.p_ppl_Polyhedron_space_dimension)
++#define ppl_subtract_Linear_Expression_from_Linear_Expression (*cloog_pointers__.p_ppl_subtract_Linear_Expression_from_Linear_Expression)
++#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 ppl_delete_Constraint_System (*cloog_pointers__.p_ppl_delete_Constraint_System)
++#define ppl_initialize (*cloog_pointers__.p_ppl_initialize)
++#define ppl_new_Constraint_System_from_Constraint (*cloog_pointers__.p_ppl_new_Constraint_System_from_Constraint)
++#define ppl_new_C_Polyhedron_from_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_Constraint_System)
++#define ppl_Polyhedron_affine_image (*cloog_pointers__.p_ppl_Polyhedron_affine_image)
++#define ppl_io_fprint_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_io_fprint_Pointset_Powerset_C_Polyhedron)
++#define ppl_new_PIP_Problem_from_constraints (*cloog_pointers__.p_ppl_new_PIP_Problem_from_constraints)
++#define ppl_PIP_Problem_is_satisfiable (*cloog_pointers__.p_ppl_PIP_Problem_is_satisfiable)
++#define ppl_delete_PIP_Problem (*cloog_pointers__.p_ppl_delete_PIP_Problem)
++
++#define cloog_finalize (*cloog_pointers__.p_ppl_finalize)
++
++
+ #endif /* GRAPHITE_CLOOG_COMPAT_H */
+--- a/gcc/graphite-poly.h
++++ b/gcc/graphite-poly.h
+@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see
+ #ifndef GCC_GRAPHITE_POLY_H
+ #define GCC_GRAPHITE_POLY_H
+
++#include "graphite-cloog-util.h"
++
+ typedef struct poly_dr *poly_dr_p;
+ DEF_VEC_P(poly_dr_p);
+ DEF_VEC_ALLOC_P (poly_dr_p, heap);
+--- a/gcc/graphite.c
++++ b/gcc/graphite.c
+@@ -56,6 +56,35 @@ along with GCC; see the file COPYING3. If not see
+
+ CloogState *cloog_state;
+
++__typeof (cloog_pointers__) cloog_pointers__;
++
++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;
++}
++
++
+ /* Print global statistics to FILE. */
+
+ static void
+@@ -201,6 +230,12 @@ graphite_initialize (void)
+ return false;
+ }
+
++ if (!init_cloog_pointers ())
++ {
++ sorry ("Graphite loop optimizations cannot be used");
++ return false;
++ }
++
+ scev_reset ();
+ recompute_all_dominators ();
+ initialize_original_copy_tables ();
diff --git a/testing/gcc/APKBUILD b/testing/gcc/APKBUILD
new file mode 100644
index 0000000000..a9600d2214
--- /dev/null
+++ b/testing/gcc/APKBUILD
@@ -0,0 +1,341 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=gcc
+pkgver=4.6.1
+_piepatchver=0.4.5
+_specs_ver=0.2.0
+_specs_gcc_ver=4.4.3
+
+_uclibc_abiver=0.9.32
+
+pkgrel=0
+pkgdesc="The GNU Compiler Collection"
+url="http://gcc.gnu.org"
+arch="all"
+license="GPL LGPL"
+depends="binutils libgcc libgomp libobjc"
+makedepends="bison flex gmp-dev mpfr-dev texinfo libmpc-dev gawk zlib-dev zip
+ cloog-dev"
+subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp"
+replaces="libstdc++"
+
+if [ -n "$BOOTSTRAP" ]; then
+ LANG_OBJC=off
+ LANG_JAVA=off
+fi
+
+if [ "$LANG_OBJC" != "off" ]; then
+ subpackages="$subpackages libobjc"
+fi
+if [ "$LANG_JAVA" != "off" ]; then
+ subpackages="$subpackages $pkgname-java libgcj"
+fi
+
+source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-core-$pkgver.tar.bz2
+ ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-g++-$pkgver.tar.bz2
+ ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-objc-$pkgver.tar.bz2
+ ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-java-$pkgver.tar.bz2
+ http://distfiles.gentoo.org/distfiles/gcc-4.6.1-piepatches-v${_piepatchver}.tar.bz2
+ http://distfiles.gentoo.org/distfiles/gcc-$_specs_gcc_ver-specs-$_specs_ver.tar.bz2
+ ftp://sourceware.org/pub/java/ecj-latest.jar
+
+ 08_all_cross-compile.patch
+ 11_all_default-warn-format-security.patch
+ 12_all_default-warn-trampolines.patch
+ 15_all_libgomp-Werror.patch
+ 34_all_ia64_note.GNU-stack.patch
+ 51_all_libiberty-pic.patch
+ 74_all_gcc46_cloog-dl.patch
+
+ gcc-spec-env.patch
+ pt_gnu_eh_frame.patch
+ uclibc-getipinfo.patch
+ gcc-4.6-dynamic-linker.patch
+ gcc-4.6-pr32219.patch
+ boehem-gc-uclibc.patch
+ gcc-pure64.patch
+ "
+
+# we build out-of-tree
+_gccdir="$srcdir"/gcc-$pkgver
+_builddir="$srcdir/build"
+
+prepare() {
+ cd "$_gccdir"
+ # verify we have set CHOST
+ if [ -z "$CHOST" ]; then
+ error "CHOST not set"
+ return 1
+ fi
+
+ # PIE patches from gentoo
+ # thanks to Zorry for hard work on those patches
+ for i in "$srcdir"/piepatch/*.patch; do
+ msg "Applying $i"
+ patch -p0 -i $i || patch -p1 -i $i || return 1
+ done
+
+ # Gentoo and uclibc patches
+ _err=
+ for i in $source; do
+ case "$i" in
+ *.patch)
+ msg "Applying $i"
+ patch -p1 -i "$srcdir"/$i || _err="$_err $i"
+ ;;
+ esac
+ done
+
+ if [ -n "$_err" ]; then
+ error "The following patches failed:"
+ for i in $_err; do
+ echo " $i"
+ done
+ return 1
+ fi
+
+ #PR33200
+ sed -i 's/use_fixproto=yes/:/' gcc/config.gcc || return 1
+
+ # enable hardened cflags by default
+ # building gcc wih PIE seem to hit some strange bug. we probably run
+ # out of some resource. so we disable PIE for gcc while enabling it
+ # by default for everything else.
+ local _hard_cflags="-DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW"
+ sed -e "/^ALL_CFLAGS/iHARD_CFLAGS = ${_hard_cflags}" \
+ -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) -fno-PIE |' \
+ -i gcc/Makefile.in || return 1
+ sed -e "/stage1_cflags=/s/-fno-stack-protector/-fno-stack-protector -fno-PIE/" \
+ -i configure
+
+ # see http://gcc.gnu.org/ml/java/2008-04/msg00027.html
+ mv "$srcdir"/ecj-latest.jar ecj.jar
+
+ echo ${pkgver} > gcc/BASE-VER
+}
+
+build() {
+ local _languages= _dynamic_linker=
+ cd "$_gccdir"
+ export CFLAGS="-fno-stack-protector"
+ [ -z "$CBUILD" ] && CBUILD="$CHOST"
+ [ -z "$CTARGET" ] && CTARGET="$CHOST"
+
+ case "$CHOST" in
+ x86_64-*-uclibc)
+ _dynamic_linker="--with-dynamic-linker=ld64-uClibc.so.$_uclibc_abiver"
+ ;;
+ *-uclibc)
+ _dynamic_linker="--with-dynamic-linker=ld-uClibc.so.$_uclibc_abiver"
+ ;;
+ *) _dynamic_linker=
+ ;;
+ esac
+
+ _languages=c,c++
+ # we can disable OBJC with LANG_OBJC=off
+ if [ "$LANG_OBJC" != "off" ]; then
+ _languages=$_languages,objc
+ fi
+
+ # and disable java with LANG_JAVA=off
+ if [ "$LANG_JAVA" != "off" ]; then
+ _languages="$_languages,java"
+ fi
+
+ # --enable-target-optspace is broken on powerpc
+ if [ "$CARCH" != "powerpc" ]; then
+ _target_optspace="--enable-target-optspace"
+ fi
+
+ msg "Building the following:"
+ echo ""
+ echo " CBUILD=$CBUILD"
+ echo " CHOST=$CHOST"
+ echo " CTARGET=$CTARGET"
+ echo " languages=$_languages"
+ echo " dynamic_linker=$_dynamic_linker"
+ echo " target_optspace=$_target_optspace"
+ echo ""
+
+ mkdir -p "$_builddir"
+ cd "$_builddir"
+ "$_gccdir"/configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --build=${CBUILD} \
+ --host=${CHOST} \
+ --target=${CTARGET} \
+ --with-pkgversion='Alpine' \
+ --disable-altivec \
+ --disable-checking \
+ --disable-fixed-point \
+ --disable-libssp \
+ --disable-libstdcxx-pch \
+ --disable-multilib \
+ --disable-nls \
+ --disable-werror \
+ --enable-__cxa_atexit \
+ --enable-cld \
+ --enable-esp \
+ --enable-cloog-backend \
+ --enable-languages=$_languages \
+ --enable-shared \
+ $_target_optspace \
+ --enable-tls \
+ --enable-threads \
+ $_dynamic_linker \
+ --with-dynamic-linker-prefix=/lib \
+ --with-system-zlib \
+ --without-system-libunwind
+
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make -j1 DESTDIR="${pkgdir}" install || return 1
+ find "$pkgdir" -name '*.la' -delete || return 1
+
+ ln -s gcc "$pkgdir"/usr/bin/cc
+
+ # binutils provides libiberty.a
+ rm -f "$pkgdir"/usr/lib/libiberty.a
+
+ # install the specs
+ cd "$srcdir"/specs
+ install -d "$pkgdir"/usr/share/gcc
+ for i in *.specs; do
+ install -m644 $i "$pkgdir"/usr/share/gcc/$i || return 1
+ done
+
+ # we dont support gcj -static
+ # and saving 35MB is not bad.
+ find "$pkgdir" -name libgcj.a -o -name libgtkpeer.a \
+ -o -name libgjsmalsa.a -o -name libgcj-tools.a \
+ -o -name libjvm.a -o -name libgij.a -o -name libgcj_bc.a \
+ -o -name libjavamath.a \
+ | xargs rm -f \
+ || return 1
+
+ [ "$LANG_JAVA" = "on" ] && \
+ sed -i -e 's/lib: /&%{static:%eJava programs cannot be linked statically}/' \
+ "$pkdir"/usr/lib/libgcj.spec
+
+ # remove ffi
+ rm "$pkgdir"/usr/lib/libffi*
+ find "$pkgdir" -name 'ffi*.h' | xargs rm -f
+
+ mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/lib
+ mv "$pkgdir"/usr/lib/*-gdb.py \
+ "$pkgdir"/usr/share/gdb/python/auto-load/usr/lib/
+}
+
+libcxx() {
+ pkgdesc="GNU C++ standard runtime library"
+ depends=
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libstdc++.so.* "$subpkgdir"/usr/lib/
+}
+
+gpp() {
+ pkgdesc="GNU C++ standard library and compiler"
+ depends="libstdc++"
+ local libexec=usr/libexec/gcc/${CHOST:-$_chost}/$pkgver
+ mkdir -p "$subpkgdir/$libexec" \
+ "$subpkgdir"/usr/bin \
+ "$subpkgdir"/usr/include \
+ "$subpkgdir"/usr/lib \
+
+ mv "$pkgdir/$libexec/cc1plus" "$subpkgdir/$libexec/"
+ mv "$pkgdir"/usr/lib/*++* "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/include/c++ "$subpkgdir"/usr/include/
+ mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
+}
+
+libobjc() {
+ pkgdesc="GNU ObjectiveC library"
+ replaces="objc"
+ mkdir -p "$subpkgdir"/usr/lib
+
+ mv "$pkgdir"/usr/lib/*objc* "$subpkgdir"/usr/lib/
+}
+
+libgcc() {
+ pkgdesc="GNU C compiler runtime libraries"
+ depends=
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
+}
+
+libgomp() {
+ pkgdesc="GCC shared-memory parallel programming API library"
+ depends=
+ replaces="gcc"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libgomp.so.* "$subpkgdir"/usr/lib/
+}
+
+java() {
+ pkgdesc="Java support for GCC"
+ mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib
+ cd "$pkgdir"/usr/bin
+ mv gcj gcj-dbtool gjavah gcjh jcf-dump "$subpkgdir"/usr/bin/
+ cd "$pkgdir"
+ for i in $(find usr/ -name ecj1 -o -name jc1 -o -name jvgenmain); do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/$i "$subpkgdir"/$i || return 1
+ done
+ mv \
+ "$pkgdir"/usr/lib/libgcj*.so \
+ "$pkgdir"/usr/lib/libgij.so \
+ "$pkgdir"/usr/lib/libgcj.spec \
+ "$subpkgdir"/usr/lib/
+}
+
+libgcj() {
+ pkgdesc="Java runtime library for gcc"
+ mkdir -p "$subpkgdir"/usr/bin
+ cd "$pkgdir"/usr/bin
+ mv aot-compile gappletviewer gc-analyze gij gjar gjarsigner gkeytool\
+ gnative2ascii gorbd grmic grmid grmiregistry gserialver \
+ gtnameserv i486-alpine-linux-uclibc-gcj jv-convert \
+ rebuild-gcj-db \
+ "$subpkgdir"/usr/bin/
+ cd "$pkgdir"
+ for i in $(find usr/lib -name jc1 -o -name jvgenmain); do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/$i "$subpkgdir"/$i || return 1
+ done
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/gcj-* \
+ "$pkgdir"/usr/lib/libgcj*.so.* \
+ "$pkgdir"/usr/lib/libgij.so.* \
+ "$pkgdir"/usr/lib/logging.properties \
+ "$pkgdir"/usr/lib/security \
+ "$subpkgdir"/usr/lib/
+
+ mkdir -p "$subpkgdir"/usr/share/
+ mv "$pkgdir"/usr/share/java "$subpkgdir"/usr/share/
+}
+
+md5sums="0c0e7e35d2215e19de9c97efba507553 gcc-core-4.6.1.tar.bz2
+0d75ca7ca35b1e7f252223f9d23a6ad1 gcc-g++-4.6.1.tar.bz2
+cbf0d4b701827922cf37ba6a4ace0079 gcc-objc-4.6.1.tar.bz2
+32431ba42c1d18e64f2abfdfc834ef94 gcc-java-4.6.1.tar.bz2
+5dc7efd84b526801b94fed21462aea62 gcc-4.6.1-piepatches-v0.4.5.tar.bz2
+441c76504e1d97170117c294e65c7a72 gcc-4.4.3-specs-0.2.0.tar.bz2
+d7cd6a27c8801e66cbaa964a039ecfdb ecj-latest.jar
+b1b5987e7c53f2c8a0fa929444bd9129 08_all_cross-compile.patch
+34e4a0260e9dbd434ac84b9dda381240 11_all_default-warn-format-security.patch
+a78022925c0ecb1f13384238b81adbe7 12_all_default-warn-trampolines.patch
+6862cb5268fef68a4a1906e0c4ea0d46 15_all_libgomp-Werror.patch
+1a8ce6b7a0b9a115e37fdda311704451 34_all_ia64_note.GNU-stack.patch
+d8692c56f04b92667096f59d843e95c5 51_all_libiberty-pic.patch
+656565d2e2c30ea12a398ef6959a9391 74_all_gcc46_cloog-dl.patch
+a695d7648509b4f8e18b389a19e6037c gcc-spec-env.patch
+2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch
+6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch
+3be85df859fa1d5c875bbfcc2dee8288 gcc-4.6-dynamic-linker.patch
+32e8e4c0e23ed8f5de95a591cb30f1da gcc-4.6-pr32219.patch
+2c6cb49bb9bfd8b6e690222e66ccc901 boehem-gc-uclibc.patch
+d1d3ad2b0c185b5548125a1b81bee154 gcc-pure64.patch"
diff --git a/testing/gcc/boehem-gc-uclibc.patch b/testing/gcc/boehem-gc-uclibc.patch
new file mode 100644
index 0000000000..0fa6884105
--- /dev/null
+++ b/testing/gcc/boehem-gc-uclibc.patch
@@ -0,0 +1,11 @@
+--- ./boehm-gc/include/gc.h.orig
++++ ./boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/testing/gcc/gcc-4.6-dynamic-linker.patch b/testing/gcc/gcc-4.6-dynamic-linker.patch
new file mode 100644
index 0000000000..a6b235cd19
--- /dev/null
+++ b/testing/gcc/gcc-4.6-dynamic-linker.patch
@@ -0,0 +1,459 @@
+commit d929f627aba264e63cf779cd4ca51af97b076445
+Author: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue Sep 28 09:45:17 2010 +0000
+
+ Submitted By: Kevin Day <thekevinday AT gmail DOT com>
+ Date: 2008-12-19
+ Initial Package Version: 4.3.2
+ Upstream Status: Not submitted
+ Description: Why not just be able to define the prefix of the dynamic linker instead of hardcoding it..
+ This includes the --nostdinc patch as well, so think of this as a specs-3 patch
+ This also allows for specifying the dynamic-linker as well
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index ae2416b..b0b9b2c 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -971,7 +971,7 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
+ # This is the variable actually used when we compile. If you change this,
+ # you probably want to update BUILD_CFLAGS in configure.ac
+ ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
+- $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
++ $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ @NOSTDINC@
+
+ # The C++ version.
+ ALL_CXXFLAGS = $(T_CFLAGS) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
+@@ -2105,6 +2105,8 @@ DRIVER_DEFINES = \
+ -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
+ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
+ -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
++ -DDYNAMIC_LINKER_PREFIX=\"@DYNAMICLINKERPREFIX@\" \
++ -DDYNAMIC_LINKER=\"@DYNAMICLINKER@\" \
+ -DDEFAULT_TARGET_VERSION=\"$(version)\" \
+ -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
+ -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
+diff --git a/gcc/config/alpha/gnu.h b/gcc/config/alpha/gnu.h
+index f98c3e7..bd16dcf 100644
+--- a/gcc/config/alpha/gnu.h
++++ b/gcc/config/alpha/gnu.h
+@@ -34,7 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ } while (0)
+
+ #undef ELF_DYNAMIC_LINKER
+-#define ELF_DYNAMIC_LINKER "/lib/ld.so"
++#define ELF_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
+index c48fc93..3068717 100644
+--- a/gcc/config/alpha/linux-elf.h
++++ b/gcc/config/alpha/linux-elf.h
+@@ -27,8 +27,8 @@ along with GCC; see the file COPYING3. If not see
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #else
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index fce1ed1..c3bcd50 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -61,7 +61,7 @@
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
+index 9fdca41..65b0a5a 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -62,7 +62,7 @@
+
+ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
+ %{b} \
+diff --git a/gcc/config/bfin/linux.h b/gcc/config/bfin/linux.h
+index 5c716cd..b5e464e 100644
+--- a/gcc/config/bfin/linux.h
++++ b/gcc/config/bfin/linux.h
+@@ -45,7 +45,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ %{shared:-G -Bdynamic} \
+ %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+- -dynamic-linker /lib/ld-uClibc.so.0} \
++ -dynamic-linker DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER} \
+ %{static}} -init __init -fini __fini"
+
+ #define MD_UNWIND_SUPPORT "config/bfin/linux-unwind.h"
+diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h
+index 38f0a7e..6893407 100644
+--- a/gcc/config/cris/linux.h
++++ b/gcc/config/cris/linux.h
+@@ -103,7 +103,7 @@ along with GCC; see the file COPYING3. If not see
+ #undef CRIS_DEFAULT_CPU_VERSION
+ #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ /* We need an -rpath-link to ld.so.1, and presumably to each directory
+ specified with -B. */
+diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 84d8127..fb3e79a 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -144,9 +144,9 @@ is built with the --enable-threads configure-time option.} \
+ #endif
+
+ #if FBSD_MAJOR < 6
+-#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
++#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #else
+-#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
++#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #endif
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+diff --git a/gcc/config/frv/linux.h b/gcc/config/frv/linux.h
+index 71cd094..221d01d 100644
+--- a/gcc/config/frv/linux.h
++++ b/gcc/config/frv/linux.h
+@@ -35,7 +35,7 @@
+ #define ENDFILE_SPEC \
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index 2a31880..9c08adb 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -100,7 +100,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */
+ #define LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef ASM_SPEC
+ #define ASM_SPEC \
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index 867de59..274acca 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -58,8 +58,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #if TARGET_64BIT_DEFAULT
+ #define SPEC_32 "m32"
+diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
+index 587a4f4..450fcb5 100644
+--- a/gcc/config/ia64/linux.h
++++ b/gcc/config/ia64/linux.h
+@@ -61,7 +61,7 @@ do { \
+ /* Define this for shared library support because it isn't in the main
+ linux.h file. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+diff --git a/gcc/config/knetbsd-gnu.h b/gcc/config/knetbsd-gnu.h
+index 4cc8eb7..bb7a063 100644
+--- a/gcc/config/knetbsd-gnu.h
++++ b/gcc/config/knetbsd-gnu.h
+@@ -34,5 +34,5 @@ along with GCC; see the file COPYING3. If not see
+
+ #ifdef GLIBC_DYNAMIC_LINKER
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #endif
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index e567e9a..c052fd0 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -117,9 +117,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+ GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+ supporting both 32-bit and 64-bit compilation. */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+@@ -135,3 +135,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ /* Whether we have sincos that follows the GNU extension. */
+ #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC)
++
++#ifdef NOSTDINC
++#undef STANDARD_INCLUDE_DIR
++#define STANDARD_INCLUDE_DIR 0
++#endif
+diff --git a/gcc/config/m32r/linux.h b/gcc/config/m32r/linux.h
+index 0515e5b..019e850 100644
+--- a/gcc/config/m32r/linux.h
++++ b/gcc/config/m32r/linux.h
+@@ -58,7 +58,7 @@
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #if TARGET_LITTLE_ENDIAN
+diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
+index 1d73ee0..e57cf50 100644
+--- a/gcc/config/m68k/linux.h
++++ b/gcc/config/m68k/linux.h
+@@ -84,7 +84,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m m68kelf %{shared} \
+diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
+index 0512ef7..7efe2fd 100644
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see
+ #undef MIPS_DEFAULT_GVALUE
+ #define MIPS_DEFAULT_GVALUE 0
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
+diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h
+index 2f24dfa..850cb22 100644
+--- a/gcc/config/mips/linux64.h
++++ b/gcc/config/mips/linux64.h
+@@ -35,10 +35,10 @@ along with GCC; see the file COPYING3. If not see
+ %{!shared: \
+ %{profile:-lc_p} %{!profile:-lc}}"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
+-#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
+-#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define BIONIC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #define LINUX_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+ BIONIC_DYNAMIC_LINKERN32)
+diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h
+index ac9f8c5..8ab78b1 100644
+--- a/gcc/config/mn10300/linux.h
++++ b/gcc/config/mn10300/linux.h
+@@ -32,7 +32,7 @@
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{Wa,*:%*}"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index da7bca3..c36e7d6 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -348,10 +348,10 @@ extern int dot_symbols;
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
+index ddbcfa9..59bfd28 100644
+--- a/gcc/config/s390/linux.h
++++ b/gcc/config/s390/linux.h
+@@ -72,8 +72,8 @@ along with GCC; see the file COPYING3. If not see
+ #define MULTILIB_DEFAULTS { "m31" }
+ #endif
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
+index d513af8..2ad27a7 100644
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
+index b12c881..83bdd8e 100644
+--- a/gcc/config/sparc/linux.h
++++ b/gcc/config/sparc/linux.h
+@@ -83,7 +83,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
+index c2e78d7..8481a34 100644
+--- a/gcc/config/sparc/linux64.h
++++ b/gcc/config/sparc/linux64.h
+@@ -109,8 +109,8 @@ along with GCC; see the file COPYING3. If not see
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #ifdef SPARC_BI_ARCH
+
+diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
+index 69ab626..ebc8e0b 100644
+--- a/gcc/config/xtensa/linux.h
++++ b/gcc/config/xtensa/linux.h
+@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls}"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+diff --git a/gcc/configure b/gcc/configure
+index b623a4a..230719b 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -757,6 +757,9 @@ AWK
+ SET_MAKE
+ REPORT_BUGS_TEXI
+ REPORT_BUGS_TO
++DYNAMICLINKER
++DYNAMICLINKERPREFIX
++NOSTDINC
+ PKGVERSION
+ onestep
+ CONFIGURE_SPECS
+@@ -1657,6 +1660,14 @@ Optional Packages:
+ --with-gc={page,zone} choose the garbage collection mechanism to use
+ with the compiler
+ --with-system-zlib use installed libz
++ --with-dynamic-linker=PATH
++ specifies path to dynamic linker.
++ example: "/lib/ld-linux.so.2", where this defines "ld-linux.so.2"
++ --with-dynamic-linker-prefix=PATH
++ specifies path to dynamic linker.
++ example: "/lib/ld-linux.so.2", where this defines "/lib"
++ --with-nostdinc build gcc to ignore standard include directories.
++ You will have to use --with-local-prefix with this option.
+ --with-slibdir=DIR shared libraries in DIR [LIBDIR]
+
+ Some influential environment variables:
+@@ -6065,6 +6076,47 @@ fi
+
+
+
++# Check whether --with-dynamic-linker was given.
++
++DYNAMICLINKER="ld-linux.so.2" ;
++if test "${with_dynamic_linker+set}" = set; then
++ withval="$with_dynamic_linker"
++ case "${withval}" in
++yes) { { echo "$as_me:$LINENO: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&5
++echo "$as_me: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&2;}
++ { (exit 1); exit 1; }; } ;;
++no) ;;
++*) DYNAMICLINKER=$withval ;;
++esac
++fi;
++
++# Check whether --with-dynamic-linker-prefix= was given.
++
++DYNAMICLINKERPREFIX="/lib" ;
++if test "${with_dynamic_linker_prefix+set}" = set; then
++ withval="$with_dynamic_linker_prefix"
++ case "${withval}" in
++yes) { { echo "$as_me:$LINENO: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&5
++echo "$as_me: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&2;}
++ { (exit 1); exit 1; }; } ;;
++no) ;;
++*) DYNAMICLINKERPREFIX=$withval ;;
++esac
++
++fi;
++
++# Check whether --with-nostdinc was given.
++
++if test "${with_nostdinc+set}" = set; then
++ withval="$with_nostdinc"
++ case "${withval}" in
++yes) NOSTDINC="-DNOSTDINC" ;;
++no) ;;
++*) NOSTDINC="-DNOSTDINC" ;;
++esac
++fi;
++
++
+
+ # ---------------------
+ # Warnings and checking
diff --git a/testing/gcc/gcc-4.6-pr32219.patch b/testing/gcc/gcc-4.6-pr32219.patch
new file mode 100644
index 0000000000..8233e5b231
--- /dev/null
+++ b/testing/gcc/gcc-4.6-pr32219.patch
@@ -0,0 +1,25 @@
+--- ./gcc/varasm.c.orig
++++ ./gcc/varasm.c
+@@ -6758,6 +6758,10 @@
+ /* Static variables are always local. */
+ else if (! TREE_PUBLIC (exp))
+ local_p = true;
++ /* Weak data can be overridden by a strong symbol
++ in another module and so are not local. */
++ else if (DECL_WEAK (exp))
++ local_p = false;
+ /* A variable is local if the user has said explicitly that it will
+ be. */
+ else if ((DECL_VISIBILITY_SPECIFIED (exp)
+@@ -6771,11 +6775,6 @@
+ local. */
+ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
+ local_p = true;
+- /* Default visibility weak data can be overridden by a strong symbol
+- in another module and so are not local. */
+- else if (DECL_WEAK (exp)
+- && !resolved_locally)
+- local_p = false;
+ /* If PIC, then assume that any global name can be overridden by
+ symbols resolved from other modules. */
+ else if (shlib)
diff --git a/testing/gcc/gcc-pure64.patch b/testing/gcc/gcc-pure64.patch
new file mode 100644
index 0000000000..f9ab69326e
--- /dev/null
+++ b/testing/gcc/gcc-pure64.patch
@@ -0,0 +1,12 @@
+diff -Naur gcc-4.2.0.orig/gcc/config/i386/t-linux64 gcc-4.2.0/gcc/config/i386/t-linux64
+--- gcc-4.2.0.orig/gcc/config/i386/t-linux64 2007-05-16 19:21:19.000000000 -0400
++++ gcc-4.2.0/gcc/config/i386/t-linux64 2007-05-18 17:04:36.000000000 -0400
+@@ -6,7 +6,7 @@
+
+ MULTILIB_OPTIONS = m64/m32
+ MULTILIB_DIRNAMES = 64 32
+-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
++MULTILIB_OSDIRNAMES = ../lib ../lib32
+
+ LIBGCC = stmp-multilib
+ INSTALL_LIBGCC = install-multilib
diff --git a/testing/gcc/gcc-spec-env.patch b/testing/gcc/gcc-spec-env.patch
new file mode 100644
index 0000000000..57e7567e54
--- /dev/null
+++ b/testing/gcc/gcc-spec-env.patch
@@ -0,0 +1,42 @@
+ Add support for external spec file via the GCC_SPECS env var. This
+ allows us to easily control pie/ssp defaults with gcc-config profiles.
+
+ Original patch by Rob Holland
+ Extended to support multiple entries separated by ':' by Kevin F. Quinn
+ Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+
+--- gcc-4/gcc/gcc.c
++++ gcc-4/gcc/gcc.c
+@@ -6482,6 +6482,32 @@
+
+ /* Process any user specified specs in the order given on the command
+ line. */
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ specs_file = getenv ("GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
diff --git a/testing/gcc/pt_gnu_eh_frame.patch b/testing/gcc/pt_gnu_eh_frame.patch
new file mode 100644
index 0000000000..3e029104aa
--- /dev/null
+++ b/testing/gcc/pt_gnu_eh_frame.patch
@@ -0,0 +1,12 @@
+--- gcc-4.3.2/gcc/crtstuff.c.orig Mon Nov 17 16:02:38 2008
++++ gcc-4.3.2/gcc/crtstuff.c Mon Nov 17 16:02:52 2008
+@@ -94,8 +94,7 @@
+ #include <link.h>
+ /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+ But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
+-# if !defined(__UCLIBC__) \
+- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
++# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+ # define USE_PT_GNU_EH_FRAME
+ # endif
diff --git a/testing/gcc/uclibc-getipinfo.patch b/testing/gcc/uclibc-getipinfo.patch
new file mode 100644
index 0000000000..3abbbdd7ae
--- /dev/null
+++ b/testing/gcc/uclibc-getipinfo.patch
@@ -0,0 +1,19 @@
+--- a/libstdc++-v3/configure 2009-08-04 15:41:02.000000000 +0000
++++ b/libstdc++-v3/configure 2009-08-04 15:46:20.000000000 +0000
+@@ -113523,14 +113523,14 @@
+ # Based on system-libunwind and target, do we have ipinfo?
+ if test x$with_system_libunwind = xyes; then
+ case ${target} in
+- ia64-*-*) have_unwind_getipinfo=no ;;
++ ia64-*-*|*-uclibc*) have_unwind_getipinfo=no ;;
+ *) have_unwind_getipinfo=yes ;;
+ esac
+ else
+ # Darwin before version 9 does not have _Unwind_GetIPInfo.
+
+ case ${target} in
+- *-*-darwin[3-8]|*-*-darwin[3-8].*) have_unwind_getipinfo=no ;;
++ *-*-darwin[3-8]|*-*-darwin[3-8].*|*-uclibc*) have_unwind_getipinfo=no ;;
+ *) have_unwind_getipinfo=yes ;;
+ esac
+