From 63cbdb27e349a4dce9d6c51fdcf86df802e9d6c6 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 10 Sep 2012 07:35:03 +0000 Subject: main/gcc: upgrade to 4.7.1 Disable gcc-go for now. It needs ucontext which we don't have. --- main/gcc/08_all_cross-compile.patch | 40 -- main/gcc/12_all_default-warn-trampolines.patch | 21 +- main/gcc/16_all_libgo-Werror-pr53679.patch | 16 + main/gcc/29_all_arm_armv4t-default.patch | 16 + main/gcc/34_all_ia64_note.GNU-stack.patch | 89 ---- main/gcc/49_all_gcc-4.7-x86-libitm-pr52695.patch | 24 + .../gcc/67_all_gcc-poison-system-directories.patch | 209 ++++++++ main/gcc/74_all_gcc46_cloog-dl.patch | 530 --------------------- main/gcc/74_all_gcc47_cloog-dl.patch | 524 ++++++++++++++++++++ main/gcc/APKBUILD | 83 ++-- main/gcc/gcc-4.6-dynamic-linker.patch | 459 ------------------ main/gcc/gcc-4.7-dynamic-linker.patch | 432 +++++++++++++++++ main/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch | 38 -- main/gcc/gcc-pure64.patch | 24 +- main/gcc/pt_gnu_eh_frame.patch | 4 +- 15 files changed, 1290 insertions(+), 1219 deletions(-) delete mode 100644 main/gcc/08_all_cross-compile.patch create mode 100644 main/gcc/16_all_libgo-Werror-pr53679.patch create mode 100644 main/gcc/29_all_arm_armv4t-default.patch delete mode 100644 main/gcc/34_all_ia64_note.GNU-stack.patch create mode 100644 main/gcc/49_all_gcc-4.7-x86-libitm-pr52695.patch create mode 100644 main/gcc/67_all_gcc-poison-system-directories.patch delete mode 100644 main/gcc/74_all_gcc46_cloog-dl.patch create mode 100644 main/gcc/74_all_gcc47_cloog-dl.patch delete mode 100644 main/gcc/gcc-4.6-dynamic-linker.patch create mode 100644 main/gcc/gcc-4.7-dynamic-linker.patch delete mode 100644 main/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch (limited to 'main/gcc') diff --git a/main/gcc/08_all_cross-compile.patch b/main/gcc/08_all_cross-compile.patch deleted file mode 100644 index 4203e3a62..000000000 --- a/main/gcc/08_all_cross-compile.patch +++ /dev/null @@ -1,40 +0,0 @@ -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/main/gcc/12_all_default-warn-trampolines.patch b/main/gcc/12_all_default-warn-trampolines.patch index a5606c5ec..4b26aecd2 100644 --- a/main/gcc/12_all_default-warn-trampolines.patch +++ b/main/gcc/12_all_default-warn-trampolines.patch @@ -1,9 +1,8 @@ Enable -Wtrampolines by default. - --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -611,7 +611,7 @@ Common Var(warn_system_headers) Warning +@@ -639,7 +639,7 @@ Common Var(warn_system_headers) Warning Do not suppress warnings from system headers Wtrampolines @@ -14,12 +13,12 @@ Enable -Wtrampolines by default. 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 +@@ -3878,6 +3878,8 @@ headers---for that, @option{-Wunknown-pragmas} must also be used. + for most targets, it is made up of code and thus requires the stack + to be made executable in order for the program to work properly. + ++ This warning is enabled by default in Gentoo. ++ + @item -Wfloat-equal + @opindex Wfloat-equal + @opindex Wno-float-equal diff --git a/main/gcc/16_all_libgo-Werror-pr53679.patch b/main/gcc/16_all_libgo-Werror-pr53679.patch new file mode 100644 index 000000000..3c1ece364 --- /dev/null +++ b/main/gcc/16_all_libgo-Werror-pr53679.patch @@ -0,0 +1,16 @@ +libgo does not respect --disable-werror + +https://bugs.gentoo.org/423153 +http://gcc.gnu.org/PR53679 + +--- a/libgo/configure ++++ b/libgo/configure +@@ -13384,7 +13384,7 @@ done + WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual' + + +-WERROR="-Werror" ++WERROR="" + + + glibgo_toolexecdir=no diff --git a/main/gcc/29_all_arm_armv4t-default.patch b/main/gcc/29_all_arm_armv4t-default.patch new file mode 100644 index 000000000..4616cf9ab --- /dev/null +++ b/main/gcc/29_all_arm_armv4t-default.patch @@ -0,0 +1,16 @@ +gcc defaults to armv5t for all targets even armv4t + +http://sourceware.org/ml/crossgcc/2008-05/msg00009.html + + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -45,7 +45,7 @@ + The ARM10TDMI core is the default for armv5t, so set + SUBTARGET_CPU_DEFAULT to achieve this. */ + #undef SUBTARGET_CPU_DEFAULT +-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ diff --git a/main/gcc/34_all_ia64_note.GNU-stack.patch b/main/gcc/34_all_ia64_note.GNU-stack.patch deleted file mode 100644 index b156eacb2..000000000 --- a/main/gcc/34_all_ia64_note.GNU-stack.patch +++ /dev/null @@ -1,89 +0,0 @@ -2004-09-20 Jakub Jelinek - - * 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 - - * 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/main/gcc/49_all_gcc-4.7-x86-libitm-pr52695.patch b/main/gcc/49_all_gcc-4.7-x86-libitm-pr52695.patch new file mode 100644 index 000000000..e1eb2e6ab --- /dev/null +++ b/main/gcc/49_all_gcc-4.7-x86-libitm-pr52695.patch @@ -0,0 +1,24 @@ +http://gcc.gnu.org/PR52695 +https://bugs.gentoo.org/421305 + +fix building on x86 systems + +--- a/libitm/config/x86/target.h ++++ b/libitm/config/x86/target.h +@@ -69,16 +69,4 @@ + } // namespace GTM + + // We'll be using some of the cpu builtins, and their associated types. +-#ifndef __cplusplus +-/* ??? It's broken for C++. */ + #include +-#else +-# ifdef __SSE2__ +-# include +-# elif defined(__SSE__) +-# include +-# endif +-# ifdef __AVX__ +-# include +-# endif +-#endif diff --git a/main/gcc/67_all_gcc-poison-system-directories.patch b/main/gcc/67_all_gcc-poison-system-directories.patch new file mode 100644 index 000000000..a9aee2732 --- /dev/null +++ b/main/gcc/67_all_gcc-poison-system-directories.patch @@ -0,0 +1,209 @@ +grabbed from openembedded + +Upstream-Status: Inappropriate [distribution: codesourcery] + + gcc/ + 2008-07-02 Joseph Myers + * c-incpath.c: Include toplev.h. + (merge_include_chains): Use warning instead of cpp_error for + system directory poisoning diagnostic. + * Makefile.in (c-incpath.o): Depend on toplev.h. + * gcc.c (LINK_COMMAND_SPEC): Pass + --error-poison-system-directories if + -Werror=poison-system-directories. + + 2007-06-13 Joseph Myers + * common.opt (--Wno-poison-system-directories): New. + * doc/invoke.texi (-Wno-poison-system-directories): Document. + * c-incpath.c: Include flags.h. + (merge_include_chains): Check flag_poison_system_directories. + * gcc.c (LINK_COMMAND_SPEC): Pass --no-poison-system-directories + to linker if -Wno-poison-system-directories. + * Makefile.in (c-incpath.o): Depend on $(FLAGS_H). + + 2007-03-20 Daniel Jacobowitz + Joseph Myers + * configure.ac (--enable-poison-system-directories): New option. + * configure, config.in: Regenerate. + * c-incpath.c (merge_include_chains): If + ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of + /usr/include, /usr/local/include or /usr/X11R6/include. + +Index: gcc-4_7-branch/gcc/common.opt +=================================================================== +--- gcc-4_7-branch.orig/gcc/common.opt 2012-04-10 10:54:04.000000000 -0700 ++++ gcc-4_7-branch/gcc/common.opt 2012-04-10 10:56:02.259442274 -0700 +@@ -582,6 +582,10 @@ + Common Var(warn_padded) Warning + Warn when padding is required to align structure members + ++Wpoison-system-directories ++Common Var(flag_poison_system_directories) Init(1) Warning ++Warn for -I and -L options using system directories if cross compiling ++ + Wshadow + Common Var(warn_shadow) Warning + Warn when one local variable shadows another +Index: gcc-4_7-branch/gcc/config.in +=================================================================== +--- gcc-4_7-branch.orig/gcc/config.in 2012-04-10 10:54:04.000000000 -0700 ++++ gcc-4_7-branch/gcc/config.in 2012-04-10 10:56:02.259442274 -0700 +@@ -144,6 +144,12 @@ + #endif + + ++/* Define to warn for use of native system header directories */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_POISON_SYSTEM_DIRECTORIES ++#endif ++ ++ + /* Define if you want all operations on RTL (the basic data structure of the + optimizer and back end) to be checked for dynamic type safety at runtime. + This is quite expensive. */ +Index: gcc-4_7-branch/gcc/configure.ac +=================================================================== +--- gcc-4_7-branch.orig/gcc/configure.ac 2012-04-10 10:55:32.000000000 -0700 ++++ gcc-4_7-branch/gcc/configure.ac 2012-04-10 10:56:02.259442274 -0700 +@@ -4959,6 +4959,16 @@ + [specify that runtime libraries should be + installed in a compiler-specific directory])]) + ++AC_ARG_ENABLE([poison-system-directories], ++ AS_HELP_STRING([--enable-poison-system-directories], ++ [warn for use of native system header directories]),, ++ [enable_poison_system_directories=no]) ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], ++ [1], ++ [Define to warn for use of native system header directories]) ++fi ++ + # Substitute configuration variables + AC_SUBST(subdirs) + AC_SUBST(srcdir) +Index: gcc-4_7-branch/gcc/doc/invoke.texi +=================================================================== +--- gcc-4_7-branch.orig/gcc/doc/invoke.texi 2012-04-10 10:54:04.000000000 -0700 ++++ gcc-4_7-branch/gcc/doc/invoke.texi 2012-04-10 10:56:02.263442231 -0700 +@@ -260,6 +260,7 @@ + -Woverlength-strings -Wpacked -Wpacked-bitfield-compat -Wpadded @gol + -Wparentheses -Wpedantic-ms-format -Wno-pedantic-ms-format @gol + -Wpointer-arith -Wno-pointer-to-int-cast @gol ++-Wno-poison-system-directories @gol + -Wredundant-decls @gol + -Wreturn-type -Wsequence-point -Wshadow @gol + -Wsign-compare -Wsign-conversion -Wstack-protector @gol +@@ -3878,6 +3879,14 @@ + for most targets, it is made up of code and thus requires the stack + to be made executable in order for the program to work properly. + ++@item -Wno-poison-system-directories ++@opindex Wno-poison-system-directories ++Do not warn for @option{-I} or @option{-L} options using system ++directories such as @file{/usr/include} when cross compiling. This ++option is intended for use in chroot environments when such ++directories contain the correct headers and libraries for the target ++system rather than the host. ++ + @item -Wfloat-equal + @opindex Wfloat-equal + @opindex Wno-float-equal +Index: gcc-4_7-branch/gcc/gcc.c +=================================================================== +--- gcc-4_7-branch.orig/gcc/gcc.c 2012-04-10 10:54:04.000000000 -0700 ++++ gcc-4_7-branch/gcc/gcc.c 2012-04-10 10:56:02.267442207 -0700 +@@ -673,6 +673,8 @@ + %{flto} %{flto=*} %l " LINK_PIE_SPEC \ + "%X %{o*} %{e*} %{N} %{n} %{r}\ + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\ ++ %{Wno-poison-system-directories:--no-poison-system-directories}\ ++ %{Werror=poison-system-directories:--error-poison-system-directories}\ + %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ + %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ + %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\ +Index: gcc-4_7-branch/gcc/incpath.c +=================================================================== +--- gcc-4_7-branch.orig/gcc/incpath.c 2012-04-10 10:54:04.000000000 -0700 ++++ gcc-4_7-branch/gcc/incpath.c 2012-04-10 10:56:02.267442207 -0700 +@@ -361,6 +361,26 @@ + } + fprintf (stderr, _("End of search list.\n")); + } ++ ++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES ++ if (flag_poison_system_directories) ++ { ++ struct cpp_dir *p; ++ ++ for (p = heads[QUOTE]; p; p = p->next) ++ { ++ if ((!strncmp (p->name, "/usr/include", 12)) ++ || (!strncmp (p->name, "/usr/local/include", 18)) ++ || (!strncmp (p->name, "/usr/X11R6/include", 18)) ++ || (!strncmp (p->name, "/sw/include", 11)) ++ || (!strncmp (p->name, "/opt/include", 12))) ++ warning (OPT_Wpoison_system_directories, ++ "include location \"%s\" is unsafe for " ++ "cross-compilation", ++ p->name); ++ } ++ } ++#endif + } + + /* Use given -I paths for #include "..." but not #include <...>, and +Index: gcc-4_7-branch/gcc/Makefile.in +=================================================================== +--- gcc-4_7-branch.orig/gcc/Makefile.in 2012-04-10 10:54:05.000000000 -0700 ++++ gcc-4_7-branch/gcc/Makefile.in 2012-04-10 10:56:02.267442207 -0700 +@@ -2065,7 +2065,7 @@ + + incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ + intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \ +- $(MACHMODE_H) ++ $(MACHMODE_H) $(FLAGS_H) toplev.h + + CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) + prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h prefix.h \ +Index: gcc-4_7-branch/gcc/configure +=================================================================== +--- gcc-4_7-branch.orig/gcc/configure 2012-04-10 10:55:32.000000000 -0700 ++++ gcc-4_7-branch/gcc/configure 2012-04-10 10:56:12.183442720 -0700 +@@ -914,6 +914,7 @@ + with_system_zlib + enable_maintainer_mode + enable_version_specific_runtime_libs ++enable_poison_system_directories + enable_plugin + enable_libquadmath_support + with_linker_hash_style +@@ -1627,6 +1628,8 @@ + --enable-version-specific-runtime-libs + specify that runtime libraries should be installed + in a compiler-specific directory ++ --enable-poison-system-directories ++ warn for use of native system header directories + --enable-plugin enable plugin support + --disable-libquadmath-support + disable libquadmath support for Fortran +@@ -27075,6 +27078,19 @@ + fi + + ++# Check whether --enable-poison-system-directories was given. ++if test "${enable_poison_system_directories+set}" = set; then : ++ enableval=$enable_poison_system_directories; ++else ++ enable_poison_system_directories=no ++fi ++ ++if test "x${enable_poison_system_directories}" = "xyes"; then ++ ++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h ++ ++fi ++ + # Substitute configuration variables + + diff --git a/main/gcc/74_all_gcc46_cloog-dl.patch b/main/gcc/74_all_gcc46_cloog-dl.patch deleted file mode 100644 index 43c2f9622..000000000 --- a/main/gcc/74_all_gcc46_cloog-dl.patch +++ /dev/null @@ -1,530 +0,0 @@ -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 - - * 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 . 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 - - * configure.ac (DL_LIB): Check how to dlopen. - * configure: Regenerate. - * Makefile.in (BACKENDLIBS): Use DL_LIB. - * graphite-cloog-compat.h: Add missing symbols. - -2012-03-12 Natanael Copa - - * Rebase against gcc 4.6.3 - -diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index 872956d..7d89f08 100644 ---- 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) \ -@@ -3483,6 +3485,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 $@ \ -diff --git a/gcc/configure b/gcc/configure -index 9b87171..0cf3795 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -602,6 +602,7 @@ ac_subst_vars='LTLIBOBJS - LIBOBJS - enable_plugin - pluginlibs -+DL_LIB - CLOOGINC - CLOOGLIBS - PPLINC -@@ -26282,6 +26283,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; } -@@ -26341,7 +26343,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 -diff --git a/gcc/configure.ac b/gcc/configure.ac -index c574fb6..228fb9f 100644 ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -4839,11 +4839,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 -diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c -index 41356dc..e93cafe 100644 ---- 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); -diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h -index 011377d..550df7a 100644 ---- 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 -+#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 */ -diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h -index 3bf87b0..3ed95b7 100644 ---- 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); -diff --git a/gcc/graphite.c b/gcc/graphite.c -index b013447..5637d37 100644 ---- 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/main/gcc/74_all_gcc47_cloog-dl.patch b/main/gcc/74_all_gcc47_cloog-dl.patch new file mode 100644 index 000000000..ee108e33a --- /dev/null +++ b/main/gcc/74_all_gcc47_cloog-dl.patch @@ -0,0 +1,524 @@ +2011-01-04 Jakub Jelinek + + * 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 . 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. + +2012-05-19 Ryan Hill + + * configure.ac (DL_LIB): Check how to dlopen. + * configure: Regenerate. + * Makefile.in (BACKENDLIBS): Use DL_LIB. + + +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -963,6 +963,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. +@@ -1017,7 +1019,7 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) + # and the system's installed libraries. + LIBS = @LIBS@ libcommon.a $(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@ +@@ -2603,40 +2605,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) \ +@@ -3455,6 +3457,15 @@ $(common_out_object_file): $(common_out_file) $(CONFIG_H) $(SYSTEM_H) \ + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \ + $< $(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)) ++graphite%.o : \ ++ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) ++graphite.o : \ ++ ALL_CXXFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CXXFLAGS)) ++ + # Build auxiliary files that support ecoff format. + mips-tfile: mips-tfile.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 +@@ -27236,6 +27237,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; } +@@ -27295,7 +27297,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 +@@ -5109,11 +5109,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 +@@ -836,7 +836,7 @@ clast_get_body_of_loop (struct clast_stmt *stmt) + from STMT_FOR. */ + + static tree +-type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip) ++type_for_clast_for (struct clast_for *stmt_fora, ivs_params_p ip) + { + mpz_t bound_one, bound_two; + tree lb_type, ub_type; +@@ -844,8 +844,8 @@ type_for_clast_for (struct clast_for *stmt_for, ivs_params_p ip) + mpz_init (bound_one); + mpz_init (bound_two); + +- lb_type = type_for_clast_expr (stmt_for->LB, ip, bound_one, bound_two); +- ub_type = type_for_clast_expr (stmt_for->UB, ip, bound_one, bound_two); ++ lb_type = type_for_clast_expr (stmt_fora->LB, ip, bound_one, bound_two); ++ ub_type = type_for_clast_expr (stmt_fora->UB, ip, bound_one, bound_two); + + mpz_clear (bound_one); + mpz_clear (bound_two); +--- a/gcc/graphite-cloog-compat.h ++++ b/gcc/graphite-cloog-compat.h +@@ -272,4 +272,279 @@ static inline int cloog_matrix_nrows (CloogMatrix * m) + return m->NbRows; + } + #endif /* CLOOG_ORG */ ++ ++#include ++#if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11 ++#define DYNSYMS_PPL11 ++#else ++#define DYNSYMS_PPL11 \ ++ DYNSYM (ppl_new_PIP_Problem_from_constraints); \ ++ DYNSYM (ppl_PIP_Problem_is_satisfiable); \ ++ DYNSYM (ppl_delete_PIP_Problem); ++#endif ++#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 (stmt_ass); \ ++ 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); \ ++ DYNSYMS_PPL11 ++extern struct cloog_pointers_s__ ++{ ++ 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 stmt_ass (*cloog_pointers__.p_stmt_ass) ++#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) ++#if !(PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11) ++#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) ++#endif ++ ++#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/main/gcc/APKBUILD b/main/gcc/APKBUILD index da967dbb4..2b7b747c9 100644 --- a/main/gcc/APKBUILD +++ b/main/gcc/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa pkgname=gcc -pkgver=4.6.3 -_piepatchver=0.4.5 +pkgver=4.7.1 +_piepatchver=0.5.3 _specs_ver=0.2.0 _specs_gcc_ver=4.4.3 @@ -12,12 +12,15 @@ 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 +depends="binutils libgomp libobjc" +makedepends="bison flex gmp-dev mpfr-dev texinfo mpc1-dev gawk zlib-dev zip cloog-dev" subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp" replaces="libstdc++" +# disable Go til we have getcontex/setcontext +LANG_GO=off + if [ -n "$BOOTSTRAP" ]; then LANG_OBJC=off LANG_JAVA=off @@ -43,33 +46,29 @@ if [ "$LANG_FORTRAN" != "off" ]; then _languages="$_languages,fortran" 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 - ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-go-$pkgver.tar.bz2 - ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-fortran-$pkgver.tar.bz2 - http://distfiles.gentoo.org/distfiles/gcc-4.6.1-piepatches-v${_piepatchver}.tar.bz2 +source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2 + http://distfiles.gentoo.org/distfiles/gcc-4.7.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 + 16_all_libgo-Werror-pr53679.patch + 29_all_arm_armv4t-default.patch + 49_all_gcc-4.7-x86-libitm-pr52695.patch 51_all_libiberty-pic.patch - 74_all_gcc46_cloog-dl.patch + 67_all_gcc-poison-system-directories.patch + 74_all_gcc47_cloog-dl.patch gcc-spec-env.patch pt_gnu_eh_frame.patch uclibc-getipinfo.patch - gcc-4.6-dynamic-linker.patch + gcc-4.7-dynamic-linker.patch gcc-4.6-pr32219.patch boehem-gc-uclibc.patch gcc-pure64.patch gcc-go.patch - gcc-libgcc-x86.get_pc_thunk.bx.patch " # we build out-of-tree @@ -119,10 +118,9 @@ prepare() { # 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 |' \ + -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \ + -e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \ -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 @@ -173,6 +171,7 @@ build() { --target=${CTARGET} \ --with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \ --disable-altivec \ + --disable-build-with-cxx \ --disable-checking \ --disable-fixed-point \ --disable-libssp \ @@ -192,7 +191,8 @@ build() { $_dynamic_linker \ --with-dynamic-linker-prefix=/lib \ --with-system-zlib \ - --without-system-libunwind + --without-system-libunwind \ + || return 1 make || return 1 } @@ -288,6 +288,7 @@ libgomp() { java() { pkgdesc="Java support for GCC" + depends="zlib-dev" paxctl -c -pm "$pkgdir"/usr/libexec/gcc/*/*/ecj1 || return 1 mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib cd "$pkgdir"/usr/bin @@ -297,8 +298,12 @@ java() { mkdir -p "$subpkgdir"/${i%/*} mv "$pkgdir"/$i "$subpkgdir"/$i || return 1 done + for i in "$pkgdir"/usr/lib/libgcj*.so; do + if [ -L "$i" ]; then + mv "$i" "$subpkgdir"/usr/lib/ + fi + done mv \ - "$pkgdir"/usr/lib/libgcj*.so \ "$pkgdir"/usr/lib/libgij.so \ "$pkgdir"/usr/lib/libgcj.spec \ "$subpkgdir"/usr/lib/ @@ -306,9 +311,11 @@ java() { libgcj() { pkgdesc="Java runtime library for gcc" + # libgcj_bc.so moved from gcc-java to libgcj + replaces="gcc-java" mkdir -p "$subpkgdir"/usr/bin cd "$pkgdir"/usr/bin - paxctl -c -pmE "$pkgdir"/usr/bin/gij || return 1 + paxctl -c -pmsE "$pkgdir"/usr/bin/gij || return 1 mv aot-compile gappletviewer gc-analyze gij gjar gjarsigner gkeytool\ gnative2ascii gorbd grmic grmid grmiregistry gserialver \ gtnameserv i486-alpine-linux-uclibc-gcj jv-convert \ @@ -321,11 +328,13 @@ libgcj() { done mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/gcj-* \ + "$pkgdir"/usr/lib/libgcj_bc.so \ "$pkgdir"/usr/lib/libgcj*.so.* \ "$pkgdir"/usr/lib/libgij.so.* \ "$pkgdir"/usr/lib/logging.properties \ "$pkgdir"/usr/lib/security \ - "$subpkgdir"/usr/lib/ + "$subpkgdir"/usr/lib/ \ + || return 1 mkdir -p "$subpkgdir"/usr/share/ mv "$pkgdir"/usr/share/java "$subpkgdir"/usr/share/ @@ -388,28 +397,24 @@ gfortran() { "$subpkgdir"/$gcclibs } -md5sums="766091220c6a14fcaa2c06dd573e3758 gcc-core-4.6.3.tar.bz2 -37515158a0fb3d0800ec41a08c05e69e gcc-g++-4.6.3.tar.bz2 -48ba23770c34b1cb468f72618b4452c5 gcc-objc-4.6.3.tar.bz2 -ea47e796f9e53118cd6e262fa220085c gcc-java-4.6.3.tar.bz2 -92166ef431c165054467a9524d0819c8 gcc-go-4.6.3.tar.bz2 -26a18d5727f7c8c18581ba924cce1e5f gcc-fortran-4.6.3.tar.bz2 -5dc7efd84b526801b94fed21462aea62 gcc-4.6.1-piepatches-v0.4.5.tar.bz2 +md5sums="933e6f15f51c031060af64a9e14149ff gcc-4.7.1.tar.bz2 +2e1d99664efcdbd86549a40ddf37d405 gcc-4.7.1-piepatches-v0.5.3.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 +1570f30f65f1c4941d2bd690a7148836 12_all_default-warn-trampolines.patch 6862cb5268fef68a4a1906e0c4ea0d46 15_all_libgomp-Werror.patch -1a8ce6b7a0b9a115e37fdda311704451 34_all_ia64_note.GNU-stack.patch +2a6a0be54c283c311a39bba359cc01f4 16_all_libgo-Werror-pr53679.patch +681499caf97fbdb4d5c97e312cddf47c 29_all_arm_armv4t-default.patch +4e35639c74fe4b6111f74a91bb3d52a8 49_all_gcc-4.7-x86-libitm-pr52695.patch d8692c56f04b92667096f59d843e95c5 51_all_libiberty-pic.patch -a90d4d1ee358b19f2068fe2e4fd5d001 74_all_gcc46_cloog-dl.patch +406fc6f29ab3d746eaef0202c50fd7e9 67_all_gcc-poison-system-directories.patch +f24f07ed008324eaecb0f75417c99116 74_all_gcc47_cloog-dl.patch a695d7648509b4f8e18b389a19e6037c gcc-spec-env.patch -2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch +ab83248e10b2bf4b3d9240de0fefb52b pt_gnu_eh_frame.patch 6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch -3be85df859fa1d5c875bbfcc2dee8288 gcc-4.6-dynamic-linker.patch +3d8131bdfa70e51be4ae186114097173 gcc-4.7-dynamic-linker.patch 32e8e4c0e23ed8f5de95a591cb30f1da gcc-4.6-pr32219.patch 2c6cb49bb9bfd8b6e690222e66ccc901 boehem-gc-uclibc.patch -d1d3ad2b0c185b5548125a1b81bee154 gcc-pure64.patch -c94014ece84407a36d239417a2bad25d gcc-go.patch -978e3fac97ad99902a86bafc6f283727 gcc-libgcc-x86.get_pc_thunk.bx.patch" +94c36cc724f5c5d6c8cb8650195ee83d gcc-pure64.patch +c94014ece84407a36d239417a2bad25d gcc-go.patch" diff --git a/main/gcc/gcc-4.6-dynamic-linker.patch b/main/gcc/gcc-4.6-dynamic-linker.patch deleted file mode 100644 index a6b235cd1..000000000 --- a/main/gcc/gcc-4.6-dynamic-linker.patch +++ /dev/null @@ -1,459 +0,0 @@ -commit d929f627aba264e63cf779cd4ca51af97b076445 -Author: Natanael Copa -Date: Tue Sep 28 09:45:17 2010 +0000 - - Submitted By: Kevin Day - 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/main/gcc/gcc-4.7-dynamic-linker.patch b/main/gcc/gcc-4.7-dynamic-linker.patch new file mode 100644 index 000000000..3dbc4d7e9 --- /dev/null +++ b/main/gcc/gcc-4.7-dynamic-linker.patch @@ -0,0 +1,432 @@ +diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h +index f578ecb..ff4d2ce 100644 +--- a/gcc/config/alpha/linux-elf.h ++++ b/gcc/config/alpha/linux-elf.h +@@ -24,8 +24,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 "}" + #elif DEFAULT_LIBC == LIBC_GLIBC +diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h +index 80bd825..64b4595 100644 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -62,7 +62,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 270e12b..dd613ef 100644 +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -59,7 +59,7 @@ + + #define LIBGCC_SPEC "%{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*} \ + %{static:-Bstatic} \ +diff --git a/gcc/config/bfin/linux.h b/gcc/config/bfin/linux.h +index f91cf17..263351a 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" + + #undef TARGET_SUPPORTS_SYNC_CALLS +diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h +index df10721..35f6d77 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 + + #undef CRIS_LINK_SUBTARGET_SPEC + #define CRIS_LINK_SUBTARGET_SPEC \ +diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h +index 770a3d1..bd02fd6 100644 +--- a/gcc/config/freebsd-spec.h ++++ b/gcc/config/freebsd-spec.h +@@ -129,9 +129,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 + + /* NOTE: The freebsd-spec.h header is included also for various +diff --git a/gcc/config/frv/linux.h b/gcc/config/frv/linux.h +index 9847712..089afdf 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 73681fe..8c51d30 100644 +--- a/gcc/config/i386/linux.h ++++ b/gcc/config/i386/linux.h +@@ -21,4 +21,4 @@ along with GCC; see the file COPYING3. If not see + . */ + + #define GNU_USER_LINK_EMULATION "elf_i386" +-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER +diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h +index 5b0a212..185c911 100644 +--- a/gcc/config/i386/linux64.h ++++ b/gcc/config/i386/linux64.h +@@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + #define GNU_USER_LINK_EMULATION64 "elf_x86_64" + #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64" + +-#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 + #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++ +diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h +index 00b0ddb..de6bb1e 100644 +--- a/gcc/config/ia64/linux.h ++++ b/gcc/config/ia64/linux.h +@@ -56,7 +56,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 30fa99a..5059b85 100644 +--- a/gcc/config/knetbsd-gnu.h ++++ b/gcc/config/knetbsd-gnu.h +@@ -33,4 +33,5 @@ along with GCC; see the file COPYING3. If not see + + + #undef GNU_USER_DYNAMIC_LINKER +-#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++ +diff --git a/gcc/config/linux.h b/gcc/config/linux.h +index dbbeea5..0147ece 100644 +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -74,10 +74,10 @@ 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_LINKERX32 "/lib/ldx32-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 UCLIBC_DYNAMIC_LINKERX32 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" +@@ -104,3 +104,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + /* Whether we have sincos that follows the GNU extension. */ + #undef TARGET_HAS_SINCOS + #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 bc7802b..6ff030f 100644 +--- a/gcc/config/m32r/linux.h ++++ b/gcc/config/m32r/linux.h +@@ -38,7 +38,7 @@ + When the -shared link option is used a final link is not being + done. */ + +-#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 325faf7..01bb765 100644 +--- a/gcc/config/m68k/linux.h ++++ b/gcc/config/m68k/linux.h +@@ -72,7 +72,7 @@ along with GCC; see the file COPYING3. If not see + When the -shared link option is used a final link is not being + done. */ + +-#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 bce9c17..46a2b0f 100644 +--- a/gcc/config/mips/linux.h ++++ b/gcc/config/mips/linux.h +@@ -18,4 +18,5 @@ You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER ++ +diff --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h +index 6e92719..736aa6d 100644 +--- a/gcc/config/mips/linux64.h ++++ b/gcc/config/mips/linux64.h +@@ -23,11 +23,11 @@ along with GCC; see the file COPYING3. If not see + #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip" + #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32" + +-#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 GNU_USER_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 d63b95a..93c54b1 100644 +--- a/gcc/config/mn10300/linux.h ++++ b/gcc/config/mn10300/linux.h +@@ -33,7 +33,7 @@ + #undef ASM_SPEC + #define ASM_SPEC "" + +-#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 7c516eb..687264e 100644 +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -358,10 +358,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 e5385ec..72df4ac 100644 +--- a/gcc/config/s390/linux.h ++++ b/gcc/config/s390/linux.h +@@ -61,8 +61,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 a5c2734..9eff3c4 100644 +--- a/gcc/config/sh/linux.h ++++ b/gcc/config/sh/linux.h +@@ -45,7 +45,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 60dc869..9930e21 100644 +--- a/gcc/config/sparc/linux.h ++++ b/gcc/config/sparc/linux.h +@@ -84,7 +84,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); + When the -shared link option is used a final link is not being + done. */ + +-#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 14966b9..c134401 100644 +--- a/gcc/config/sparc/linux64.h ++++ b/gcc/config/sparc/linux64.h +@@ -93,8 +93,8 @@ along with GCC; see the file COPYING3. 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.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 f5caeb7..c9274e4 100644 +--- a/gcc/config/xtensa/linux.h ++++ b/gcc/config/xtensa/linux.h +@@ -45,7 +45,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 3e9152a..4e1fdd3 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -755,6 +755,9 @@ AWK + SET_MAKE + REPORT_BUGS_TEXI + REPORT_BUGS_TO ++DYNAMICLINKER ++DYNAMICLINKERPREFIX ++NOSTDINC + PKGVERSION + CONFIGURE_SPECS + CROSS_SYSTEM_HEADER_DIR +@@ -1669,6 +1672,18 @@ 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-linker-hash-style={sysv,gnu,both} + specify the linker hash style + +@@ -6378,6 +6393,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 +--- ./gcc/Makefile.in.orig ++++ ./gcc/Makefile.in +@@ -986,7 +986,7 @@ + # 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 = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) \ +@@ -2090,6 +2090,8 @@ + -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/main/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch b/main/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch deleted file mode 100644 index 551e6150a..000000000 --- a/main/gcc/gcc-libgcc-x86.get_pc_thunk.bx.patch +++ /dev/null @@ -1,38 +0,0 @@ -Index: libgcc/config/i386/morestack.S -=================================================================== ---- ./libgcc/config/i386/morestack.S (revision 173993) -+++ ./libgcc/config/i386/morestack.S (revision 173994) -@@ -278,8 +278,7 @@ - movl 4(%esp),%eax # Function argument. - movl %eax,(%esp) - #ifdef __PIC__ --#undef __i686 -- call __i686.get_pc_thunk.bx # %ebx may not be set up for us. -+ call __x86.get_pc_thunk.bx # %ebx may not be set up for us. - addl $_GLOBAL_OFFSET_TABLE_, %ebx - call _Unwind_Resume@PLT # Resume unwinding. - #else -@@ -449,6 +448,23 @@ - .size __morestack, . - __morestack - #endif - -+#if !defined(__x86_64__) && defined(__PIC__) -+# Output the thunk to get PC into bx, since we use it above. -+ .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat -+ .globl __x86.get_pc_thunk.bx -+ .hidden __x86.get_pc_thunk.bx -+#ifdef __ELF__ -+ .type __x86.get_pc_thunk.bx, @function -+#endif -+__x86.get_pc_thunk.bx: -+ .cfi_startproc -+ movl (%esp), %ebx -+ ret -+ .cfi_endproc -+#ifdef __ELF__ -+ .size __x86.get_pc_thunk.bx, . - __x86.get_pc_thunk.bx -+#endif -+#endif - - # The exception table. This tells the personality routine to execute - # the exception handler. diff --git a/main/gcc/gcc-pure64.patch b/main/gcc/gcc-pure64.patch index f9ab69326..392aa5695 100644 --- a/main/gcc/gcc-pure64.patch +++ b/main/gcc/gcc-pure64.patch @@ -1,12 +1,14 @@ -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 - +diff -Naur gcc-orig/gcc/config/i386/t-linux64 gcc/gcc/config/i386/t-linux64 +--- gcc-orig/gcc/config/i386/t-linux64 2011-07-08 01:38:34.000000000 +1000 ++++ gcc/gcc/config/i386/t-linux64 2011-07-24 19:49:41.000000000 +1000 +@@ -34,8 +34,8 @@ + comma=, + MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) + MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +-MULTILIB_OSDIRNAMES = m64=../lib64 +-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) ++MULTILIB_OSDIRNAMES = m64=../lib ++MULTILIB_OSDIRNAMES+= m32=../lib32 + MULTILIB_OSDIRNAMES+= mx32=../libx32 + LIBGCC = stmp-multilib - INSTALL_LIBGCC = install-multilib diff --git a/main/gcc/pt_gnu_eh_frame.patch b/main/gcc/pt_gnu_eh_frame.patch index 3e029104a..f093eac43 100644 --- a/main/gcc/pt_gnu_eh_frame.patch +++ b/main/gcc/pt_gnu_eh_frame.patch @@ -1,5 +1,5 @@ ---- 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 +--- ./libgcc/crtstuff.c.orig Mon Nov 17 16:02:38 2008 ++++ ./libgcc/crtstuff.c Mon Nov 17 16:02:52 2008 @@ -94,8 +94,7 @@ #include /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. -- cgit v1.2.3