[cross-gcc] Initial import (#766166).

David Howells dhowells at fedoraproject.org
Thu Mar 22 22:27:15 UTC 2012


commit 5384cc5ac2ced07f3fb910c68f593a18cb46ed38
Author: David Howells <dhowells at redhat.com>
Date:   Thu Mar 22 22:26:22 2012 +0000

    Initial import (#766166).

 .gitignore                         |    1 +
 cross-gcc.spec                     |  622 ++++++++++++++++++++++++++++++++++++
 cross-intl-filename.patch          |   14 +
 gcc47-c++-builtin-redecl.patch     |  134 ++++++++
 gcc47-hack.patch                   |  102 ++++++
 gcc47-i386-libgomp.patch           |   28 ++
 gcc47-java-nomulti.patch           |   44 +++
 gcc47-libgomp-omp_h-multilib.patch |   17 +
 gcc47-libitm-fno-exceptions.patch  |   28 ++
 gcc47-libtool-no-rpath.patch       |   27 ++
 gcc47-no-add-needed.patch          |   53 +++
 gcc47-ppc32-retaddr.patch          |   86 +++++
 gcc47-ppl-0.10.patch               |  121 +++++++
 gcc47-pr33763.patch                |  153 +++++++++
 gcc47-pr38757.patch                |  105 ++++++
 gcc47-rh330771.patch               |   27 ++
 gcc47-sparc-config-detection.patch |   40 +++
 sources                            |    1 +
 18 files changed, 1603 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..62aa1a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/gcc-4.7.0-RC-20120302.tar.bz2
diff --git a/cross-gcc.spec b/cross-gcc.spec
new file mode 100644
index 0000000..45e20ae
--- /dev/null
+++ b/cross-gcc.spec
@@ -0,0 +1,622 @@
+
+%define build_all 1
+%define build_alpha %{build_all}
+%define build_arm %{build_all}
+%define build_avr32 %{build_all}
+%define build_blackfin %{build_all}
+%define build_c6x %{build_all}
+%define build_cris %{build_all}
+%define build_frv %{build_all}
+%define build_h8300 %{build_all}
+%define build_hppa64 %{build_all}
+%define build_ia64 %{build_all}
+%define build_m32r %{build_all}
+%define build_m68k %{build_all}
+%define build_mips64 %{build_all}
+%define build_mn10300 %{build_all}
+%define build_powerpc64 %{build_all}
+%define build_s390x %{build_all}
+%define build_sh4 %{build_all}
+%define build_sparc64 %{build_all}
+%define build_tile %{build_all}
+%define build_x86_64 %{build_all}
+%define build_xtensa %{build_all}
+
+# gcc considers obsolete
+%define build_score 0
+
+# gcc doesn't build
+%define build_microblaze 0
+%define build_sh64 0
+
+# 32-bit packages we don't build as we can use the 64-bit package instead
+%define build_hppa 0
+%define build_i386 0
+%define build_mips 0
+%define build_powerpc 0
+%define build_s390 0
+%define build_sh 0
+%define build_sparc 0
+
+# gcc doesn't support
+%define build_openrisc 0
+
+# not available in binutils-2.22
+%define build_unicore32 0
+
+# % global DATE 20120206
+%global DATE RC-20120302
+%global SVNREV 183946
+%global gcc_version 4.7.0
+
+# Note, gcc_release must be integer, if you want to add suffixes to
+# %{release}, append them after %{gcc_release} on Release: line.
+%global gcc_release 0.11.2
+
+Summary: Cross C compiler
+Name: cross-gcc
+Version: %{gcc_version}
+Release: %{gcc_release}%{?dist}
+License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
+Group: Development/Languages
+URL: http://gcc.gnu.org
+
+# The source for this package was pulled from upstream's vcs.  Use the
+# following commands to generate the tarball:
+# svn export svn://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_6-branch@%{SVNREV} gcc-%{version}-%{DATE}
+# tar cf - gcc-%{version}-%{DATE} | bzip2 -9 > gcc-%{version}-%{DATE}.tar.bz2
+Source0: gcc-%{version}-%{DATE}.tar.bz2
+
+Patch0: gcc47-hack.patch
+Patch1: gcc47-c++-builtin-redecl.patch
+Patch2: gcc47-java-nomulti.patch
+Patch3: gcc47-ppc32-retaddr.patch
+Patch4: gcc47-pr33763.patch
+Patch5: gcc47-rh330771.patch
+Patch6: gcc47-i386-libgomp.patch
+Patch7: gcc47-sparc-config-detection.patch
+Patch8: gcc47-libgomp-omp_h-multilib.patch
+Patch9: gcc47-libtool-no-rpath.patch
+Patch11: gcc47-pr38757.patch
+Patch13: gcc47-no-add-needed.patch
+Patch14: gcc47-ppl-0.10.patch
+Patch15: gcc47-libitm-fno-exceptions.patch
+Patch100: cross-intl-filename.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildRequires: binutils >= 2.20.51.0.2-12
+BuildRequires: zlib-devel, gettext, dejagnu, bison, flex, texinfo, sharutils
+BuildRequires: cross-binutils-common >= 2.22
+
+# Make sure pthread.h doesn't contain __thread tokens
+# Make sure glibc supports stack protector
+# Make sure glibc supports DT_GNU_HASH
+BuildRequires: glibc-devel >= 2.4.90-13
+BuildRequires: elfutils-devel >= 0.147
+BuildRequires: elfutils-libelf-devel >= 0.147
+
+%description
+Cross-build GNU C compiler collection.
+
+%package -n cross-gcc-common
+Summary: Cross-build GNU C compiler documentation and translation files
+Group: Development/Languages
+BuildArch: noarch
+
+%description -n cross-gcc-common
+Documentation, manual pages and translation files for cross-build GNU C
+compiler.
+
+This is the common part of a set of cross-build GNU C compiler packages for
+building kernels for other architectures.  No support for cross-building
+user space programs is currently supplied as that would massively multiply the
+number of packages.
+
+%define do_package() \
+%if %2 \
+%package -n gcc-%1 \
+Summary: Cross-build binary utilities for %1 \
+Group: Development/Tools \
+Requires: cross-gcc-common == %{version}-%{release} \
+BuildRequires: binutils-%1 >= 2.22 \
+Requires: binutils-%1 >= 2.22 \
+%description -n gcc-%1 \
+Cross-build GNU C compiler. \
+\
+Only building kernels is currently supported.  Support for cross-building \
+user space programs is not currently provided as that would massively multiply \
+the number of packages. \
+%endif
+
+%do_package alpha-linux-gnu	%{build_alpha}
+%do_package arm-linux-gnu	%{build_arm}
+%do_package avr32-linux-gnu	%{build_avr32}
+%do_package bfin-linux-gnu	%{build_blackfin}
+%do_package c6x-linux-gnu	%{build_c6x}
+%do_package cris-linux-gnu	%{build_cris}
+%do_package frv-linux-gnu	%{build_frv}
+%do_package h8300-linux-gnu	%{build_h8300}
+%do_package hppa-linux-gnu	%{build_hppa}
+%do_package hppa64-linux-gnu	%{build_hppa64}
+%do_package i386-linux-gnu	%{build_i386}
+%do_package ia64-linux-gnu	%{build_ia64}
+%do_package m32r-linux-gnu	%{build_m32r}
+%do_package m68k-linux-gnu	%{build_m68k}
+%do_package microblaze-linux-gnu %{build_microblaze}
+%do_package mips-linux-gnu	%{build_mips}
+%do_package mips64-linux-gnu	%{build_mips64}
+%do_package mn10300-linux-gnu	%{build_mn10300}
+%do_package openrisc-linux-gnu	%{build_openrisc}
+%do_package powerpc-linux-gnu	%{build_powerpc}
+%do_package powerpc64-linux-gnu	%{build_powerpc64}
+%do_package s390-linux-gnu	%{build_s390}
+%do_package s390x-linux-gnu	%{build_s390x}
+%do_package score-linux-gnu	%{build_score}
+%do_package sh-linux-gnu	%{build_sh}
+%do_package sh4-linux-gnu	%{build_sh4}
+%do_package sh64-linux-gnu	%{build_sh64}
+%do_package sparc-linux-gnu	%{build_sparc}
+%do_package sparc64-linux-gnu	%{build_sparc64}
+%do_package tile-linux-gnu	%{build_tile}
+%do_package unicore32-linux-gnu	%{build_unicore32}
+%do_package x86_64-linux-gnu	%{build_x86_64}
+%do_package xtensa-linux-gnu	%{build_xtensa}
+
+###############################################################################
+#
+# Preparation
+#
+###############################################################################
+%prep
+
+%define srcdir gcc-%{version}-%{DATE}
+
+%setup -q -n %{srcdir} -c
+cd %{srcdir}
+%patch0 -p0 -b .hack~
+%patch1 -p0 -b .c++-builtin-redecl~
+%patch2 -p0 -b .java-nomulti~
+%patch3 -p0 -b .ppc32-retaddr~
+%patch4 -p0 -b .pr33763~
+%patch5 -p0 -b .rh330771~
+%patch6 -p0 -b .i386-libgomp~
+%patch7 -p0 -b .sparc-config-detection~
+%patch8 -p0 -b .libgomp-omp_h-multilib~
+%patch9 -p0 -b .libtool-no-rpath~
+%patch11 -p0 -b .pr38757~
+%patch13 -p0 -b .no-add-needed~
+%if 0%{?fedora} < 15 || 0%{?rhel} < 7
+%patch14 -p0 -b .ppl-0.10~
+%endif
+%patch15 -p0 -b .libitm-fno-exceptions~
+%patch100 -p0 -b .cross-intl~
+
+sed -i -e 's/4\.7\.0/4.7.0/' gcc/BASE-VER
+echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
+
+%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7
+# Default to -gdwarf-4 -fno-debug-types-section rather than -gdwarf-2
+sed -i '/UInteger Var(dwarf_version)/s/Init(2)/Init(4)/' gcc/common.opt
+sed -i '/flag_debug_types_section/s/Init(1)/Init(0)/' gcc/common.opt
+sed -i '/dwarf_record_gcc_switches/s/Init(0)/Init(1)/' gcc/common.opt
+sed -i 's/\(may be either 2, 3 or 4; the default version is \)2\./\14./' gcc/doc/invoke.texi
+%else
+# Default to -gdwarf-3 rather than -gdwarf-2
+sed -i '/UInteger Var(dwarf_version)/s/Init(2)/Init(3)/' gcc/common.opt
+sed -i 's/\(may be either 2, 3 or 4; the default version is \)2\./\13./' gcc/doc/invoke.texi
+sed -i 's/#define[[:blank:]]*EMIT_ENTRY_VALUE[[:blank:]].*$/#define EMIT_ENTRY_VALUE 0/' gcc/{var-tracking,dwarf2out}.c
+sed -i 's/#define[[:blank:]]*EMIT_TYPED_DWARF_STACK[[:blank:]].*$/#define EMIT_TYPED_DWARF_STACK 0/' gcc/dwarf2out.c
+sed -i 's/#define[[:blank:]]*EMIT_DEBUG_MACRO[[:blank:]].*$/#define EMIT_DEBUG_MACRO 0/' gcc/dwarf2out.c
+%endif
+
+./contrib/gcc_update --touch
+
+LC_ALL=C sed -i -e 's/\xa0/ /' gcc/doc/options.texi
+
+function prep_target () {
+    target=$1
+    cond=$2
+
+    if [ $cond = 1 ]
+    then
+	echo $1 >&5
+    fi
+}
+
+cd ..
+(
+    prep_target alpha-linux-gnu		%{build_alpha}
+    prep_target arm-linux-gnu		%{build_arm}
+    prep_target avr32-linux-gnu		%{build_avr32}
+    prep_target bfin-linux-gnu		%{build_blackfin}
+    prep_target c6x-linux-gnu		%{build_c6x}
+    prep_target cris-linux-gnu		%{build_cris}
+    prep_target frv-linux-gnu		%{build_frv}
+    prep_target h8300-linux-gnu		%{build_h8300}
+    prep_target hppa-linux-gnu		%{build_hppa}
+    prep_target hppa64-linux-gnu	%{build_hppa64}
+    prep_target i386-linux-gnu		%{build_i386}
+    prep_target ia64-linux-gnu		%{build_ia64}
+    prep_target m32r-linux-gnu		%{build_m32r}
+    prep_target m68k-linux-gnu		%{build_m68k}
+    prep_target microblaze-linux-gnu	%{build_microblaze}
+    prep_target mips-linux-gnu		%{build_mips}
+    prep_target mips64-linux-gnu	%{build_mips64}
+    prep_target mn10300-linux-gnu	%{build_mn10300}
+    prep_target openrisc-linux-gnu	%{build_openrisc}
+    prep_target powerpc-linux-gnu	%{build_powerpc}
+    prep_target powerpc64-linux-gnu	%{build_powerpc64}
+    prep_target s390-linux-gnu		%{build_s390}
+    prep_target s390x-linux-gnu		%{build_s390x}
+    prep_target score-linux-gnu		%{build_score}
+    prep_target sh-linux-gnu		%{build_sh}
+    prep_target sh4-linux-gnu		%{build_sh4}
+    prep_target sh64-linux-gnu		%{build_sh64}
+    prep_target sparc-linux-gnu		%{build_sparc}
+    prep_target sparc64-linux-gnu	%{build_sparc64}
+    prep_target tile-linux-gnu		%{build_tile}
+    prep_target unicore32-linux-gnu	%{build_unicore32}
+    prep_target x86_64-linux-gnu	%{build_x86_64}
+    prep_target xtensa-linux-gnu	%{build_xtensa}
+) 5>target.list
+
+n=0
+for target in `cat target.list`
+do
+    n=1
+    break
+done
+if [ $n = 0 ]
+then
+    echo "No targets selected" >&2
+    exit 8
+fi
+
+###############################################################################
+#
+# Build
+#
+###############################################################################
+%build
+
+function config_target () {
+    arch=$1
+    cross=$arch-
+    build_dir=$arch
+
+    case $arch in
+	arm-*)		target=arm-linux-gnueabi;;
+	avr32-*)	target=avr-linux;;
+	bfin-*)		target=bfin-uclinux;;
+	c6x-*)		target=c6x-uclinux;;
+	h8300-*)	target=h8300-elf;;
+	mn10300-*)	target=am33_2.0-linux;;
+	openrisc-*)	target=or32-linux;;
+	parisc-*)	target=hppa-linux;;
+	score-*)	target=score-elf;;
+	sh64-*)		target=sh64-elf;;
+	sh-*)		target=sh-linux ;;
+	tile-*)		target=tilegx-linux;;
+	v850-*)		target=v850e-linux;;
+	x86-*)		target=x86_64-linux;;
+	*)		target=$arch;;
+    esac
+
+    echo $arch: target is $target
+    #export CFLAGS="$RPM_OPT_FLAGS"
+
+    COPT=
+    case $arch in
+	powerpc-*|powerpc64-*)
+	    COPT="--with-cpu-32=power4 --with-tune-32=power6 --with-cpu-64=power4 --with-tune-64=power6"
+	    ;;
+	s390-*)
+	    COPT="--with-arch=z9-109 --with-tune=z10 --enable-decimal-float"
+	    ;;
+	sparc-*)
+	    COPT="--with-long-double-128 --disable-linux-futex"
+	    ;;
+	tile-*)
+	    COPT="--with-arch_32=tilepro"
+	    ;;
+	x86-*)
+	    COPT="--with-arch_32=i686"
+	    ;;
+    esac
+
+    mkdir $build_dir
+    cd $build_dir
+
+    # We could optimize the cross builds size by --enable-shared but the produced
+    # binaries may be less convenient in the embedded environment.
+    AR_FOR_TARGET=%{_bindir}/$arch-ar \
+    AS_FOR_TARGET=%{_bindir}/$arch-as \
+    DLLTOOL_FOR_TARGET=%{_bindir}/$arch-dlltool \
+    LD_FOR_TARGET=%{_bindir}/$arch-ld \
+    NM_FOR_TARGET=%{_bindir}/$arch-nm \
+    OBJDUMP_FOR_TARGET=%{_bindir}/$arch-objdump \
+    RANLIB_FOR_TARGET=%{_bindir}/$arch-ranlib \
+    STRIP_FOR_TARGET=%{_bindir}/$arch-strip \
+    WINDRES_FOR_TARGET=%{_bindir}/$arch-windres \
+    WINDMC_FOR_TARGET=%{_bindir}/$arch-windmc \
+    LDFLAGS='-Wl,-z,relro ' \
+    ../%{srcdir}/configure \
+	--disable-dependency-tracking \
+	--disable-silent-rules \
+	--prefix=%{_prefix} \
+	--exec-prefix=%{_exec_prefix} \
+	--bindir=%{_bindir} \
+	--sbindir=%{_sbindir} \
+	--sysconfdir=%{_sysconfdir} \
+	--datadir=%{_datadir} \
+	--includedir=%{_includedir} \
+	--libexecdir=%{_libexecdir} \
+	--localstatedir=%{_localstatedir} \
+	--sharedstatedir=%{_sharedstatedir} \
+	--mandir=%{_mandir} \
+	--infodir=%{_infodir} \
+	--build=%{_target_platform} \
+	--host=%{_target_platform} \
+	--target=$target \
+	--enable-targets=all \
+	--program-prefix=$cross \
+	--enable-languages=c --without-headers \
+	--enable-sjlj-exceptions --with-system-libunwind \
+	--disable-nls --disable-threads --disable-shared \
+	--disable-libmudflap --disable-libssp --disable-libgomp \
+	--disable-libquadmath --disable-gold \
+	--disable-decimal-float \
+	--enable-checking=$checking \
+	--enable-gnu-unique-object \
+	--enable-linker-build-id \
+	--disable-plugin \
+	--enable-nls \
+	--with-system-zlib \
+	--with-bugurl=http://bugzilla.redhat.com/bugzilla/ \
+	--enable-obsolete
+%if 0
+	--libdir=%{_libdir} # we want stuff in /usr/lib/gcc/ not /usr/lib64/gcc
+	--with-sysroot=%{_prefix}/$target/sys-root
+%endif
+    cd ..
+}
+
+for target in `cat target.list`
+do
+    config_target $target
+done
+
+function build_target () {
+    arch=$1
+    AR_FOR_TARGET=%{_bindir}/$arch-ar \
+    AS_FOR_TARGET=%{_bindir}/$arch-as \
+    DLLTOOL_FOR_TARGET=%{_bindir}/$arch-dlltool \
+    LD_FOR_TARGET=%{_bindir}/$arch-ld \
+    NM_FOR_TARGET=%{_bindir}/$arch-nm \
+    OBJDUMP_FOR_TARGET=%{_bindir}/$arch-objdump \
+    RANLIB_FOR_TARGET=%{_bindir}/$arch-ranlib \
+    STRIP_FOR_TARGET=%{_bindir}/$arch-strip \
+    WINDRES_FOR_TARGET=%{_bindir}/$arch-windres \
+    WINDMC_FOR_TARGET=%{_bindir}/$arch-windmc \
+    make -C $target %{_smp_mflags} tooldir=%{_prefix} all-gcc
+}
+
+for target in `cat target.list`
+do
+    build_target $target
+done
+
+# for documentation purposes only
+mkdir stuff
+cd stuff
+
+../%{srcdir}/configure \
+    --disable-dependency-tracking \
+    --disable-silent-rules \
+    --prefix=%{_prefix} \
+    --exec-prefix=%{_exec_prefix} \
+    --bindir=%{_bindir} \
+    --sbindir=%{_sbindir} \
+    --sysconfdir=%{_sysconfdir} \
+    --datadir=%{_datadir} \
+    --includedir=%{_includedir} \
+    --libdir=%{_libdir} \
+    --libexecdir=%{_libexecdir} \
+    --localstatedir=%{_localstatedir} \
+    --sharedstatedir=%{_sharedstatedir} \
+    --mandir=%{_mandir} \
+    --infodir=%{_infodir} \
+    --build=%{_target_platform} \
+    --host=%{_target_platform} \
+    --program-prefix=cross- \
+    --enable-languages=c --without-headers \
+    --enable-sjlj-exceptions --with-system-libunwind \
+    --disable-nls --disable-threads --disable-shared \
+    --disable-libmudflap --disable-libssp --disable-libgomp \
+    --disable-libquadmath --disable-gold \
+    --disable-decimal-float \
+    --enable-checking=$checking \
+    --enable-gnu-unique-object \
+    --enable-linker-build-id \
+    --enable-plugin \
+    --enable-nls \
+    --with-system-zlib \
+    --with-bugurl=http://bugzilla.redhat.com/bugzilla/
+
+cd ..
+
+###############################################################################
+#
+# Installation
+#
+###############################################################################
+%install
+rm -rf %{buildroot}
+
+function install_bin () {
+    arch=$1
+    make -C $arch DESTDIR=%{buildroot} install-gcc
+}
+
+for target in `cat target.list`
+do
+    install_bin $target
+done
+
+# For cross-gcc we drop the documentation.
+rm -rf %{buildroot}%{_infodir}
+
+# Remove binaries we will not be including, so that they don't end up in
+# gcc-debuginfo
+FULLPATH=%{buildroot}%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}
+
+rm -f %{buildroot}%{_libdir}/{libffi*,libiberty.a}
+rm -f %{buildroot}%{_libexecdir}/gcc/*/%{gcc_version}/install-tools/{mkheaders,fixincl}
+rm -f %{buildroot}%{_prefix}/bin/*-gcc-%{version} || :
+rm -f %{buildroot}%{_bindir}/*-ar || :
+rm -f %{buildroot}%{_bindir}/*-nm || :
+rm -f %{buildroot}%{_bindir}/*-ranlib || :
+rmdir  %{buildroot}%{_includedir}
+
+find %{buildroot}%{_datadir} -name gcc.mo |
+while read x
+do
+    y=`dirname $x`
+    mv $x $y/cross-gcc.mo
+done
+
+%find_lang cross-gcc
+
+gzip %{buildroot}%{_mandir}/man1/*.1
+rm %{buildroot}%{_mandir}/man7/*.7
+rmdir %{buildroot}%{_mandir}/man7
+
+# All the installed manual pages and translation files for each program are the
+# same, so symlink them to the common package
+cd %{buildroot}%{_mandir}/man1
+for i in cross-cpp.1.gz cross-gcc.1.gz cross-gcov.1.gz
+do
+    j=${i#cross-}
+
+    for k in *-$j
+    do
+	if [ $k != $i ]
+	then
+	    mv $k $i
+	    ln -s $i $k
+	fi
+    done
+done
+cd -
+
+function install_lang () {
+    arch=$1
+    cpu=${arch%%%%-*}
+
+    (
+	echo '%%defattr(-,root,root,-)'
+	echo '%{_bindir}/'$arch'-*'
+	echo '%{_mandir}/man1/'$arch'-*'
+
+	case $cpu in
+	    avr32)		target_cpu=avr;;
+	    bfin)		target_cpu=bfin;;
+	    h8300)		target_cpu=h8300;;
+	    mn10300)		target_cpu=am33_2.0;;
+	    openrisc)		target_cpu=openrisc;;
+	    parisc)		target_cpu=hppa;;
+	    score)		target_cpu=score;;
+	    tile)		target_cpu=tilegx;;
+	    v850)		target_cpu=v850e;;
+	    x86)		target_cpu=x86_64;;
+	    *)			target_cpu=$cpu;;
+	esac
+	echo '/usr/lib/gcc/'$target_cpu'-*/'
+	echo '%{_libexecdir}/gcc/'$target_cpu'-*/'
+
+    ) >files.$arch
+}
+
+for target in `cat target.list`
+do
+    install_lang $target
+done
+
+%define __ar_no_strip $RPM_BUILD_DIR/%{srcdir}/ar-no-strip
+cat >%{__ar_no_strip} <<EOF
+#!/bin/bash 
+f=\$2
+if [ \${f##*/} = libgcc.a -o \${f##*/} = libgcov.a ]
+then
+	:
+else
+	%{__strip} \$*
+fi
+EOF
+chmod +x %{__ar_no_strip}
+%undefine __strip
+%define __strip %{__ar_no_strip}
+
+###############################################################################
+#
+# Cleanup
+#
+###############################################################################
+%clean
+rm -rf %{buildroot}
+
+###############################################################################
+#
+# Filesets
+#
+###############################################################################
+%files -n cross-gcc-common -f cross-gcc.lang
+%doc %{srcdir}/COPYING*
+%doc %{srcdir}/README
+%{_mandir}/man1/cross-*
+
+%define do_files() \
+%if %2 \
+%files -n gcc-%1 -f files.%1 \
+%endif
+
+%do_files alpha-linux-gnu	%{build_alpha}
+%do_files arm-linux-gnu		%{build_arm}
+%do_files avr32-linux-gnu	%{build_avr32}
+%do_files bfin-linux-gnu	%{build_blackfin}
+%do_files c6x-linux-gnu		%{build_c6x}
+%do_files cris-linux-gnu	%{build_cris}
+%do_files frv-linux-gnu		%{build_frv}
+%do_files h8300-linux-gnu	%{build_h8300}
+%do_files hppa-linux-gnu	%{build_hppa}
+%do_files hppa64-linux-gnu	%{build_hppa64}
+%do_files i386-linux-gnu	%{build_i386}
+%do_files ia64-linux-gnu	%{build_ia64}
+%do_files m32r-linux-gnu	%{build_m32r}
+%do_files m68k-linux-gnu	%{build_m68k}
+%do_files microblaze-linux-gnu	%{build_microblaze}
+%do_files mips-linux-gnu	%{build_mips}
+%do_files mips64-linux-gnu	%{build_mips64}
+%do_files mn10300-linux-gnu	%{build_mn10300}
+%do_files openrisc-linux-gnu	%{build_openrisc}
+%do_files powerpc-linux-gnu	%{build_powerpc}
+%do_files powerpc64-linux-gnu	%{build_powerpc64}
+%do_files s390-linux-gnu	%{build_s390}
+%do_files s390x-linux-gnu	%{build_s390x}
+%do_files score-linux-gnu	%{build_score}
+%do_files sh-linux-gnu		%{build_sh}
+%do_files sh4-linux-gnu		%{build_sh4}
+%do_files sh64-linux-gnu	%{build_sh64}
+%do_files sparc-linux-gnu	%{build_sparc}
+%do_files sparc64-linux-gnu	%{build_sparc64}
+%do_files tile-linux-gnu	%{build_tile}
+%do_files unicore32-linux-gnu	%{build_unicore32}
+%do_files x86_64-linux-gnu	%{build_x86_64}
+%do_files xtensa-linux-gnu	%{build_xtensa}
+
+%changelog
+* Thu Mar 22 2012 David Howells <dhowells at redhat.com> - 4.7.0-0.11.2
+- Initial import of cross-binutils [BZ 766166].
+
+* Mon Oct 31 2011 Rex Dieter <rdieter at fedoraproject.org> 4.6.2-1.fc17.1
+- rebuild (gmp)
diff --git a/cross-intl-filename.patch b/cross-intl-filename.patch
new file mode 100644
index 0000000..b24f547
--- /dev/null
+++ b/cross-intl-filename.patch
@@ -0,0 +1,14 @@
+diff -uNr --exclude '*~' gcc-4.7.0-RC-20120302/gcc/intl.c gcc-4.7.0-RC-20120302-old/gcc/intl.c
+--- gcc/intl.c	2010-12-01 17:29:12.000000000 +0000
++++ gcc/intl.c	2012-03-15 14:49:19.709968148 +0000
+@@ -56,8 +56,8 @@
+   setlocale (LC_ALL, "");
+ #endif
+ 
+-  (void) bindtextdomain ("gcc", LOCALEDIR);
+-  (void) textdomain ("gcc");
++  (void) bindtextdomain ("cross-gcc", LOCALEDIR);
++  (void) textdomain ("cross-gcc");
+ 
+   /* Opening quotation mark.  */
+   open_quote = _("`");
diff --git a/gcc47-c++-builtin-redecl.patch b/gcc47-c++-builtin-redecl.patch
new file mode 100644
index 0000000..fa30745
--- /dev/null
+++ b/gcc47-c++-builtin-redecl.patch
@@ -0,0 +1,134 @@
+2007-10-02  Jakub Jelinek  <jakub at 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-85.c: New test.
+	* g++.dg/ext/builtin30.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
+@@ -2137,39 +2137,37 @@ 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 (DECL_BUILT_IN_CLASS (newdecl) == BUILT_IN_NORMAL)
++	    {
++	      enum built_in_function fncode = DECL_FUNCTION_CODE (newdecl);
++	      switch (fncode)
++		{
++		  /* If a compatible prototype of these builtin functions
++		     is seen, assume the runtime implements it with the
++		     expected semantics.  */
++		case BUILT_IN_STPCPY:
++		  if (builtin_decl_explicit_p (fncode))
++		    set_builtin_decl_implicit_p (fncode, true);
++		  break;
++		default:
++		  break;
++		}
++	    }
++	}
+       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);
+-	      if (DECL_BUILT_IN_CLASS (newdecl) == BUILT_IN_NORMAL)
+-		{
+-		  enum built_in_function fncode = DECL_FUNCTION_CODE (newdecl);
+-		  switch (fncode)
+-		    {
+-		      /* If a compatible prototype of these builtin functions
+-			 is seen, assume the runtime implements it with the
+-			 expected semantics.  */
+-		    case BUILT_IN_STPCPY:
+-		      if (builtin_decl_explicit_p (fncode))
+-			set_builtin_decl_implicit_p (fncode, true);
+-		      break;
+-		    default:
+-		      break;
+-		    }
+-		}
+-	    }
+-
+ 	  DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
+ 	  /* Don't clear out the arguments if we're just redeclaring a
+ 	     function.  */
+--- gcc/testsuite/gcc.dg/builtins-85.c.jj	2007-10-02 11:23:51.000000000 +0200
++++ gcc/testsuite/gcc.dg/builtins-85.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/builtin30.C.jj	2007-10-02 11:19:45.000000000 +0200
++++ gcc/testsuite/g++.dg/ext/builtin30.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/gcc47-hack.patch b/gcc47-hack.patch
new file mode 100644
index 0000000..1903e95
--- /dev/null
+++ b/gcc47-hack.patch
@@ -0,0 +1,102 @@
+--- libada/Makefile.in.jj	2009-01-14 12:07:35.000000000 +0100
++++ libada/Makefile.in	2009-01-15 14:25:33.000000000 +0100
+@@ -66,18 +66,40 @@ libsubdir := $(libdir)/gcc/$(target_nonc
+ ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
+ ADA_RTS_SUBDIR=./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=$(LDFLAGS) $(DEFAULTMULTIFLAGS)" \
+         "LN_S=$(LN_S)" \
+         "SHELL=$(SHELL)" \
+-        "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
+-        "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
+-        "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
++        "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
++        "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
++        "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS) $(DEFAULTMULTIFLAGS)" \
+         "PICFLAG_FOR_TARGET=$(PICFLAG)" \
+         "THREAD_KIND=$(THREAD_KIND)" \
+         "TRACE=$(TRACE)" \
+@@ -88,7 +110,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)"
++        "CFLAGS=$(CFLAGS) $(DEFAULTMULTIFLAGS)"
+ 
+ # Rules to build gnatlib.
+ .PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-zcx gnatlib-shared osconstool
+--- gcc/ada/sem_util.adb	(revision 161677)
++++ gcc/ada/sem_util.adb	(working copy)
+@@ -5487,7 +5487,7 @@ package body Sem_Util is
+             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; \
+- at USE_LIBGCJ_BC_TRUE@	mv $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so.1.0.0 $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
++ at USE_LIBGCJ_BC_TRUE@	$(INSTALL) $(INSTALL_STRIP_FLAG) $(here)/.libs/libgcj_bc.so $(DESTDIR)$(toolexeclibdir)/libgcj_bc.so; \
++ at 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/gcc47-i386-libgomp.patch b/gcc47-i386-libgomp.patch
new file mode 100644
index 0000000..f6a6b91
--- /dev/null
+++ b/gcc47-i386-libgomp.patch
@@ -0,0 +1,28 @@
+--- libgomp/configure.tgt.jj	2008-01-10 20:53:48.000000000 +0100
++++ libgomp/configure.tgt	2008-03-27 12:44:51.000000000 +0100
+@@ -44,14 +44,14 @@ if test $enable_linux_futex = yes; then
+ 	;;
+ 
+     # Note that bare i386 is not included here.  We need cmpxchg.
+-    i[456]86-*-linux*)
++    i[456]86-*-linux*)
+ 	config_path="linux/x86 linux posix"
+ 	case " ${CC} ${CFLAGS} " in
+ 	  *" -m64 "*)
+ 	    ;;
+ 	  *)
+ 	    if test -z "$with_arch"; then
+-	      XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
++	      XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
+ 	    fi
+ 	esac
+ 	;;
+@@ -63,7 +63,7 @@ if test $enable_linux_futex = yes; then
+ 	config_path="linux/x86 linux posix"
+ 	case " ${CC} ${CFLAGS} " in
+ 	  *" -m32 "*)
+-	    XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
++	    XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
+ 	    ;;
+ 	esac
+ 	;;
diff --git a/gcc47-java-nomulti.patch b/gcc47-java-nomulti.patch
new file mode 100644
index 0000000..17334aa
--- /dev/null
+++ b/gcc47-java-nomulti.patch
@@ -0,0 +1,44 @@
+--- libjava/configure.ac.jj	2007-12-07 17:55:50.000000000 +0100
++++ libjava/configure.ac	2007-12-07 18:36:56.000000000 +0100
+@@ -82,6 +82,13 @@ AC_ARG_ENABLE(java-maintainer-mode,
+ 	[allow rebuilding of .class and .h files]))
+ AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
+ 
++AC_ARG_ENABLE(libjava-multilib,
++	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
++if test "$enable_libjava_multilib" = no; then
++  multilib=no
++  ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ GCC_NO_EXECUTABLES
+ 
+--- libjava/configure.jj	2007-12-07 17:55:50.000000000 +0100
++++ libjava/configure	2007-12-07 18:39:58.000000000 +0100
+@@ -1021,6 +1021,8 @@ Optional Features:
+                           default=yes
+   --enable-java-maintainer-mode
+                           allow rebuilding of .class and .h files
++  --enable-libjava-multilib
++                          build libjava as multilib
+   --disable-dependency-tracking  speeds up one-time build
+   --enable-dependency-tracking   do not reject slow dependency extractors
+   --enable-maintainer-mode  enable make rules and dependencies not useful
+@@ -1973,6 +1975,16 @@ else
+ fi
+ 
+ 
++# Check whether --enable-libjava-multilib was given.
++if test "${enable_libjava_multilib+set}" = set; then
++  enableval=$enable_libjava_multilib;
++fi
++
++if test "$enable_libjava_multilib" = no; then
++  multilib=no
++  ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ 
+ 
diff --git a/gcc47-libgomp-omp_h-multilib.patch b/gcc47-libgomp-omp_h-multilib.patch
new file mode 100644
index 0000000..d0e98d1
--- /dev/null
+++ b/gcc47-libgomp-omp_h-multilib.patch
@@ -0,0 +1,17 @@
+2008-06-09  Jakub Jelinek  <jakub at 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/gcc47-libitm-fno-exceptions.patch b/gcc47-libitm-fno-exceptions.patch
new file mode 100644
index 0000000..8b9d590
--- /dev/null
+++ b/gcc47-libitm-fno-exceptions.patch
@@ -0,0 +1,28 @@
+2011-12-22  Jakub Jelinek  <jakub at redhat.com>
+
+	* Makefile.am (beginend.lo): Append -fno-exceptions to
+	CXXFLAGS.
+	* Makefile.in: Regenerated.
+
+--- libitm/Makefile.am.jj	2011-12-20 13:47:57.000000000 +0100
++++ libitm/Makefile.am	2011-12-22 09:14:06.663469165 +0100
+@@ -72,6 +72,8 @@ endif
+ if ARCH_X86_AVX
+ x86_avx.lo : XCFLAGS += -mavx
+ endif
++beginend.lo : CXXCOMPILE += -fno-exceptions
++beginend.lo : LTCXXCOMPILE += -fno-exceptions
+ 
+ if ARCH_FUTEX
+ libitm_la_SOURCES += futex.cc
+--- libitm/Makefile.in.jj	2011-12-20 13:47:57.000000000 +0100
++++ libitm/Makefile.in	2011-12-22 09:14:29.466329944 +0100
+@@ -1278,6 +1278,8 @@ vpath % $(strip $(search_path))
+ @LIBITM_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBITM_BUILD_VERSIONED_SHLIB_TRUE@	 > $@ || (rm -f $@ ; exit 1)
+ @ARCH_X86_TRUE at x86_sse.lo : XCFLAGS += -msse
+ @ARCH_X86_AVX_TRUE at x86_avx.lo : XCFLAGS += -mavx
++beginend.lo : CXXCOMPILE += -fno-exceptions
++beginend.lo : LTCXXCOMPILE += -fno-exceptions
+ 
+ all-local: $(STAMP_GENINSRC)
+ 
diff --git a/gcc47-libtool-no-rpath.patch b/gcc47-libtool-no-rpath.patch
new file mode 100644
index 0000000..466c661
--- /dev/null
+++ b/gcc47-libtool-no-rpath.patch
@@ -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/gcc47-no-add-needed.patch b/gcc47-no-add-needed.patch
new file mode 100644
index 0000000..e8ddf1a
--- /dev/null
+++ b/gcc47-no-add-needed.patch
@@ -0,0 +1,53 @@
+2010-02-08  Roland McGrath  <roland at 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.
+	* config/freebsd-spec.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
+@@ -77,7 +77,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 "
+ 
+ /* Put all *tf routines in libgcc.  */
+ #undef LIBGCC2_HAS_TF_MODE
+--- 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
+@@ -820,7 +820,7 @@ extern int fixuplabelno;
+   -dynamic-linker " GNU_USER_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/gcc47-ppc32-retaddr.patch b/gcc47-ppc32-retaddr.patch
new file mode 100644
index 0000000..e9ae1bc
--- /dev/null
+++ b/gcc47-ppc32-retaddr.patch
@@ -0,0 +1,86 @@
+2005-11-28  Jakub Jelinek  <jakub at redhat.com>
+
+	* config/rs6000/rs6000.c (rs6000_return_addr): If COUNT == 0,
+	read word RETURN_ADDRESS_OFFSET bytes above arg_pointer_rtx
+	instead of doing an extran indirection from frame_pointer_rtx.
+
+	* gcc.dg/20051128-1.c: New test.
+
+--- gcc/config/rs6000/rs6000.c.jj	2005-11-26 14:38:01.000000000 +0100
++++ gcc/config/rs6000/rs6000.c	2005-11-28 20:32:18.000000000 +0100
+@@ -13166,17 +13166,22 @@ rs6000_return_addr (int count, rtx frame
+      don't try to be too clever here.  */
+   if (count != 0 || (DEFAULT_ABI != ABI_AIX && flag_pic))
+     {
++      rtx x;
+       cfun->machine->ra_needs_full_frame = 1;
+ 
+-      return
+-	gen_rtx_MEM
+-	  (Pmode,
+-	   memory_address
+-	   (Pmode,
+-	    plus_constant (copy_to_reg
+-			   (gen_rtx_MEM (Pmode,
+-					 memory_address (Pmode, frame))),
+-			   RETURN_ADDRESS_OFFSET)));
++      if (count == 0)
++	{
++	  gcc_assert (frame == frame_pointer_rtx);
++	  x = arg_pointer_rtx;
++	}
++      else
++	{
++	  x = memory_address (Pmode, frame);
++	  x = copy_to_reg (gen_rtx_MEM (Pmode, x));
++	}
++
++      x = plus_constant (x, RETURN_ADDRESS_OFFSET);
++      return gen_rtx_MEM (Pmode, memory_address (Pmode, x));
+     }
+ 
+   cfun->machine->ra_need_lr = 1;
+--- gcc/testsuite/gcc.dg/20051128-1.c.jj	2005-10-10 11:21:41.096999000 +0200
++++ gcc/testsuite/gcc.dg/20051128-1.c	2005-11-28 12:30:57.000000000 +0100
+@@ -0,0 +1,41 @@
++/* { dg-do run } */
++/* { dg-options "-O2 -fpic" } */
++
++extern void exit (int);
++extern void abort (void);
++
++int b;
++
++struct A
++{
++  void *pad[147];
++  void *ra, *h;
++  long o;
++};
++
++void
++__attribute__((noinline))
++foo (struct A *a, void *x)
++{
++  __builtin_memset (a, 0, sizeof (a));
++  if (!b)
++    exit (0);
++}
++
++void
++__attribute__((noinline))
++bar (void)
++{
++  struct A a;
++
++  __builtin_unwind_init ();
++  foo (&a, __builtin_return_address (0));
++}
++
++int
++main (void)
++{
++  bar ();
++  abort ();
++  return 0;
++}
diff --git a/gcc47-ppl-0.10.patch b/gcc47-ppl-0.10.patch
new file mode 100644
index 0000000..d43f34f
--- /dev/null
+++ b/gcc47-ppl-0.10.patch
@@ -0,0 +1,121 @@
+2011-01-28  Jakub Jelinek  <jakub at redhat.com>
+
+	Revert:
+	2011-01-25  Sebastian Pop  <sebastian.pop at amd.com>
+
+	* configure: Regenerated.
+	* configure.ac: Check for version 0.11 (or later revision) of PPL.
+gcc/
+	* doc/install.texi: Update the expected version number of PPL to 0.11.
+	* graphite-ppl.c (ppl_powerset_is_empty): Remove now dead code under
+	#if PPL_VERSION_MINOR < 11.
+
+--- gcc/doc/install.texi	(revision 169207)
++++ gcc/doc/install.texi	(revision 169206)
+@@ -332,7 +332,7 @@ and @option{--with-mpc-include}.  Altern
+ distribution is found in a subdirectory of your GCC sources named
+ @file{mpc}, it will be built together with GCC at .
+ 
+- at item Parma Polyhedra Library (PPL) version 0.11
++ at 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/}.
+--- gcc/graphite-ppl.c	(revision 169207)
++++ gcc/graphite-ppl.c	(revision 169206)
+@@ -521,6 +521,15 @@ debug_gmp_value (mpz_t val)
+ 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_powerset_is_empty (ppl_Pointset_Powe
+   ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (end);
+ 
+   return !has_integer_solutions;
++#endif
+ }
+ 
+ #endif
+--- configure.ac	(revision 169207)
++++ configure.ac	(revision 169206)
+@@ -1688,9 +1688,9 @@ if test "x$with_ppl" != xno; then
+   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 ])
+--- configure	(revision 169207)
++++ configure	(revision 169206)
+@@ -5775,8 +5775,8 @@ fi
+   if test "$enable_ppl_version_check" != no; then
+     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 "$as_me:${as_lineno-$LINENO}: checking for version 0.10 (revision 0 or later) of PPL" >&5
++$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 @@ int
+ main ()
+ {
+ 
+-    #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 11
++    #if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 10
+     choke me
+     #endif
+ 
+--- gcc/testsuite/gcc.dg/graphite/interchange-11.c.jj	2011-01-28 09:38:11.000000000 +0100
++++ gcc/testsuite/gcc.dg/graphite/interchange-11.c	2011-01-28 11:06:56.461429848 +0100
+@@ -46,5 +46,5 @@ main (void)
+   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" } } */
+--- gcc/testsuite/gcc.dg/graphite/interchange-13.c.jj	2011-01-28 09:38:12.000000000 +0100
++++ gcc/testsuite/gcc.dg/graphite/interchange-13.c	2011-01-28 11:07:08.182429223 +0100
+@@ -50,5 +50,5 @@ main (void)
+ }
+ 
+ 
+-/* { 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" } } */
+--- gcc/testsuite/gcc.dg/graphite/interchange-1.c.jj	2011-01-28 09:38:13.000000000 +0100
++++ gcc/testsuite/gcc.dg/graphite/interchange-1.c	2011-01-28 11:06:42.160429193 +0100
+@@ -49,5 +49,5 @@ main (void)
+   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" } } */
+--- gcc/testsuite/gfortran.dg/graphite/interchange-3.f90.jj	2011-01-28 09:38:05.000000000 +0100
++++ gcc/testsuite/gfortran.dg/graphite/interchange-3.f90	2011-01-28 11:07:46.313420441 +0100
+@@ -24,5 +24,5 @@ Program FOO
+ 
+ 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/gcc47-pr33763.patch b/gcc47-pr33763.patch
new file mode 100644
index 0000000..0cf0723
--- /dev/null
+++ b/gcc47-pr33763.patch
@@ -0,0 +1,153 @@
+2007-11-06  Jakub Jelinek  <jakub at 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 at 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
+@@ -3817,6 +3817,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 always_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
+ 	  /* PR 20090218-1_0.c. Body can be provided by another module. */
+--- 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/gcc47-pr38757.patch b/gcc47-pr38757.patch
new file mode 100644
index 0000000..5fd23ea
--- /dev/null
+++ b/gcc47-pr38757.patch
@@ -0,0 +1,105 @@
+2009-03-18  Jakub Jelinek  <jakub at 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.  */
+ 
+@@ -45,6 +51,8 @@ enum c_language_kind c_language = clk_c;
+ #define LANG_HOOKS_INIT c_objc_common_init
+ #undef LANG_HOOKS_INIT_TS
+ #define LANG_HOOKS_INIT_TS c_common_init_ts
++#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
+@@ -15793,9 +15793,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))
++	add_AT_flag (die, DW_AT_prototyped, 1);
++      break;
++    default:
++      break;
++    }
+ }
+ 
+ /* Add an 'abstract_origin' attribute below a given DIE.  The DIE is found
+@@ -18438,6 +18447,10 @@ gen_compile_unit_die (const char *filena
+ 	  if (strcmp (language_string, "GNU Go") == 0)
+ 	    language = DW_LANG_Go;
+ 	}
++      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/gcc47-rh330771.patch b/gcc47-rh330771.patch
new file mode 100644
index 0000000..102730f
--- /dev/null
+++ b/gcc47-rh330771.patch
@@ -0,0 +1,27 @@
+2007-10-16  Jakub Jelinek  <jakub at redhat.com>
+
+	* Makefile.am (libgcj_tools_la_LIBADD): Add.
+	* Makefile.in: Regenerated.
+
+--- libjava/Makefile.am.jj	2009-05-06 08:14:50.000000000 +0200
++++ libjava/Makefile.am	2009-05-06 10:26:43.000000000 +0200
+@@ -550,7 +550,7 @@ libgcj_tools_la_LDFLAGS = -rpath $(toole
+  $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) \
+  $(LIBJAVA_LDFLAGS_LIBMATH)
+ 
+-libgcj_tools_la_LIBADD = libgcj.la
++libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la
+ libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \
+  $(libgcj_tools_la_version_dep)
+ if BUILD_SUBLIBS
+--- libjava/Makefile.in.jj	2009-05-06 08:14:49.000000000 +0200
++++ libjava/Makefile.in	2009-05-06 10:27:18.000000000 +0200
+@@ -1110,7 +1110,7 @@ libgcj_tools_la_LDFLAGS = -rpath $(toole
+  $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF) \
+  $(LIBJAVA_LDFLAGS_LIBMATH)
+ 
+-libgcj_tools_la_LIBADD = libgcj.la
++libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la
+ libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec \
+ 	$(libgcj_tools_la_version_dep) $(am__append_19)
+ libgcj_tools_la_LINK = $(LIBLINK) $(libgcj_tools_la_LDFLAGS) \
diff --git a/gcc47-sparc-config-detection.patch b/gcc47-sparc-config-detection.patch
new file mode 100644
index 0000000..ce2acc7
--- /dev/null
+++ b/gcc47-sparc-config-detection.patch
@@ -0,0 +1,40 @@
+--- gcc/config.gcc.jj	2008-04-24 15:42:46.000000000 -0500
++++ gcc/config.gcc	2008-04-24 15:44:51.000000000 -0500
+@@ -2356,7 +2356,7 @@ sparc-*-rtems*)
+ 	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
+ 	tmake_file="sparc/t-sparc sparc/t-elf t-rtems"
+ 	;;
+-sparc-*-linux*)
++sparc-*-linux* | sparcv9-*-linux*)
+ 	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
+ 	extra_options="${extra_options} sparc/long-double-switch.opt"
+ 	case ${target} in
+@@ -2409,7 +2409,7 @@ sparc64-*-rtems*)
+ 	extra_options="${extra_options}"
+ 	tmake_file="${tmake_file} sparc/t-sparc t-rtems"
+ 	;;
+-sparc64-*-linux*)
++sparc64*-*-linux*)
+ 	tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h sparc/tso.h"
+ 	extra_options="${extra_options} sparc/long-double-switch.opt"
+ 	tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
+--- libgcc/config.host.jj	2008-04-24 15:46:19.000000000 -0500
++++ libgcc/config.host	2008-04-24 15:46:49.000000000 -0500
+@@ -1002,7 +1002,7 @@ sparc-*-elf*)
+ 	tmake_file="${tmake_file} t-fdpbit t-crtfm"
+ 	extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
+ 	;;
+-sparc-*-linux*)		# SPARC's running GNU/Linux, libc6
++sparc-*-linux* | sparcv9-*-linux*)		# SPARC's running GNU/Linux, libc6
+ 	tmake_file="${tmake_file} t-crtfm"
+ 	if test "${host_address}" = 64; then
+ 		tmake_file="$tmake_file sparc/t-linux64"
+@@ -1050,7 +1050,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*
+ 	tmake_file="$tmake_file t-crtfm"
+ 	extra_parts="$extra_parts crtfastmath.o"
+ 	;;
+-sparc64-*-linux*)		# 64-bit SPARC's running GNU/Linux
++sparc64*-*-linux*)		# 64-bit SPARC's running GNU/Linux
+ 	extra_parts="$extra_parts crtfastmath.o"
+ 	tmake_file="${tmake_file} t-crtfm sparc/t-linux"
+ 	if test "${host_address}" = 64; then
diff --git a/sources b/sources
index e69de29..3969550 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+4e179c2f1a50664abf57764430edb48f  gcc-4.7.0-RC-20120302.tar.bz2


More information about the scm-commits mailing list