From 3643c48bfb8c9fc9e3c93be8be16cda04a87a3d6 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 15 Mar 2013 15:33:59 +1100 Subject: [PATCH] Add RTEMS 4.9 support for i386 and SPARC. --- rtems/config/4.9/rtems-i386.bset | 20 ++ rtems/config/4.9/rtems-sparc.bset | 20 ++ rtems/config/rtems-4.9-base.bset | 30 +++ .../config/tools/rtems-binutils-2.19.1-1.cfg | 13 ++ .../tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg | 42 ++++ rtems/config/tools/rtems-gdb-6.8-1.cfg | 21 ++ source-builder/config/gcc-4.3-1.cfg | 200 ++++++++++++++++++ source-builder/config/gdb-6-1.cfg | 81 +++++++ 8 files changed, 427 insertions(+) create mode 100644 rtems/config/4.9/rtems-i386.bset create mode 100644 rtems/config/4.9/rtems-sparc.bset create mode 100644 rtems/config/rtems-4.9-base.bset create mode 100644 rtems/config/tools/rtems-binutils-2.19.1-1.cfg create mode 100644 rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg create mode 100644 rtems/config/tools/rtems-gdb-6.8-1.cfg create mode 100644 source-builder/config/gcc-4.3-1.cfg create mode 100644 source-builder/config/gdb-6-1.cfg diff --git a/rtems/config/4.9/rtems-i386.bset b/rtems/config/4.9/rtems-i386.bset new file mode 100644 index 0000000..e58f234 --- /dev/null +++ b/rtems/config/4.9/rtems-i386.bset @@ -0,0 +1,20 @@ +# +# Tools Set for RTEMS i386 4.9 Stable +# + +%define release 1 + +%define rtems_arch i386 + +# +# The RTEMS 4.9 base defines. +# +%include rtems-4.9-base.bset + +# +# Tools configuration. +# +expat-2.1.0-1 +tools/rtems-binutils-2.19.1-1 +tools/rtems-gcc-4.3.2-newlib-1.16.0-1 +tools/rtems-gdb-6.8-1 diff --git a/rtems/config/4.9/rtems-sparc.bset b/rtems/config/4.9/rtems-sparc.bset new file mode 100644 index 0000000..de08eb7 --- /dev/null +++ b/rtems/config/4.9/rtems-sparc.bset @@ -0,0 +1,20 @@ +# +# Tools Set for RTEMS SPARC 4.9 Stable +# + +%define release 1 + +%define rtems_arch sparc + +# +# The RTEMS 4.11 base defines. +# +%include rtems-4.9-base.bset + +# +# Tools configuration. +# +expat-2.1.0-1 +tools/rtems-binutils-2.19.1-1 +tools/rtems-gcc-4.3.2-newlib-1.16.0-1 +tools/rtems-gdb-6.8-1 diff --git a/rtems/config/rtems-4.9-base.bset b/rtems/config/rtems-4.9-base.bset new file mode 100644 index 0000000..61a229c --- /dev/null +++ b/rtems/config/rtems-4.9-base.bset @@ -0,0 +1,30 @@ +# +# Base defines for RTEMS 4.9 +# + +%define rtems_version 4.9 + +# +# Define the build target. +# +%define _target %{rtems_arch}-rtems%{rtems_version} + +# +# The generic package name. +# +package: rtems-%{rtems_version}-%{_target}-%{release} + +# +# Project custom message +# +%define gcc_version_message RTEMS %{rtems_version}-RSB(%{_sbgit_id})-%{release},gcc-%{gcc_version}/newlib-%{newlib_version} + +# +# The RTEMS http git URL. +# +%define rtems_http_git http://git.rtems.org +%define rtems_git_tools %{rtems_http_git}/rtems-tools.git/plain/tools/%{rtems_version} +%define rtems_binutils_patches %{rtems_git_tools}/binutils +%define rtems_gcc_patches %{rtems_git_tools}/gcc +%define rtems_newlib_patches %{rtems_git_tools}/newlib +%define rtems_gdb_patches %{rtems_git_tools}/gdb diff --git a/rtems/config/tools/rtems-binutils-2.19.1-1.cfg b/rtems/config/tools/rtems-binutils-2.19.1-1.cfg new file mode 100644 index 0000000..fb9f018 --- /dev/null +++ b/rtems/config/tools/rtems-binutils-2.19.1-1.cfg @@ -0,0 +1,13 @@ +# +# Binutils 2.19. +# + +%include %{_configdir}/checks.cfg +%include %{_configdir}/base.cfg + +%define binutils_version 2.19.1 + +# +# The binutils build instructions. We use 2.xx Release 1. +# +%include %{_configdir}/binutils-2-1.cfg diff --git a/rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg b/rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg new file mode 100644 index 0000000..b440c9f --- /dev/null +++ b/rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg @@ -0,0 +1,42 @@ +# +# GCC 4.3.1., Newlib 1.16.0 +# + +%include %{_configdir}/checks.cfg +%include %{_configdir}/base.cfg + +%define gcc_version 4.3.2 +%define newlib_version 1.16.0 +%define mpfr_version 2.4.2 +%define mpc_version 0.8.2 +%define gmp_version 5.1.1 + +%define with_threads 1 +%define with_plugin 0 +%define with_iconv 0 + +%ifn %{defined enable_cxx} +%define enable_cxx 1 +%endif + +%ifn %{defined enable_obsolete} +%define enable_obsolete 0 +%endif + +# +# The RTEMS 4.9 patches +# +Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2 +Patch0: %{rtems_gcc_patches}/gcc-core-4.3.2-rtems4.9-20090825.diff +Source1: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_version}.tar.bz2 +Patch10: %{rtems_newlib_patches}/newlib-1.16.0-rtems4.9-20090324.diff + +# +# Generic RTEMS patch handling. +# +%include rtems-gcc-patches.cfg + +# +# The gcc/newlib build instructions. We use 4.7 Release 1. +# +%include %{_configdir}/gcc-4.3-1.cfg diff --git a/rtems/config/tools/rtems-gdb-6.8-1.cfg b/rtems/config/tools/rtems-gdb-6.8-1.cfg new file mode 100644 index 0000000..49953b7 --- /dev/null +++ b/rtems/config/tools/rtems-gdb-6.8-1.cfg @@ -0,0 +1,21 @@ +# +# GDB 6.8. +# + +%include %{_configdir}/checks.cfg +%include %{_configdir}/base.cfg + +%define gdb_version 6.8 + +# +# RTEMS Build Set patches. +# +Source0: http://ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.bz2 +Patch0: %{rtems_gdb_patches}/gdb-6.8-rtems4.9-20091111.diff + +%include rtems-gdb-patches.cfg + +# +# The gdb build instructions. We use 6.xx Release 1. +# +%include %{_configdir}/gdb-6-1.cfg diff --git a/source-builder/config/gcc-4.3-1.cfg b/source-builder/config/gcc-4.3-1.cfg new file mode 100644 index 0000000..5ecd27b --- /dev/null +++ b/source-builder/config/gcc-4.3-1.cfg @@ -0,0 +1,200 @@ +# +# 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}. + GCC uses MPFR v%{mpfr_version}, MPC v%{mpc_version}, and GMP v%{gmp_version}. +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 +# +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 + +# +# Packages GCC requires +# +Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2 +Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz +Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2 + +# +# The GCC library directory +# +%global _gcclibdir %{_prefix}/lib + +# +# Prepare the source code. +# +%prep + # gcc and optional the g++ core if separate packages + %setup -q -c -n %{name}-%{version} + %{?source1:%setup -q -D -T -n %{name}-%{version} -a1} + cd gcc-%{gcc_version} + %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}} + %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}} + %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}} + %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}} + %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}} + %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}} + %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}} + %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}} + %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}} + %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}} + cd .. + + # newlib + %setup -q -D -T -n %{name}-%{version} -a10 + cd newlib-%{newlib_version} + %{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}} + %{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}} + %{?patch12:%patch12 %{?patch12_opts:%{patch12_opts}}%{!?patch12_opts:-p1}} + %{?patch13:%patch13 %{?patch13_opts:%{patch13_opts}}%{!?patch13_opts:-p1}} + %{?patch14:%patch14 %{?patch14_opts:%{patch14_opts}}%{!?patch14_opts:-p1}} + %{?patch15:%patch15 %{?patch15_opts:%{patch15_opts}}%{!?patch15_opts:-p1}} + %{?patch16:%patch16 %{?patch16_opts:%{patch16_opts}}%{!?patch16_opts:-p1}} + %{?patch17:%patch17 %{?patch17_opts:%{patch17_opts}}%{!?patch17_opts:-p1}} + %{?patch18:%patch18 %{?patch18_opts:%{patch18_opts}}%{!?patch18_opts:-p1}} + %{?patch19:%patch19 %{?patch19_opts:%{patch19_opts}}%{!?patch19_opts:-p1}} + cd .. + + # Link newlib into the gcc source tree + ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_version} + + # MPFR + %setup -q -D -T -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 -D -T -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 -D -T -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* diff --git a/source-builder/config/gdb-6-1.cfg b/source-builder/config/gdb-6-1.cfg new file mode 100644 index 0000000..678fd85 --- /dev/null +++ b/source-builder/config/gdb-6-1.cfg @@ -0,0 +1,81 @@ +# +# GDB 6.xx Version 1. +# +# This configuration file configure's, make's and install's gdb. +# + +%include %{_configdir}/checks.cfg + +Name: %{_target}-gdb-%{gdb_version}-%{release} +Summary: GDB v%{gdb_version} for target %{_target} on host %{_host} +Version: %{gdb_version} +Release: %{release} +URL: http://www.gnu.org/software/gdb/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +%ifn %{defined Source0} + Source0: http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2 + VersionControl0 git clone git://sourceware.org/git/gdb.git +%endif + +# +# Prepare the source code. +# +%prep + %setup -q -c -n %{name}-%{version} + cd gdb-%{gdb_version} + %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}} + %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}} + %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}} + %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}} + %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}} + %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}} + %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}} + %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}} + %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}} + %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}} + cd .. + +%build + export PATH="%{_bindir}:${PATH}" + mkdir -p build + cd build +%if "%{_build}" != "%{_host}" + CFLAGS_FOR_BUILD="-g -O2 -Wall" \ +%endif + CFLAGS="$SB_OPT_FLAGS" \ + ../gdb-%{gdb_version}/configure \ + --build=%{_build} --host=%{_host} \ + --target=%{_target} \ + --verbose --disable-nls \ + --without-included-gettext \ + --disable-win32-registry \ + --disable-werror \ + --enable-sim \ + --with-expat \ + %{!?without_python:--with-python} \ + --prefix=%{_prefix} --bindir=%{_bindir} \ + --exec-prefix=%{_exec_prefix} \ + --includedir=%{_includedir} --libdir=%{_libdir} \ + --mandir=%{_mandir} --infodir=%{_infodir} + + %{__make} %{?_smp_mflags} all + cd .. + +%install + export PATH="%{_bindir}:${PATH}" + rm -rf $SB_BUILD_ROOT + + cd build + %{__make} DESTDIR=$SB_BUILD_ROOT install + + # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. + rm -rf $SB_BUILD_ROOT%{_infodir}/configure.info* + + rm -f $SB_BUILD_ROOT%{_infodir}/dir + touch $SB_BUILD_ROOT%{_infodir}/dir + + cd ..