Mailinglist Archive: opensuse-commit (1093 mails)

< Previous Next >
commit gcc45 for openSUSE:Factory
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Thu, 04 Mar 2010 16:07:21 +0100
  • Message-id: <20100304150721.31C60202AC@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package gcc45 for openSUSE:Factory
checked in at Thu Mar 4 16:07:21 CET 2010.



--------
New Changes file:

--- /dev/null 2009-09-30 08:50:26.000000000 +0200
+++ /mounts/work_src_done/STABLE/gcc45/cross-avr-gcc45.changes 2010-03-02
17:56:13.000000000 +0100
@@ -0,0 +1,256 @@
+-------------------------------------------------------------------
+Tue Mar 2 17:50:14 CET 2010 - rguenther@xxxxxxxxxx
+
+- Update to SVN trunk head (r157166).
+
+-------------------------------------------------------------------
+Fri Feb 26 16:30:03 CET 2010 - rguenther@xxxxxxxxxx
+
+- Split gcc45-testresults build to a separate spec file.
+- Apply the LFS patch again.
+
+-------------------------------------------------------------------
+Wed Feb 24 14:06:57 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r157039).
+
+-------------------------------------------------------------------
+Fri Feb 19 17:11:51 CET 2010 - rguenther@xxxxxxx
+
+- Enable icecream crosses.
+- Enable cross compilers and version them all properly.
+
+-------------------------------------------------------------------
+Thu Feb 18 11:07:59 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156860).
+
+-------------------------------------------------------------------
+Fri Feb 12 15:06:35 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156733).
+- Split libffi45 build to a separate spec file.
+
+-------------------------------------------------------------------
+Wed Feb 10 18:08:57 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156666).
+
+-------------------------------------------------------------------
+Tue Feb 9 23:27:39 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Also add zlib to BuildRequires - lto_compress depends on it
+
+-------------------------------------------------------------------
+Tue Feb 9 19:02:12 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Add missing mpc-devel to cross.spec.in's BuildRequires
+ (GCC really wants this)
+- Add cloog/ppl to cross.spec.in BuildRequires
+ (Nice to have)
+
+-------------------------------------------------------------------
+Tue Feb 9 12:38:43 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156628).
+
+-------------------------------------------------------------------
+Tue Feb 9 01:33:51 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Adjust baselibs.conf (4.4 -> 4.5)
+
+-------------------------------------------------------------------
+Sun Feb 7 17:28:50 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Add SPARC support to specfile
+
+-------------------------------------------------------------------
+Fri Feb 5 11:20:25 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156514).
+- Add patch for PR42762.
+
+-------------------------------------------------------------------
+Wed Feb 3 16:56:11 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156468).
+
+-------------------------------------------------------------------
+Fri Jan 29 13:31:49 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156346).
+
+-------------------------------------------------------------------
+Thu Jan 21 13:52:45 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156152).
+- Adjust textdomain.
+- Adjust libjava version.
+- Adjust ada manual version.
+- Fix libffi-devel provides and obsoletes.
+
+-------------------------------------------------------------------
+Fri Jan 15 12:28:55 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155935).
+- Revert patch for PR42634.
+- Add patches for PR42248 and PR42739.
+
+-------------------------------------------------------------------
+Tue Jan 12 17:16:26 CET 2010 - rguenther@xxxxxxx
+
+- Fixup and re-enable patch for stack-protector support on ia64.
+
+-------------------------------------------------------------------
+Mon Jan 11 13:52:12 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155809).
+
+-------------------------------------------------------------------
+Wed Jan 6 19:03:41 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155679).
+- Update ecj.jar.
+
+-------------------------------------------------------------------
+Wed Dec 18 12:53:27 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155344).
+
+-------------------------------------------------------------------
+Mon Dec 14 00:37:58 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155199).
+
+-------------------------------------------------------------------
+Thu Nov 26 17:30:05 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r154675).
+
+-------------------------------------------------------------------
+Thu Nov 19 18:45:55 CET 2009 - rguenther@xxxxxxx
+
+- Enable decimal floating point support on s390(x).
+
+-------------------------------------------------------------------
+Fri Nov 18 17:05:30 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r154292).
+- Re-diff patches to avoid fuzz.
+- Add defaults.spec that adds a rpath by default for the optional compiler.
+
+-------------------------------------------------------------------
+Tue Nov 17 16:10:47 CET 2009 - rguenther@xxxxxxx
+
+- For optional compilers do not build libgcj.spec and run the
+ testsuite from within gcc.spec.
+
+-------------------------------------------------------------------
+Fri Nov 6 11:25:03 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153963).
+
+-------------------------------------------------------------------
+Wed Nov 4 21:06:32 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153912).
+- Build with release checking.
+
+-------------------------------------------------------------------
+Tue Nov 3 12:06:26 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153845).
+- Fixup lto-plugin install.
+- Fixup thunks with LTO.
+
+-------------------------------------------------------------------
+Thu Oct 29 11:54:27 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153698).
+
+-------------------------------------------------------------------
+Mon Oct 26 11:42:53 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153548).
+
+-------------------------------------------------------------------
+Sun Oct 18 13:21:48 CEST 2009 - rguenther@xxxxxxx
+
+- Fixup provides.
+
+-------------------------------------------------------------------
+Mon Oct 12 14:35:29 CEST 2009 - rguenther@xxxxxxx
+
+- Enable support to build an optional compiler that doesn't
+ replace system libraries. [fate#306970]
+- Add the patch to read a default spec file if present.
+
+-------------------------------------------------------------------
+Sun Oct 4 00:20:38 CEST 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r152434).
+ * Includes LTO.
+
+-------------------------------------------------------------------
+Fri Sep 25 14:41:32 CEST 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r152168).
++++ 59 more lines (skipped)
++++ between /dev/null
++++ and /mounts/work_src_done/STABLE/gcc45/cross-avr-gcc45.changes
New Changes file:

cross-hppa-gcc-icecream-backend.changes: same change
New Changes file:

cross-i386-gcc-icecream-backend.changes: same change
New Changes file:

cross-ia64-gcc-icecream-backend.changes: same change
New Changes file:

cross-ppc64-gcc-icecream-backend.changes: same change
New Changes file:

cross-ppc-gcc-icecream-backend.changes: same change
New Changes file:

cross-s390-gcc-icecream-backend.changes: same change
New Changes file:

cross-s390x-gcc-icecream-backend.changes: same change
New Changes file:

cross-spu-gcc45.changes: same change
New Changes file:

cross-spu-gcc45-static.changes: same change
New Changes file:

cross-x86_64-gcc-icecream-backend.changes: same change
--- gcc45/gcc45.changes 2010-02-18 12:04:35.000000000 +0100
+++ /mounts/work_src_done/STABLE/gcc45/gcc45.changes 2010-03-02
17:56:13.000000000 +0100
@@ -1,0 +2,22 @@
+Tue Mar 2 17:50:14 CET 2010 - rguenther@xxxxxxxxxx
+
+- Update to SVN trunk head (r157166).
+
+-------------------------------------------------------------------
+Fri Feb 26 16:30:03 CET 2010 - rguenther@xxxxxxxxxx
+
+- Split gcc45-testresults build to a separate spec file.
+- Apply the LFS patch again.
+
+-------------------------------------------------------------------
+Wed Feb 24 14:06:57 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r157039).
+
+-------------------------------------------------------------------
+Fri Feb 19 17:11:51 CET 2010 - rguenther@xxxxxxx
+
+- Enable icecream crosses.
+- Enable cross compilers and version them all properly.
+
+-------------------------------------------------------------------
New Changes file:

--- /dev/null 2009-09-30 08:50:26.000000000 +0200
+++ /mounts/work_src_done/STABLE/gcc45/gcc45-testresults.changes
2010-03-02 17:56:13.000000000 +0100
@@ -0,0 +1,256 @@
+-------------------------------------------------------------------
+Tue Mar 2 17:50:14 CET 2010 - rguenther@xxxxxxxxxx
+
+- Update to SVN trunk head (r157166).
+
+-------------------------------------------------------------------
+Fri Feb 26 16:30:03 CET 2010 - rguenther@xxxxxxxxxx
+
+- Split gcc45-testresults build to a separate spec file.
+- Apply the LFS patch again.
+
+-------------------------------------------------------------------
+Wed Feb 24 14:06:57 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r157039).
+
+-------------------------------------------------------------------
+Fri Feb 19 17:11:51 CET 2010 - rguenther@xxxxxxx
+
+- Enable icecream crosses.
+- Enable cross compilers and version them all properly.
+
+-------------------------------------------------------------------
+Thu Feb 18 11:07:59 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156860).
+
+-------------------------------------------------------------------
+Fri Feb 12 15:06:35 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156733).
+- Split libffi45 build to a separate spec file.
+
+-------------------------------------------------------------------
+Wed Feb 10 18:08:57 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156666).
+
+-------------------------------------------------------------------
+Tue Feb 9 23:27:39 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Also add zlib to BuildRequires - lto_compress depends on it
+
+-------------------------------------------------------------------
+Tue Feb 9 19:02:12 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Add missing mpc-devel to cross.spec.in's BuildRequires
+ (GCC really wants this)
+- Add cloog/ppl to cross.spec.in BuildRequires
+ (Nice to have)
+
+-------------------------------------------------------------------
+Tue Feb 9 12:38:43 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156628).
+
+-------------------------------------------------------------------
+Tue Feb 9 01:33:51 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Adjust baselibs.conf (4.4 -> 4.5)
+
+-------------------------------------------------------------------
+Sun Feb 7 17:28:50 UTC 2010 - jengelh@xxxxxxxxxx
+
+- Add SPARC support to specfile
+
+-------------------------------------------------------------------
+Fri Feb 5 11:20:25 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156514).
+- Add patch for PR42762.
+
+-------------------------------------------------------------------
+Wed Feb 3 16:56:11 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156468).
+
+-------------------------------------------------------------------
+Fri Jan 29 13:31:49 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156346).
+
+-------------------------------------------------------------------
+Thu Jan 21 13:52:45 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r156152).
+- Adjust textdomain.
+- Adjust libjava version.
+- Adjust ada manual version.
+- Fix libffi-devel provides and obsoletes.
+
+-------------------------------------------------------------------
+Fri Jan 15 12:28:55 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155935).
+- Revert patch for PR42634.
+- Add patches for PR42248 and PR42739.
+
+-------------------------------------------------------------------
+Tue Jan 12 17:16:26 CET 2010 - rguenther@xxxxxxx
+
+- Fixup and re-enable patch for stack-protector support on ia64.
+
+-------------------------------------------------------------------
+Mon Jan 11 13:52:12 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155809).
+
+-------------------------------------------------------------------
+Wed Jan 6 19:03:41 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155679).
+- Update ecj.jar.
+
+-------------------------------------------------------------------
+Wed Dec 18 12:53:27 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155344).
+
+-------------------------------------------------------------------
+Mon Dec 14 00:37:58 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r155199).
+
+-------------------------------------------------------------------
+Thu Nov 26 17:30:05 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r154675).
+
+-------------------------------------------------------------------
+Thu Nov 19 18:45:55 CET 2009 - rguenther@xxxxxxx
+
+- Enable decimal floating point support on s390(x).
+
+-------------------------------------------------------------------
+Fri Nov 18 17:05:30 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r154292).
+- Re-diff patches to avoid fuzz.
+- Add defaults.spec that adds a rpath by default for the optional compiler.
+
+-------------------------------------------------------------------
+Tue Nov 17 16:10:47 CET 2009 - rguenther@xxxxxxx
+
+- For optional compilers do not build libgcj.spec and run the
+ testsuite from within gcc.spec.
+
+-------------------------------------------------------------------
+Fri Nov 6 11:25:03 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153963).
+
+-------------------------------------------------------------------
+Wed Nov 4 21:06:32 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153912).
+- Build with release checking.
+
+-------------------------------------------------------------------
+Tue Nov 3 12:06:26 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153845).
+- Fixup lto-plugin install.
+- Fixup thunks with LTO.
+
+-------------------------------------------------------------------
+Thu Oct 29 11:54:27 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153698).
+
+-------------------------------------------------------------------
+Mon Oct 26 11:42:53 CET 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r153548).
+
+-------------------------------------------------------------------
+Sun Oct 18 13:21:48 CEST 2009 - rguenther@xxxxxxx
+
+- Fixup provides.
+
+-------------------------------------------------------------------
+Mon Oct 12 14:35:29 CEST 2009 - rguenther@xxxxxxx
+
+- Enable support to build an optional compiler that doesn't
+ replace system libraries. [fate#306970]
+- Add the patch to read a default spec file if present.
+
+-------------------------------------------------------------------
+Sun Oct 4 00:20:38 CEST 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r152434).
+ * Includes LTO.
+
+-------------------------------------------------------------------
+Fri Sep 25 14:41:32 CEST 2009 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r152168).
++++ 59 more lines (skipped)
++++ between /dev/null
++++ and /mounts/work_src_done/STABLE/gcc45/gcc45-testresults.changes
--- gcc45/libffi45.changes 2010-02-18 12:04:35.000000000 +0100
+++ /mounts/work_src_done/STABLE/gcc45/libffi45.changes 2010-03-02
17:56:13.000000000 +0100
@@ -1,0 +2,22 @@
+Tue Mar 2 17:50:14 CET 2010 - rguenther@xxxxxxxxxx
+
+- Update to SVN trunk head (r157166).
+
+-------------------------------------------------------------------
+Fri Feb 26 16:30:03 CET 2010 - rguenther@xxxxxxxxxx
+
+- Split gcc45-testresults build to a separate spec file.
+- Apply the LFS patch again.
+
+-------------------------------------------------------------------
+Wed Feb 24 14:06:57 CET 2010 - rguenther@xxxxxxx
+
+- Update to SVN trunk head (r157039).
+
+-------------------------------------------------------------------
+Fri Feb 19 17:11:51 CET 2010 - rguenther@xxxxxxx
+
+- Enable icecream crosses.
+- Enable cross compilers and version them all properly.
+
+-------------------------------------------------------------------
libgcj45.changes: same change

calling whatdependson for head-i586


Old:
----
gcc-4.5.0-20100218.tar.bz2

New:
----
cross-avr-gcc45.changes
cross-avr-gcc45.spec
cross-hppa-gcc-icecream-backend.changes
cross-hppa-gcc-icecream-backend.spec
cross-i386-gcc-icecream-backend.changes
cross-i386-gcc-icecream-backend.spec
cross-ia64-gcc-icecream-backend.changes
cross-ia64-gcc-icecream-backend.spec
cross-ppc64-gcc-icecream-backend.changes
cross-ppc64-gcc-icecream-backend.spec
cross-ppc-gcc-icecream-backend.changes
cross-ppc-gcc-icecream-backend.spec
cross-s390-gcc-icecream-backend.changes
cross-s390-gcc-icecream-backend.spec
cross-s390x-gcc-icecream-backend.changes
cross-s390x-gcc-icecream-backend.spec
cross-spu-gcc45.changes
cross-spu-gcc45.spec
cross-spu-gcc45-static.changes
cross-spu-gcc45-static.spec
cross-x86_64-gcc-icecream-backend.changes
cross-x86_64-gcc-icecream-backend.spec
gcc-4.5.0-20100302.tar.bz2
gcc45-testresults.changes
gcc45-testresults.spec

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cross-avr-gcc45.spec ++++++
#
# spec file for package cross-avr-gcc45 (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_static 1
#
# spec file for package gcc (Version 4.0.1)
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#

%define build_cp 1
%define build_ada 0
%define build_java 0
%define build_libjava 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch avr

%if "avr" == "spu"
%define build_fortran 1
%endif

%if 0%{?build_static:1}
%define build_fortran 0
%endif

Name: cross-avr-gcc45
BuildRequires: bison flex mpc-devel mpfr-devel zlib-devel
%ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc
BuildRequires: cloog-devel libelf0-devel ppl-devel
%endif
BuildRequires: cross-avr-binutils
%if "avr" == "spu"
%if 0%{?build_static:1}
BuildRequires: cross-avr-newlib-headers
%else
BuildRequires: cross-avr-newlib
%endif
Requires: cross-avr-newlib
%endif
Requires: cross-avr-binutils
# Suffixed gcc conflicts with unsuffixed gcc
%if "" == ""
%else
Conflicts: cross-avr-gcc45
%endif

%define _prefix /opt/cross

# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
This compiler supports the C language on avr microprocessors.
Also install cross-avr-binutils and avr-libc.


# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END

make %{?jobs:-j%jobs}

%install
cd obj-%{GCCDIST}
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_prefix}/share
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-gccbug
find $RPM_BUILD_ROOT -name libiberty.a | xargs rm

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_prefix}
%changelog
++++++ cross-hppa-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-hppa-gcc-icecream-backend (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch hppa-linux
%define gcc_icecream 1

Name: cross-hppa-gcc-icecream-backend
BuildRequires: cross-hppa-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ cross-i386-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-i386-gcc-icecream-backend (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch i386-linux
%define gcc_icecream 1

Name: cross-i386-gcc-icecream-backend
BuildRequires: cross-i386-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ cross-ia64-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-ia64-gcc-icecream-backend (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch ia64-linux
%define gcc_icecream 1

Name: cross-ia64-gcc-icecream-backend
BuildRequires: cross-ia64-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ cross-ppc64-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-ppc64-gcc-icecream-backend (Version
4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch ppc64-linux
%define gcc_icecream 1

Name: cross-ppc64-gcc-icecream-backend
BuildRequires: cross-ppc64-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ cross-ppc-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-ppc-gcc-icecream-backend (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch ppc-linux
%define gcc_icecream 1

Name: cross-ppc-gcc-icecream-backend
BuildRequires: cross-ppc-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ cross-s390-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-s390-gcc-icecream-backend (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch s390-linux
%define gcc_icecream 1

Name: cross-s390-gcc-icecream-backend
BuildRequires: cross-s390-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ cross-s390x-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-s390x-gcc-icecream-backend (Version
4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch s390x-linux
%define gcc_icecream 1

Name: cross-s390x-gcc-icecream-backend
BuildRequires: cross-s390x-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ cross-spu-gcc45.spec ++++++
#
# spec file for package cross-spu-gcc45 (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_java 0
%define build_libjava 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch spu

%if "spu" == "spu"
%define build_fortran 1
%endif

%if 0%{?build_static:1}
%define build_fortran 0
%endif

Name: cross-spu-gcc45
BuildRequires: bison flex mpc-devel mpfr-devel zlib-devel
%ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc
BuildRequires: cloog-devel libelf0-devel ppl-devel
%endif
BuildRequires: cross-spu-binutils
%if "spu" == "spu"
%if 0%{?build_static:1}
BuildRequires: cross-spu-newlib-headers
%else
BuildRequires: cross-spu-newlib
%endif
Requires: cross-spu-newlib
%endif
Requires: cross-spu-binutils
# Suffixed gcc conflicts with unsuffixed gcc
%if "" == ""
%else
Conflicts: cross-spu-gcc45
%endif

%define _prefix /opt/cross

# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
This compiler supports the C language on spu microprocessors.
Also install cross-spu-binutils and spu-libc.


# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END

make %{?jobs:-j%jobs}

%install
cd obj-%{GCCDIST}
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_prefix}/share
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-gccbug
find $RPM_BUILD_ROOT -name libiberty.a | xargs rm

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_prefix}
%changelog
++++++ cross-spu-gcc45-static.spec ++++++
#
# spec file for package cross-spu-gcc45-static (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_static 1
#
# spec file for package gcc (Version 4.0.1)
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#

%define build_cp 1
%define build_ada 0
%define build_java 0
%define build_libjava 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch spu

%if "spu" == "spu"
%define build_fortran 1
%endif

%if 0%{?build_static:1}
%define build_fortran 0
%endif

Name: cross-spu-gcc45-static
BuildRequires: bison flex mpc-devel mpfr-devel zlib-devel
%ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc
BuildRequires: cloog-devel libelf0-devel ppl-devel
%endif
BuildRequires: cross-spu-binutils
%if "spu" == "spu"
%if 0%{?build_static:1}
BuildRequires: cross-spu-newlib-headers
%else
BuildRequires: cross-spu-newlib
%endif
Requires: cross-spu-newlib
%endif
Requires: cross-spu-binutils
# Suffixed gcc conflicts with unsuffixed gcc
%if "-static" == ""
%else
Conflicts: cross-spu-gcc45
%endif

%define _prefix /opt/cross

# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
This compiler supports the C language on spu microprocessors.
Also install cross-spu-binutils and spu-libc.


# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END

make %{?jobs:-j%jobs}

%install
cd obj-%{GCCDIST}
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_prefix}/share
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-gccbug
find $RPM_BUILD_ROOT -name libiberty.a | xargs rm

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_prefix}
%changelog
++++++ cross-x86_64-gcc-icecream-backend.spec ++++++
#
# spec file for package cross-x86_64-gcc-icecream-backend (Version
4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_libjava 0
%define build_java 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
%define gcc_target_arch x86_64-linux
%define gcc_icecream 1

Name: cross-x86_64-gcc-icecream-backend
BuildRequires: cross-x86_64-binutils glibc-devel-32bit
BuildRequires: gmp-devel mpfr-devel
BuildRequires: bison
BuildRequires: flex
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _binary_payload w.ufdio

# COMMON-BEGIN
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

Url: http://gcc.gnu.org/
Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1: change_spec
Source2: libgcj45-rpmlintrc
Source3: gcc45-rpmlintrc
Source4: ecj.jar
Source5: README.First-for.SuSE.packagers
Source6: baselibs.conf
Patch1: gcc-dir-version.patch
Patch2: gcc-sles-version.patch
Patch3: gcc-noalias-warn.diff
Patch5: boehm-gc-strict-aliasing.patch
Patch6: suse-record-gcc-opts.diff
Patch7: gcc-add-defaultsspec.diff
Patch8: Wunprototyped-calls.diff
Patch9: gcc44-lfs.diff
Patch10: program-transform-name.diff
Patch12: gcc4-ppc64-m32-m64-multilib-only.patch
Patch23: libjava-no-multilib.diff
Patch24: tls-no-direct.diff
Patch25: pr27880.diff
Patch28: pr33763.diff
Patch29: build-id.diff
Patch30: gcc43-no-unwind-tables.diff
# A set of patches from the RH srpm
Patch51: gcc41-ia64-stack-protector.patch
Patch55: gcc41-java-slow_pthread_self.patch
Patch57: gcc41-ppc32-retaddr.patch
# Some patches taken from Debian
Patch60: gcc44-textdomain.patch
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff

# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
Summary: The GNU C Compiler and Support Files
License: GPLv3+

%description
Core package for the GNU Compiler Collection, including the C language
frontend.

Language frontends other than C are split to different sub-packages,
namely gcc-ada, gcc-c++, gcc-fortran, gcc-java, gcc-objc and
gcc-obj-c++.



# COMMON-END
# COMMON-BEGIN

# Define the canonical target and host architecture
# %gcc_target_arch is supposed to be the full target triple
# %TARGET_ARCH is the canonicalized CPU part
# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
%define CONFIGURE_TARGET powerpc64-linux
%endif
%if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
%define CONFIGURE_TARGET i586-linux
%endif
%else
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")

%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)

%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
%ifarch %sparc
%define GCCDIST sparc64-suse-linux
%else
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif

%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}

# COMMON-END
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat
gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e
's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e
's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g'
-e 's/-m64//g'`
%ifarch %ix86
# -mcpu is superceded by -mtune but -mtune is not supported by
# our bootstrap compiler. -mcpu gives a warning that stops
# the build process, so remove it for now. Also remove all other
# -march and -mtune flags. They are superseeded by proper
# default compiler settings now.
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e
's/-march=i.86//g' -e 's/-mtune=i.86//g'`
%endif
%ifarch s390 s390x
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
%endif
%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
# Kill all -march/tune/cpu because that screws building the target libs
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`

languages=c
%if %{build_cp}
languages=$languages,c++
%endif
%if %{build_objc}
languages=$languages,objc
%endif
%if %{build_fortran}
languages=$languages,fortran
%endif
%if %{build_objcp}
languages=$languages,obj-c++
%endif
%if %{build_java}
languages=$languages,java
%endif
%if %{build_ada}
languages=$languages,ada
%endif

J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
JL=$(($J * 2))
else
test 1 -gt "$J" && J=1
JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
J=1
fi
if test "$JL" == "0"; then
JL=1
fi
PARALLEL="-j$J -l$JL"

# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))

# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"

%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
# GNATMAKE="gnatmake%{hostsuffix}"
# doesn't work due to PR33857, so an un-suffixed gnatmake has to be
# available
mkdir -p host-tools/bin
cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
ln -sf /usr/%{_lib} host-tools/%{_lib}
export PATH="`pwd`/host-tools/bin:$PATH"
%endif
#%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
#%else
# --enable-threads=posix \
#%endif
# --enable-shared \
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
../configure \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--libexecdir=%{_libdir} \
--enable-languages=$languages \
$ENABLE_CHECKING \
--with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
--enable-ssp \
--disable-libssp \
--disable-plugin \
--with-bugurl="http://bugs.opensuse.org/"; \
--with-pkgversion="SUSE Linux" \
%if !%{build_libjava}
--disable-libgcj \
%else
--with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
--with-ecj-jar=%{libsubdir}/ecj.jar \
--enable-java-awt=gtk \
--enable-gtk-cairo \
%if !%{biarch_libjava}
--disable-libjava-multilib \
%endif
%endif
%if !%{build_with_mudflap}
--disable-libmudflap \
%endif
--with-slibdir=/%{_lib} \
--with-system-zlib \
--enable-__cxa_atexit \
--enable-libstdcxx-allocator=new \
--disable-libstdcxx-pch \
--enable-version-specific-runtime-libs \
%if 0%{?gcc_target_arch:1}
%if 0%{?gcc_icecream:1}
--with-as=/opt/cross/%{TARGET_ARCH}-linux/bin/as \
--with-ld=/opt/cross/%{TARGET_ARCH}-linux/bin/ld \
--with-sysroot=/ \
--enable-linux-futex \
%endif
%if 0%{?build_static:1}
--disable-shared \
%endif
%if "%{TARGET_ARCH}" == "spu"
--with-sysroot=/usr/spu \
--with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
--with-newlib \
%endif
--disable-nls \
--target=%{CONFIGURE_TARGET} \
%else
--program-suffix=%{binsuffix} \
--enable-linux-futex \
%ifarch ia64
--with-system-libunwind \
%else
--without-system-libunwind \
%endif
%ifarch %gold_archs
--enable-gold \
--with-plugin-ld=/usr/bin/gold \
%endif
%endif
%if "%{TARGET_ARCH}" == "powerpc"
--with-cpu=default32 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "powerpc64"
--with-cpu=power4 \
--enable-secureplt \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc64"
--with-cpu=ultrasparc \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "sparc"
--with-cpu=v8 \
--with-long-double-128 \
%endif
%if "%{TARGET_ARCH}" == "i586"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "x86_64"
--with-arch-32=i586 \
--with-tune=generic \
%endif
%if "%{TARGET_ARCH}" == "s390"
--with-tune=z9-109 --with-arch=z900 \
--with-long-double-128 \
--enable-decimal-float \
%endif
%if "%{TARGET_ARCH}" == "s390x"
--with-tune=z10 --with-arch=z9-109 \
--with-long-double-128 \
--enable-decimal-float \
%endif
--build=%{GCCDIST}

# COMMON-END
# COMMON-END

make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

%install
cd obj-%{GCCDIST}
rm -rf $RPM_BUILD_ROOT
BUILD_TARGET=%{TARGET_ARCH}
ORIG_TARGET=$BUILD_TARGET
# We play funny tricks with the ppc compiler. We want to have it biarch,
# which the powerpc compiler itself doesn't support. So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
test "$BUILD_TARGET" = powerpc && BUILD_TARGET=powerpc64
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D /opt/cross/bin/${ORIG_TARGET}-linux-as
$RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-g++
$RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/${BUILD_TARGET}-linux-gcc
$RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do
install -s -D
$RPM_BUILD_ROOT/inst%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
\

$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/$back
done

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*
$RPM_BUILD_ROOT/env%{_libdir}/gcc/${BUILD_TARGET}-linux/%{gcc_dir_version}/*;
do \
ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }' ;\
done | sort -u `
for lib in $libs; do
# Check wether the same library also exists in the parent directory,
# and prefer that on the assumption that it is a more generic one.
baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
test -f "$baselib" && lib=$baselib
install -s -D $lib $RPM_BUILD_ROOT/env$lib
done
rm -rf $RPM_BUILD_ROOT/inst
cd $RPM_BUILD_ROOT/env
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc > usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils > usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/icecream-envs

%changelog
++++++ gcc45.spec ++++++
++++ 887 lines (skipped)
++++ between gcc45/gcc45.spec
++++ and /mounts/work_src_done/STABLE/gcc45/gcc45.spec

++++++ gcc45-testresults.spec ++++++
++++ 690 lines (skipped)

++++++ libffi45.spec ++++++
--- /var/tmp/diff_new_pack.ojBZfF/_old 2010-03-04 16:06:24.000000000 +0100
+++ /var/tmp/diff_new_pack.ojBZfF/_new 2010-03-04 16:06:24.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package libffi45 (Version 4.5.0_20100218)
+# spec file for package libffi45 (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -31,16 +31,20 @@
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
# Run the testsuite if there's a file named RUN_TESTS in the source
%if 0%{!?run_tests:1}
%define run_tests %(test -f %_sourcedir/RUN_TESTS && echo 1 || echo 0)
%endif
+
# Keep in sync with binutils
%if 0%{suse_version} >= 1100
%define gold_archs %ix86 x86_64 ppc ppc64 %sparc
%endif
+
# Ada currently fails to build on a few platforms, enable it only
# on those that work
# Note that AdaCore only supports %ix86, x86_64 and ia64
@@ -50,26 +54,31 @@
# alpha ppc64 s390x hppa arm
%define build_ada 0
%endif
+
# We don't want to build java on arm
%ifarch mips %arm
%define build_java 0
%define build_libjava 0
%else
%define build_java 1
-%define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}
+%define build_libjava
0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
%endif
+
%define build_cp 1
%define build_fortran 1
%define build_objc 1
%define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
%define build_with_mudflap 0
+
%if %{build_objcp}
%define build_cp 1
%define build_objc 1
%endif
+
%if %{build_libjava}
%define build_cp 1
%endif
+
# For optional compilers only build C, C++ and Fortran
%if 0%{?build_optional_compiler:1}
%define build_ada 0
@@ -104,6 +113,7 @@
%if %{run_tests}
BuildRequires: dejagnu expect
%endif
+
# Define version number of libgcc_s
%ifarch hppa
%define libgcc_s 4
@@ -117,6 +127,7 @@
%else
%define build_nof 0
%endif
+
%define separate_bi32 0
%define separate_bi64 0
%ifarch ppc sparcv9
@@ -127,6 +138,7 @@
%ifarch x86_64 s390x ppc64 sparc64
%define separate_bi32 1
%endif
+
# Define two macros to trigger -32bit or -64bit package variants
%define separate_biarch 0
%if %{separate_bi32}
@@ -137,23 +149,28 @@
%define separate_biarch 1
%define separate_biarch_suffix -64bit
%endif
+
%ifarch x86_64 ia64 s390x alpha ppc64 sparc64
# 64-bit is primary build target
%define build_primary_64bit 1
%else
%define build_primary_64bit 0
%endif
+
%define biarch_libjava 0
+
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
+
Url: http://gcc.gnu.org/
-Version: 4.5.0_20100218
+Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
+
%if !0%{?building_libjava:1}%{?building_libffi:1}
Requires: binutils glibc-devel
%ifarch %gold_archs
@@ -176,6 +193,7 @@
Suggests: gcc45-info gcc45-locale
%endif
%endif
+
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -211,6 +229,8 @@
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff
+
+# GCC-TESTSUITE-DELETE-BEGIN
# PACKAGE-BEGIN
# PACKAGE-BEGIN
License: BSD3c
@@ -284,6 +304,7 @@
%postun -n libffi45-64bit
/sbin/ldconfig
# PACKAGE-END
+
# PACKAGE-BEGIN
# PACKAGE-BEGIN

@@ -300,6 +321,9 @@

%description -n libffi45-devel
A foreign function interface is the popular name for the interface that allows
code written in one language to call code written in another language.
+# PACKAGE-END
+# PACKAGE-BEGIN
+# PACKAGE-BEGIN
%package -n libffi45-devel-32bit
License: BSD3c
Summary: Foreign Function Interface library development files
@@ -313,6 +337,9 @@

%description -n libffi45-devel-32bit
A foreign function interface is the popular name for the interface that allows
code written in one language to call code written in another language.
+# PACKAGE-END
+# PACKAGE-BEGIN
+# PACKAGE-BEGIN
%package -n libffi45-devel-64bit
License: BSD3c
Summary: Foreign Function Interface library development files
@@ -326,8 +353,10 @@

%description -n libffi45-devel-64bit
A foreign function interface is the popular name for the interface that allows
code written in one language to call code written in another language.
+# PACKAGE-END

%package -n gcc45-testresults
+# GCC-TESTSUITE-DELETE-END
License: Public Domain, Freeware
Summary: Testsuite results
Group: Development/Languages/C and C++
@@ -336,7 +365,12 @@
Results from running the gcc and target library testsuites.


+# COMMON-BEGIN

+# Define the canonical target and host architecture
+# %gcc_target_arch is supposed to be the full target triple
+# %TARGET_ARCH is the canonicalized CPU part
+# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
@@ -353,7 +387,9 @@
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
+
%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)
+
%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
@@ -363,9 +399,12 @@
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif
+
%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
+
# COMMON-END
+
# Versionspecific directories
%define versmainlibdir %{libsubdir}
%define versmainlibdirbi32 %{libsubdir}/32
@@ -383,6 +422,7 @@
%else
%define versmainlibdirbi %{versmainlibdirbi64}
%endif
+
%if 0%{?build_optional_compiler:1}
%define mainlibdir %{versmainlibdir}
%define mainlibdirbi32 %{versmainlibdirbi32}
@@ -400,6 +440,7 @@
%define mainlibdirbi %{mainlibdirbi64}
%endif
%endif
+
# Now define a few macros that make it easy to package libs and
# related files just to the right package, without caring for the
# exact path the files are in.
@@ -440,6 +481,7 @@
%endif
%endif
%endif
+
%if %{build_nof}
%define versmainlib() %{versmainlibdir}/%1\
%{versnoflibdir}/%1\
@@ -474,17 +516,19 @@
%endif
%endif
%endif
+
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
+#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
-#%patch9
+%patch9
%patch10
%if !%{build_nof}
%patch12
@@ -507,6 +551,7 @@
%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch
+
# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
@@ -517,6 +562,7 @@
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
+
rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
@@ -540,6 +586,7 @@
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
+
languages=c
%if %{build_cp}
languages=$languages,c++
@@ -559,6 +606,7 @@
%if %{build_ada}
languages=$languages,ada
%endif
+
J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
@@ -574,26 +622,32 @@
JL=1
fi
PARALLEL="-j$J -l$JL"
+
# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))
+
# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"
+
%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif
+
# Work around tail/head -1 changes
export _POSIX2_VERSION=199209
+
# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/
+
%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
@@ -716,7 +770,9 @@
--enable-decimal-float \
%endif
--build=%{GCCDIST}
+
# COMMON-END
+
%if 0%{?building_libffi:1}
make all-target-libffi $PARALLEL
%else
@@ -742,6 +798,7 @@
%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
cd obj-%{GCCDIST}
+# GCC-TESTSUITE-DELETE-BEGIN
# Work around tail/head -1 changes
export _POSIX2_VERSION=199209
export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
@@ -774,6 +831,7 @@
%endif
%endif
%endif
+
# Remove some useless .la files
for lib in libobjc libgfortran libgfortranbegin libmudflap libmudflapth \
libgomp libstdc++ libsupc++ libgcj-tools libgij; do
@@ -782,6 +840,7 @@
rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
%endif
done
+
mkdir -p $RPM_BUILD_ROOT%{_libdir}
%if %{biarch}
%if %{build_primary_64bit}
@@ -790,6 +849,7 @@
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
%endif
%endif
+
%if %{build_ada}
mv $RPM_BUILD_ROOT%{libsubdir}/adalib/lib*-*.so $RPM_BUILD_ROOT%{_libdir}
ln -sf %{_libdir}/libgnarl%{binsuffix}.so
$RPM_BUILD_ROOT%{libsubdir}/adalib/libgnarl.so
@@ -802,7 +862,9 @@
chmod a+x $RPM_BUILD_ROOT%{mainlibdirbi}/libgna*-*.so
%endif
%endif
+
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++%{binsuffix}
+
# Remove some crap from the .la files:
for l in `find $RPM_BUILD_ROOT -name '*.la'`; do
echo "changing $l"
@@ -822,11 +884,14 @@
< $l > $l.new
mv $l.new $l
done
+
+# GCC-TESTSUITE-DELETE-END
%if %{run_tests}
cp `find . -name "*.sum"` ../testresults/
cp `find . -name "*.log" \! -name "config.log" |grep -v 'acats/tests' `
../testresults/
chmod 644 ../testresults/*
%endif
+# GCC-TESTSUITE-DELETE-BEGIN
# Remove files that we do not need to clean up filelist
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/%{GCCDIST}-*
rm -rf $RPM_BUILD_ROOT%{libsubdir}/install-tools
@@ -852,6 +917,7 @@
rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/gccbug%{binsuffix}
+
%if !0%{?building_libjava:1}%{?building_libffi:1}
# delete compile flag tracking from crt files
crt_list=$RPM_BUILD_ROOT%{versmainlibdir}/crt*.o
@@ -866,6 +932,7 @@
objcopy -R ".comment.SUSE.OPTs" $o
done
%endif
+
%if 0%{?building_libjava:1}
# gcj -static doesn't work properly anyway, unless using --whole-archive
# let's save the space instead.
@@ -877,14 +944,17 @@
-o -name libjvm.a \
-o -name libgcj_bc.a \
| xargs rm -f
+
find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
+
# security files have broken install locations, also they cause conflicts
# between libgcj versions. Simply delete them here, libgcj will use its
# defaults in this case (which is what these files contain anyway).
rm $RPM_BUILD_ROOT%{_libdir}/logging.properties
rm -r $RPM_BUILD_ROOT%{_libdir}/security
%endif
+
%if 0%{?building_libffi:1}
# Move libffi headers, remove empty libffi libtool file
mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
@@ -895,6 +965,7 @@
rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
%endif
%endif
+
%if %{build_java}
%if !%{build_libjava}
rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
@@ -926,6 +997,7 @@
rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
%endif
+
%if %{build_java}
%if 0%{?building_libffi:1}

@@ -933,6 +1005,7 @@
%defattr(-,root,root)
%mainlib libffi.so.*

+
%if %{separate_biarch}

%files -n libffi45%{separate_biarch_suffix}
@@ -952,6 +1025,7 @@
%doc %{_mandir}/man3/ffi%{binsuffix}.3.gz
%doc %{_mandir}/man3/ffi_call%{binsuffix}.3.gz
%doc %{_mandir}/man3/ffi_prep_cif%{binsuffix}.3.gz
+
%if %{separate_biarch}

%files -n libffi45-devel%{separate_biarch_suffix}
@@ -963,6 +1037,8 @@
%endif
%endif
%endif
+# GCC-TESTSUITE-DELETE-END
+
%if %{run_tests}

%files -n gcc45-testresults

++++++ libgcj45.spec ++++++
--- /var/tmp/diff_new_pack.ojBZfF/_old 2010-03-04 16:06:24.000000000 +0100
+++ /var/tmp/diff_new_pack.ojBZfF/_new 2010-03-04 16:06:24.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package libgcj45 (Version 4.5.0_20100218)
+# spec file for package libgcj45 (Version 4.5.0_20100302)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,6 @@
# icecream 0

%define building_libjava 1
-%define run_tests 1
#
# spec file for package gcc45 (Version 4.5.x)
#
@@ -32,16 +31,20 @@
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
# Run the testsuite if there's a file named RUN_TESTS in the source
%if 0%{!?run_tests:1}
%define run_tests %(test -f %_sourcedir/RUN_TESTS && echo 1 || echo 0)
%endif
+
# Keep in sync with binutils
%if 0%{suse_version} >= 1100
%define gold_archs %ix86 x86_64 ppc ppc64 %sparc
%endif
+
# Ada currently fails to build on a few platforms, enable it only
# on those that work
# Note that AdaCore only supports %ix86, x86_64 and ia64
@@ -51,26 +54,31 @@
# alpha ppc64 s390x hppa arm
%define build_ada 0
%endif
+
# We don't want to build java on arm
%ifarch mips %arm
%define build_java 0
%define build_libjava 0
%else
%define build_java 1
-%define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}
+%define build_libjava
0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
%endif
+
%define build_cp 1
%define build_fortran 1
%define build_objc 1
%define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
%define build_with_mudflap 0
+
%if %{build_objcp}
%define build_cp 1
%define build_objc 1
%endif
+
%if %{build_libjava}
%define build_cp 1
%endif
+
# For optional compilers only build C, C++ and Fortran
%if 0%{?build_optional_compiler:1}
%define build_ada 0
@@ -105,6 +113,7 @@
%if %{run_tests}
BuildRequires: dejagnu expect
%endif
+
# Define version number of libgcc_s
%ifarch hppa
%define libgcc_s 4
@@ -118,6 +127,7 @@
%else
%define build_nof 0
%endif
+
%define separate_bi32 0
%define separate_bi64 0
%ifarch ppc sparcv9
@@ -128,6 +138,7 @@
%ifarch x86_64 s390x ppc64 sparc64
%define separate_bi32 1
%endif
+
# Define two macros to trigger -32bit or -64bit package variants
%define separate_biarch 0
%if %{separate_bi32}
@@ -138,23 +149,28 @@
%define separate_biarch 1
%define separate_biarch_suffix -64bit
%endif
+
%ifarch x86_64 ia64 s390x alpha ppc64 sparc64
# 64-bit is primary build target
%define build_primary_64bit 1
%else
%define build_primary_64bit 0
%endif
+
%define biarch_libjava 0
+
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
+
Url: http://gcc.gnu.org/
-Version: 4.5.0_20100218
+Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed
's/_/-/')
%define binsuffix -4.5
# COMMON-END
+
%if !0%{?building_libjava:1}%{?building_libffi:1}
Requires: binutils glibc-devel
%ifarch %gold_archs
@@ -177,6 +193,7 @@
Suggests: gcc45-info gcc45-locale
%endif
%endif
+
# COMMON-BEGIN
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -212,6 +229,8 @@
Patch61: gcc44-rename-info-files.patch
# Patches for SAP features
Patch130: sap303956-uchar.diff
+
+# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
License: GPLv2+ ; LGPLv2.1+
Summary: Java Runtime Library for gcc
@@ -319,6 +338,9 @@
%description -n gcc45-gij
This package contains the java bytecode interpreter gij and related tools.

+# LIBFFI-DELETE-END
+# PACKAGE-BEGIN
+# PACKAGE-BEGIN
%package -n libffi45
License: BSD3c
Summary: Foreign Function Interface library
@@ -391,6 +413,7 @@
%postun -n libffi45-64bit
/sbin/ldconfig
# PACKAGE-END
+
# PACKAGE-BEGIN
# PACKAGE-BEGIN

@@ -407,6 +430,9 @@

%description -n libffi45-devel
A foreign function interface is the popular name for the interface that allows
code written in one language to call code written in another language.
+# PACKAGE-END
+# PACKAGE-BEGIN
+# PACKAGE-BEGIN
%package -n libffi45-devel-32bit
License: BSD3c
Summary: Foreign Function Interface library development files
@@ -420,6 +446,9 @@

%description -n libffi45-devel-32bit
A foreign function interface is the popular name for the interface that allows
code written in one language to call code written in another language.
+# PACKAGE-END
+# PACKAGE-BEGIN
+# PACKAGE-BEGIN
%package -n libffi45-devel-64bit
License: BSD3c
Summary: Foreign Function Interface library development files
@@ -433,8 +462,10 @@

%description -n libffi45-devel-64bit
A foreign function interface is the popular name for the interface that allows
code written in one language to call code written in another language.
+# PACKAGE-END

%package -n gcc45-testresults
+# GCC-TESTSUITE-DELETE-END
License: Public Domain, Freeware
Summary: Testsuite results
Group: Development/Languages/C and C++
@@ -443,7 +474,12 @@
Results from running the gcc and target library testsuites.


+# COMMON-BEGIN

+# Define the canonical target and host architecture
+# %gcc_target_arch is supposed to be the full target triple
+# %TARGET_ARCH is the canonicalized CPU part
+# %CONFIGURE_TARGET is the target triple used for --target=
%if 0%{?gcc_target_arch:1}
%define CONFIGURE_TARGET %{gcc_target_arch}
%define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
@@ -460,7 +496,9 @@
%define TARGET_ARCH %(echo %{_target_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
%endif
%define HOST_ARCH %(echo %{_host_cpu} | sed -e
"s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
+
%define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;;
(*) echo 0;; esac)
+
%ifarch ppc
%define GCCDIST powerpc64-suse-linux
%else
@@ -470,9 +508,12 @@
%define GCCDIST %{HOST_ARCH}-suse-linux
%endif
%endif
+
%define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
%define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
+
# COMMON-END
+
# Versionspecific directories
%define versmainlibdir %{libsubdir}
%define versmainlibdirbi32 %{libsubdir}/32
@@ -490,6 +531,7 @@
%else
%define versmainlibdirbi %{versmainlibdirbi64}
%endif
+
%if 0%{?build_optional_compiler:1}
%define mainlibdir %{versmainlibdir}
%define mainlibdirbi32 %{versmainlibdirbi32}
@@ -507,6 +549,7 @@
%define mainlibdirbi %{mainlibdirbi64}
%endif
%endif
+
# Now define a few macros that make it easy to package libs and
# related files just to the right package, without caring for the
# exact path the files are in.
@@ -547,6 +590,7 @@
%endif
%endif
%endif
+
%if %{build_nof}
%define versmainlib() %{versmainlibdir}/%1\
%{versnoflibdir}/%1\
@@ -581,17 +625,19 @@
%endif
%endif
%endif
+
# COMMON-BEGIN

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
+#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
-#%patch9
+%patch9
%patch10
%if !%{build_nof}
%patch12
@@ -614,6 +660,7 @@
%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch
+
# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
@@ -624,6 +671,7 @@
mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
+
rm -rf obj-%{GCCDIST}
mkdir obj-%{GCCDIST}
cd obj-%{GCCDIST}
@@ -647,6 +695,7 @@
%endif
# Replace 2 spaces by one finally
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
+
languages=c
%if %{build_cp}
languages=$languages,c++
@@ -666,6 +715,7 @@
%if %{build_ada}
languages=$languages,ada
%endif
+
J=%{?jobs:%jobs}
if test -z "$J"; then
J=$(getconf _NPROCESSORS_CONF)
@@ -681,26 +731,32 @@
JL=1
fi
PARALLEL="-j$J -l$JL"
+
# we don't want some miscompiles in the testsuite, or some fault in
# the compiler to kill the machine. Hence we limit the amount of memory
# by the physical RAM plus half of swap
#MEM=$(free -m | awk '/^Mem:/ {print $2}')
#SWAP=$(free -m | awk '/^Swap:/ {print $2}')
#ulimit -v $(((MEM + SWAP/2)*1024))
+
# In general we want to ship release checking enabled compilers
# and run BETA with checking enabled.
#ENABLE_CHECKING="--enable-checking=yes"
ENABLE_CHECKING="--enable-checking=release"
+
%if "%{name}" != "gcc45"
export PATH=/opt/cross/bin:$PATH
%endif
+
# Work around tail/head -1 changes
export _POSIX2_VERSION=199209
+
# configure tries to parse include/features.h to detect
# if glibc supports SSP. When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/
+
%if %{build_ada}
# Using the host gnatmake like
# CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
@@ -823,7 +879,9 @@
--enable-decimal-float \
%endif
--build=%{GCCDIST}
+
# COMMON-END
+
%if 0%{?building_libffi:1}
make all-target-libffi $PARALLEL
%else
@@ -849,6 +907,7 @@
%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
cd obj-%{GCCDIST}
+# GCC-TESTSUITE-DELETE-BEGIN
# Work around tail/head -1 changes
export _POSIX2_VERSION=199209
export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
@@ -881,6 +940,7 @@
%endif
%endif
%endif
+
# Remove some useless .la files
for lib in libobjc libgfortran libgfortranbegin libmudflap libmudflapth \
libgomp libstdc++ libsupc++ libgcj-tools libgij; do
@@ -889,6 +949,7 @@
rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
%endif
done
+
mkdir -p $RPM_BUILD_ROOT%{_libdir}
%if %{biarch}
%if %{build_primary_64bit}
@@ -897,7 +958,9 @@
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
%endif
%endif
+
# LIBFFI-DELETE-BEGIN
+
%if 0%{!?build_optional_compiler:1}
# move shared libs from versionspecific dir to main libdir
for libname in \
@@ -950,7 +1013,9 @@
%endif
%endif
%endif
+
# LIBFFI-DELETE-END
+
%if %{build_ada}
mv $RPM_BUILD_ROOT%{libsubdir}/adalib/lib*-*.so $RPM_BUILD_ROOT%{_libdir}
ln -sf %{_libdir}/libgnarl%{binsuffix}.so
$RPM_BUILD_ROOT%{libsubdir}/adalib/libgnarl.so
@@ -963,7 +1028,9 @@
chmod a+x $RPM_BUILD_ROOT%{mainlibdirbi}/libgna*-*.so
%endif
%endif
+
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++%{binsuffix}
+
# Remove some crap from the .la files:
for l in `find $RPM_BUILD_ROOT -name '*.la'`; do
echo "changing $l"
@@ -983,11 +1050,14 @@
< $l > $l.new
mv $l.new $l
done
+
+# GCC-TESTSUITE-DELETE-END
%if %{run_tests}
cp `find . -name "*.sum"` ../testresults/
cp `find . -name "*.log" \! -name "config.log" |grep -v 'acats/tests' `
../testresults/
chmod 644 ../testresults/*
%endif
+# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
%if %{build_cp}
# Find C++ and Java headers
@@ -1022,6 +1092,7 @@
rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/gccbug%{binsuffix}
+
%if !0%{?building_libjava:1}%{?building_libffi:1}
# delete compile flag tracking from crt files
crt_list=$RPM_BUILD_ROOT%{versmainlibdir}/crt*.o
@@ -1036,6 +1107,7 @@
objcopy -R ".comment.SUSE.OPTs" $o
done
%endif
+
%if 0%{?building_libjava:1}
# gcj -static doesn't work properly anyway, unless using --whole-archive
# let's save the space instead.
@@ -1047,14 +1119,17 @@
-o -name libjvm.a \
-o -name libgcj_bc.a \
| xargs rm -f
+
find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
+
# security files have broken install locations, also they cause conflicts
# between libgcj versions. Simply delete them here, libgcj will use its
# defaults in this case (which is what these files contain anyway).
rm $RPM_BUILD_ROOT%{_libdir}/logging.properties
rm -r $RPM_BUILD_ROOT%{_libdir}/security
%endif
+
%if 0%{?building_libffi:1}
# Move libffi headers, remove empty libffi libtool file
mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
@@ -1065,6 +1140,7 @@
rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
%endif
%endif
+
%if %{build_java}
%if !%{build_libjava}
rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
@@ -1096,6 +1172,7 @@
rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
%endif
+
# LIBFFI-DELETE-BEGIN
%if 0%{?building_libjava:1}
# For building libjava only we need to delete other info docs
@@ -1115,6 +1192,7 @@
mv $RPM_BUILD_ROOT%{_infodir}/gnat_ugn.info
$RPM_BUILD_ROOT%{_infodir}/gnat_ugn%{binsuffix}.info
%endif
%endif
+
%if %{build_java}
%if 0%{?building_libjava:1}

@@ -1142,6 +1220,7 @@
%doc %{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1.gz
%endif
%endif
+
%if %{build_java}
%if %{build_libjava}

@@ -1270,6 +1349,7 @@
%endif
%endif
# LIBFFI-DELETE-END
+
%if %{build_java}
%if 0%{?building_libffi:1}

@@ -1277,6 +1357,7 @@
%defattr(-,root,root)
%mainlib libffi.so.*

+
%if %{separate_biarch}

%files -n libffi45%{separate_biarch_suffix}
@@ -1296,6 +1377,7 @@
%doc %{_mandir}/man3/ffi%{binsuffix}.3.gz
%doc %{_mandir}/man3/ffi_call%{binsuffix}.3.gz
%doc %{_mandir}/man3/ffi_prep_cif%{binsuffix}.3.gz
+
%if %{separate_biarch}

%files -n libffi45-devel%{separate_biarch_suffix}
@@ -1307,6 +1389,8 @@
%endif
%endif
%endif
+# GCC-TESTSUITE-DELETE-END
+
%if %{run_tests}

%files -n gcc45-testresults

++++++ change_spec ++++++
--- /var/tmp/diff_new_pack.ojBZfF/_old 2010-03-04 16:06:25.000000000 +0100
+++ /var/tmp/diff_new_pack.ojBZfF/_new 2010-03-04 16:06:25.000000000 +0100
@@ -1,10 +1,10 @@
#!/bin/bash

-do_icecream=0
-do_cross_static=0
-do_cross_shared=0
+do_icecream=1
+do_cross_static=1
+do_cross_shared=1
do_optional_compiler=0
-rm -f libgcj*.spec libgcj*.changes gcc*.spec cross*.spec cross*.changes
+rm -f libgcj*.spec libgcj*.changes libffi*.spec libffi*.changes
gcc*-testresults.spec gcc*-testresults.changes gcc*.spec cross*.spec
cross*.changes

# Default is to generate the normal gcc package
# unless a parameter is given. In case that it is '-*',
@@ -51,7 +51,6 @@
}' >> $outfile
if test "$do_optional_compiler" = "0"; then
echo '%define building_libjava 1' > libgcj$base_ver.spec
- echo '%define run_tests 1' >> libgcj$base_ver.spec
sed -e '/^# LIBJAVA-DELETE-BEGIN/,/^# LIBJAVA-DELETE-END/d;s/-n
libgcj@base_ver@$//g;s/^Name:[[:space:]]*gcc/Name: libgcj/g' \
gcc.spec.in \
| sed -e 's%@base_ver@%'$base_ver'%g' \
@@ -70,6 +69,12 @@
p
}
}' >> libgcj$base_ver.spec
+ echo '%define building_testsuite 1' > gcc$base_ver-testresults.spec
+ echo '%define run_tests 1' >> gcc$base_ver-testresults.spec
+ sed -e '/^# GCC-TESTSUITE-DELETE-BEGIN/,/^#
GCC-TESTSUITE-DELETE-END/d;s/-n
gcc@base_ver@-testresults$//g;s/^Name:[[:space:]]*gcc@base_ver@/Name:
gcc@base_ver@-testresults/g' \
+ gcc.spec.in \
+ | sed -e 's%@base_ver@%'$base_ver'%g' \
+>> gcc$base_ver-testresults.spec
echo '%define building_libffi 1' > libffi$base_ver.spec
sed -e '/^# LIBFFI-DELETE-BEGIN/,/^#
LIBFFI-DELETE-END/d;s/^Name:[[:space:]]*gcc/Name: libffi/g' \
gcc.spec.in \
@@ -95,7 +100,8 @@

test -f gcc$base_ver.changes \
&& ( ln -f gcc$base_ver.changes libgcj$base_ver.changes; \
- ln -f gcc$base_ver.changes libffi$base_ver.changes )
+ ln -f gcc$base_ver.changes libffi$base_ver.changes; \
+ ln -f gcc$base_ver.changes gcc$base_ver-testresults.changes; )
fi


@@ -106,31 +112,28 @@
sed -n -e '/COMMON-BEGIN/,/COMMON-END/p' $outfile
sed -n -e '/COMMON-END/,$p' cross-icecream.spec.in; } |
sed -e "s#@cross_arch@#$arch#" > cross-$arch-gcc-icecream-backend.spec
- test -f gcc*.changes && ln -f gcc*.changes
cross-$arch-gcc-icecream-backend.changes
+ test -f gcc$base_ver.changes && ln -f gcc$base_ver.changes
cross-$arch-gcc-icecream-backend.changes
done
fi

export outfile
-# avr is static but wants the non-static versioned name
-if test "$do_cross_static" = 1 ; then
- echo '%define build_static 1' > cross-avr-gcc$base_ver.spec
- cross_arch=avr name_suffix="43" sh cross.spec.in >>
cross-avr-gcc$base_ver.spec
- test -f gcc*.changes && ln -f gcc*.changes cross-avr-gcc$base_ver.changes
-fi
if test "$do_cross_shared" = 1 ; then
# shared cross
for arch in spu; do
- cross_arch=$arch name_suffix="" sh cross.spec.in > cross-$arch-gcc.spec
- test -f gcc*.changes && ln -f gcc*.changes cross-$arch-gcc.changes
+ base_ver=$base_ver cross_arch=$arch sh cross.spec.in >
cross-$arch-gcc$base_ver.spec
+ test -f gcc$base_ver.changes && ln -f gcc$base_ver.changes
cross-$arch-gcc$base_ver.changes
done
fi
if test "$do_cross_static" = 1 ; then
- # static cross
-# for arch in spu i586 x86_64 s390x s390 sparc powerpc powerpc64; do
+ # static crosses
for arch in spu; do
- echo '%define build_static 1' > cross-$arch-gcc-static.spec
- cross_arch=$arch name_suffix="-static" sh cross.spec.in >>
cross-$arch-gcc-static.spec
- test -f gcc*.changes && ln -f gcc*.changes cross-$arch-gcc-static.changes
+ echo '%define build_static 1' > cross-$arch-gcc$base_ver-static.spec
+ base_ver=$base_ver cross_arch=$arch name_suffix="-static" sh cross.spec.in
cross-$arch-gcc$base_ver-static.spec
+ test -f gcc$base_ver.changes && ln -f gcc$base_ver.changes
cross-$arch-gcc$base_ver-static.changes
done
+ # avr is static but wants the non-static versioned name
+ echo '%define build_static 1' > cross-avr-gcc$base_ver.spec
+ base_ver=$base_ver cross_arch=avr sh cross.spec.in >>
cross-avr-gcc$base_ver.spec
+ test -f gcc$base_ver.changes && ln -f gcc$base_ver.changes
cross-avr-gcc$base_ver.changes
fi
exit 0

++++++ cross-icecream.spec.in ++++++
--- /var/tmp/diff_new_pack.ojBZfF/_old 2010-03-04 16:06:25.000000000 +0100
+++ /var/tmp/diff_new_pack.ojBZfF/_new 2010-03-04 16:06:25.000000000 +0100
@@ -19,7 +19,6 @@
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
-%define gcc_for_opt 0
%define gcc_target_arch @cross_arch@-linux
%define gcc_icecream 1


++++++ cross.spec.in ++++++
--- /var/tmp/diff_new_pack.ojBZfF/_old 2010-03-04 16:06:25.000000000 +0100
+++ /var/tmp/diff_new_pack.ojBZfF/_new 2010-03-04 16:06:25.000000000 +0100
@@ -31,7 +31,6 @@
%define build_objcp 0
%define build_nof 0
%define build_with_mudflap 0
-%define gcc_for_opt 0
%define gcc_target_arch $cross_arch

%if "$cross_arch" == "spu"
@@ -42,24 +41,25 @@
%define build_fortran 0
%endif

-Name: cross-$cross_arch-gcc$name_suffix
+Name: cross-$cross_arch-gcc$base_ver$name_suffix
BuildRequires: bison flex mpfr-devel zlib-devel mpc-devel
%ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc
BuildRequires: cloog-devel ppl-devel libelf0-devel
%endif
BuildRequires: cross-$cross_arch_cpu-binutils
-%if "$cross_arch$name_suffix" == "spu-static"
+%if "$cross_arch" == "spu"
+%if 0%{?build_static:1}
BuildRequires: cross-$cross_arch_cpu-newlib-headers
-%endif
-%if "$cross_arch$name_suffix" == "spu"
+%else
BuildRequires: cross-$cross_arch_cpu-newlib
+%endif
Requires: cross-$cross_arch_cpu-newlib
%endif
Requires: cross-$cross_arch_cpu-binutils
# Suffixed gcc conflicts with unsuffixed gcc
%if "$name_suffix" == ""
%else
-Conflicts: cross-$cross_arch_cpu-gcc
+Conflicts: cross-$cross_arch_cpu-gcc$base_ver
%endif

%define _prefix /opt/cross


++++++ gcc-4.5.0-20100218.tar.bz2 -> gcc-4.5.0-20100302.tar.bz2 ++++++
gcc45/gcc-4.5.0-20100218.tar.bz2
/mounts/work_src_done/STABLE/gcc45/gcc-4.5.0-20100302.tar.bz2 differ: byte 11,
line 1

++++++ gcc.spec.in ++++++
--- /var/tmp/diff_new_pack.ojBZfF/_old 2010-03-04 16:06:25.000000000 +0100
+++ /var/tmp/diff_new_pack.ojBZfF/_new 2010-03-04 16:06:25.000000000 +0100
@@ -45,7 +45,7 @@
%define build_libjava 0
%else
%define build_java 1
-%define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}
+%define build_libjava
0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
%endif

%define build_cp 1
@@ -148,7 +148,7 @@
%define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64

URL: http://gcc.gnu.org/
-Version: 4.5.0_20100218
+Version: 4.5.0_20100302
Release: 1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
@@ -215,6 +215,7 @@
# Patches for SAP features
Patch130: sap303956-uchar.diff

+# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
# LIBJAVA-DELETE-BEGIN
Group: Development/Languages/C and C++
@@ -761,6 +762,7 @@
# PACKAGE-END

%package -n gcc@base_ver@-testresults
+# GCC-TESTSUITE-DELETE-END
License: Public Domain, Freeware
Summary: Testsuite results
Group: Development/Languages/C and C++
@@ -928,12 +930,13 @@
%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
+#%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
-#%patch9
+%patch9
%patch10
%if !%{build_nof}
%patch12
@@ -1203,6 +1206,7 @@
%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
cd obj-%{GCCDIST}
+# GCC-TESTSUITE-DELETE-BEGIN
# Work around tail/head -1 changes
export _POSIX2_VERSION=199209
export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
@@ -1449,11 +1453,13 @@
mv $l.new $l
done

+# GCC-TESTSUITE-DELETE-END
%if %{run_tests}
cp `find . -name "*.sum"` ../testresults/
cp `find . -name "*.log" \! -name "config.log" |grep -v 'acats/tests' `
../testresults/
chmod 644 ../testresults/*
%endif
+# GCC-TESTSUITE-DELETE-BEGIN
# LIBFFI-DELETE-BEGIN
%if %{build_cp}
# Find C++ and Java headers
@@ -2182,6 +2188,7 @@
%endif
%endif
%endif
+# GCC-TESTSUITE-DELETE-END

%if %{run_tests}
%files -n gcc@base_ver@-testresults

++++++ Wunprototyped-calls.diff ++++++
--- /var/tmp/diff_new_pack.ojBZfF/_old 2010-03-04 16:06:25.000000000 +0100
+++ /var/tmp/diff_new_pack.ojBZfF/_new 2010-03-04 16:06:25.000000000 +0100
@@ -1,94 +1,72 @@
Index: gcc/c.opt
===================================================================
-*** gcc/c.opt.orig 2009-05-08 15:12:10.000000000 +0200
---- gcc/c.opt 2009-05-08 15:41:27.000000000 +0200
-*************** Wunsuffixed-float-constants
-*** 480,485 ****
---- 480,489 ----
- C ObjC Var(warn_unsuffixed_float_constants) Warning
- Warn about unsuffixed float constants
-
-+ Wunprototyped-calls
-+ C Var(warn_unprototyped_calls) Warning
-+ Warn about calls to unprototyped functions with at least one argument
-+
- Wunused-macros
- C ObjC C++ ObjC++ Warning
- Warn about macros defined in the main file that are not used
+--- gcc/c.opt.orig 2010-02-22 13:47:22.000000000 +0100
++++ gcc/c.opt 2010-02-24 16:22:12.000000000 +0100
+@@ -488,6 +488,10 @@ Wunsuffixed-float-constants
+ C ObjC Var(warn_unsuffixed_float_constants) Warning
+ Warn about unsuffixed float constants
+
++Wunprototyped-calls
++C Var(warn_unprototyped_calls) Warning
++Warn about calls to unprototyped functions with at least one argument
++
+ Wunused-macros
+ C ObjC C++ ObjC++ Warning
+ Warn about macros defined in the main file that are not used
Index: gcc/testsuite/gcc.dg/cleanup-1.c
===================================================================
-*** gcc/testsuite/gcc.dg/cleanup-1.c.orig 2008-08-29 10:39:37.000000000
+0200
---- gcc/testsuite/gcc.dg/cleanup-1.c 2009-05-08 15:41:27.000000000 +0200
-***************
-*** 6,12 ****
- #define C(x) __attribute__((cleanup(x)))
-
- static int f1(void *x U) { return 0; }
-! static void f2() { }
- static void f3(void) { }
- static void f4(void *x U) { }
- static void f5(int *x U) { }
---- 6,12 ----
- #define C(x) __attribute__((cleanup(x)))
-
- static int f1(void *x U) { return 0; }
-! static void f2() { } /* { dg-message "declared here" "" } */
- static void f3(void) { }
- static void f4(void *x U) { }
- static void f5(int *x U) { }
-*************** static void f9(int x U) { } /* { dg-mess
-*** 18,24 ****
- void test(void)
- {
- int o1 C(f1);
-! int o2 C(f2);
- int o3 C(f3); /* { dg-error "too many arguments" } */
- int o4 C(f4);
- int o5 C(f5);
---- 18,24 ----
- void test(void)
- {
- int o1 C(f1);
-! int o2 C(f2); /* { dg-warning "without a real prototype" } */
- int o3 C(f3); /* { dg-error "too many arguments" } */
- int o4 C(f4);
- int o5 C(f5);
+--- gcc/testsuite/gcc.dg/cleanup-1.c.orig 2010-02-23 12:43:21.000000000
+0100
++++ gcc/testsuite/gcc.dg/cleanup-1.c 2010-02-24 16:22:39.000000000 +0100
+@@ -6,7 +6,7 @@
+ #define C(x) __attribute__((cleanup(x)))
+
+ static int f1(void *x U) { return 0; }
+-static void f2() { }
++static void f2() { } /* { dg-message "declared here" "" } */
+ static void f3(void) { } /* { dg-message "note: declared here" } */
+ static void f4(void *x U) { }
+ static void f5(int *x U) { }
+@@ -18,7 +18,7 @@ static void f9(int x U) { } /* { dg-mess
+ void test(void)
+ {
+ int o1 C(f1);
+- int o2 C(f2);
++ int o2 C(f2); /* { dg-warning "without a real prototype" } */
+ int o3 C(f3); /* { dg-error "too many arguments" } */
+ int o4 C(f4);
+ int o5 C(f5);
Index: gcc/c-typeck.c
===================================================================
-*** gcc/c-typeck.c.orig 2009-05-08 15:12:10.000000000 +0200
---- gcc/c-typeck.c 2009-05-08 15:41:27.000000000 +0200
-*************** build_function_call_vec (tree function,
-*** 2549,2554 ****
---- 2549,2566 ----
- && !check_builtin_function_arguments (fundecl, nargs, argarray))
- return error_mark_node;
-
-+ /* If we cannot check function arguments because a prototype is
-+ missing for the callee, warn here. */
-+ if (warn_unprototyped_calls
-+ && nargs > 0 && !TYPE_ARG_TYPES (fntype)
-+ && fundecl && !DECL_BUILT_IN (fundecl) && !C_DECL_IMPLICIT (fundecl)
-+ && !DECL_ARGUMENTS (fundecl))
-+ {
-+ warning (OPT_Wunprototyped_calls,
-+ "call to function %qD without a real prototype", fundecl);
-+ inform (DECL_SOURCE_LOCATION (fundecl), "%qD was declared here",
fundecl);
-+ }
-+
- /* Check that the arguments to the function are valid. */
- check_function_arguments (TYPE_ATTRIBUTES (fntype), nargs, argarray,
- TYPE_ARG_TYPES (fntype));
+--- gcc/c-typeck.c.orig 2010-02-23 12:43:26.000000000 +0100
++++ gcc/c-typeck.c 2010-02-24 16:22:12.000000000 +0100
+@@ -2700,6 +2700,18 @@ build_function_call_vec (location_t loc,
+ && !check_builtin_function_arguments (fundecl, nargs, argarray))
+ return error_mark_node;
+
++ /* If we cannot check function arguments because a prototype is
++ missing for the callee, warn here. */
++ if (warn_unprototyped_calls
++ && nargs > 0 && !TYPE_ARG_TYPES (fntype)
++ && fundecl && !DECL_BUILT_IN (fundecl) && !C_DECL_IMPLICIT (fundecl)
++ && !DECL_ARGUMENTS (fundecl))
++ {
++ warning (OPT_Wunprototyped_calls,
++ "call to function %qD without a real prototype", fundecl);
++ inform (DECL_SOURCE_LOCATION (fundecl), "%qD was declared here",
fundecl);
++ }
++
+ /* Check that the arguments to the function are valid. */
+ check_function_arguments (TYPE_ATTRIBUTES (fntype), nargs, argarray,
+ TYPE_ARG_TYPES (fntype));
Index: gcc/c-opts.c
===================================================================
-*** gcc/c-opts.c.orig 2009-05-05 14:09:52.000000000 +0200
---- gcc/c-opts.c 2009-05-08 15:41:56.000000000 +0200
-*************** c_common_handle_option (size_t scode, co
-*** 408,413 ****
---- 408,414 ----
- can turn it off only if it's not explicit. */
- if (warn_main == -1)
- warn_main = (value ? 2 : 0);
-+ warn_unprototyped_calls = 1;
-
- /* In C, -Wall turns on -Wenum-compare, which we do here.
- In C++ it is on by default, which is done in
+--- gcc/c-opts.c.orig 2009-11-26 17:07:43.000000000 +0100
++++ gcc/c-opts.c 2010-02-24 16:22:12.000000000 +0100
+@@ -410,6 +410,7 @@ c_common_handle_option (size_t scode, co
+ can turn it off only if it's not explicit. */
+ if (warn_main == -1)
+ warn_main = (value ? 2 : 0);
++ warn_unprototyped_calls = 1;
+
+ /* In C, -Wall turns on -Wenum-compare, which we do here.
+ In C++ it is on by default, which is done in


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread