Add unstable.

Add a tree of unstable configurations to track recent gcc source.
This commit is contained in:
Chris Johns 2013-02-20 14:46:51 +11:00
parent 9f04b64113
commit a32dcbdda5
4 changed files with 339 additions and 0 deletions

View File

@ -0,0 +1,55 @@
#
# GCC 4.7.2., Newlib 2.0.0
#
%include %{_configdir}/checks.cfg
%include %{_configdir}/base.cfg
%define gcc_version 4.7.2
%define newlib_version 2.0.0
%define mpfr_version 3.0.1
%define mpc_version 0.8.2
%define gmp_version 5.0.5
%define with_threads 1
%define with_plugin 0
%define with_iconv 1
#
# AVR C++ does not work.
# configure: error: unable to detect exception model
#
%if %{_target} == avr-rtems4.11
%define enable_cxx 0
%endif
#
# M32C C++ does not work.
# gcc-4.7.2/libstdc++-v3/src/mt_allocator.cc:76: error: cast from 'void*' to 'size_t' loses precision
#
%if %{_target} == m32c-rtems4.11
%define enable_cxx 0
%endif
%ifn %{defined enable_cxx}
%define enable_cxx 1
%endif
#
# If arm-rtems4.11 add --enable-obsolete.
#
%if %{_target} == arm-rtems4.11
%define enable_obsolete 1
%else
%define enable_obsolete 0
%endif
#
# The RTEMS 4.11 patches
#
Patch0: gcc-4.7.2-rtems4.11-20121026.diff
#
# The gcc/newlib build instructions. We use 4.7 Release 1.
#
%include %{_configdir}/gcc-4.7-1.cfg

View File

@ -0,0 +1,55 @@
#
# GCC 4.8.x., Newlib 2.0.0
#
%include %{_configdir}/checks.cfg
%include %{_configdir}/base.cfg
%define gcc_version 4.8-20130217
%define newlib_version 2.0.0
%define mpfr_version 3.0.1
%define mpc_version 0.8.2
%define gmp_version 5.0.5
%define with_threads 1
%define with_plugin 0
%define with_iconv 1
#
# AVR C++ does not work.
# configure: error: unable to detect exception model
#
%if %{_target} == avr-rtems4.11
%define enable_cxx 0
%endif
#
# M32C C++ does not work.
# gcc-4.7.2/libstdc++-v3/src/mt_allocator.cc:76: error: cast from 'void*' to 'size_t' loses precision
#
%if %{_target} == m32c-rtems4.11
%define enable_cxx 0
%endif
%ifn %{defined enable_cxx}
%define enable_cxx 1
%endif
#
# If arm-rtems4.11 add --enable-obsolete.
#
%if %{_target} == arm-rtems4.11
%define enable_obsolete 1
%else
%define enable_obsolete 0
%endif
#
# The RTEMS 4.11 patches
#
Source0: ftp://gcc.gnu.org/pub/gcc/snapshots/%{gcc_version}/gcc-%{gcc_version}.tar.bz2
#
# The gcc/newlib build instructions. We use 4.7 Release 1.
#
%include %{_configdir}/gcc-4.8-1.cfg

View File

@ -0,0 +1,20 @@
#
# Tools Set for RTEMS ARM 4.11 Unstable
#
%define _target arm-rtems4.11
%define release 1
#
# The RTEMS 4.11 base defines.
#
%include rtems-4.11-base.bset
#
# Tools configuration.
#
expat-2.1.0-1
tools/rtems-binutils-2.22-1
tools/rtems-gcc-4.8-ss-newlib-2.0.0-1
tools/rtems-gdb-7.5-1

View File

@ -0,0 +1,209 @@
#
# GCC 4.7 Version 1.
#
# This configuration file configure's, make's and install's gcc. It uses
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
#
#
# Default to C++ on.
#
%ifn %{defined enable_cxx}
%define enable_cxx 1
%endif
%include %{_configdir}/checks.cfg
%ifn %{defined gcc_version_message}
%error No GCC Version message defined.
%endif
Name: %{_target}-gcc-%{gcc_version}-newlib-%{newlib_version}-%{release}
Summary: GCC v%{gcc_version} and Newlib v%{newlib_version} for target %{_target} on host %{_host}
Version: %{gcc_version}
Release: %{release}
URL: http://gcc.gnu.org/
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
#
# GCC core and G++
#
%ifn %{defined Source0}
Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
VersionContro0: git clone git://gcc.gnu.org/git/gcc.git
%endif
#
# Newlib
#
%ifn %{defined Source10}
Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
VersionControl10: cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src co newlib
%endif
#
# Packages GCC requires
#
%ifn %{defined Source20}
Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
%endif
%ifn %{defined Source21}
Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
%endif
%ifn %{defined Source22}
Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
%endif
#
# The GCC library directory
#
%global _gcclibdir %{_prefix}/lib
#
# Prepare the source code.
#
%prep
%setup -q -c -T -n %{name}-%{version}
# gcc and optional the g++ core if separate packages
%setup -q -T -D -n %{name}-%{version} -a0
%{?source1:%setup -q -T -D -n %{name}-%{version} -a1}
cd gcc-%{gcc_version}
%{?patch0:%patch0 -p1}
%{?patch1:%patch1 -p1}
%{?patch2:%patch2 -p1}
%{?patch3:%patch3 -p1}
%{?patch4:%patch4 -p1}
%{?patch5:%patch5 -p1}
%{?patch6:%patch6 -p1}
%{?patch7:%patch7 -p1}
%{?patch8:%patch8 -p1}
%{?patch9:%patch9 -p1}
cd ..
# newlib
%setup -q -T -D -n %{name}-%{version} -a10
cd newlib-%{newlib_version}
%{?patch10:%patch10 -p1}
%{?patch11:%patch11 -p1}
%{?patch12:%patch12 -p1}
%{?patch13:%patch13 -p1}
%{?patch14:%patch14 -p1}
%{?patch15:%patch15 -p1}
%{?patch16:%patch16 -p1}
%{?patch17:%patch17 -p1}
%{?patch18:%patch18 -p1}
%{?patch19:%patch19 -p1}
cd ..
# Link newlib into the gcc source tree
ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version}
# MPFR
%setup -q -T -D -n %{name}-%{version} -a20
cd mpfr-%{mpfr_version}
%{?patch20:%patch20 -p1}
cd ..
# Build MPFR one-tree style
ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_version}/mpfr
# MPC
%setup -q -T -D -n %{name}-%{version} -a21
cd mpc-%{mpc_version}
%{?patch21:%patch21 -p1}
cd ..
# Build MPC one-tree style
ln -s ../mpc-%{mpc_version} gcc-%{gcc_version}/mpc
# GMP
%setup -q -T -D -n %{name}-%{version} -a22
cd gmp-%{gmp_version}
%{?patch22:%patch22 -p1}
cd ..
# Build GMP one-tree style
ln -s ../gmp-%{gmp_version} gcc-%{gcc_version}/gmp
echo "%{gcc_version_message}" > gcc-%{gcc_version}/gcc/DEV-PHASE
# Fix timestamps
cd gcc-%{gcc_version}
contrib/gcc_update --touch
cd ..
%build
export PATH="%{_bindir}:${PATH}"
mkdir -p build
cd build
languages="c"
%if %{enable_cxx}
languages="$languages,c++"
%endif
%if "%{_build}" != "%{_host}"
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
CC="%{_host}-gcc ${SB_OPT_FLAGS}" \
%else
# gcc is not ready to be compiled with -std=gnu99
CC=$(echo "%{__cc} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
%endif
../gcc-%{gcc_version}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
--includedir=%{_includedir} \
--libdir=%{_gcclibdir} \
--libexecdir=%{_libexecdir} \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--datadir=%{_datadir} \
--build=%_build --host=%_host \
--target=%{_target} \
--disable-libstdcxx-pch \
--with-gnu-as --with-gnu-ld --verbose \
--with-newlib \
--with-system-zlib \
--disable-nls --without-included-gettext \
--disable-win32-registry \
--enable-version-specific-runtime-libs \
%{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \
%{?with_threads:--enable-threads}%{!?with_threads:--disable-threads} \
%{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \
--enable-newlib-io-c99-formats \
%{?with_iconv:--enable-newlib-iconv} \
%if %{enable_obsolete}
--enable-obsolete \
%endif
--enable-languages="$languages"
%if "%_host" != "%_build"
# Bug in gcc-3.2.1:
# Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
mkdir -p gcc/include
cp ../gcc-%{gcc_version}/gcc/gsyslimits.h gcc/include/syslimits.h
%endif
%{__make} %{?_smp_mflags} all
cd ..
%install
export PATH="%{_bindir}:${PATH}"
rm -rf $SB_BUILD_ROOT
cd build
%{__make} DESTDIR=$SB_BUILD_ROOT install
cd ..
# libiberty doesn't honor --libdir, but always installs to a
# magically guessed _libdir
rm -f ${SB_BUILD_ROOT}%{_libdir}/libiberty.a
# We use the version from binutils
rm -f $SB_BUILD_ROOT%{_bindir}/%{_target}-c++filt%{_exeext}
# We don't ship info/dir
rm -f $SB_BUILD_ROOT%{_infodir}/dir
# Don't want libffi's man-pages
rm -f $SB_BUILD_ROOT%{_mandir}/man3/*ffi*