This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 3.x development tree".
The branch, master has been updated via c5f8a495f862716d91bc24325b7837f869ddd85c (commit) via 3c9265095f18e3d911178e6e178841859f5d7a1d (commit) from c5753b73b8e2467ca41a3683c1668256212ee456 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit c5f8a495f862716d91bc24325b7837f869ddd85c Merge: 3c92650 c5753b7 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Apr 8 21:05:45 2011 +0200
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x
commit 3c9265095f18e3d911178e6e178841859f5d7a1d Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Apr 8 21:00:51 2011 +0200
gcc: Update to 4.6.0.
Closes #157.
-----------------------------------------------------------------------
Summary of changes: pkgs/gcc/gcc.nm | 32 +- pkgs/gcc/patches/gcc-4.4-optimize_linking.patch | 24 - pkgs/gcc/patches/gcc-4.4.1-asprintf_fix.patch | 16 - .../patches/gcc-4.5.0-piepatches-20100421.patch | 1056 -------------------- .../patches/gcc-4.6.0-piepatches-20110407.patch | 791 +++++++++++++++ .../patches/gcc46-Woverlength-string-asm.patch0 | 180 ++++ pkgs/gcc/patches/gcc46-Woverlength-string.patch0 | 103 ++ pkgs/gcc/patches/gcc46-c++-builtin-redecl.patch0 | 102 ++ pkgs/gcc/patches/gcc46-cloog-dl.patch0 | 445 ++++++++ pkgs/gcc/patches/gcc46-hack.patch0 | 114 +++ .../patches/gcc46-libgomp-omp_h-multilib.patch0 | 17 + ...o-rpath.patch => gcc46-libtool-no-rpath.patch0} | 4 +- ...add-needed.patch => gcc46-no-add-needed.patch0} | 32 +- pkgs/gcc/patches/gcc46-ppl-0.10.patch | 115 +++ .../{gcc45-pr33763.patch => gcc46-pr33763.patch0} | 12 +- .../{gcc45-pr38757.patch => gcc46-pr38757.patch0} | 67 +- pkgs/gcc/patches/gcc46-unwind-debughook-sdt.patch0 | 88 ++ 17 files changed, 2028 insertions(+), 1170 deletions(-) delete mode 100644 pkgs/gcc/patches/gcc-4.4-optimize_linking.patch delete mode 100644 pkgs/gcc/patches/gcc-4.4.1-asprintf_fix.patch delete mode 100644 pkgs/gcc/patches/gcc-4.5.0-piepatches-20100421.patch create mode 100644 pkgs/gcc/patches/gcc-4.6.0-piepatches-20110407.patch create mode 100644 pkgs/gcc/patches/gcc46-Woverlength-string-asm.patch0 create mode 100644 pkgs/gcc/patches/gcc46-Woverlength-string.patch0 create mode 100644 pkgs/gcc/patches/gcc46-c++-builtin-redecl.patch0 create mode 100644 pkgs/gcc/patches/gcc46-cloog-dl.patch0 create mode 100644 pkgs/gcc/patches/gcc46-hack.patch0 create mode 100644 pkgs/gcc/patches/gcc46-libgomp-omp_h-multilib.patch0 rename pkgs/gcc/patches/{gcc45-libtool-no-rpath.patch => gcc46-libtool-no-rpath.patch0} (91%) rename pkgs/gcc/patches/{gcc-4.5.0-no-add-needed.patch => gcc46-no-add-needed.patch0} (58%) create mode 100644 pkgs/gcc/patches/gcc46-ppl-0.10.patch rename pkgs/gcc/patches/{gcc45-pr33763.patch => gcc46-pr33763.patch0} (87%) rename pkgs/gcc/patches/{gcc45-pr38757.patch => gcc46-pr38757.patch0} (55%) create mode 100644 pkgs/gcc/patches/gcc46-unwind-debughook-sdt.patch0
Difference in files: diff --git a/pkgs/gcc/gcc.nm b/pkgs/gcc/gcc.nm index 328b687..e30eff4 100644 --- a/pkgs/gcc/gcc.nm +++ b/pkgs/gcc/gcc.nm @@ -25,8 +25,8 @@ include $(PKGROOT)/Include
PKG_NAME = gcc -PKG_VER = 4.5.2 -PKG_REL = 7 +PKG_VER = 4.6.0 +PKG_REL = 1
PKG_MAINTAINER = Michael Tremer michael.tremer@ipfire.org PKG_GROUPS = Development/Compilers @@ -40,8 +40,8 @@ define PKG_DESCRIPTION endef
PKG_BUILD_DEPS+= autogen cloog-devel dejagnu elfutils-devel expect gmp-devel \ - libffi-devel mpc-devel mpfr-devel pkg-config ppl-devel texinfo zlib-devel -PKG_DEPS-gcc += binutils libgcc-devel + libffi-devel mpc-devel mpfr-devel ppl-devel=0.10.2-0.ip3 texinfo zlib-devel +PKG_DEPS-gcc += binutils libgcc-devel cloog>=0.15
# Make the GCC target platform GCC_TARGET_PLATFORM = $(subst -gnu,,$(DISTRO_MACHINE)) @@ -66,6 +66,21 @@ export CXXFLAGS = $(subst -Wall,,$(CFLAGS))
PKG_TARBALL += $(THISAPP).tar.gz
+PKG_PATCHES = \ + gcc46-hack.patch0 \ + gcc46-c++-builtin-redecl.patch0 \ + gcc46-pr33763.patch0 \ + gcc46-libgomp-omp_h-multilib.patch0 \ + gcc46-libtool-no-rpath.patch0 \ + gcc46-cloog-dl.patch0 \ + gcc46-pr38757.patch0 \ + gcc46-no-add-needed.patch0 \ + gcc46-unwind-debughook-sdt.patch0 \ + gcc46-ppl-0.10.patch \ + gcc46-Woverlength-string.patch0 \ + gcc46-Woverlength-string-asm.patch0 \ + gcc-4.6.0-piepatches-20110407.patch + # A package for C++ PKG_PACKAGES += $(PKG_NAME)-c++ PKG_DEPS-$(PKG_NAME)-c++ = gcc libstdc++-devel @@ -133,17 +148,12 @@ define STAGE_PREPARE_CMDS cd $(DIR_APP) && sed -i 's/install_to_$$(INSTALL_DEST) //' libiberty/Makefile.in
# Branding gcc - cd $(DIR_APP) && sed -e "s:PKGVERSION:"(GCC for $(DISTRO_NAME)-$(DISTRO_VERSION)) ":" \ - -i gcc/version.c + echo "$(DISTRO_NAME) $(PKG_VER)-$(PKG_RELEASE)" > $(DIR_APP)/gcc/DEV-PHASE
# Libgomp uses -Werror regardless of --disable-werror, and this will cause a # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings: cd $(DIR_APP) && sed -e "s/-Werror//" -i libgomp/configure - # Apply the following sed to force the build to use the -fomit-frame-pointer - # compiler flag in order to ensure consistent compiler builds: - cd $(DIR_APP) && sed -i 's/^T_CFLAGS =$$/& -fomit-frame-pointer/' gcc/Makefile.in - # The fixincludes script is known to occasionally erroneously attempt to # "fix" the system headers installed so far. As the headers up to this point # are known to not require fixing, issue the following command to prevent @@ -178,6 +188,8 @@ define STAGE_BUILD --disable-static \ --with-system-zlib \ --with-bugurl=http://bugtracker.ipfire.org \ + --with-ppl \ + --with-cloog \ --disable-libunwind-exceptions \ --enable-gnu-unique-object \ --enable-linker-build-id \ diff --git a/pkgs/gcc/patches/gcc-4.4-optimize_linking.patch b/pkgs/gcc/patches/gcc-4.4-optimize_linking.patch deleted file mode 100644 index 659586d..0000000 --- a/pkgs/gcc/patches/gcc-4.4-optimize_linking.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Naur gcc-4.4-20100216.orig/gcc/config/i386/linux.h gcc-4.4-20100216/gcc/config/i386/linux.h ---- gcc-4.4-20100216.orig/gcc/config/i386/linux.h 2010-02-26 17:44:46.000000000 +0000 -+++ gcc-4.4-20100216/gcc/config/i386/linux.h 2010-02-26 17:46:55.000000000 +0000 -@@ -113,7 +113,7 @@ - { "dynamic_linker", LINUX_DYNAMIC_LINKER } - - #undef LINK_SPEC --#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \ -+#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} --hash-style=gnu -O1 \ - %{!shared: \ - %{!ibcs: \ - %{!static: \ -diff -Naur gcc-4.4-20100216.orig/gcc/config/i386/linux64.h gcc-4.4-20100216/gcc/config/i386/linux64.h ---- gcc-4.4-20100216.orig/gcc/config/i386/linux64.h 2010-02-26 17:44:46.000000000 +0000 -+++ gcc-4.4-20100216/gcc/config/i386/linux64.h 2010-02-26 17:47:47.000000000 +0000 -@@ -75,7 +75,7 @@ - #endif - - #undef LINK_SPEC --#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \ -+#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} --hash-style=gnu -O1 \ - %{shared:-shared} \ - %{!shared: \ - %{!static: \ diff --git a/pkgs/gcc/patches/gcc-4.4.1-asprintf_fix.patch b/pkgs/gcc/patches/gcc-4.4.1-asprintf_fix.patch deleted file mode 100644 index 7704430..0000000 --- a/pkgs/gcc/patches/gcc-4.4.1-asprintf_fix.patch +++ /dev/null @@ -1,16 +0,0 @@ -https://hardened.gentooexperimental.org/trac/secure/raw-attachment/ticket/33... - ---- gcc-4.0/include/libiberty.h.orig 2007-02-09 15:29:21.000000000 +0000 -+++ gcc-4.0/include/libiberty.h 2008-07-25 21:17:25.000000000 +0000 -@@ -554,8 +554,11 @@ - /* Like sprintf but provides a pointer to malloc'd storage, which must - be freed by the caller. */ - -+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */ -+#ifndef asprintf - extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2; - #endif -+#endif - - #if !HAVE_DECL_VASPRINTF - /* Like vsprintf but provides a pointer to malloc'd storage, which diff --git a/pkgs/gcc/patches/gcc-4.5.0-no-add-needed.patch b/pkgs/gcc/patches/gcc-4.5.0-no-add-needed.patch deleted file mode 100644 index 792bcb8..0000000 --- a/pkgs/gcc/patches/gcc-4.5.0-no-add-needed.patch +++ /dev/null @@ -1,52 +0,0 @@ -2010-02-08 Roland McGrath roland@redhat.com - - * config/rs6000/sysv4.h (LINK_EH_SPEC): Pass --no-add-needed to the - linker. - * config/linux.h (LINK_EH_SPEC): Likewise. - * config/alpha/elf.h (LINK_EH_SPEC): Likewise. - * config/ia64/linux.h (LINK_EH_SPEC): Likewise. - ---- a/gcc/config/alpha/elf.h.~1~ -+++ b/gcc/config/alpha/elf.h -@@ -421,7 +421,7 @@ extern int alpha_this_gpdisp_sequence_nu - I imagine that other systems will catch up. In the meantime, it - doesn't harm to make sure that the data exists to be used later. */ - #if defined(HAVE_LD_EH_FRAME_HDR) --#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " -+#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " - #endif - - /* A C statement (sans semicolon) to output to the stdio stream STREAM ---- a/gcc/config/ia64/linux.h.~1~ -+++ b/gcc/config/ia64/linux.h -@@ -58,7 +58,7 @@ do { \ - Signalize that because we have fde-glibc, we don't need all C shared libs - linked against -lgcc_s. */ - #undef LINK_EH_SPEC --#define LINK_EH_SPEC "" -+#define LINK_EH_SPEC "--no-add-needed " - - #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h" - ---- a/gcc/config/linux.h.~1~ -+++ b/gcc/config/linux.h -@@ -89,7 +89,7 @@ see the files COPYING3 and COPYING.RUNTI - } while (0) - - #if defined(HAVE_LD_EH_FRAME_HDR) --#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " -+#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " - #endif - - /* Define this so we can compile MS code for use with WINE. */ ---- a/gcc/config/rs6000/sysv4.h.~1~ -+++ b/gcc/config/rs6000/sysv4.h -@@ -917,7 +917,7 @@ SVR4_ASM_SPEC \ - %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}" - - #if defined(HAVE_LD_EH_FRAME_HDR) --# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " -+# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " - #endif - - #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ diff --git a/pkgs/gcc/patches/gcc-4.5.0-piepatches-20100421.patch b/pkgs/gcc/patches/gcc-4.5.0-piepatches-20100421.patch deleted file mode 100644 index e525d5b..0000000 --- a/pkgs/gcc/patches/gcc-4.5.0-piepatches-20100421.patch +++ /dev/null @@ -1,1056 +0,0 @@ -diff -Nur gcc-4.5.0-vanilla/configure gcc-4.5.0/configure ---- gcc-4.5.0-vanilla/configure 2010-04-02 19:35:47.000000000 +0200 -+++ gcc-4.5.0/configure 2010-04-21 15:21:09.762948361 +0200 -@@ -707,6 +707,7 @@ - CFLAGS - CC - target_subdir -+enable_esp - host_subdir - build_subdir - build_libsubdir -@@ -1485,6 +1486,11 @@ - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-gold use gold instead of ld - --enable-libada build libada directory -+ --enable-esp -+ Enable Stack protector, Position independent executable and -+ Fortify_sources as default if we have suppot for it when compiling -+ and link with -z relro and -z now as default. -+ Linux targets supported i*86, x86_64, powerpc*, ia64, arm* and mips - --enable-libssp build libssp directory - --enable-build-with-cxx build with C++ compiler instead of C compiler - --disable-ppl-version-check disable check for PPL version -@@ -3164,6 +3170,24 @@ - noconfigdirs="$noconfigdirs gnattools" - fi - -+# Check whether --enable-esp was given and target have the support. -+# Check whether --enable-esp or --disable-esp was given. -+if test "${enable_esp+set}" = set; then -+ enableval="$enable_esp" -+ -+ case $target in -+ i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux* | mips-*-linux*) -+ enable_esp=yes -+ ;; -+ *) -+ { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported on this $target target." >&5 -+echo "$as_me: error: *** --enable-esp is not supported on this $target target." >&2;} -+ { (exit 1); exit 1; }; } -+ ;; -+ esac -+ -+fi; -+ - # Check whether --enable-libssp was given. - if test "${enable_libssp+set}" = set; then : - enableval=$enable_libssp; ENABLE_LIBSSP=$enableval -@@ -14290,6 +14314,9 @@ - *) stage1_cflags="-g -J" ;; - esac ;; - esac -+if test x$enable_esp = xyes; then -+ stage1_cflags="$stage1_cflags -fno-stack-protector" -+fi - - # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. - if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then -diff -Nur gcc-4.5.0-vanilla/gcc/config/i386/linux64.h gcc-4.5.0/gcc/config/i386/linux64.h ---- gcc-4.5.0-vanilla/gcc/config/i386/linux64.h 2010-03-24 21:44:48.000000000 +0100 -+++ gcc-4.5.0/gcc/config/i386/linux64.h 2010-04-21 15:21:16.730815972 +0200 -@@ -115,7 +115,7 @@ - /* This macro may be overridden in i386/k*bsd-gnu.h. */ - #define REG_NAME(reg) reg - --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ - /* i386 glibc provides __stack_chk_guard in %gs:0x14, - x86_64 glibc provides it in %fs:0x28. */ - #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14) -diff -Nur gcc-4.5.0-vanilla/gcc/config/i386/linux.h gcc-4.5.0/gcc/config/i386/linux.h ---- gcc-4.5.0-vanilla/gcc/config/i386/linux.h 2010-03-24 21:44:48.000000000 +0100 -+++ gcc-4.5.0/gcc/config/i386/linux.h 2010-04-21 15:21:16.721813554 +0200 -@@ -212,7 +212,7 @@ - /* This macro may be overridden in i386/k*bsd-gnu.h. */ - #define REG_NAME(reg) reg - --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ - /* i386 glibc provides __stack_chk_guard in %gs:0x14. */ - #define TARGET_THREAD_SSP_OFFSET 0x14 - #endif -diff -Nur gcc-4.5.0-vanilla/gcc/config/linux.h gcc-4.5.0/gcc/config/linux.h ---- gcc-4.5.0-vanilla/gcc/config/linux.h 2009-04-09 17:00:19.000000000 +0200 -+++ gcc-4.5.0/gcc/config/linux.h 2010-04-21 15:21:16.667815357 +0200 -@@ -43,7 +43,11 @@ - object constructed before entering `main'. */ - - #undef STARTFILE_SPEC --#if defined HAVE_LD_PIE -+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS) -+#define STARTFILE_SPEC \ -+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s \ -+ %{static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}" -+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS) - #define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" -diff -Nur gcc-4.5.0-vanilla/gcc/config/rs6000/linux64.h gcc-4.5.0/gcc/config/rs6000/linux64.h ---- gcc-4.5.0-vanilla/gcc/config/rs6000/linux64.h 2010-03-17 05:44:37.000000000 +0100 -+++ gcc-4.5.0/gcc/config/rs6000/linux64.h 2010-04-21 15:21:16.732816308 +0200 -@@ -162,7 +162,7 @@ - #endif - - #define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \ --%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ -+%{mrelocatable} %{mrelocatable-lib} %{fpic|fPIC|fpie|fPIE:-K PIC} \ - %{memb} %{!memb: %{msdata=eabi: -memb}} \ - %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ - %{mcall-freebsd: -mbig} \ -@@ -525,7 +525,7 @@ - - #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h" - --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ - /* ppc32 glibc provides __stack_chk_guard in -0x7008(2), - ppc64 glibc provides it at -0x7010(13). */ - #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? -0x7010 : -0x7008) -diff -Nur gcc-4.5.0-vanilla/gcc/config/rs6000/linux.h gcc-4.5.0/gcc/config/rs6000/linux.h ---- gcc-4.5.0-vanilla/gcc/config/rs6000/linux.h 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.5.0/gcc/config/rs6000/linux.h 2010-04-21 15:21:16.731819651 +0200 -@@ -117,7 +117,7 @@ - - #define MD_UNWIND_SUPPORT "config/rs6000/linux-unwind.h" - --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ - /* ppc32 glibc provides __stack_chk_guard in -0x7008(2). */ - #define TARGET_THREAD_SSP_OFFSET -0x7008 - #endif -diff -Nur gcc-4.5.0-vanilla/gcc/config/rs6000/sysv4.h gcc-4.5.0/gcc/config/rs6000/sysv4.h ---- gcc-4.5.0-vanilla/gcc/config/rs6000/sysv4.h 2009-11-25 21:23:20.000000000 +0100 -+++ gcc-4.5.0/gcc/config/rs6000/sysv4.h 2010-04-21 15:21:16.674812959 +0200 -@@ -883,7 +883,12 @@ - %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \ - %{!shared: %{profile:-lc_p} %{!profile:-lc}}}" - --#ifdef HAVE_LD_PIE -+#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS) -+#define STARTFILE_LINUX_SPEC \ -+ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ -+ %{mnewlib:ecrti.o%s;:crti.o%s} \ -+ {static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}" -+#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS) - #define STARTFILE_LINUX_SPEC "\ - %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ - %{mnewlib:ecrti.o%s;:crti.o%s} \ -diff -Nur gcc-4.5.0-vanilla/gcc/config/s390/linux.h gcc-4.5.0/gcc/config/s390/linux.h ---- gcc-4.5.0-vanilla/gcc/config/s390/linux.h 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.5.0/gcc/config/s390/linux.h 2010-04-21 15:21:16.738814124 +0200 -@@ -93,7 +93,7 @@ - - #define MD_UNWIND_SUPPORT "config/s390/linux-unwind.h" - --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ - /* s390 glibc provides __stack_chk_guard in 0x14(tp), - s390x glibc provides it at 0x28(tp). */ - #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14) -diff -Nur gcc-4.5.0-vanilla/gcc/config/sparc/linux64.h gcc-4.5.0/gcc/config/sparc/linux64.h ---- gcc-4.5.0-vanilla/gcc/config/sparc/linux64.h 2009-12-08 00:31:01.000000000 +0100 -+++ gcc-4.5.0/gcc/config/sparc/linux64.h 2010-04-21 15:21:16.749816158 +0200 -@@ -298,7 +298,7 @@ - #undef NEED_INDICATE_EXEC_STACK - #define NEED_INDICATE_EXEC_STACK 1 - --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ - /* sparc glibc provides __stack_chk_guard in [%g7 + 0x14], - sparc64 glibc provides it at [%g7 + 0x28]. */ - #define TARGET_THREAD_SSP_OFFSET (TARGET_ARCH64 ? 0x28 : 0x14) -diff -Nur gcc-4.5.0-vanilla/gcc/config/sparc/linux.h gcc-4.5.0/gcc/config/sparc/linux.h ---- gcc-4.5.0-vanilla/gcc/config/sparc/linux.h 2009-12-08 00:31:01.000000000 +0100 -+++ gcc-4.5.0/gcc/config/sparc/linux.h 2010-04-21 15:21:16.746815839 +0200 -@@ -172,7 +172,7 @@ - #undef NEED_INDICATE_EXEC_STACK - #define NEED_INDICATE_EXEC_STACK 1 - --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if defined TARGET_LIBC_PROVIDES_SSP && !defined __UCLIBC__ - /* sparc glibc provides __stack_chk_guard in [%g7 + 0x14]. */ - #define TARGET_THREAD_SSP_OFFSET 0x14 - #endif -diff -Nur gcc-4.5.0-vanilla/gcc/config.in gcc-4.5.0/gcc/config.in ---- gcc-4.5.0-vanilla/gcc/config.in 2010-04-14 11:30:07.000000000 +0200 -+++ gcc-4.5.0/gcc/config.in 2010-04-21 15:21:09.879812904 +0200 -@@ -52,6 +52,12 @@ - #endif - - -+/* Define to 1 to enable crtbeginTS.o. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_CRTBEGINTS -+#endif -+ -+ - /* Define to 1 to specify that we are using the BID decimal floating point - format instead of DPD */ - #ifndef USED_FOR_TARGET -@@ -71,6 +77,12 @@ - #endif - - -+/* Define to 1 to enable esp. */ -+#ifndef USED_FOR_TARGET -+#undef ENABLE_ESP -+#endif -+ -+ - /* Define to 1 to enable fixed-point arithmetic extension to C. */ - #ifndef USED_FOR_TARGET - #undef ENABLE_FIXED_POINT -@@ -996,6 +1008,12 @@ - #endif - - -+/* Define to 1 if your compiler supports -fstack-protector */ -+#ifndef USED_FOR_TARGET -+#undef HAVE_GCC_SSP -+#endif -+ -+ - /* Define to 1 if you have the `getchar_unlocked' function. */ - #ifndef USED_FOR_TARGET - #undef HAVE_GETCHAR_UNLOCKED -diff -Nur gcc-4.5.0-vanilla/gcc/configure gcc-4.5.0/gcc/configure ---- gcc-4.5.0-vanilla/gcc/configure 2010-03-26 06:40:32.000000000 +0100 -+++ gcc-4.5.0/gcc/configure 2010-04-21 15:21:09.784072083 +0200 -@@ -678,6 +678,8 @@ - HOST_LIBS - GGC - libgcc_visibility -+enable_esp -+enable_crtbeginTS - gcc_cv_readelf - gcc_cv_objdump - ORIGINAL_NM_FOR_TARGET -@@ -24576,6 +24578,50 @@ - ;; - esac - -+echo "$as_me:$LINENO: checking linker -z now support" >&5 -+echo $ECHO_N "checking linker -z now support... $ECHO_C" >&6 -+if test "${gcc_cv_ld_now+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gcc_cv_ld_now=no -+if test $in_tree_ld = yes ; then -+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ -+ && test $in_tree_ld_is_elf = yes; then -+ gcc_cv_ld_now=yes -+ fi -+elif test x$gcc_cv_ld != x; then -+ # Check if linker supports -z now options -+ if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then -+ gcc_cv_ld_now=yes -+ fi -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_ld_now" >&5 -+echo "${ECHO_T}$gcc_cv_ld_now" >&6 -+ -+echo "$as_me:$LINENO: checking linker -z relro support" >&5 -+echo $ECHO_N "checking linker -z relro support... $ECHO_C" >&6 -+if test "${gcc_cv_ld_relro+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ gcc_cv_ld_relro=no -+if test $in_tree_ld = yes ; then -+ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ -+ && test $in_tree_ld_is_elf = yes; then -+ gcc_cv_ld_relro=yes -+ fi -+elif test x$gcc_cv_ld != x; then -+ # Check if linker supports -z relro and -z norelro options -+ if $gcc_cv_ld --help 2>/dev/null | grep relro > /dev/null; then -+ gcc_cv_ld_relro=yes -+ fi -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_ld_relro" >&5 -+echo "${ECHO_T}$gcc_cv_ld_relro" >&6 -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --build-id support" >&5 - $as_echo_n "checking linker --build-id support... " >&6; } - if test "${gcc_cv_ld_buildid+set}" = set; then : -@@ -24729,6 +24775,146 @@ - - fi - -+if test x$gcc_cv_libc_provides_ssp = xyes; then -+ echo "$as_me:$LINENO: checking whether $CC support -fstack-protector" >&5 -+echo $ECHO_N "checking whether $CC support -fstack-protector... $ECHO_C" >&6 -+if test "${gcc_cv_cc_stack_protector+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ -+ saved_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -fstack-protector" -+ cat >conftest.$ac_ext <<_ACEOF -+#ifndef __SSP__ -+#error -+#endif -+ -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: "$ac_compile"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: "$ac_try"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: $? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ -+ case $target in -+ i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux*) -+ if test x$set_have_as_tls = xyes; then -+ gcc_cv_cc_stack_protector=yes -+ else -+ gcc_cv_cc_stack_protector=no -+ fi -+ ;; -+ *) -+ cc_cv_cc_stack_protector=yes -+ ;; -+ esac -+ -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gcc_cv_cc_stack_protector=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS="$saved_CFLAGS" -+ -+fi -+echo "$as_me:$LINENO: result: $gcc_cv_cc_stack_protector" >&5 -+echo "${ECHO_T}$gcc_cv_cc_stack_protector" >&6 -+fi -+if test x$gcc_cv_cc_stack_protector = xyes; then -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_GCC_SSP 1 -+_ACEOF -+ -+fi -+ -+ -+if test x$enable_esp = xyes ; then -+case $target in -+ ia64*-*-linux*) -+ if test x$gcc_cv_ld_now = xyes; then -+ enable_esp_ld=yes -+ else -+ enable_esp_ld=no -+ fi -+ ;; -+ *-*-linux*) -+ if test x$gcc_cv_ld_relro = xyes && test x$gcc_cv_ld_now = xyes; then -+ enable_esp_ld=yes -+ else -+ enable_esp_ld=no -+ fi -+ ;; -+ *) -+ enable_esp_ld=no -+ ;; -+ esac -+else -+ enable_esp_ld=no -+fi -+if test x$enable_esp_ld = xyes; then -+ -+cat >>confdefs.h <<_ACEOF -+#define ENABLE_ESP 1 -+_ACEOF -+ -+fi -+if test x$enable_esp = xyes && test x$enable_esp_ld = xno; then -+ { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&5 -+echo "$as_me: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ -+echo "$as_me:$LINENO: checking for crtbeginTS.o support" >&5 -+echo $ECHO_N "checking for crtbeginTS.o support... $ECHO_C" >&6 -+if test "${enable_crtbeginTS+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ -+if test x$enable_esp = xyes ; then -+ case "$target" in -+ ia64*-*-linux*) -+ enable_crtbeginTS=no ;; -+ *-*-linux*) -+ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then -+ enable_crtbeginTS=yes -+ fi -+ ;; -+ *) enable_crtbeginTS=no ;; -+ esac -+fi -+ -+fi -+echo "$as_me:$LINENO: result: $enable_crtbeginTS" >&5 -+echo "${ECHO_T}$enable_crtbeginTS" >&6 -+ -+if test x$enable_crtbeginTS = xyes; then -+ -+cat >>confdefs.h <<_ACEOF -+#define ENABLE_CRTBEGINTS 1 -+_ACEOF -+ -+fi -+ - # Check if TFmode long double should be used by default or not. - # Some glibc targets used DFmode long double, but with glibc 2.4 - # and later they can use TFmode. -diff -Nur gcc-4.5.0-vanilla/gcc/cp/lang-specs.h gcc-4.5.0/gcc/cp/lang-specs.h ---- gcc-4.5.0-vanilla/gcc/cp/lang-specs.h 2007-08-06 13:10:19.000000000 +0200 -+++ gcc-4.5.0/gcc/cp/lang-specs.h 2010-04-21 15:21:16.684816335 +0200 -@@ -47,7 +47,7 @@ - %(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\ - cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\ - %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2 %{+e1*}\ -+ %(cc1_options) %(esp_options) %2 %{+e1*}\ - %{!fsyntax-only:-o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {"@c++", -@@ -57,11 +57,11 @@ - %(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\ - cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\ - %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2 %{+e1*}\ -+ %(cc1_options) %(esp_options) %2 %{+e1*}\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".ii", "@c++-cpp-output", 0, 0, 0}, - {"@c++-cpp-output", - "%{!M:%{!MM:%{!E:\ -- cc1plus -fpreprocessed %i %(cc1_options) %2 %{+e*}\ -+ cc1plus -fpreprocessed %i %(cc1_options) %(esp_options) %2 %{+e*}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -diff -Nur gcc-4.5.0-vanilla/gcc/doc/invoke.texi gcc-4.5.0/gcc/doc/invoke.texi ---- gcc-4.5.0-vanilla/gcc/doc/invoke.texi 2010-04-06 16:02:22.000000000 +0200 -+++ gcc-4.5.0/gcc/doc/invoke.texi 2010-04-21 15:21:16.796812184 +0200 -@@ -7856,6 +7856,11 @@ - @opindex fstack-protector-all - Like @option{-fstack-protector} except that all functions are protected. - -+NOTE: When --enable-esp this option is enabled by default -+for C, C++, ObjC, ObjC++, if neither @option{-fno-stack-protector} -+or @option{-nostdlib} or @option{-nodefaultlibs} or -+@option{-fstack-protector} are found. -+ - @item -fsection-anchors - @opindex fsection-anchors - Try to reduce the number of symbolic address calculations by using -@@ -8705,6 +8710,12 @@ - that were used to generate code (@option{-fpie}, @option{-fPIE}, - or model suboptions) when you specify this option. - -+NOTE: When --enable-esp this option is enabled by default -+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE} -+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or -+@option{-nostartfiles} or @option{-shared} or @option{-pg} or @option{-p} -+are found. -+ - @item -rdynamic - @opindex rdynamic - Pass the flag @option{-export-dynamic} to the ELF linker, on targets -@@ -17251,6 +17262,11 @@ - @code{__pie__} and @code{__PIE__}. The macros have the value 1 - for @option{-fpie} and 2 for @option{-fPIE}. - -+NOTE: When --enable-esp this option is enabled by default -+for C, C++, ObjC, ObjC++, if neither @option{-fno-pie} or @option{-fno-PIE} -+or @option{-fno-pic} or @option{-fno-PIC} or @option{-nostdlib} or -+@option{-nostartfiles} or @option{-shared} are found. -+ - @item -fno-jump-tables - @opindex fno-jump-tables - Do not use jump tables for switch statements even where it would be -diff -Nur gcc-4.5.0-vanilla/gcc/esp.h gcc-4.5.0/gcc/esp.h ---- gcc-4.5.0-vanilla/gcc/esp.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.5.0/gcc/esp.h 2010-04-21 15:21:16.622811922 +0200 -@@ -0,0 +1,148 @@ -+/* License terms see GNU GENERAL PUBLIC LICENSE Version 3. -+ * Version 20100409.1 -+ * Magnus Granberg (Zorry) zorry@gentoo.org */ -+#ifndef GCC_ESP_H -+#define GCC_ESP_H -+ -+/* This file will add -fstack-protector, -fPIE, -pie -D_FORTIFY_SOURCES=2 -z,relro and -z,now -+ as default if the defines and the spec allow it. -+ -+ On Gentoo -+ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass -+ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened. -+ We use -fstack-protector-all instead of -fstack-protector -+ This will add some unsupported upstream commands options as -nopie. -+ -D__KERNEL__ is added so we don't have -fPIE and -fstack-protector-all when building kernels. -+ ESP_CC1_SPEC is added to CC1_SPEC. -+ -D_FORTIFY_SOURCES=2 is added with gentoo's patchset as default so no need to set it hear. -+ ESP_LINK_SPEC will not add -z,relro as it default on with binutils. -+ ESP_CC1_STRICT_SPEC is added so we don't use gcc/opts.c to disable it. -+ ESP_OPTIONS_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile, -static and -shared. -+ ENABLE_CRTBEGINTS add support for crtbeginTS.o, build -static with -fPIE or -fpie. -+*/ -+#ifdef ENABLE_ESP -+ -+ /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */ -+ #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict)" -+ #ifdef HAVE_GCC_SSP -+ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}" -+ #else -+ #define ESP_CC1_SSP_SPEC "" -+ #endif -+ #define ESP_CC1_PIE_SPEC "%{!nopie: }" -+ #define ESP_CC1_STRICT_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}" -+ -+ /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable -+ -z now will be added if we don't have -vanilla spec */ -+ #define ESP_LINK_SPEC "%(esp_link_now)" -+ #define ESP_LINK_NOW_SPEC "%{!now:-z now}" -+ -+ /* ESP_OPTIONS_SPEC is added to the compiler spec in gcc/gcc.c */ -+ #define ESP_OPTIONS_SPEC "%(esp_options_ssp)" -+ -+ /* ESP_CPP_OPTIONS_SPEC is added to the cpp_options spec in gcc/gcc.c -+ For precompiling headers. */ -+ #define ESP_CPP_OPTIONS_SPEC "%(esp_options_ssp)" -+ -+ /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector -+ -fstack-protector-all and we have TARGET_LIBC_PROVIDES_SSP and HAVE_GCC_SSP defined. */ -+ #ifdef HAVE_GCC_SSP -+ #define ESP_OPTIONS_SSP_SPEC \ -+ "%{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs: %{!fno-stack-protector: \ -+ %{!fstack-protector:%{!fstack-protector-all:-fstack-protector-all}}}}}}" -+ #else -+ #define ESP_OPTIONS_SSP_SPEC "" -+ #endif -+ -+ /* If HAVE_LD_PIE not defined we will not add any -fPIE -pie */ -+ #ifdef HAVE_LD_PIE -+ -+ /* We use ESP_COMMAND_OPTIONS_SPEC to add pie command-line options. */ -+ #define ESP_COMMAND_OPTIONS_SPEC "%{!D__KERNEL__:%{!nopie:%(esp_options_pie) %(esp_link_pie)}}" -+ -+ /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -+ -nostdlib -nostartfiles. */ -+ /* With ENABLE_CRTBEGINTS we don't need to check for -static */ -+ #ifdef ENABLE_CRTBEGINTS -+ #define ESP_OPTIONS_PIE_SPEC \ -+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \ -+ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }" -+ #else -+ #define ESP_OPTIONS_PIE_SPEC \ -+ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \ -+ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}" -+ #endif -+ -+ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib -+ -nostartfiles */ -+ /* With ENABLE_CRTBEGINTS we don't need to check for -static -+ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */ -+ #ifdef ENABLE_CRTBEGINTS -+ #define ESP_LINK_PIE_SPEC \ -+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \ -+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}" -+ #else -+ #define ESP_LINK_PIE_SPEC \ -+ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \ -+ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}" -+ #endif -+ -+ /* This will check if shared is set when -static -pie -fPIE -fpie -fno-PIC -fno-pic, -pie is set when -static -pg -p -profile. -+ If set it will make gcc print out "-shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible" or -+ "-pie and pg|p|profile are incompatible" */ -+ /* With ENABLE_CRTBEGINTS we don't need to check for -static */ -+ #ifdef ENABLE_CRTBEGINTS -+ #define ESP_OPTIONS_PIE_CHECK_SPEC \ -+ "%{shared:%{static|pie|fPIE|fpie|fno-PIC|fno-pic:%e-shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible}} \ -+ %{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible}}" -+ #else -+ #define ESP_OPTIONS_PIE_CHECK_SPEC \ -+ "%{shared:%{static|pie|fPIE|fpie|fno-PIC|fno-pic:%e-shared and -static|pie|fPIE|fpie|fno-PIC|fno-pic are incompatible}} \ -+ %{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible}}" -+ #endif -+ -+ /* We don't pass -pie to the linker when -static */ -+ #ifdef ENABLE_CRTBEGINTS -+ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link) " -+ #else -+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link) " -+ #endif -+ -+ #else -+ #define ESP_OPTIONS_PIE_SPEC "" -+ #define ESP_OPTIONS_PIE_CHECK_SPEC "" -+ #define ESP_LINK_PIE_SPEC "" -+ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link) " -+ #endif -+ -+ /* We add extra spec name's to the EXTRA_SPECS list */ -+ #define ESP_EXTRA_SPECS \ -+ { "esp_cc1", ESP_CC1_SPEC }, \ -+ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \ -+ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \ -+ { "esp_cc1_strict", ESP_CC1_STRICT_SPEC }, \ -+ { "esp_link", ESP_LINK_SPEC }, \ -+ { "esp_link_now", ESP_LINK_NOW_SPEC }, \ -+ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \ -+ { "esp_command_options", ESP_COMMAND_OPTIONS_SPEC }, \ -+ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC }, \ -+ { "esp_options", ESP_OPTIONS_SPEC }, \ -+ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \ -+ { "esp_options_pie_check", ESP_OPTIONS_PIE_CHECK_SPEC }, \ -+ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC } -+ -+ static const char *esp_command_options_spec = ESP_COMMAND_OPTIONS_SPEC; -+ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC; -+ -+#else /* If not ESP_ENABLE defined do this. */ -+ -+ #define ESP_OPTIONS_SPEC "" -+ #define ESP_CPP_OPTIONS_SPEC "" -+ -+ /* We add extra spec name's to the EXTRA_SPECS list */ -+ #define ESP_EXTRA_SPECS \ -+ { "esp_options", ESP_OPTIONS_SPEC }, \ -+ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC } -+ -+#endif -+#endif /* End GCC_ESP_H */ -diff -Nur gcc-4.5.0-vanilla/gcc/gcc.c gcc-4.5.0/gcc/gcc.c ---- gcc-4.5.0-vanilla/gcc/gcc.c 2010-02-11 13:23:08.000000000 +0100 -+++ gcc-4.5.0/gcc/gcc.c 2010-04-21 15:21:16.589812777 +0200 -@@ -84,6 +84,7 @@ - #include "gcc.h" - #include "flags.h" - #include "opts.h" -+#include "esp.h" /* for --enable-esp support */ - - #ifdef HAVE_MMAP_FILE - # include <sys/mman.h> -@@ -822,7 +823,9 @@ - - static const char *asm_debug; - static const char *cpp_spec = CPP_SPEC; -+#ifndef ENABLE_ESP - static const char *cc1_spec = CC1_SPEC; -+#endif - static const char *cc1plus_spec = CC1PLUS_SPEC; - static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC; - static const char *link_ssp_spec = LINK_SSP_SPEC; -@@ -885,7 +888,7 @@ - static const char *cpp_options = - "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ - %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\ -- %{undef} %{save-temps*:-fpch-preprocess}"; -+ %{undef} %{save-temps*:-fpch-preprocess} %(esp_cpp_options)"; - - /* This contains cpp options which are not passed when the preprocessor - output will be used by another program. */ -@@ -893,6 +896,9 @@ - - /* NB: This is shared amongst all front-ends, except for Ada. */ - static const char *cc1_options = -+#ifdef ENABLE_ESP -+"%(esp_options_pie_check)" -+#endif - "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ - %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{a*}\ - %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \ -@@ -1075,15 +1081,15 @@ - %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ - %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ - cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ -- %(cc1_options)}\ -+ %(cc1_options) %(esp_options)}\ - %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ -- cc1 %(cpp_unique_options) %(cc1_options)}}}\ -+ cc1 %(cpp_unique_options) %(cc1_options) %(esp_options)}}}\ - %{!fsyntax-only:%(invoke_as)}} \ - %{combine:\ - %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ - %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i}}\ - %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ -- cc1 %(cpp_unique_options) %(cc1_options)}}\ -+ cc1 %(cpp_unique_options) %(cc1_options) %(esp_options)}}\ - %{!fsyntax-only:%(invoke_as)}}}}}}", 0, 1, 1}, - {"-", - "%{!E:%e-E or -x required when input is from standard input}\ -@@ -1106,7 +1112,7 @@ - %W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0}, - {".i", "@cpp-output", 0, 1, 0}, - {"@cpp-output", -- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0}, -+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(esp_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0}, - {".s", "@assembler", 0, 1, 0}, - {"@assembler", - "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0}, -@@ -1699,18 +1705,23 @@ - INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec), - }; - --#ifdef EXTRA_SPECS /* additional specs needed */ -+/* EXTRA_SPECS needs to be defined */ -+#ifndef EXTRA_SPECS -+#define EXTRA_SPECS -+#endif -+ -+/* EXTRA_SPECS and ESP_EXTRA_SPECS add additional specs */ - /* Structure to keep track of just the first two args of a spec_list. -- That is all that the EXTRA_SPECS macro gives us. */ -+ That is all that the EXTRA_SPECS and ESP_EXTRA_SPECS macro gives us. */ - struct spec_list_1 - { - const char *const name; - const char *const ptr; - }; - --static const struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS }; -+/* ESP_EXTRA_SPECS before EXTRA_SPECS */ -+static const struct spec_list_1 extra_specs_1[] = { ESP_EXTRA_SPECS, EXTRA_SPECS }; - static struct spec_list *extra_specs = (struct spec_list *) 0; --#endif - - /* List of dynamically allocates specs that have been defined so far. */ - -@@ -1798,7 +1809,6 @@ - if (verbose_flag) - notice ("Using built-in specs.\n"); - --#ifdef EXTRA_SPECS - extra_specs = XCNEWVEC (struct spec_list, ARRAY_SIZE (extra_specs_1)); - - for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--) -@@ -1811,7 +1821,6 @@ - sl->ptr_spec = &sl->ptr; - next = sl; - } --#endif - - for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--) - { -@@ -7111,6 +7120,12 @@ - gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str, - spec_version, dir_separator_str, NULL); - -+#ifdef ENABLE_ESP -+ /* Process ESP_COMMAND_OPTIONS_SPEC, adding any new options to the end -+ of the command line. */ -+ do_self_spec (esp_command_options_spec); -+#endif -+ - /* Now we have the specs. - Set the `valid' bits for switches that match anything in any spec. */ - -diff -Nur gcc-4.5.0-vanilla/gcc/Makefile.in gcc-4.5.0/gcc/Makefile.in ---- gcc-4.5.0-vanilla/gcc/Makefile.in 2010-04-02 09:49:06.000000000 +0200 -+++ gcc-4.5.0/gcc/Makefile.in 2010-04-21 15:21:10.033812913 +0200 -@@ -636,13 +636,24 @@ - INHIBIT_LIBC_CFLAGS = -Dinhibit_libc - endif - -+# We don't want __stack_chk_fail in crt* and libgcc2.a. -+# We don't want to compile crtbegin, crtend and crtbeginT with -fPIE. -+enable_esp = @enable_esp@ -+ifeq ($(enable_esp),yes) -+ESP_NOPIE_CFLAGS = -fno-PIE -+ESP_NOSSP_CFLAGS = -fno-stack-protector -+else -+ESP_NOPIE_CFLAGS= -+ESP_NOSSP_CFLAGS= -+endif -+ - # Options to use when compiling libgcc2.a. - # - LIBGCC2_DEBUG_CFLAGS = -g - LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \ - $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \ - -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ -- $(INHIBIT_LIBC_CFLAGS) -+ $(INHIBIT_LIBC_CFLAGS) $(ESP_NOSSP_CFLAGS) - - # Additional options to use when compiling libgcc2.a. - # Some targets override this to -isystem include -@@ -655,7 +666,7 @@ - CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ - -finhibit-size-directive -fno-inline -fno-exceptions \ - -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ -- $(INHIBIT_LIBC_CFLAGS) -+ $(INHIBIT_LIBC_CFLAGS) $(ESP_NOSSP_CFLAGS) - - # Additional sources to handle exceptions; overridden by targets as needed. - LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ -@@ -685,6 +696,12 @@ - # The rules for compiling them should be in the t-* file for the machine. - EXTRA_PARTS = @extra_parts@ - -+# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes -+enable_crtbeginTS = @enable_crtbeginTS@ -+ifeq ($(enable_crtbeginTS),yes) -+EXTRA_PARTS += crtbeginTS.o -+endif -+ - # List of extra object files that should be compiled and linked with - # compiler proper (cc1, cc1obj, cc1plus). - EXTRA_OBJS = @extra_objs@ -@@ -1863,9 +1880,10 @@ - echo LIBGCC_SYNC = '$(LIBGCC_SYNC)' >> tmp-libgcc.mvars - echo LIBGCC_SYNC_CFLAGS = '$(LIBGCC_SYNC_CFLAGS)' >> tmp-libgcc.mvars - echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars -- echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars -+ echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS) $(ESP_NOPIE_CFLAGS)' >> tmp-libgcc.mvars - echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars - echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars -+ echo enable_crtbeginTS = '$(enable_crtbeginTS)' >> tmp-libgcc.mvars - - mv tmp-libgcc.mvars libgcc.mvars - -@@ -1899,12 +1917,14 @@ - $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ - gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) - $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ -+ $(ESP_NOPIE_CFLAGS) \ - -c $(srcdir)/crtstuff.c -DCRT_BEGIN \ - -o $(T)crtbegin$(objext) - - $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ - gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) - $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ -+ $(ESP_NOPIE_CFLAGS) \ - -c $(srcdir)/crtstuff.c -DCRT_END \ - -o $(T)crtend$(objext) - -@@ -1925,9 +1945,19 @@ - $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ - gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) - $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ -+ $(ESP_NOPIE_CFLAGS) \ - -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \ - -o $(T)crtbeginT$(objext) - -+# This is a version of crtbegin for -static -fPIE links if esp is enable. -+ifeq ($(enable_crtbeginTS),yes) -+$(T)crtbeginTS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ -+ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) -+ $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \ -+ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O \ -+ -o $(T)crtbeginTS$(objext) -+endif -+ - # Compile the start modules crt0.o and mcrt0.o that are linked with - # every program - $(T)crt0.o: s-crt0 ; @true -diff -Nur gcc-4.5.0-vanilla/gcc/objc/lang-specs.h gcc-4.5.0/gcc/objc/lang-specs.h ---- gcc-4.5.0-vanilla/gcc/objc/lang-specs.h 2007-08-02 12:37:36.000000000 +0200 -+++ gcc-4.5.0/gcc/objc/lang-specs.h 2010-04-21 15:21:16.702913793 +0200 -@@ -30,13 +30,13 @@ - %{traditional|ftraditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\ -- cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\ -+ cc1obj -fpreprocessed %{save-temps:%b.mi} %{!save-temps:%g.mi} %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}\ - %{!save-temps:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {".mi", "@objc-cpp-output", 0, 0, 0}, - {"@objc-cpp-output", -- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objective-c-header", - "%{E|M|MM:cc1obj -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}\ -@@ -45,10 +45,10 @@ - %{traditional|ftraditional|traditional-cpp:\ - %eGNU Objective C no longer supports traditional compilation}\ - %{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps:%b.mi} %{!save-temps:%g.mi} \n\ -- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj -fpreprocessed %b.mi %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}\ - %{!save-temps:%{!no-integrated-cpp:\ -- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ -+ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ - -o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0}, -diff -Nur gcc-4.5.0-vanilla/gcc/objcp/lang-specs.h gcc-4.5.0/gcc/objcp/lang-specs.h ---- gcc-4.5.0-vanilla/gcc/objcp/lang-specs.h 2007-08-02 12:38:44.000000000 +0200 -+++ gcc-4.5.0/gcc/objcp/lang-specs.h 2010-04-21 15:21:16.708817730 +0200 -@@ -36,7 +36,7 @@ - %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\ - cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\ - %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2 %{+e1*}\ -+ %(cc1_options) %(esp_options) %2 %{+e1*}\ - -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {"@objective-c++", -@@ -46,15 +46,15 @@ - %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\ - cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\ - %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\ -- %(cc1_options) %2 %{+e1*}\ -+ %(cc1_options) %(esp_options) %2 %{+e1*}\ - %{!fsyntax-only:%(invoke_as)}}}}", - CPLUSPLUS_CPP_SPEC, 0, 0}, - {".mii", "@objective-c++-cpp-output", 0, 0, 0}, - {"@objective-c++-cpp-output", - "%{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2 %{+e*}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, - {"@objc++-cpp-output", - "%{!M:%{!MM:%{!E:\ -- cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\ -+ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2 %{+e*}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, -diff -Nur gcc-4.5.0-vanilla/gcc/varasm.c gcc-4.5.0/gcc/varasm.c ---- gcc-4.5.0-vanilla/gcc/varasm.c 2010-03-27 12:56:30.000000000 +0100 -+++ gcc-4.5.0/gcc/varasm.c 2010-04-21 15:21:16.606812404 +0200 -@@ -5961,7 +5961,11 @@ - bool is_local; - - is_local = targetm.binds_local_p (decl); -- if (!flag_shlib) -+ #ifdef ENABLE_ESP -+ if (!flag_pic) -+ #else -+ if (!flag_shlib) -+ #endif - { - if (is_local) - kind = TLS_MODEL_LOCAL_EXEC; -diff -Nur gcc-4.5.0-vanilla/libgcc/Makefile.in gcc-4.5.0/libgcc/Makefile.in ---- gcc-4.5.0-vanilla/libgcc/Makefile.in 2010-03-30 15:08:52.000000000 +0200 -+++ gcc-4.5.0/libgcc/Makefile.in 2010-04-21 15:21:10.824811514 +0200 -@@ -291,6 +291,12 @@ - gen-hide-list = echo > $@ - endif - -+# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes -+enable_libgcc_crtbeginTS = $(enable_crtbeginTS) -+ifeq ($(enable_libgcc_crtbeginTS),yes) -+EXTRA_PARTS += crtbeginTS.o -+endif -+ - ifneq ($(EXTRA_PARTS),) - extra-parts = libgcc-extra-parts - INSTALL_PARTS = $(EXTRA_PARTS) -@@ -842,6 +848,13 @@ - crtbeginT.o: $(gcc_srcdir)/crtstuff.c - $(crt_compile) $(CRTSTUFF_T_CFLAGS) \ - -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -+ -+# This is a version of crtbegin for -static -fPIE links. -+ifeq ($(enable_libgcc_crtbeginTS),yes) -+crtbeginTS.o: $(gcc_srcdir)/crtstuff.c -+ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \ -+ -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O -+endif - endif - - # Build extra startfiles in the libgcc directory. -diff -Nur gcc-4.5.0-vanilla/libmudflap/configure gcc-4.5.0/libmudflap/configure ---- gcc-4.5.0-vanilla/libmudflap/configure 2009-12-05 18:18:53.000000000 +0100 -+++ gcc-4.5.0/libmudflap/configure 2010-04-21 15:21:09.843811773 +0200 -@@ -652,6 +652,7 @@ - MAINTAINER_MODE_FALSE - MAINTAINER_MODE_TRUE - am__untar -+enable_esp - am__tar - AMTAR - am__leading_dot -diff -Nur gcc-4.5.0-vanilla/libmudflap/Makefile.in gcc-4.5.0/libmudflap/Makefile.in ---- gcc-4.5.0-vanilla/libmudflap/Makefile.in 2010-04-02 20:18:06.000000000 +0200 -+++ gcc-4.5.0/libmudflap/Makefile.in 2010-04-21 15:21:10.844815108 +0200 -@@ -304,10 +304,18 @@ - MAINT_CHARSET = latin1 - SUBDIRS = testsuite - -+# Some stuff don't compile with PIE or SSP -+enable_esp = @enable_esp@ -+ifeq ($(enable_esp),yes) -+NO_ESP_CFLAGS = -fno-stack-protector -U_FORTIFY_SOURCE -+else -+NO_ESP_CFLAGS = -+endif -+ - # May be used by various substitution variables. - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) --AM_CFLAGS = -Wall $(SECTION_FLAGS) --@LIBMUDFLAPTH_FALSE@libmudflapth = -+AM_CFLAGS = -Wall $(SECTION_FLAGS) $(NO_ESP_CFLAGS) -+@LIBMUDFLAPTH_FALSE@libmudflapth = - @LIBMUDFLAPTH_TRUE@libmudflapth = libmudflapth.la - toolexeclib_LTLIBRARIES = libmudflap.la $(libmudflapth) - libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include -diff -Nur gcc-4.5.0-vanilla/Makefile.in gcc-4.5.0/Makefile.in ---- gcc-4.5.0-vanilla/Makefile.in 2010-02-17 12:01:44.000000000 +0100 -+++ gcc-4.5.0/Makefile.in 2010-04-21 15:21:10.022812548 +0200 -@@ -350,9 +350,17 @@ - BUILD_PREFIX = @BUILD_PREFIX@ - BUILD_PREFIX_1 = @BUILD_PREFIX_1@ - -+# Some stuff don't compile with SSP -+enable_esp = @enable_esp@ -+ifeq ($(enable_esp),yes) -+ESP_NOSSP_CFLAGS = -fno-stack-protector -+else -+ESP_NOSSP_CFLAGS= -+endif -+ - # Flags to pass to stage2 and later makes. They are defined - # here so that they can be overridden by Makefile fragments. --BOOT_CFLAGS= -g -O2 -+BOOT_CFLAGS= -g -O2 $(ESP_NOSSP_CFLAGS) - BOOT_LDFLAGS= - BOOT_ADAFLAGS=-gnatpg -gnata - -@@ -397,9 +405,9 @@ - - CFLAGS = @CFLAGS@ - LDFLAGS = @LDFLAGS@ --LIBCFLAGS = $(CFLAGS) -+LIBCFLAGS = $(CFLAGS) $(ESP_NOSSP_CFLAGS) - CXXFLAGS = @CXXFLAGS@ --LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -+LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates $(ESP_NOSSP_CFLAGS) - - TFLAGS = - diff --git a/pkgs/gcc/patches/gcc-4.6.0-piepatches-20110407.patch b/pkgs/gcc/patches/gcc-4.6.0-piepatches-20110407.patch new file mode 100644 index 0000000..a9ffaba --- /dev/null +++ b/pkgs/gcc/patches/gcc-4.6.0-piepatches-20110407.patch @@ -0,0 +1,791 @@ +diff -Nur gcc-4.6.0-vanilla/configure gcc-4.6.0/configure +--- gcc-4.6.0-vanilla/configure 2011-03-16 19:27:36.000000000 +0100 ++++ gcc-4.6.0/configure 2011-04-07 19:17:55.383923352 +0200 +@@ -668,6 +668,7 @@ + CFLAGS + CC + target_subdir ++enable_esp + host_subdir + build_subdir + build_libsubdir +@@ -1459,6 +1460,11 @@ + --disable-libquadmath-support + disable libquadmath support for Fortran + --enable-libada build libada directory ++ --enable-esp ++ Enable Stack protector, Position independent executable as ++ default if we have suppot for it when compiling ++ and link with -z relro and -z now as default. ++ Linux targets supported i*86, x86_64, powerpc, powerpc64, ia64 and arm + --enable-libssp build libssp directory + --enable-build-with-cxx build with C++ compiler instead of C compiler + --disable-ppl-version-check +@@ -3040,6 +3046,25 @@ + noconfigdirs="$noconfigdirs gnattools" + fi + ++# Check whether --enable-esp was given and target have the support. ++# Check whether --enable-esp or --disable-esp was given. ++if test "${enable_esp+set}" = set; then ++ enableval="$enable_esp" ++ ++ case $target in ++ i?86*-*-linux* | x86_64*-*-linux* | powerpc-*-linux* | powerpc64-*-linux* | arm*-*-linux* | ia64-*-linux*) ++ enable_esp=yes ++ ;; ++ *) ++ { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported on this $target target." >&5 ++echo "$as_me: error: *** --enable-esp is not supported on this $target target." >&2;} ++ { (exit 1); exit 1; }; } ++ ;; ++ esac ++ ++fi; ++ ++ + # Check whether --enable-libssp was given. + if test "${enable_libssp+set}" = set; then : + enableval=$enable_libssp; ENABLE_LIBSSP=$enableval +@@ -14199,6 +14224,9 @@ + *) stage1_cflags="-g -J" ;; + esac ;; + esac ++if test x$enable_esp = xyes; then ++ stage1_cflags="$stage1_cflags -fno-stack-protector" ++fi + + # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. + if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then +diff -Nur gcc-4.6.0-vanilla/gcc/config/gnu-user.h gcc-4.6.0/gcc/config/gnu-user.h +--- gcc-4.6.0-vanilla/gcc/config/gnu-user.h 2011-01-12 15:29:14.000000000 +0100 ++++ gcc-4.6.0/gcc/config/gnu-user.h 2011-04-07 19:19:31.962715700 +0200 +@@ -41,7 +41,11 @@ + provides part of the support for getting C++ file-scope static + object constructed before entering `main'. */ + +-#if defined HAVE_LD_PIE ++#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS) ++#define GNU_USER_TARGET_STARTFILE_SPEC \ ++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crti.o%s \ ++ %{static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}" ++#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS) + #define GNU_USER_TARGET_STARTFILE_SPEC \ + "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" +diff -Nur gcc-4.6.0-vanilla/gcc/config/rs6000/linux64.h gcc-4.6.0/gcc/config/rs6000/linux64.h +--- gcc-4.6.0-vanilla/gcc/config/rs6000/linux64.h 2011-03-07 08:50:23.000000000 +0100 ++++ gcc-4.6.0/gcc/config/rs6000/linux64.h 2011-04-07 19:19:26.658727069 +0200 +@@ -193,7 +193,7 @@ + #endif + + #define ASM_SPEC32 "-a32 \ +-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \ ++%{mrelocatable} %{mrelocatable-lib} %{fpic|fPIC|fpie|fPIE:-K PIC} \ + %{memb} %{!memb: %{msdata=eabi: -memb}} \ + %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ + %{mcall-freebsd: -mbig} \ +diff -Nur gcc-4.6.0-vanilla/gcc/config/rs6000/sysv4.h gcc-4.6.0/gcc/config/rs6000/sysv4.h +--- gcc-4.6.0-vanilla/gcc/config/rs6000/sysv4.h 2011-03-07 08:50:23.000000000 +0100 ++++ gcc-4.6.0/gcc/config/rs6000/sysv4.h 2011-04-07 19:19:31.963715695 +0200 +@@ -800,7 +800,12 @@ + %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \ + %{!shared: %{profile:-lc_p} %{!profile:-lc}}}" + +-#ifdef HAVE_LD_PIE ++#if defined (HAVE_LD_PIE) && defined (ENABLE_CRTBEGINTS) ++#define STARTFILE_LINUX_SPEC "\ ++%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ ++%{mnewlib:ecrti.o%s;:crti.o%s} \ ++%{static:%{pie:crtbeginTS.o%s;:crtbeginT.o%s}} %{!static:%{shared|pie:crtbeginS.o%s;:crtbegin.o%s}}" ++#elif defined (HAVE_LD_PIE) && ! defined (ENABLE_CRTBEGINTS) + #define STARTFILE_LINUX_SPEC "\ + %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ + %{mnewlib:ecrti.o%s;:crti.o%s} \ +diff -Nur gcc-4.6.0-vanilla/gcc/config.in gcc-4.6.0/gcc/config.in +--- gcc-4.6.0-vanilla/gcc/config.in 2011-03-25 18:07:00.000000000 +0100 ++++ gcc-4.6.0/gcc/config.in 2011-04-07 19:18:10.478890819 +0200 +@@ -58,6 +58,12 @@ + #endif + + ++/* Define to 1 to enable crtbeginTS.o. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_CRTBEGINTS ++#endif ++ ++ + /* Define to 1 to specify that we are using the BID decimal floating point + format instead of DPD */ + #ifndef USED_FOR_TARGET +@@ -77,6 +83,12 @@ + #endif + + ++/* Define to 1 to enable esp. */ ++#ifndef USED_FOR_TARGET ++#undef ENABLE_ESP ++#endif ++ ++ + /* Define to 1 to enable fixed-point arithmetic extension to C. */ + #ifndef USED_FOR_TARGET + #undef ENABLE_FIXED_POINT +diff -Nur gcc-4.6.0-vanilla/gcc/configure gcc-4.6.0/gcc/configure +--- gcc-4.6.0-vanilla/gcc/configure 2011-02-28 16:36:37.000000000 +0100 ++++ gcc-4.6.0/gcc/configure 2011-04-07 19:17:55.388923340 +0200 +@@ -677,6 +677,8 @@ + HOST_LIBS + GGC + libgcc_visibility ++enable_esp ++enable_crtbeginTS + gcc_cv_readelf + gcc_cv_objdump + ORIGINAL_NM_FOR_TARGET +@@ -25608,6 +25610,50 @@ + ;; + esac + ++echo "$as_me:$LINENO: checking linker -z now support" >&5 ++echo $ECHO_N "checking linker -z now support... $ECHO_C" >&6 ++if test "${gcc_cv_ld_now+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ gcc_cv_ld_now=no ++if test $in_tree_ld = yes ; then ++ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ ++ && test $in_tree_ld_is_elf = yes; then ++ gcc_cv_ld_now=yes ++ fi ++elif test x$gcc_cv_ld != x; then ++ # Check if linker supports -z now options ++ if $gcc_cv_ld --help 2>/dev/null | grep now > /dev/null; then ++ gcc_cv_ld_now=yes ++ fi ++fi ++ ++fi ++echo "$as_me:$LINENO: result: $gcc_cv_ld_now" >&5 ++echo "${ECHO_T}$gcc_cv_ld_now" >&6 ++ ++echo "$as_me:$LINENO: checking linker -z relro support" >&5 ++echo $ECHO_N "checking linker -z relro support... $ECHO_C" >&6 ++if test "${gcc_cv_ld_relro+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ gcc_cv_ld_relro=no ++if test $in_tree_ld = yes ; then ++ if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \ ++ && test $in_tree_ld_is_elf = yes; then ++ gcc_cv_ld_relro=yes ++ fi ++elif test x$gcc_cv_ld != x; then ++ # Check if linker supports -z relro and -z norelro options ++ if $gcc_cv_ld --help 2>/dev/null | grep relro > /dev/null; then ++ gcc_cv_ld_relro=yes ++ fi ++fi ++ ++fi ++echo "$as_me:$LINENO: result: $gcc_cv_ld_relro" >&5 ++echo "${ECHO_T}$gcc_cv_ld_relro" >&6 ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker --build-id support" >&5 + $as_echo_n "checking linker --build-id support... " >&6; } + if test "${gcc_cv_ld_buildid+set}" = set; then : +@@ -25792,6 +25838,74 @@ + + fi + ++if test x$enable_esp = xyes ; then ++case $target in ++ ia64*-*-linux*) ++ if test x$gcc_cv_ld_now = xyes; then ++ enable_esp_ld=yes ++ else ++ enable_esp_ld=no ++ fi ++ ;; ++ *-*-linux*) ++ if test x$gcc_cv_ld_relro = xyes && test x$gcc_cv_ld_now = xyes; then ++ enable_esp_ld=yes ++ else ++ enable_esp_ld=no ++ fi ++ ;; ++ *) ++ enable_esp_ld=no ++ ;; ++ esac ++else ++ enable_espf_ld=no ++fi ++if test x$enable_esp_ld = xyes; then ++ ++cat >>confdefs.h <<_ACEOF ++#define ENABLE_ESP 1 ++_ACEOF ++ ++fi ++ ++if test x$enable_esp = xyes && test x$enable_esp_ld = xno; then ++ { { echo "$as_me:$LINENO: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&5 ++echo "$as_me: error: *** --enable-esp is not supported. You don't have -z,relro or -z,now support in the linker." >&2;} ++ { (exit 1); exit 1; }; } ++fi ++ ++echo "$as_me:$LINENO: checking for crtbeginTS.o support" >&5 ++echo $ECHO_N "checking for crtbeginTS.o support... $ECHO_C" >&6 ++if test "${enable_crtbeginTS+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ++if test x$enable_esp = xyes ; then ++ case "$target" in ++ ia64*-*-linux*) ++ enable_crtbeginTS=no ;; ++ *-*-linux*) ++ if test x$gcc_cv_ld_pie = xyes && test x$lt_cv_prog_compiler_static_works = xyes; then ++ enable_crtbeginTS=yes ++ fi ++ ;; ++ *) enable_crtbeginTS=no ;; ++ esac ++fi ++ ++fi ++echo "$as_me:$LINENO: result: $enable_crtbeginTS" >&5 ++echo "${ECHO_T}$enable_crtbeginTS" >&6 ++ ++if test x$enable_crtbeginTS = xyes; then ++ ++cat >>confdefs.h <<_ACEOF ++#define ENABLE_CRTBEGINTS 1 ++_ACEOF ++ ++fi ++ + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 + # and later they can use TFmode. +diff -Nur gcc-4.6.0-vanilla/gcc/cp/lang-specs.h gcc-4.6.0/gcc/cp/lang-specs.h +--- gcc-4.6.0-vanilla/gcc/cp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 ++++ gcc-4.6.0/gcc/cp/lang-specs.h 2011-04-07 19:19:04.828773916 +0200 +@@ -47,7 +47,7 @@ + %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ + cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ + %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ +- %(cc1_options) %2\ ++ %(cc1_options) %(esp_options) %2\ + %{!fsyntax-only:%{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\ + %W{o*:--output-pch=%*}}%V}}}}", + CPLUSPLUS_CPP_SPEC, 0, 0}, +@@ -58,7 +58,7 @@ + %(cpp_options) %2 -o %{save-temps*:%b.ii} %{!save-temps*:%g.ii} \n}\ + cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\ + %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ +- %(cc1_options) %2\ ++ %(cc1_options) %(esp_options) %2\ + %{!fsyntax-only:%(invoke_as)}}}}", + CPLUSPLUS_CPP_SPEC, 0, 0}, + {".ii", "@c++-cpp-output", 0, 0, 0}, +diff -Nur gcc-4.6.0-vanilla/gcc/esp.h gcc-4.6.0/gcc/esp.h +--- gcc-4.6.0-vanilla/gcc/esp.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.6.0/gcc/esp.h 2011-04-07 19:19:14.329753502 +0200 +@@ -0,0 +1,145 @@ ++/* License terms see GNU GENERAL PUBLIC LICENSE Version 3. ++ * Version 20100527.1 ++ * Magnus Granberg (Zorry) zorry@gentoo.org */ ++#ifndef GCC_ESP_H ++#define GCC_ESP_H ++ ++/* This file will add -fstack-protector-all, -fPIE, -pie and -z now ++ as default if the defines and the spec allow it. ++ Added a hack for gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass ++ to support older hardened GCC patches and we don't need to change the code on gcc-specs-* and _filter-hardened. ++ This will add some unsupported upstream commands options as -nopie and -nonow. ++ -D__KERNEL__ is added so we don't have -fPIE, -pie and -fstack-protector-all when building kernels. ++ ESP_CC1_SPEC is added to CC1_SPEC. ++ ESP_CC1_STRICT_OVERFLOW_SPEC is added so we don't disable the strict-overflow check. ++ ESP_LINK_PIE_CHECK_SPEC check for -pie, -p, -pg, -profile and -static. ++ ENABLE_CRTBEGINTS add support for crtbeginTS.o, build -static with -fPIE or -fpie. ++*/ ++#ifdef ENABLE_ESP ++ ++ /* Hack to support gcc-specs-* in toolchain-funcs.eclass and _filter-hardened in flag-o-matic.eclass */ ++ #define ESP_CC1_SPEC " %(esp_cc1_ssp) %(esp_cc1_pie) %(esp_cc1_strict_overflow)" ++ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP ) ++ #define ESP_CC1_SSP_SPEC "%{!fno-stack-protector: %{!fno-stack-protector-all: }}" ++ #else ++ #define ESP_CC1_SSP_SPEC "" ++ #endif ++ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP ) ++ #define ESP_CC1_PIE_SPEC "%{!nopie: }" ++ #else ++ #define ESP_CC1_PIE_SPEC "" ++ #endif ++ #define ESP_CC1_STRICT_OVERFLOW_SPEC "%{!fstrict-overflow:%{!fno-strict-overflow: -fno-strict-overflow}}" ++ ++ /* ESP_LINK_SPEC is added to LINK_PIE_SPEC if esp is enable ++ -z now will be added if we don't have -vanilla spec. We do a -pie incompatible check ++ Don't remove the specs in the end */ ++ #define ESP_LINK_SPEC "%(esp_link_now) %(esp_link_pie_check) " ++ #define ESP_LINK_NOW_SPEC "%{!nonow:-z now}" ++ ++ /* We use ESP_COMMAND_OPTIONS_SPEC to add pie command-line options. */ ++ #define ESP_COMMAND_OPTIONS_SPEC "%{!D__KERNEL__:%{!nopie:%(esp_options_pie) %(esp_link_pie)}}" ++ ++ /* ESP_OPTIONS_SPEC is added to the compiler spec in gcc/gcc.c */ ++ #define ESP_OPTIONS_SPEC "%(esp_options_ssp)" ++ ++ /* ESP_CPP_OPTIONS_SPEC is added to the cpp_options spec in gcc/gcc.c ++ For precompiling headers. */ ++ #define ESP_CPP_OPTIONS_SPEC "%(esp_options_ssp)" ++ ++ /* This will add -fstack-protector-all if we don't have -nostdlib -nodefaultlibs -fno-stack-protector -fstack-protector ++ -fstack-protector-all and we have EFAULT_SSP or EFAULT_PIE_SSP defined. */ ++ #if defined ( EFAULT_SSP ) || defined ( EFAULT_PIE_SSP ) ++ #define ESP_OPTIONS_SSP_SPEC \ ++ "%{!D__KERNEL__:%{!nostdlib:%{!nodefaultlibs: %{!fno-stack-protector: \ ++ %{!fstack-protector:%{!fstack-protector-all:-fstack-protector-all}}}}}}" ++ #else ++ #define ESP_OPTIONS_SSP_SPEC "" ++ #endif ++ ++ /* If EFAULT_PIE or EFAULT_PIE_SSP is defined we will add -fPIE -pie */ ++ #if defined ( EFAULT_PIE ) || defined ( EFAULT_PIE_SSP ) ++ ++ /* This will add -fPIE if we don't have -pie -fpic -fPIC -fpie -fPIE -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static ++ -nostdlib -nostartfiles. */ ++ /* With ENABLE_CRTBEGINTS we don't need to check for -static */ ++ #ifdef ENABLE_CRTBEGINTS ++ #define ESP_OPTIONS_PIE_SPEC \ ++ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \ ++ %{!shared: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }" ++ #else ++ #define ESP_OPTIONS_PIE_SPEC \ ++ "%{!pie: %{!fpic:%{!fPIC:%{!fpie:%{!fPIE: %{!fno-pic:%{!fno-PIC:%{!fno-pie:%{!fno-PIE: \ ++ %{!shared: %{!static: %{!nostdlib: %{!nostartfiles:-fPIE}} } }}}} }}}} }}" ++ #endif ++ ++ /* This will add -pie if we don't have -pie -A -fno-pic -fno-PIC -fno-pie -fno-PIE -shared -static -r -nostdlib ++ -nostartfiles */ ++ /* With ENABLE_CRTBEGINTS we don't need to check for -static ++ and we add -pie only to get the start and endfiles. -pie will not go to the linker. */ ++ #ifdef ENABLE_CRTBEGINTS ++ #define ESP_LINK_PIE_SPEC \ ++ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!r: \ ++ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}" ++ #else ++ #define ESP_LINK_PIE_SPEC \ ++ "%{!pie:%{!A:%{!fno-pie:%{!fno-PIE:%{!fno-pic:%{!fno-PIC:%{!shared:%{!static:%{!r: \ ++ %{!nostdlib:%{!nostartfiles:-pie}}}}}}}}}}}" ++ #endif ++ ++ /* This will check if -pie is set when (-static) -pg -p -profile. If set it will make gcc print out ++ "-pie and (static)|pg|p|profile are incompatible when linking" */ ++ /* With ENABLE_CRTBEGINTS we don't need to check for -static */ ++ #ifdef ENABLE_CRTBEGINTS ++ #define ESP_LINK_PIE_CHECK_SPEC \ ++ "%{pie:%{pg|p|profile:%e-pie and -pg|p|profile are incompatible when linking}}" ++ #else ++ #define ESP_LINK_PIE_CHECK_SPEC \ ++ "%{pie:%{static|pg|p|profile:%e-pie and -static|pg|p|profile are incompatible when linking}}" ++ #endif ++ ++ /* We don't pass -pie to the linker when -static. */ ++ #ifdef ENABLE_CRTBEGINTS ++ #define LINK_PIE_SPEC "%{!static:%{pie:-pie}} %(esp_link)" ++ #else ++ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)" ++ #endif ++ ++ #else ++ #define ESP_OPTIONS_PIE_SPEC "" ++ #define ESP_LINK_PIE_CHECK_SPEC "" ++ #define ESP_LINK_PIE_SPEC "" ++ #define LINK_PIE_SPEC "%{pie:-pie} %(esp_link)" ++ #endif ++ ++ /* We add extra spec name's to the EXTRA_SPECS list */ ++ #define ESP_EXTRA_SPECS \ ++ { "esp_cc1", ESP_CC1_SPEC }, \ ++ { "esp_cc1_pie", ESP_CC1_PIE_SPEC }, \ ++ { "esp_cc1_ssp", ESP_CC1_SSP_SPEC }, \ ++ { "esp_cc1_strict_overflow", ESP_CC1_STRICT_OVERFLOW_SPEC }, \ ++ { "esp_link", ESP_LINK_SPEC }, \ ++ { "esp_link_now", ESP_LINK_NOW_SPEC }, \ ++ { "esp_link_pie", ESP_LINK_PIE_SPEC }, \ ++ { "esp_link_pie_check", ESP_LINK_PIE_CHECK_SPEC }, \ ++ { "esp_command_options", ESP_COMMAND_OPTIONS_SPEC }, \ ++ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC }, \ ++ { "esp_options", ESP_OPTIONS_SPEC }, \ ++ { "esp_options_pie", ESP_OPTIONS_PIE_SPEC }, \ ++ { "esp_options_ssp", ESP_OPTIONS_SSP_SPEC } ++ ++ static const char *esp_command_options_spec = ESP_COMMAND_OPTIONS_SPEC; ++ static const char *cc1_spec = CC1_SPEC ESP_CC1_SPEC; ++ ++#else /* If not ESP_ENABLE defined do this. */ ++ ++ #define ESP_OPTIONS_SPEC "" ++ #define ESP_CPP_OPTIONS_SPEC "" ++ ++ /* We add extra spec name's to the EXTRA_SPECS list */ ++ #define ESP_EXTRA_SPECS \ ++ { "esp_options", ESP_OPTIONS_SPEC }, \ ++ { "esp_cpp_options", ESP_CPP_OPTIONS_SPEC } ++ ++#endif ++#endif /* End GCC_ESP_H */ +diff -Nur gcc-4.6.0-vanilla/gcc/gcc.c gcc-4.6.0/gcc/gcc.c +--- gcc-4.6.0-vanilla/gcc/gcc.c 2011-02-23 03:04:43.000000000 +0100 ++++ gcc-4.6.0/gcc/gcc.c 2011-04-07 19:19:04.828773916 +0200 +@@ -44,6 +44,7 @@ + #include "flags.h" + #include "opts.h" + #include "vec.h" ++#include "esp.h" /* for --enable-esp support */ + + /* By default there is no special suffix for target executables. */ + /* FIXME: when autoconf is fixed, remove the host check - dj */ +@@ -690,7 +691,9 @@ + + static const char *asm_debug; + static const char *cpp_spec = CPP_SPEC; ++#ifndef ENABLE_ESP + static const char *cc1_spec = CC1_SPEC; ++#endif + static const char *cc1plus_spec = CC1PLUS_SPEC; + static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC; + static const char *link_ssp_spec = LINK_SSP_SPEC; +@@ -751,7 +754,7 @@ + static const char *cpp_options = + "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ + %{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\ +- %{undef} %{save-temps*:-fpch-preprocess}"; ++ %{undef} %{save-temps*:-fpch-preprocess} %(esp_cpp_options)"; + + /* This contains cpp options which are not passed when the preprocessor + output will be used by another program. */ +@@ -925,9 +928,9 @@ + %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ + %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ + cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ +- %(cc1_options)}\ ++ %(cc1_options) %(esp_options)}\ + %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ +- cc1 %(cpp_unique_options) %(cc1_options)}}}\ ++ cc1 %(cpp_unique_options) %(cc1_options) %(esp_options)}}}\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1}, + {"-", + "%{!E:%e-E or -x required when input is from standard input}\ +@@ -950,7 +953,7 @@ + %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, + {".i", "@cpp-output", 0, 0, 0}, + {"@cpp-output", +- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, ++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %(esp_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {".s", "@assembler", 0, 0, 0}, + {"@assembler", + "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0}, +@@ -1203,18 +1206,23 @@ + INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec), + }; + +-#ifdef EXTRA_SPECS /* additional specs needed */ ++/* EXTRA_SPECS needs to be defined */ ++#ifndef EXTRA_SPECS ++#define EXTRA_SPECS ++#endif ++ ++/* EXTRA_SPECS and ESP_EXTRA_SPECS add additional specs */ + /* Structure to keep track of just the first two args of a spec_list. +- That is all that the EXTRA_SPECS macro gives us. */ ++ That is all that the EXTRA_SPECS and ESP_EXTRA_SPECS macro gives us. */ + struct spec_list_1 + { + const char *const name; + const char *const ptr; + }; + +-static const struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS }; ++/* ESP_EXTRA_SPECS before EXTRA_SPECS */ ++static const struct spec_list_1 extra_specs_1[] = { ESP_EXTRA_SPECS, EXTRA_SPECS }; + static struct spec_list *extra_specs = (struct spec_list *) 0; +-#endif + + /* List of dynamically allocates specs that have been defined so far. */ + +@@ -1306,7 +1314,6 @@ + if (verbose_flag) + fnotice (stderr, "Using built-in specs.\n"); + +-#ifdef EXTRA_SPECS + extra_specs = XCNEWVEC (struct spec_list, ARRAY_SIZE (extra_specs_1)); + + for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--) +@@ -1319,7 +1326,6 @@ + sl->ptr_spec = &sl->ptr; + next = sl; + } +-#endif + + for (i = ARRAY_SIZE (static_specs) - 1; i >= 0; i--) + { +@@ -6418,6 +6424,12 @@ + gcc_exec_prefix = concat (gcc_exec_prefix, spec_machine, dir_separator_str, + spec_version, dir_separator_str, NULL); + ++#ifdef ENABLE_ESP ++ /* Process ESP_COMMAND_OPTIONS_SPEC, adding any new options to the end ++ of the command line. */ ++ do_self_spec (esp_command_options_spec); ++#endif ++ + /* Now we have the specs. + Set the `valid' bits for switches that match anything in any spec. */ + +diff -Nur gcc-4.6.0-vanilla/gcc/Makefile.in gcc-4.6.0/gcc/Makefile.in +--- gcc-4.6.0-vanilla/gcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100 ++++ gcc-4.6.0/gcc/Makefile.in 2011-04-07 19:18:24.186861296 +0200 +@@ -642,6 +642,14 @@ + INHIBIT_LIBC_CFLAGS = -Dinhibit_libc + endif + ++# We don't want to compile the compiler with -fPIE. ++enable_esp = @enable_esp@ ++ifeq ($(enable_esp),yes) ++ESP_NOPIE_CFLAGS = -fno-PIE ++else ++ESP_NOPIE_CFLAGS= ++endif ++ + # Options to use when compiling libgcc2.a. + # + LIBGCC2_DEBUG_CFLAGS = -g +@@ -662,7 +670,7 @@ + CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \ + -finhibit-size-directive -fno-inline -fno-exceptions \ + -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \ +- -fno-stack-protector \ ++ -fno-stack-protector $(ESP_NOPIE_CFLAGS) \ + $(INHIBIT_LIBC_CFLAGS) + + # Additional sources to handle exceptions; overridden by targets as needed. +@@ -693,6 +701,12 @@ + # The rules for compiling them should be in the t-* file for the machine. + EXTRA_PARTS = @extra_parts@ + ++# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes ++enable_crtbeginTS = @enable_crtbeginTS@ ++ifeq ($(enable_crtbeginTS),yes) ++EXTRA_PARTS += crtbeginTS.o ++endif ++ + # List of extra object files that should be compiled and linked with + # compiler proper (cc1, cc1obj, cc1plus). + EXTRA_OBJS = @extra_objs@ +@@ -996,7 +1010,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 = $(T_CFLAGS) $(CFLAGS-$@) \ ++ALL_CFLAGS = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \ + $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ + + # The C++ version. +@@ -1920,9 +1934,10 @@ + echo LIBGCC_SYNC = '$(LIBGCC_SYNC)' >> tmp-libgcc.mvars + echo LIBGCC_SYNC_CFLAGS = '$(LIBGCC_SYNC_CFLAGS)' >> tmp-libgcc.mvars + echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars +- echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars ++ echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS) $(ESP_NOPIE_CFLAGS)' >> tmp-libgcc.mvars + echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars + echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars ++ echo enable_crtbeginTS = '$(enable_crtbeginTS)' >> tmp-libgcc.mvars + + mv tmp-libgcc.mvars libgcc.mvars + +@@ -1982,9 +1997,19 @@ + $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ + gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) + $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \ ++ $(ESP_NOPIE_CFLAGS) \ + -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \ + -o $(T)crtbeginT$(objext) + ++# This is a version of crtbegin for -static -fPIE links if esp is enable. ++ifeq ($(enable_crtbeginTS),yes) ++$(T)crtbeginTS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \ ++ gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H) ++ $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \ ++ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O \ ++ -o $(T)crtbeginTS$(objext) ++endif ++ + # Compile the start modules crt0.o and mcrt0.o that are linked with + # every program + $(T)crt0.o: s-crt0 ; @true +diff -Nur gcc-4.6.0-vanilla/gcc/objc/lang-specs.h gcc-4.6.0/gcc/objc/lang-specs.h +--- gcc-4.6.0-vanilla/gcc/objc/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 ++++ gcc-4.6.0/gcc/objc/lang-specs.h 2011-04-07 19:19:04.831773909 +0200 +@@ -30,9 +30,9 @@ + %{traditional|traditional-cpp:\ + %eGNU Objective C no longer supports traditional compilation}\ + %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ +- cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}\ ++ cc1obj -fpreprocessed %{save-temps*:%b.mi} %{!save-temps*:%g.mi} %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}\ + %{!save-temps*:%{!no-integrated-cpp:\ +- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}}}\ ++ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}}}\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {"@objective-c-header", + "%{E|M|MM:cc1obj -E %{traditional|traditional-cpp:-traditional-cpp}\ +@@ -41,18 +41,18 @@ + %{traditional|traditional-cpp:\ + %eGNU Objective C no longer supports traditional compilation}\ + %{save-temps*|no-integrated-cpp:cc1obj -E %(cpp_options) -o %{save-temps*:%b.mi} %{!save-temps*:%g.mi} \n\ +- cc1obj -fpreprocessed %b.mi %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ ++ cc1obj -fpreprocessed %b.mi %(cc1_options)%(esp_options) %{print-objc-runtime-info} %{gen-decls}\ + -o %g.s %{!o*:--output-pch=%i.gch}\ + %W{o*:--output-pch=%*}%V}\ + %{!save-temps*:%{!no-integrated-cpp:\ +- cc1obj %(cpp_unique_options) %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ ++ cc1obj %(cpp_unique_options) %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ + -o %g.s %{!o*:--output-pch=%i.gch}\ + %W{o*:--output-pch=%*}%V}}}}}", 0, 0, 0}, + {".mi", "@objective-c-cpp-output", 0, 0, 0}, + {"@objective-c-cpp-output", +- "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ ++ "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {"@objc-cpp-output", + "%nobjc-cpp-output is deprecated; please use objective-c-cpp-output instead\n\ +- %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{print-objc-runtime-info} %{gen-decls}\ ++ %{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %(esp_options) %{print-objc-runtime-info} %{gen-decls}\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, +diff -Nur gcc-4.6.0-vanilla/gcc/objcp/lang-specs.h gcc-4.6.0/gcc/objcp/lang-specs.h +--- gcc-4.6.0-vanilla/gcc/objcp/lang-specs.h 2011-03-06 17:27:57.000000000 +0100 ++++ gcc-4.6.0/gcc/objcp/lang-specs.h 2011-04-07 19:19:04.829773913 +0200 +@@ -36,7 +36,7 @@ + %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ + cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ + %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ +- %(cc1_options) %2\ ++ %(cc1_options) %(esp_options) %2\ + -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}", + CPLUSPLUS_CPP_SPEC, 0, 0}, + {"@objective-c++", +@@ -46,16 +46,16 @@ + %(cpp_options) %2 -o %{save-temps*:%b.mii} %{!save-temps*:%g.mii} \n}\ + cc1objplus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.mii} %{!save-temps*:%g.mii}}\ + %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\ +- %(cc1_options) %2\ ++ %(cc1_options) %(esp_options) %2\ + %{!fsyntax-only:%(invoke_as)}}}}", + CPLUSPLUS_CPP_SPEC, 0, 0}, + {".mii", "@objective-c++-cpp-output", 0, 0, 0}, + {"@objective-c++-cpp-output", + "%{!M:%{!MM:%{!E:\ +- cc1objplus -fpreprocessed %i %(cc1_options) %2\ ++ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, + {"@objc++-cpp-output", + "%nobjc++-cpp-output is deprecated; please use objective-c++-cpp-output instead\n\ + %{!M:%{!MM:%{!E:\ +- cc1objplus -fpreprocessed %i %(cc1_options) %2\ ++ cc1objplus -fpreprocessed %i %(cc1_options) %(esp_options) %2\ + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, +diff -Nur gcc-4.6.0-vanilla/gcc/varasm.c gcc-4.6.0/gcc/varasm.c +--- gcc-4.6.0-vanilla/gcc/varasm.c 2011-02-28 16:36:37.000000000 +0100 ++++ gcc-4.6.0/gcc/varasm.c 2011-04-07 19:18:52.338800740 +0200 +@@ -6022,7 +6022,11 @@ + bool is_local; + + is_local = targetm.binds_local_p (decl); +- if (!flag_shlib) ++ #ifdef ENABLE_ESP ++ if (!flag_pic) ++ #else ++ if (!flag_shlib) ++ #endif + { + if (is_local) + kind = TLS_MODEL_LOCAL_EXEC; +diff -Nur gcc-4.6.0-vanilla/libgcc/Makefile.in gcc-4.6.0/libgcc/Makefile.in +--- gcc-4.6.0-vanilla/libgcc/Makefile.in 2011-01-26 05:19:58.000000000 +0100 ++++ gcc-4.6.0/libgcc/Makefile.in 2011-04-07 19:18:24.190861287 +0200 +@@ -298,6 +298,12 @@ + gen-hide-list = echo > $@ + endif + ++# We add crtbeginTS.o to the EXTRA_PARTS list if enable_crtbeginTS = yes ++enable_libgcc_crtbeginTS = $(enable_crtbeginTS) ++ifeq ($(enable_libgcc_crtbeginTS),yes) ++EXTRA_PARTS += crtbeginTS.o ++endif ++ + ifneq ($(EXTRA_PARTS),) + extra-parts = libgcc-extra-parts + INSTALL_PARTS = $(EXTRA_PARTS) +@@ -849,6 +855,13 @@ + crtbeginT.o: $(gcc_srcdir)/crtstuff.c + $(crt_compile) $(CRTSTUFF_T_CFLAGS) \ + -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O ++ ++# This is a version of crtbegin for -static -fPIE links. ++ifeq ($(enable_libgcc_crtbeginTS),yes) ++crtbeginTS.o: $(gcc_srcdir)/crtstuff.c ++ $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \ ++ -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O ++endif + endif + + # Build extra startfiles in the libgcc directory. +diff -Nur gcc-4.6.0-vanilla/libmudflap/configure gcc-4.6.0/libmudflap/configure +--- gcc-4.6.0-vanilla/libmudflap/configure 2011-02-13 12:45:53.000000000 +0100 ++++ gcc-4.6.0/libmudflap/configure 2011-04-07 19:17:55.399923318 +0200 +@@ -652,6 +652,7 @@ + MAINTAINER_MODE_FALSE + MAINTAINER_MODE_TRUE + am__untar ++enable_esp + am__tar + AMTAR + am__leading_dot +diff -Nur gcc-4.6.0-vanilla/Makefile.in gcc-4.6.0/Makefile.in +--- gcc-4.6.0-vanilla/Makefile.in 2011-02-12 13:02:24.000000000 +0100 ++++ gcc-4.6.0/Makefile.in 2011-04-07 19:18:24.184861300 +0200 +@@ -356,9 +356,17 @@ + BUILD_PREFIX = @BUILD_PREFIX@ + BUILD_PREFIX_1 = @BUILD_PREFIX_1@ + ++# Some stuff don't compile with SSP ++enable_esp = @enable_esp@ ++ifeq ($(enable_esp),yes) ++ESP_NOSSP_CFLAGS = -fno-stack-protector ++else ++ESP_NOSSP_CFLAGS= ++endif ++ + # Flags to pass to stage2 and later makes. They are defined + # here so that they can be overridden by Makefile fragments. +-BOOT_CFLAGS= -g -O2 ++BOOT_CFLAGS= -g -O2 $(ESP_NOSSP_CFLAGS) + BOOT_LDFLAGS= + BOOT_ADAFLAGS=-gnatpg -gnata + +@@ -403,9 +411,9 @@ + + CFLAGS = @CFLAGS@ + LDFLAGS = @LDFLAGS@ +-LIBCFLAGS = $(CFLAGS) ++LIBCFLAGS = $(CFLAGS) $(ESP_NOSSP_CFLAGS) + CXXFLAGS = @CXXFLAGS@ +-LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates ++LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates $(ESP_NOSSP_CFLAGS) + GOCFLAGS = $(CFLAGS) + + TFLAGS = diff --git a/pkgs/gcc/patches/gcc45-libtool-no-rpath.patch b/pkgs/gcc/patches/gcc45-libtool-no-rpath.patch deleted file mode 100644 index 1382a1b..0000000 --- a/pkgs/gcc/patches/gcc45-libtool-no-rpath.patch +++ /dev/null @@ -1,27 +0,0 @@ -libtool sucks. ---- a/ltmain.sh.jj 2007-12-07 14:53:21.000000000 +0100 -+++ b/ltmain.sh 2008-09-05 21:51:48.000000000 +0200 -@@ -5394,6 +5394,7 @@ EOF - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do -+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then -@@ -6071,6 +6072,7 @@ EOF - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do -+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then -@@ -6120,6 +6122,7 @@ EOF - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do -+ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then diff --git a/pkgs/gcc/patches/gcc45-pr33763.patch b/pkgs/gcc/patches/gcc45-pr33763.patch deleted file mode 100644 index dfc9d59..0000000 --- a/pkgs/gcc/patches/gcc45-pr33763.patch +++ /dev/null @@ -1,153 +0,0 @@ -2007-11-06 Jakub Jelinek jakub@redhat.com - - PR tree-optimization/33763 - * gcc.dg/pr33763.c: New test. - * g++.dg/opt/inline13.C: New test. - -2007-11-06 Jan Hubicka jh@suse.cz - - PR tree-optimization/33763 - * tree-inline.c (expand_call_inline): Silently ignore always_inline - attribute for redefined extern inline functions. - ---- a/gcc/tree-inline.c.jj 2007-11-06 09:29:04.000000000 +0100 -+++ b/gcc/tree-inline.c 2007-11-06 16:19:12.000000000 +0100 -@@ -3157,6 +3157,12 @@ expand_call_inline (basic_block bb, gimp - goto egress; - - if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) -+ /* For extern inline functions that get redefined we always -+ silently ignored alway_inline flag. Better behaviour would -+ be to be able to keep both bodies and use extern inline body -+ for inlining, but we can't do that because frontends overwrite -+ the body. */ -+ && !cg_edge->callee->local.redefined_extern_inline - /* Avoid warnings during early inline pass. */ - && cgraph_global_info_ready) - { ---- a/gcc/testsuite/gcc.dg/pr33763.c.jj 2007-11-06 16:19:12.000000000 +0100 -+++ b/gcc/testsuite/gcc.dg/pr33763.c 2007-11-06 16:19:12.000000000 +0100 -@@ -0,0 +1,60 @@ -+/* PR tree-optimization/33763 */ -+/* { dg-do compile } */ -+/* { dg-options "-O2" } */ -+ -+typedef struct -+{ -+ void *a; -+ void *b; -+} T; -+extern void *foo (const char *, const char *); -+extern void *bar (void *, const char *, T); -+extern int baz (const char *, int); -+ -+extern inline __attribute__ ((always_inline, gnu_inline)) int -+baz (const char *x, int y) -+{ -+ return 2; -+} -+ -+int -+baz (const char *x, int y) -+{ -+ return 1; -+} -+ -+int xa, xb; -+ -+static void * -+inl (const char *x, const char *y) -+{ -+ T t = { &xa, &xb }; -+ int *f = (int *) __builtin_malloc (sizeof (int)); -+ const char *z; -+ int o = 0; -+ void *r = 0; -+ -+ for (z = y; *z; z++) -+ { -+ if (*z == 'r') -+ o |= 1; -+ if (*z == 'w') -+ o |= 2; -+ } -+ if (o == 1) -+ *f = baz (x, 0); -+ if (o == 2) -+ *f = baz (x, 1); -+ if (o == 3) -+ *f = baz (x, 2); -+ -+ if (o && *f > 0) -+ r = bar (f, "w", t); -+ return r; -+} -+ -+void * -+foo (const char *x, const char *y) -+{ -+ return inl (x, y); -+} ---- a/gcc/testsuite/g++.dg/opt/inline13.C.jj 2007-11-06 16:20:20.000000000 +0100 -+++ b/gcc/testsuite/g++.dg/opt/inline13.C 2007-11-06 16:21:30.000000000 +0100 -@@ -0,0 +1,60 @@ -+// PR tree-optimization/33763 -+// { dg-do compile } -+// { dg-options "-O2" } -+ -+typedef struct -+{ -+ void *a; -+ void *b; -+} T; -+extern void *foo (const char *, const char *); -+extern void *bar (void *, const char *, T); -+extern int baz (const char *, int); -+ -+extern inline __attribute__ ((always_inline, gnu_inline)) int -+baz (const char *x, int y) -+{ -+ return 2; -+} -+ -+int -+baz (const char *x, int y) -+{ -+ return 1; -+} -+ -+int xa, xb; -+ -+static void * -+inl (const char *x, const char *y) -+{ -+ T t = { &xa, &xb }; -+ int *f = (int *) __builtin_malloc (sizeof (int)); -+ const char *z; -+ int o = 0; -+ void *r = 0; -+ -+ for (z = y; *z; z++) -+ { -+ if (*z == 'r') -+ o |= 1; -+ if (*z == 'w') -+ o |= 2; -+ } -+ if (o == 1) -+ *f = baz (x, 0); -+ if (o == 2) -+ *f = baz (x, 1); -+ if (o == 3) -+ *f = baz (x, 2); -+ -+ if (o && *f > 0) -+ r = bar (f, "w", t); -+ return r; -+} -+ -+void * -+foo (const char *x, const char *y) -+{ -+ return inl (x, y); -+} diff --git a/pkgs/gcc/patches/gcc45-pr38757.patch b/pkgs/gcc/patches/gcc45-pr38757.patch deleted file mode 100644 index d3aec2d..0000000 --- a/pkgs/gcc/patches/gcc45-pr38757.patch +++ /dev/null @@ -1,118 +0,0 @@ -2009-03-18 Jakub Jelinek jakub@redhat.com - - PR debug/38757 - * langhooks.h (struct lang_hooks): Add source_language langhook. - * langhooks-def.h (LANG_HOOKS_SOURCE_LANGUAGE): Define to NULL. - (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_SOURCE_LANGUAGE. - * c-lang.c (c_source_language): New function. - (LANG_HOOKS_SOURCE_LANGUAGE): Define. - * dwarf2out.c (add_prototyped_attribute): Add DW_AT_prototype - also for DW_LANG_{C,C99,ObjC}. - (gen_compile_unit_die): Use lang_hooks.source_language () to - determine if DW_LANG_C99 or DW_LANG_C89 should be returned. - ---- a/gcc/langhooks.h.jj 2010-06-30 09:48:30.000000000 +0200 -+++ b/gcc/langhooks.h 2010-07-01 16:15:22.432616871 +0200 -@@ -454,6 +454,10 @@ struct lang_hooks - is enabled. */ - bool eh_use_cxa_end_cleanup; - -+ /* Return year of the source language standard version if the FE supports -+ multiple versions of the standard. */ -+ int (*source_language) (void); -+ - /* Whenever you add entries here, make sure you adjust langhooks-def.h - and langhooks.c accordingly. */ - }; ---- a/gcc/langhooks-def.h.jj 2010-06-30 09:48:30.000000000 +0200 -+++ b/gcc/langhooks-def.h 2010-07-01 16:16:07.427460761 +0200 -@@ -1,5 +1,5 @@ - /* Default macros to initialize the lang_hooks data structure. -- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -+ Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 - Free Software Foundation, Inc. - Contributed by Alexandre Oliva aoliva@redhat.com - -@@ -111,6 +111,7 @@ extern void lhd_omp_firstprivatize_type_ - #define LANG_HOOKS_EH_PERSONALITY lhd_gcc_personality - #define LANG_HOOKS_EH_RUNTIME_TYPE lhd_pass_through_t - #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false -+#define LANG_HOOKS_SOURCE_LANGUAGE NULL - - /* Attribute hooks. */ - #define LANG_HOOKS_ATTRIBUTE_TABLE NULL -@@ -301,6 +302,7 @@ extern void lhd_end_section (void); - LANG_HOOKS_EH_PERSONALITY, \ - LANG_HOOKS_EH_RUNTIME_TYPE, \ - LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \ -+ LANG_HOOKS_SOURCE_LANGUAGE, \ - } - - #endif /* GCC_LANG_HOOKS_DEF_H */ ---- a/gcc/c-lang.c.jj 2010-06-30 09:48:30.000000000 +0200 -+++ b/gcc/c-lang.c 2010-07-01 16:14:25.396197804 +0200 -@@ -1,6 +1,6 @@ - /* Language-specific hook definitions for C front end. - Copyright (C) 1991, 1995, 1997, 1998, -- 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008 -+ 1999, 2000, 2001, 2003, 2004, 2005, 2007, 2008, 2009 - Free Software Foundation, Inc. - - This file is part of GCC. -@@ -37,6 +37,12 @@ along with GCC; see the file COPYING3. - - enum c_language_kind c_language = clk_c; - -+static int -+c_source_language (void) -+{ -+ return flag_isoc99 ? 1999 : 1989; -+} -+ - /* Lang hooks common to C and ObjC are declared in c-objc-common.h; - consequently, there should be very few hooks below. */ - -@@ -44,6 +50,8 @@ enum c_language_kind c_language = clk_c; - #define LANG_HOOKS_NAME "GNU C" - #undef LANG_HOOKS_INIT - #define LANG_HOOKS_INIT c_objc_common_init -+#undef LANG_HOOKS_SOURCE_LANGUAGE -+#define LANG_HOOKS_SOURCE_LANGUAGE c_source_language - - /* Each front end provides its own lang hook initializer. */ - struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; ---- a/gcc/dwarf2out.c.jj 2010-07-01 14:07:41.000000000 +0200 -+++ b/gcc/dwarf2out.c 2010-07-01 16:13:24.597354717 +0200 -@@ -17150,9 +17150,18 @@ add_bit_size_attribute (dw_die_ref die, - static inline void - add_prototyped_attribute (dw_die_ref die, tree func_type) - { -- if (get_AT_unsigned (comp_unit_die, DW_AT_language) == DW_LANG_C89 -- && TYPE_ARG_TYPES (func_type) != NULL) -- add_AT_flag (die, DW_AT_prototyped, 1); -+ switch (get_AT_unsigned (comp_unit_die, DW_AT_language)) -+ { -+ case DW_LANG_C: -+ case DW_LANG_C89: -+ case DW_LANG_C99: -+ case DW_LANG_ObjC: -+ if (TYPE_ARG_TYPES (func_type) != NULL) -+ add_AT_flag (die, DW_AT_prototyped, 1); -+ break; -+ default: -+ break; -+ } - } - - /* Add an 'abstract_origin' attribute below a given DIE. The DIE is found -@@ -19246,6 +19255,10 @@ gen_compile_unit_die (const char *filena - language = DW_LANG_ObjC; - else if (strcmp (language_string, "GNU Objective-C++") == 0) - language = DW_LANG_ObjC_plus_plus; -+ else if (strcmp (language_string, "GNU C") == 0 -+ && lang_hooks.source_language -+ && lang_hooks.source_language () >= 1999) -+ language = DW_LANG_C99; - } - - add_AT_unsigned (die, DW_AT_language, language); diff --git a/pkgs/gcc/patches/gcc46-Woverlength-string-asm.patch0 b/pkgs/gcc/patches/gcc46-Woverlength-string-asm.patch0 new file mode 100644 index 0000000..47aae37 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-Woverlength-string-asm.patch0 @@ -0,0 +1,180 @@ +2011-02-02 Tom Tromey tromey@redhat.com + + * c-parser.c (c_parser_asm_string_literal): Clear + warn_overlength_strings. + + * gcc.dg/Woverlength-strings-pedantic-c90-asm.c: New file. + * gcc.dg/Woverlength-strings-pedantic-c89-asm.c: New file. + * gcc.dg/Woverlength-strings-pedantic-c99-asm.c: New file. + +--- gcc/c-parser.c ++++ gcc/c-parser.c +@@ -3264,6 +3264,8 @@ static tree + c_parser_asm_string_literal (c_parser *parser) + { + tree str; ++ int save_flag = warn_overlength_strings; ++ warn_overlength_strings = 0; + if (c_parser_next_token_is (parser, CPP_STRING)) + { + str = c_parser_peek_token (parser)->value; +@@ -3281,6 +3283,7 @@ c_parser_asm_string_literal (c_parser *parser) + c_parser_error (parser, "expected string literal"); + str = NULL_TREE; + } ++ warn_overlength_strings = save_flag; + return str; + } + +--- gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c ++++ gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-asm.c +@@ -0,0 +1,47 @@ ++/* -Woverlength-strings complains about string constants which are too long ++ for the C standard's "minimum maximum" limits. It is off by default, ++ but implied by -pedantic. */ ++ ++/* { dg-options "-std=c89 -pedantic" } */ ++ ++#define TEN " " ++#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN ++#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN ++ ++/* C89's minimum-maximum is 509. */ ++__asm__ (HUN HUN HUN HUN HUN TEN); ++ ++/* C99's minimum-maximum is 4095. */ ++__asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"); ++ ++void ++f (void) ++{ ++ /* C89's minimum-maximum is 509. */ ++ __asm__ (HUN HUN HUN HUN HUN TEN); ++ __asm__ (HUN HUN HUN HUN HUN TEN : : ); ++ __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label); ++ ++ /* C99's minimum-maximum is 4095. */ ++ __asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"); ++ __asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456" : : ); ++ __asm__ goto ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456" : : : : label); ++ ++ label: ; ++} +--- gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c ++++ gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-asm.c +@@ -0,0 +1,48 @@ ++/* -Woverlength-strings complains about string constants which are too long ++ for the C standard's "minimum maximum" limits. It is off by default, ++ but implied by -pedantic. */ ++ ++/* { dg-options "-std=c90 -pedantic" } */ ++ ++#define TEN " " ++#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN ++#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN ++ ++/* C89's minimum-maximum is 509. */ ++__asm__ (HUN HUN HUN HUN HUN TEN); ++ ++/* C99's minimum-maximum is 4095. */ ++__asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"); ++ ++void ++f (void) ++{ ++ /* C89's minimum-maximum is 509. */ ++ __asm__ (HUN HUN HUN HUN HUN TEN); ++ __asm__ (HUN HUN HUN HUN HUN TEN : :); ++ __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label); ++ ++ /* C99's minimum-maximum is 4095. */ ++ __asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"); ++ __asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456" : :); ++ __asm__ goto ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456" : : : : label); ++ ++ label: ; ++} ++ +--- gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c ++++ gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-asm.c +@@ -0,0 +1,48 @@ ++/* -Woverlength-strings complains about string constants which are too long ++ for the C standard's "minimum maximum" limits. It is off by default, ++ but implied by -pedantic. */ ++ ++/* { dg-options "-std=c99 -pedantic" } */ ++ ++#define TEN " " ++#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN ++#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN ++ ++/* C89's minimum-maximum is 509. */ ++__asm__ (HUN HUN HUN HUN HUN TEN); ++ ++/* C99's minimum-maximum is 4095. */ ++__asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"); ++ ++void ++f (void) ++{ ++ /* C89's minimum-maximum is 509. */ ++ __asm__ (HUN HUN HUN HUN HUN TEN); ++ __asm__ (HUN HUN HUN HUN HUN TEN : :); ++ __asm__ goto (HUN HUN HUN HUN HUN TEN : : : : label); ++ ++ /* C99's minimum-maximum is 4095. */ ++ __asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"); ++ __asm__ ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456" : :); ++ __asm__ goto ( ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456" : : : : label); ++ ++ label: ; ++} ++ diff --git a/pkgs/gcc/patches/gcc46-Woverlength-string.patch0 b/pkgs/gcc/patches/gcc46-Woverlength-string.patch0 new file mode 100644 index 0000000..cda5cbf --- /dev/null +++ b/pkgs/gcc/patches/gcc46-Woverlength-string.patch0 @@ -0,0 +1,103 @@ +2011-01-18 Tom Tromey tromey@redhat.com + + * c-parser.c (disable_extension_diagnostics): Save + warn_overlength_strings. + (restore_extension_diagnostics): Restore warn_overlength_strings. + + * gcc.dg/Woverlength-strings-pedantic-c89-ext.c: New file. + * gcc.dg/Woverlength-strings-pedantic-c90-ext.c: New file. + * gcc.dg/Woverlength-strings-pedantic-c99-ext.c: New file. + +--- gcc/c-parser.c (revision 168933) ++++ gcc/c-parser.c (working copy) +@@ -1045,13 +1045,15 @@ + | (warn_traditional << 2) + | (flag_iso << 3) + | (warn_long_long << 4) +- | (warn_cxx_compat << 5)); ++ | (warn_cxx_compat << 5) ++ | (warn_overlength_strings << 6)); + cpp_opts->cpp_pedantic = pedantic = 0; + warn_pointer_arith = 0; + cpp_opts->cpp_warn_traditional = warn_traditional = 0; + flag_iso = 0; + cpp_opts->cpp_warn_long_long = warn_long_long = 0; + warn_cxx_compat = 0; ++ warn_overlength_strings = 0; + return ret; + } + +@@ -1067,6 +1069,7 @@ + flag_iso = (flags >> 3) & 1; + cpp_opts->cpp_warn_long_long = warn_long_long = (flags >> 4) & 1; + warn_cxx_compat = (flags >> 5) & 1; ++ warn_overlength_strings = (flags >> 6) & 1; + } + + /* Possibly kinds of declarator to parse. */ +--- gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c (revision 0) ++++ gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c89-ext.c (revision 0) +@@ -0,0 +1,19 @@ ++/* -Woverlength-strings complains about string constants which are too long ++ for the C standard's "minimum maximum" limits. It is off by default, ++ but implied by -pedantic. */ ++ ++/* { dg-options "-std=c89 -pedantic" } */ ++ ++#define TEN "xxxxxxxxxx" ++#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN ++#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN ++ ++/* C89's minimum-maximum is 509. */ ++const char x510[] = __extension__ HUN HUN HUN HUN HUN TEN; ++ ++/* C99's minimum-maximum is 4095. */ ++const char x4096[] = __extension__ ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"; +--- gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c (revision 0) ++++ gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c90-ext.c (revision 0) +@@ -0,0 +1,19 @@ ++/* -Woverlength-strings complains about string constants which are too long ++ for the C standard's "minimum maximum" limits. It is off by default, ++ but implied by -pedantic. */ ++ ++/* { dg-options "-std=c90 -pedantic" } */ ++ ++#define TEN "xxxxxxxxxx" ++#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN ++#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN ++ ++/* C89's minimum-maximum is 509. */ ++const char x510[] = __extension__ HUN HUN HUN HUN HUN TEN; ++ ++/* C99's minimum-maximum is 4095. */ ++const char x4096[] = __extension__ ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"; +--- gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c (revision 0) ++++ gcc/testsuite/gcc.dg/Woverlength-strings-pedantic-c99-ext.c (revision 0) +@@ -0,0 +1,19 @@ ++/* -Woverlength-strings complains about string constants which are too long ++ for the C standard's "minimum maximum" limits. It is off by default, ++ but implied by -pedantic. */ ++ ++/* { dg-options "-std=c99 -pedantic" } */ ++ ++#define TEN "xxxxxxxxxx" ++#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN ++#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN ++ ++/* C89's minimum-maximum is 509. */ ++const char x510[] = HUN HUN HUN HUN HUN TEN; ++ ++/* C99's minimum-maximum is 4095. */ ++const char x4096[] = __extension__ ++ THO THO THO THO /* 4000 */ ++ TEN TEN TEN TEN TEN /* 4050 */ ++ TEN TEN TEN TEN /* 4090 */ ++ "123456"; diff --git a/pkgs/gcc/patches/gcc46-c++-builtin-redecl.patch0 b/pkgs/gcc/patches/gcc46-c++-builtin-redecl.patch0 new file mode 100644 index 0000000..1f36f1f --- /dev/null +++ b/pkgs/gcc/patches/gcc46-c++-builtin-redecl.patch0 @@ -0,0 +1,102 @@ +2007-10-02 Jakub Jelinek jakub@redhat.com + + * decl.c (duplicate_decls): When redeclaring a builtin function, + keep the merged decl builtin whenever types match, even if new + decl defines a function. + + * gcc.dg/builtins-65.c: New test. + * g++.dg/ext/builtin10.C: New test. + +--- gcc/cp/decl.c.jj 2007-10-01 22:11:09.000000000 +0200 ++++ gcc/cp/decl.c 2007-10-02 11:39:46.000000000 +0200 +@@ -2001,23 +2001,21 @@ duplicate_decls (tree newdecl, tree oldd + DECL_ARGUMENTS (olddecl) = DECL_ARGUMENTS (newdecl); + DECL_RESULT (olddecl) = DECL_RESULT (newdecl); + } ++ /* If redeclaring a builtin function, it stays built in. */ ++ if (types_match && DECL_BUILT_IN (olddecl)) ++ { ++ DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); ++ DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); ++ /* If we're keeping the built-in definition, keep the rtl, ++ regardless of declaration matches. */ ++ COPY_DECL_RTL (olddecl, newdecl); ++ } + if (new_defines_function) + /* If defining a function declared with other language + linkage, use the previously declared language linkage. */ + SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl)); + else if (types_match) + { +- /* If redeclaring a builtin function, and not a definition, +- it stays built in. */ +- if (DECL_BUILT_IN (olddecl)) +- { +- DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); +- DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); +- /* If we're keeping the built-in definition, keep the rtl, +- regardless of declaration matches. */ +- COPY_DECL_RTL (olddecl, newdecl); +- } +- + DECL_RESULT (newdecl) = DECL_RESULT (olddecl); + /* Don't clear out the arguments if we're just redeclaring a + function. */ +--- gcc/testsuite/gcc.dg/builtins-65.c.jj 2007-10-02 11:23:51.000000000 +0200 ++++ gcc/testsuite/gcc.dg/builtins-65.c 2007-10-02 11:24:12.000000000 +0200 +@@ -0,0 +1,25 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++typedef __SIZE_TYPE__ size_t; ++extern void __chk_fail (void); ++extern int snprintf (char *, size_t, const char *, ...); ++extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) ++{ ++ if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) ++ __chk_fail (); ++ return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); ++} ++extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); ++ ++char buf[10]; ++ ++int ++main (void) ++{ ++ snprintf (buf, 10, "%d%d\n", 10, 10); ++ return 0; ++} ++ ++/* { dg-final { scan-assembler "mysnprintf" } } */ ++/* { dg-final { scan-assembler-not "__chk_fail" } } */ +--- gcc/testsuite/g++.dg/ext/builtin10.C.jj 2007-10-02 11:19:45.000000000 +0200 ++++ gcc/testsuite/g++.dg/ext/builtin10.C 2007-10-02 11:23:26.000000000 +0200 +@@ -0,0 +1,27 @@ ++// { dg-do compile } ++// { dg-options "-O2" } ++ ++typedef __SIZE_TYPE__ size_t; ++extern "C" { ++extern void __chk_fail (void); ++extern int snprintf (char *, size_t, const char *, ...); ++extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...) ++{ ++ if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b) ++ __chk_fail (); ++ return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ()); ++} ++extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf"); ++} ++ ++char buf[10]; ++ ++int ++main (void) ++{ ++ snprintf (buf, 10, "%d%d\n", 10, 10); ++ return 0; ++} ++ ++// { dg-final { scan-assembler "mysnprintf" } } ++// { dg-final { scan-assembler-not "__chk_fail" } } diff --git a/pkgs/gcc/patches/gcc46-cloog-dl.patch0 b/pkgs/gcc/patches/gcc46-cloog-dl.patch0 new file mode 100644 index 0000000..dd9a5b9 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-cloog-dl.patch0 @@ -0,0 +1,445 @@ +2011-01-04 Jakub Jelinek jakub@redhat.com + + * Makefile.in (BACKENDLIBS): Link against -ldl instead of + -lcloog -lppl. + (graphite.o, graphite%.o): Force -O, remove -fkeep-inline-functions. + (GRAPHITE_CLOOG_UTIL_H, GRAPHITE_POLY_H): New. + (graphite*.o): Adjust dependencies. + * graphite-cloog-compat.h: Include <dlfcn.h>. Reference libcloog and + libppl symbols through pointers in cloog_pointers__ variable. + * graphite.c (init_cloog_pointers): New function. + (graphite_transform_loops): Call init_cloog_pointers. + * graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Rename + stmt_for argument to stmt_fora. + * graphite-poly.h: Include graphite-cloog-util.h. + +--- gcc/Makefile.in.jj 2011-01-03 13:44:14.163900902 +0100 ++++ gcc/Makefile.in 2011-01-04 17:48:53.588775911 +0100 +@@ -984,6 +984,8 @@ GCC_PLUGIN_H = gcc-plugin.h highlev-plug + 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),-ldl) $(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) $(SYS + $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) tree-pass.h value-prof.h + graphite.o : graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) \ + $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \ +- $(DBGCNT_H) graphite-ppl.h graphite-poly.h graphite-scop-detection.h \ ++ $(DBGCNT_H) graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h \ + graphite-clast-to-gimple.h graphite-sese-to-poly.h + graphite-blocking.o : graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ +- sese.h graphite-ppl.h graphite-poly.h ++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) + graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \ + $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ +- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-cloog-util.h \ +- graphite-ppl.h graphite-poly.h graphite-clast-to-gimple.h \ ++ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h $(GRAPHITE_CLOOG_UTIL_H) \ ++ graphite-ppl.h $(GRAPHITE_POLY_H) graphite-clast-to-gimple.h \ + graphite-dependences.h graphite-cloog-compat.h + graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \ +- coretypes.h graphite-cloog-util.h graphite-cloog-compat.h ++ coretypes.h $(GRAPHITE_CLOOG_UTIL_H) graphite-cloog-compat.h + graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ +- sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \ +- graphite-cloog-util.h ++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-dependences.h \ ++ $(GRAPHITE_CLOOG_UTIL_H) + graphite-flattening.o : graphite-flattening.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ +- sese.h graphite-ppl.h graphite-poly.h ++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) + graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ +- sese.h graphite-ppl.h graphite-poly.h ++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) + graphite-poly.o : graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_DUMP_H) gimple-pretty-print.h \ +- $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h graphite-poly.h \ +- graphite-dependences.h graphite-cloog-util.h ++ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \ ++ graphite-dependences.h $(GRAPHITE_CLOOG_UTIL_H) + graphite-ppl.o : graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ +- graphite-cloog-util.h graphite-ppl.h ++ $(GRAPHITE_CLOOG_UTIL_H) graphite-ppl.h + graphite-scop-detection.o : graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \ +- sese.h graphite-ppl.h graphite-poly.h graphite-scop-detection.h ++ sese.h graphite-ppl.h $(GRAPHITE_POLY_H) graphite-scop-detection.h + graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \ + $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) \ +- $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h graphite-poly.h \ ++ $(TREE_DATA_REF_H) domwalk.h sese.h graphite-ppl.h $(GRAPHITE_POLY_H) \ + graphite-sese-to-poly.h + tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \ +@@ -3482,6 +3484,11 @@ $(out_object_file): $(out_file) $(CONFIG + $(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 $@ \ +--- gcc/graphite-cloog-compat.h.jj 2011-01-03 12:53:05.000000000 +0100 ++++ gcc/graphite-cloog-compat.h 2011-01-04 17:34:09.857757544 +0100 +@@ -272,4 +272,263 @@ static inline int cloog_matrix_nrows (Cl + return m->NbRows; + } + #endif /* CLOOG_ORG */ ++ ++#include <dlfcn.h> ++#define DYNSYMS \ ++ DYNSYM (cloog_block_alloc); \ ++ DYNSYM (cloog_block_list_free); \ ++ DYNSYM (cloog_block_list_malloc); \ ++ DYNSYM (cloog_clast_create); \ ++ DYNSYM (cloog_clast_free); \ ++ DYNSYM (cloog_domain_free); \ ++ DYNSYM (cloog_domain_matrix2domain); \ ++ DYNSYM (cloog_initialize); \ ++ DYNSYM (cloog_loop_malloc); \ ++ DYNSYM (cloog_matrix_alloc); \ ++ DYNSYM (cloog_matrix_copy); \ ++ DYNSYM (cloog_matrix_free); \ ++ DYNSYM (cloog_matrix_print); \ ++ DYNSYM (cloog_names_malloc); \ ++ DYNSYM (cloog_names_scalarize); \ ++ DYNSYM (cloog_options_free); \ ++ DYNSYM (cloog_options_malloc); \ ++ DYNSYM (cloog_program_dump_cloog); \ ++ DYNSYM (cloog_program_extract_scalars); \ ++ DYNSYM (cloog_program_free); \ ++ DYNSYM (cloog_program_generate); \ ++ DYNSYM (cloog_program_malloc); \ ++ DYNSYM (cloog_program_print); \ ++ DYNSYM (cloog_program_scatter); \ ++ DYNSYM (cloog_statement_alloc); \ ++ DYNSYM (cloog_domain_union); \ ++ DYNSYM (cloog_matrix_read); \ ++ DYNSYM (cloog_new_pol); \ ++ DYNSYM (cloog_vector_gcd); \ ++ DYNSYM (ppl_finalize); \ ++ DYNSYM (ppl_assign_Coefficient_from_mpz_t); \ ++ DYNSYM (ppl_assign_Linear_Expression_from_Linear_Expression); \ ++ DYNSYM (ppl_Coefficient_to_mpz_t); \ ++ DYNSYM (ppl_Constraint_coefficient); \ ++ DYNSYM (ppl_Constraint_inhomogeneous_term); \ ++ DYNSYM (ppl_Constraint_space_dimension); \ ++ DYNSYM (ppl_Constraint_System_begin); \ ++ DYNSYM (ppl_Constraint_System_const_iterator_dereference); \ ++ DYNSYM (ppl_Constraint_System_const_iterator_equal_test); \ ++ DYNSYM (ppl_Constraint_System_const_iterator_increment); \ ++ DYNSYM (ppl_Constraint_System_end); \ ++ DYNSYM (ppl_Constraint_System_insert_Constraint); \ ++ DYNSYM (ppl_Constraint_System_space_dimension); \ ++ DYNSYM (ppl_Constraint_type); \ ++ DYNSYM (ppl_delete_Coefficient); \ ++ DYNSYM (ppl_delete_Constraint); \ ++ DYNSYM (ppl_delete_Constraint_System_const_iterator); \ ++ DYNSYM (ppl_delete_Linear_Expression); \ ++ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron); \ ++ DYNSYM (ppl_delete_Pointset_Powerset_C_Polyhedron_iterator); \ ++ DYNSYM (ppl_delete_Polyhedron); \ ++ DYNSYM (ppl_Linear_Expression_add_to_coefficient); \ ++ DYNSYM (ppl_Linear_Expression_add_to_inhomogeneous); \ ++ DYNSYM (ppl_Linear_Expression_coefficient); \ ++ DYNSYM (ppl_Linear_Expression_inhomogeneous_term); \ ++ DYNSYM (ppl_Linear_Expression_space_dimension); \ ++ DYNSYM (ppl_new_Coefficient); \ ++ DYNSYM (ppl_new_Coefficient_from_mpz_t); \ ++ DYNSYM (ppl_new_Constraint); \ ++ DYNSYM (ppl_new_Constraint_System); \ ++ DYNSYM (ppl_new_Constraint_System_const_iterator); \ ++ DYNSYM (ppl_new_C_Polyhedron_from_C_Polyhedron); \ ++ DYNSYM (ppl_new_C_Polyhedron_from_space_dimension); \ ++ DYNSYM (ppl_new_C_Polyhedron_recycle_Constraint_System); \ ++ DYNSYM (ppl_new_Linear_Expression); \ ++ DYNSYM (ppl_new_Linear_Expression_from_Constraint); \ ++ DYNSYM (ppl_new_Linear_Expression_from_Linear_Expression); \ ++ DYNSYM (ppl_new_Linear_Expression_with_dimension); \ ++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron); \ ++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron); \ ++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension); \ ++ DYNSYM (ppl_new_Pointset_Powerset_C_Polyhedron_iterator); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_constraint); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_difference_assign); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_intersection_assign); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_is_empty); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_end); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_iterator_increment); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_maximize); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_minimize); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_remove_space_dimensions); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_size); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_space_dimension); \ ++ DYNSYM (ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign); \ ++ DYNSYM (ppl_Polyhedron_add_constraint); \ ++ DYNSYM (ppl_Polyhedron_add_constraints); \ ++ DYNSYM (ppl_Polyhedron_add_space_dimensions_and_embed); \ ++ DYNSYM (ppl_Polyhedron_get_constraints); \ ++ DYNSYM (ppl_Polyhedron_map_space_dimensions); \ ++ DYNSYM (ppl_Polyhedron_remove_space_dimensions); \ ++ DYNSYM (ppl_Polyhedron_space_dimension); \ ++ DYNSYM (ppl_subtract_Linear_Expression_from_Linear_Expression); \ ++ DYNSYM (pprint); \ ++ DYNSYM (stmt_block); \ ++ DYNSYM (stmt_for); \ ++ DYNSYM (stmt_guard); \ ++ DYNSYM (stmt_root); \ ++ DYNSYM (stmt_user); \ ++ DYNSYM (ppl_delete_Constraint_System); \ ++ DYNSYM (ppl_initialize); \ ++ DYNSYM (ppl_new_Constraint_System_from_Constraint); \ ++ DYNSYM (ppl_new_C_Polyhedron_from_Constraint_System); \ ++ DYNSYM (ppl_Polyhedron_affine_image); \ ++ DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron); ++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 cloog_finalize (*cloog_pointers__.p_ppl_finalize) ++ ++ + #endif /* GRAPHITE_CLOOG_COMPAT_H */ +--- gcc/graphite.c.jj 2011-01-03 12:53:05.194056513 +0100 ++++ gcc/graphite.c 2011-01-04 16:18:32.385007767 +0100 +@@ -54,6 +54,35 @@ along with GCC; see the file COPYING3. + #include "graphite-clast-to-gimple.h" + #include "graphite-sese-to-poly.h" + ++__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 +@@ -199,6 +228,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 (); +--- gcc/graphite-clast-to-gimple.c.jj 2011-01-03 12:53:05.000000000 +0100 ++++ gcc/graphite-clast-to-gimple.c 2011-01-04 16:29:55.738007463 +0100 +@@ -738,10 +738,10 @@ clast_get_body_of_loop (struct clast_stm + 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); +--- gcc/graphite-poly.h.jj 2011-01-03 12:53:05.000000000 +0100 ++++ gcc/graphite-poly.h 2011-01-04 17:35:53.308788629 +0100 +@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. + #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/pkgs/gcc/patches/gcc46-hack.patch0 b/pkgs/gcc/patches/gcc46-hack.patch0 new file mode 100644 index 0000000..4689ce8 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-hack.patch0 @@ -0,0 +1,114 @@ +--- libada/Makefile.in.jj 2009-01-14 12:07:35.000000000 +0100 ++++ libada/Makefile.in 2009-01-15 14:25:33.000000000 +0100 +@@ -69,18 +69,40 @@ version := $(shell cat $(srcdir)/../gcc/ + libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR) + ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR)) + ++DEFAULTMULTIFLAGS := ++ifeq ($(MULTISUBDIR),) ++targ:=$(subst -, ,$(target)) ++arch:=$(word 1,$(targ)) ++ifeq ($(words $(targ)),2) ++osys:=$(word 2,$(targ)) ++else ++osys:=$(word 3,$(targ)) ++endif ++ifeq ($(strip $(filter-out i%86 x86_64 powerpc% ppc% s390% sparc% linux%, $(arch) $(osys))),) ++ifeq ($(shell $(CC) $(CFLAGS) -print-multi-os-directory),../lib64) ++DEFAULTMULTIFLAGS := -m64 ++else ++ifeq ($(strip $(filter-out s390%, $(arch))),) ++DEFAULTMULTIFLAGS := -m31 ++else ++DEFAULTMULTIFLAGS := -m32 ++endif ++endif ++endif ++endif ++ + # exeext should not be used because it's the *host* exeext. We're building + # a *target* library, aren't we?!? Likewise for CC. Still, provide bogus + # definitions just in case something slips through the safety net provided + # by recursive make invocations in gcc/ada/Makefile.in + LIBADA_FLAGS_TO_PASS = \ + "MAKEOVERRIDES=" \ +- "LDFLAGS=$(LDFLAGS)" \ ++ "LDFLAGS=$(strip $(LDFLAGS) $(DEFAULTMULTIFLAGS))" \ + "LN_S=$(LN_S)" \ + "SHELL=$(SHELL)" \ +- "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \ +- "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \ +- "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \ ++ "GNATLIBFLAGS=$(strip $(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ ++ "GNATLIBCFLAGS=$(strip $(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ ++ "GNATLIBCFLAGS_FOR_C=$(strip $(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS))" \ + "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \ + "THREAD_KIND=$(THREAD_KIND)" \ + "TRACE=$(TRACE)" \ +@@ -91,7 +113,7 @@ LIBADA_FLAGS_TO_PASS = \ + "exeext=.exeext.should.not.be.used " \ + 'CC=the.host.compiler.should.not.be.needed' \ + "GCC_FOR_TARGET=$(CC)" \ +- "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" ++ "CFLAGS=$(strip $(CFLAGS) $(DEFAULTMULTIFLAGS) $(WARN_CFLAGS))" + + # Rules to build gnatlib. + .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared oscons +--- gcc/ada/sem_util.adb (revision 161677) ++++ gcc/ada/sem_util.adb (working copy) +@@ -2246,7 +2246,11 @@ + end if; + + elsif Is_Entity_Name (A2) then ++ ++ -- Triggered by -Wall ++ pragma Warnings (Off); + return Denotes_Same_Prefix (A2, A1); ++ pragma Warnings (On); + + elsif Nkind_In (A1, N_Selected_Component, N_Indexed_Component, N_Slice) + and then +@@ -4694,7 +4698,7 @@ + Exp : Node_Id; + Assn : Node_Id; + Choice : Node_Id; +- Comp_Type : Entity_Id; ++ Comp_Type : Entity_Id := Empty; + Is_Array_Aggr : Boolean; + + begin +--- config-ml.in.jj 2010-06-30 09:50:44.000000000 +0200 ++++ config-ml.in 2010-07-02 21:24:17.994211151 +0200 +@@ -516,6 +516,8 @@ multi-do: + ADAFLAGS="$(ADAFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ ++ mandir="$(mandir)" \ ++ infodir="$(infodir)" \ + GCJFLAGS="$(GCJFLAGS) $${flags}" \ + GOCFLAGS="$(GOCFLAGS) $${flags}" \ + CXXFLAGS="$(CXXFLAGS) $${flags}" \ +--- libjava/Makefile.am.jj 2010-07-09 11:17:33.729604090 +0200 ++++ libjava/Makefile.am 2010-07-09 13:16:41.894375641 +0200 +@@ -710,7 +710,8 @@ if USE_LIBGCJ_BC + ## later. + @echo Installing dummy lib libgcj_bc.so.1.0.0; \ + rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ +- mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++ $(INSTALL) $(INSTALL_STRIP_FLAG) $(here)/.libs/libgcj_bc.so $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0; \ + $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \ + -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \ + rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \ +--- libjava/Makefile.in.jj 2010-07-09 11:17:34.000000000 +0200 ++++ libjava/Makefile.in 2010-07-09 13:18:07.542572270 +0200 +@@ -12665,7 +12665,8 @@ install-exec-hook: install-binPROGRAMS i + install-libexecsubPROGRAMS + @USE_LIBGCJ_BC_TRUE@ @echo Installing dummy lib libgcj_bc.so.1.0.0; \ + @USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ +-@USE_LIBGCJ_BC_TRUE@ mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++@USE_LIBGCJ_BC_TRUE@ $(INSTALL) $(INSTALL_STRIP_FLAG) $(here)/.libs/libgcj_bc.so $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \ ++@USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0; \ + @USE_LIBGCJ_BC_TRUE@ $(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \ + @USE_LIBGCJ_BC_TRUE@ -o $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 -lgcj || exit; \ + @USE_LIBGCJ_BC_TRUE@ rm $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1; \ diff --git a/pkgs/gcc/patches/gcc46-libgomp-omp_h-multilib.patch0 b/pkgs/gcc/patches/gcc46-libgomp-omp_h-multilib.patch0 new file mode 100644 index 0000000..d0e98d1 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-libgomp-omp_h-multilib.patch0 @@ -0,0 +1,17 @@ +2008-06-09 Jakub Jelinek jakub@redhat.com + + * omp.h.in (omp_nest_lock_t): Fix up for Linux multilibs. + +--- libgomp/omp.h.in.jj 2008-06-09 13:34:05.000000000 +0200 ++++ libgomp/omp.h.in 2008-06-09 13:34:48.000000000 +0200 +@@ -42,8 +42,8 @@ typedef struct + + typedef struct + { +- unsigned char _x[@OMP_NEST_LOCK_SIZE@] +- __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@))); ++ unsigned char _x[8 + sizeof (void *)] ++ __attribute__((__aligned__(sizeof (void *)))); + } omp_nest_lock_t; + #endif + diff --git a/pkgs/gcc/patches/gcc46-libtool-no-rpath.patch0 b/pkgs/gcc/patches/gcc46-libtool-no-rpath.patch0 new file mode 100644 index 0000000..466c661 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-libtool-no-rpath.patch0 @@ -0,0 +1,27 @@ +libtool sucks. +--- ltmain.sh.jj 2007-12-07 14:53:21.000000000 +0100 ++++ ltmain.sh 2008-09-05 21:51:48.000000000 +0200 +@@ -5394,6 +5394,7 @@ EOF + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -6071,6 +6072,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -6120,6 +6122,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then diff --git a/pkgs/gcc/patches/gcc46-no-add-needed.patch0 b/pkgs/gcc/patches/gcc46-no-add-needed.patch0 new file mode 100644 index 0000000..8aac209 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-no-add-needed.patch0 @@ -0,0 +1,52 @@ +2010-02-08 Roland McGrath roland@redhat.com + + * config/rs6000/sysv4.h (LINK_EH_SPEC): Pass --no-add-needed to the + linker. + * config/gnu-user.h (LINK_EH_SPEC): Likewise. + * config/alpha/elf.h (LINK_EH_SPEC): Likewise. + * config/ia64/linux.h (LINK_EH_SPEC): Likewise. + +--- gcc/config/alpha/elf.h.jj 2011-01-03 12:52:31.118056764 +0100 ++++ gcc/config/alpha/elf.h 2011-01-04 18:14:10.931874160 +0100 +@@ -438,7 +438,7 @@ extern int alpha_this_gpdisp_sequence_nu + I imagine that other systems will catch up. In the meantime, it + doesn't harm to make sure that the data exists to be used later. */ + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " + #endif + + /* A C statement (sans semicolon) to output to the stdio stream STREAM +--- gcc/config/ia64/linux.h.jj 2011-01-03 13:02:11.462994522 +0100 ++++ gcc/config/ia64/linux.h 2011-01-04 18:14:10.931874160 +0100 +@@ -82,7 +82,7 @@ do { \ + Signalize that because we have fde-glibc, we don't need all C shared libs + linked against -lgcc_s. */ + #undef LINK_EH_SPEC +-#define LINK_EH_SPEC "" ++#define LINK_EH_SPEC "--no-add-needed " + + #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h" + +--- gcc/config/gnu-user.h.jj 2011-01-03 12:53:03.739057299 +0100 ++++ gcc/config/gnu-user.h 2011-01-04 18:14:10.932814884 +0100 +@@ -82,7 +82,7 @@ see the files COPYING3 and COPYING.RUNTI + #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC + + #if defined(HAVE_LD_EH_FRAME_HDR) +-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " + #endif + + #undef LINK_GCC_C_SEQUENCE_SPEC +--- gcc/config/rs6000/sysv4.h.jj 2011-01-03 13:02:18.255994215 +0100 ++++ gcc/config/rs6000/sysv4.h 2011-01-04 18:14:10.933888871 +0100 +@@ -869,7 +869,7 @@ extern int fixuplabelno; + -dynamic-linker " LINUX_DYNAMIC_LINKER "}}" + + #if defined(HAVE_LD_EH_FRAME_HDR) +-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} " + #endif + + #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \ diff --git a/pkgs/gcc/patches/gcc46-ppl-0.10.patch b/pkgs/gcc/patches/gcc46-ppl-0.10.patch new file mode 100644 index 0000000..e7c2d87 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-ppl-0.10.patch @@ -0,0 +1,115 @@ +diff -Nur gcc-4.6.0-vanilla/configure gcc-4.6.0/configure +--- gcc-4.6.0-vanilla/configure 2011-03-16 19:27:36.000000000 +0100 ++++ gcc-4.6.0/configure 2011-04-07 21:41:50.876254183 +0200 +@@ -5776,7 +5776,7 @@ + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $pplinc $gmpinc" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.11 (revision 0 or later) of PPL" >&5 +-$as_echo_n "checking for version 0.11 (revision 0 or later) of PPL... " >&6; } ++$as_echo_n "checking for version 0.10 (revision 0 or later) of PPL... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include "ppl_c.h" +@@ -5784,7 +5784,7 @@ + main () + { + +- #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11 ++ #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 10 + choke me + #endif + +diff -Nur gcc-4.6.0-vanilla/configure.ac gcc-4.6.0/configure.ac +--- gcc-4.6.0-vanilla/configure.ac 2011-03-16 19:27:36.000000000 +0100 ++++ gcc-4.6.0/configure.ac 2011-04-07 21:41:04.254292244 +0200 +@@ -1688,9 +1688,9 @@ + if test "$enable_ppl_version_check" != no; then + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $pplinc $gmpinc" +- AC_MSG_CHECKING([for version 0.11 (revision 0 or later) of PPL]) ++ AC_MSG_CHECKING([for version 0.10 (revision 0 or later) of PPL]) + AC_TRY_COMPILE([#include "ppl_c.h"],[ +- #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11 ++ #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 10 + choke me + #endif + ], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); ppllibs= ; pplinc= ; with_ppl=no ]) +diff -Nur gcc-4.6.0-vanilla/gcc/doc/install.texi gcc-4.6.0/gcc/doc/install.texi +--- gcc-4.6.0-vanilla/gcc/doc/install.texi 2011-03-21 13:13:26.000000000 +0100 ++++ gcc-4.6.0/gcc/doc/install.texi 2011-04-07 21:40:12.957333674 +0200 +@@ -362,7 +362,7 @@ + distribution is found in a subdirectory of your GCC sources named + @file{mpc}, it will be built together with GCC@. + +-@item Parma Polyhedra Library (PPL) version 0.11 ++@item Parma Polyhedra Library (PPL) version 0.10 + + Necessary to build GCC with the Graphite loop optimizations. + It can be downloaded from @uref{http://www.cs.unipr.it/ppl/Download/%7D. +diff -Nur gcc-4.6.0-vanilla/gcc/graphite-ppl.c gcc-4.6.0/gcc/graphite-ppl.c +--- gcc-4.6.0-vanilla/gcc/graphite-ppl.c 2011-01-25 07:46:43.000000000 +0100 ++++ gcc-4.6.0/gcc/graphite-ppl.c 2011-04-07 21:40:12.958333672 +0200 +@@ -521,6 +521,15 @@ + bool + ppl_powerset_is_empty (ppl_Pointset_Powerset_C_Polyhedron_t ps) + { ++#if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11 ++ /* On PPL 0.10, ++ ppl_Pointset_Powerset_C_Polyhedron_contains_integer_point (ps) ++ takes too long on some cases and so we call _is_empty instead. */ ++ return ppl_Pointset_Powerset_C_Polyhedron_is_empty (ps); ++ ++#else ++ /* On PPL 0.11 or later, we can check for integer feasibility using ++ the PIP solver. */ + ppl_PIP_Problem_t pip; + ppl_dimension_type d; + ppl_const_Constraint_System_t pcs; +@@ -561,6 +570,7 @@ + ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (end); + + return !has_integer_solutions; ++#endif + } + + #endif +diff -Nur gcc-4.6.0-vanilla/gcc/testsuite/gcc.dg/graphite/interchange-11.c gcc-4.6.0/gcc/testsuite/gcc.dg/graphite/interchange-11.c +--- gcc-4.6.0-vanilla/gcc/testsuite/gcc.dg/graphite/interchange-11.c 2011-01-25 07:45:54.000000000 +0100 ++++ gcc-4.6.0/gcc/testsuite/gcc.dg/graphite/interchange-11.c 2011-04-07 21:40:12.974333658 +0200 +@@ -46,5 +46,5 @@ + return 0; + } + +-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */ ++/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */ + /* { dg-final { cleanup-tree-dump "graphite" } } */ +diff -Nur gcc-4.6.0-vanilla/gcc/testsuite/gcc.dg/graphite/interchange-13.c gcc-4.6.0/gcc/testsuite/gcc.dg/graphite/interchange-13.c +--- gcc-4.6.0-vanilla/gcc/testsuite/gcc.dg/graphite/interchange-13.c 2011-01-25 07:45:54.000000000 +0100 ++++ gcc-4.6.0/gcc/testsuite/gcc.dg/graphite/interchange-13.c 2011-04-07 21:40:12.975333657 +0200 +@@ -50,5 +50,5 @@ + } + + +-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */ ++/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */ + /* { dg-final { cleanup-tree-dump "graphite" } } */ +diff -Nur gcc-4.6.0-vanilla/gcc/testsuite/gcc.dg/graphite/interchange-1.c gcc-4.6.0/gcc/testsuite/gcc.dg/graphite/interchange-1.c +--- gcc-4.6.0-vanilla/gcc/testsuite/gcc.dg/graphite/interchange-1.c 2011-01-25 07:45:54.000000000 +0100 ++++ gcc-4.6.0/gcc/testsuite/gcc.dg/graphite/interchange-1.c 2011-04-07 21:40:12.975333657 +0200 +@@ -49,5 +49,5 @@ + return 0; + } + +-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */ ++/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */ + /* { dg-final { cleanup-tree-dump "graphite" } } */ +diff -Nur gcc-4.6.0-vanilla/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90 gcc-4.6.0/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90 +--- gcc-4.6.0-vanilla/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90 2011-01-25 07:47:34.000000000 +0100 ++++ gcc-4.6.0/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90 2011-04-07 21:40:12.976333657 +0200 +@@ -24,5 +24,5 @@ + + end Program FOO + +-! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } ++! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } + ! { dg-final { cleanup-tree-dump "graphite" } } diff --git a/pkgs/gcc/patches/gcc46-pr33763.patch0 b/pkgs/gcc/patches/gcc46-pr33763.patch0 new file mode 100644 index 0000000..86c8ac7 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-pr33763.patch0 @@ -0,0 +1,153 @@ +2007-11-06 Jakub Jelinek jakub@redhat.com + + PR tree-optimization/33763 + * gcc.dg/pr33763.c: New test. + * g++.dg/opt/inline13.C: New test. + +2007-11-06 Jan Hubicka jh@suse.cz + + PR tree-optimization/33763 + * tree-inline.c (expand_call_inline): Silently ignore always_inline + attribute for redefined extern inline functions. + +--- gcc/tree-inline.c.jj 2007-11-06 09:29:04.000000000 +0100 ++++ gcc/tree-inline.c 2007-11-06 16:19:12.000000000 +0100 +@@ -3157,6 +3157,12 @@ expand_call_inline (basic_block bb, gimp + goto egress; + + if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) ++ /* For extern inline functions that get redefined we always ++ silently ignored alway_inline flag. Better behaviour would ++ be to be able to keep both bodies and use extern inline body ++ for inlining, but we can't do that because frontends overwrite ++ the body. */ ++ && !cg_edge->callee->local.redefined_extern_inline + /* Avoid warnings during early inline pass. */ + && cgraph_global_info_ready) + { +--- gcc/testsuite/gcc.dg/pr33763.c.jj 2007-11-06 16:19:12.000000000 +0100 ++++ gcc/testsuite/gcc.dg/pr33763.c 2007-11-06 16:19:12.000000000 +0100 +@@ -0,0 +1,60 @@ ++/* PR tree-optimization/33763 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++typedef struct ++{ ++ void *a; ++ void *b; ++} T; ++extern void *foo (const char *, const char *); ++extern void *bar (void *, const char *, T); ++extern int baz (const char *, int); ++ ++extern inline __attribute__ ((always_inline, gnu_inline)) int ++baz (const char *x, int y) ++{ ++ return 2; ++} ++ ++int ++baz (const char *x, int y) ++{ ++ return 1; ++} ++ ++int xa, xb; ++ ++static void * ++inl (const char *x, const char *y) ++{ ++ T t = { &xa, &xb }; ++ int *f = (int *) __builtin_malloc (sizeof (int)); ++ const char *z; ++ int o = 0; ++ void *r = 0; ++ ++ for (z = y; *z; z++) ++ { ++ if (*z == 'r') ++ o |= 1; ++ if (*z == 'w') ++ o |= 2; ++ } ++ if (o == 1) ++ *f = baz (x, 0); ++ if (o == 2) ++ *f = baz (x, 1); ++ if (o == 3) ++ *f = baz (x, 2); ++ ++ if (o && *f > 0) ++ r = bar (f, "w", t); ++ return r; ++} ++ ++void * ++foo (const char *x, const char *y) ++{ ++ return inl (x, y); ++} +--- gcc/testsuite/g++.dg/opt/inline13.C.jj 2007-11-06 16:20:20.000000000 +0100 ++++ gcc/testsuite/g++.dg/opt/inline13.C 2007-11-06 16:21:30.000000000 +0100 +@@ -0,0 +1,60 @@ ++// PR tree-optimization/33763 ++// { dg-do compile } ++// { dg-options "-O2" } ++ ++typedef struct ++{ ++ void *a; ++ void *b; ++} T; ++extern void *foo (const char *, const char *); ++extern void *bar (void *, const char *, T); ++extern int baz (const char *, int); ++ ++extern inline __attribute__ ((always_inline, gnu_inline)) int ++baz (const char *x, int y) ++{ ++ return 2; ++} ++ ++int ++baz (const char *x, int y) ++{ ++ return 1; ++} ++ ++int xa, xb; ++ ++static void * ++inl (const char *x, const char *y) ++{ ++ T t = { &xa, &xb }; ++ int *f = (int *) __builtin_malloc (sizeof (int)); ++ const char *z; ++ int o = 0; ++ void *r = 0; ++ ++ for (z = y; *z; z++) ++ { ++ if (*z == 'r') ++ o |= 1; ++ if (*z == 'w') ++ o |= 2; ++ } ++ if (o == 1) ++ *f = baz (x, 0); ++ if (o == 2) ++ *f = baz (x, 1); ++ if (o == 3) ++ *f = baz (x, 2); ++ ++ if (o && *f > 0) ++ r = bar (f, "w", t); ++ return r; ++} ++ ++void * ++foo (const char *x, const char *y) ++{ ++ return inl (x, y); ++} diff --git a/pkgs/gcc/patches/gcc46-pr38757.patch0 b/pkgs/gcc/patches/gcc46-pr38757.patch0 new file mode 100644 index 0000000..5e6bf57 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-pr38757.patch0 @@ -0,0 +1,105 @@ +2009-03-18 Jakub Jelinek jakub@redhat.com + + PR debug/38757 + * langhooks.h (struct lang_hooks): Add source_language langhook. + * langhooks-def.h (LANG_HOOKS_SOURCE_LANGUAGE): Define to NULL. + (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_SOURCE_LANGUAGE. + * c-lang.c (c_source_language): New function. + (LANG_HOOKS_SOURCE_LANGUAGE): Define. + * dwarf2out.c (add_prototyped_attribute): Add DW_AT_prototype + also for DW_LANG_{C,C99,ObjC}. + (gen_compile_unit_die): Use lang_hooks.source_language () to + determine if DW_LANG_C99 or DW_LANG_C89 should be returned. + +--- gcc/langhooks.h.jj 2011-01-03 12:53:05.125745450 +0100 ++++ gcc/langhooks.h 2011-01-04 17:59:43.166744926 +0100 +@@ -467,6 +467,10 @@ struct lang_hooks + gimplification. */ + bool deep_unsharing; + ++ /* Return year of the source language standard version if the FE supports ++ multiple versions of the standard. */ ++ int (*source_language) (void); ++ + /* Whenever you add entries here, make sure you adjust langhooks-def.h + and langhooks.c accordingly. */ + }; +--- gcc/langhooks-def.h.jj 2011-01-03 12:53:05.000000000 +0100 ++++ gcc/langhooks-def.h 2011-01-04 18:00:44.858851030 +0100 +@@ -118,6 +118,7 @@ extern void lhd_omp_firstprivatize_type_ + #define LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS NULL + #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false + #define LANG_HOOKS_DEEP_UNSHARING false ++#define LANG_HOOKS_SOURCE_LANGUAGE NULL + + /* Attribute hooks. */ + #define LANG_HOOKS_ATTRIBUTE_TABLE NULL +@@ -307,7 +308,8 @@ extern void lhd_end_section (void); + LANG_HOOKS_EH_RUNTIME_TYPE, \ + LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \ + LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \ +- LANG_HOOKS_DEEP_UNSHARING \ ++ LANG_HOOKS_DEEP_UNSHARING, \ ++ LANG_HOOKS_SOURCE_LANGUAGE \ + } + + #endif /* GCC_LANG_HOOKS_DEF_H */ +--- gcc/c-lang.c.jj 2011-01-03 12:53:05.376056936 +0100 ++++ gcc/c-lang.c 2011-01-04 17:59:43.167743798 +0100 +@@ -36,6 +36,12 @@ along with GCC; see the file COPYING3. + + enum c_language_kind c_language = clk_c; + ++static int ++c_source_language (void) ++{ ++ return flag_isoc99 ? 1999 : 1989; ++} ++ + /* Lang hooks common to C and ObjC are declared in c-objc-common.h; + consequently, there should be very few hooks below. */ + +@@ -43,6 +49,8 @@ enum c_language_kind c_language = clk_c; + #define LANG_HOOKS_NAME "GNU C" + #undef LANG_HOOKS_INIT + #define LANG_HOOKS_INIT c_objc_common_init ++#undef LANG_HOOKS_SOURCE_LANGUAGE ++#define LANG_HOOKS_SOURCE_LANGUAGE c_source_language + + /* Each front end provides its own lang hook initializer. */ + struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; +--- gcc/dwarf2out.c.jj 2011-01-03 12:53:05.102056475 +0100 ++++ gcc/dwarf2out.c 2011-01-04 18:03:14.534151763 +0100 +@@ -17650,9 +17650,18 @@ add_bit_size_attribute (dw_die_ref die, + static inline void + add_prototyped_attribute (dw_die_ref die, tree func_type) + { +- if (get_AT_unsigned (comp_unit_die (), DW_AT_language) == DW_LANG_C89 +- && prototype_p (func_type)) +- add_AT_flag (die, DW_AT_prototyped, 1); ++ switch (get_AT_unsigned (comp_unit_die (), DW_AT_language)) ++ { ++ case DW_LANG_C: ++ case DW_LANG_C89: ++ case DW_LANG_C99: ++ case DW_LANG_ObjC: ++ if (prototype_p (func_type) != NULL) ++ add_AT_flag (die, DW_AT_prototyped, 1); ++ break; ++ default: ++ break; ++ } + } + + /* Add an 'abstract_origin' attribute below a given DIE. The DIE is found +@@ -19875,6 +19884,10 @@ gen_compile_unit_die (const char *filena + language = DW_LANG_ObjC; + else if (strcmp (language_string, "GNU Objective-C++") == 0) + language = DW_LANG_ObjC_plus_plus; ++ else if (strcmp (language_string, "GNU C") == 0 ++ && lang_hooks.source_language ++ && lang_hooks.source_language () >= 1999) ++ language = DW_LANG_C99; + } + + add_AT_unsigned (die, DW_AT_language, language); diff --git a/pkgs/gcc/patches/gcc46-unwind-debughook-sdt.patch0 b/pkgs/gcc/patches/gcc46-unwind-debughook-sdt.patch0 new file mode 100644 index 0000000..3b87e39 --- /dev/null +++ b/pkgs/gcc/patches/gcc46-unwind-debughook-sdt.patch0 @@ -0,0 +1,88 @@ +2011-01-14 Tom Tromey tromey@redhat.com + + * unwind-dw2.c: Include sys/sdt.h if it exists. + (_Unwind_DebugHook): Use STAP_PROBE2. + * config.in, configure: Rebuild. + * configure.ac: Check for sys/sdt.h. + +--- gcc/configure.ac ++++ gcc/configure.ac +@@ -4313,6 +4313,16 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then + [Define if your target C library provides stack protector support]) + fi + ++# Test for <sys/sdt.h> on the target. ++GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) ++AC_MSG_CHECKING(sys/sdt.h in the target C library) ++have_sys_sdt_h=no ++if test -f $target_header_dir/sys/sdt.h; then ++ AC_DEFINE(HAVE_SYS_SDT_H, 1, ++ [Define if your target C library provides sys/sdt.h]) ++fi ++AC_MSG_RESULT($have_sys_sdt_h) ++ + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 + # and later they can use TFmode. +--- gcc/unwind-dw2.c ++++ gcc/unwind-dw2.c +@@ -37,6 +37,10 @@ + #include "gthr.h" + #include "unwind-dw2.h" + ++#ifdef HAVE_SYS_SDT_H ++#include <sys/sdt.h> ++#endif ++ + #ifndef __USING_SJLJ_EXCEPTIONS__ + + #ifndef STACK_GROWS_DOWNWARD +@@ -1493,7 +1497,13 @@ static void + _Unwind_DebugHook (void *cfa __attribute__ ((__unused__)), + void *handler __attribute__ ((__unused__))) + { ++ /* We only want to use stap probes starting with v3. Earlier ++ versions added too much startup cost. */ ++#if defined (HAVE_SYS_SDT_H) && defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3 ++ STAP_PROBE2 (libgcc, unwind, cfa, handler); ++#else + asm (""); ++#endif + } + + /* Install TARGET into CURRENT so that we can return to it. This is a + +--- gcc/config.in.jj 2011-01-22 10:21:47.000000000 +0100 ++++ gcc/config.in 2011-01-22 11:10:39.000000000 +0100 +@@ -1405,6 +1407,9 @@ + #endif + + ++/* Define if your target C library provides sys/sdt.h */ ++#undef HAVE_SYS_SDT_H ++ + /* Define to 1 if you have the <sys/stat.h> header file. */ + #ifndef USED_FOR_TARGET + #undef HAVE_SYS_STAT_H +--- gcc/configure.jj 2011-01-22 10:20:55.000000000 +0100 ++++ gcc/configure 2011-01-22 11:10:34.990648298 +0100 +@@ -25757,6 +25757,19 @@ $as_echo "#define TARGET_LIBC_PROVIDES_S + + fi + ++# Test for <sys/sdt.h> on the target. ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 ++$as_echo_n "checking sys/sdt.h in the target C library... " >&6; } ++have_sys_sdt_h=no ++if test -f $target_header_dir/sys/sdt.h; then ++ ++$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 ++$as_echo "$have_sys_sdt_h" >&6; } ++ + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 + # and later they can use TFmode.
hooks/post-receive -- IPFire 3.x development tree