[PATCH] [RSB] Add support for building rtems-or1k tool-chain.

Hesham Moustafa heshamelmatary at gmail.com
Mon May 26 00:02:49 UTC 2014


On Mon, May 26, 2014 at 12:57 AM, Chris Johns <chris at contemporary.net.au>wrote:

> On 25/05/2014 10:12 am, Hesham ALMatary wrote:
>
>> From: Hesham AL-Matary <heshamelmatary at gmail.com>
>>
>> Configuration files get the following releases:
>> - binutils-2.24
>> - newlib-2.1.0
>> - gcc-4.8.2
>> - gdb-7.7
>>
>> Patches are mix of OpenRISC original patches and other
>> additions to build the previous releases for RTEMS.
>>
>
> Thanks. We are look forward to get this into the tool set.
>
>
>  ---
>>   rtems/config/4.11/rtems-or1k.bset                  | 26 ++++++
>>   rtems/config/tools/rtems-binutils-2.24-or1k.cfg    | 25 ++++++
>>   .../tools/rtems-gcc-4.8.2-newlib-2.1.0-or1k.cfg    | 39 +++++++++
>>   rtems/config/tools/rtems-gdb-7.7-or1k.cfg          | 28 +++++++
>>   source-builder/config/gdb-7-7-or1k.cfg             | 95
>> ++++++++++++++++++++++
>>   5 files changed, 213 insertions(+)
>>   create mode 100644 rtems/config/4.11/rtems-or1k.bset
>>   create mode 100644 rtems/config/tools/rtems-binutils-2.24-or1k.cfg
>>   create mode 100644 rtems/config/tools/rtems-gcc-
>> 4.8.2-newlib-2.1.0-or1k.cfg
>>   create mode 100644 rtems/config/tools/rtems-gdb-7.7-or1k.cfg
>>   create mode 100644 source-builder/config/gdb-7-7-or1k.cfg
>>
>> diff --git a/rtems/config/4.11/rtems-or1k.bset b/rtems/config/4.11/rtems-
>> or1k.bset
>> new file mode 100644
>> index 0000000..dbc95e7
>> --- /dev/null
>> +++ b/rtems/config/4.11/rtems-or1k.bset
>> @@ -0,0 +1,26 @@
>> +#
>> +# Tools Set for RTEMS or1k 4.11 Stable
>> +#
>> +
>> +%define release 1
>> +
>> +%define rtems_arch or1k
>> +
>> +#
>> +# The RTEMS 4.11 BSP to build and test
>> +#
>> +%define rtems_bsps      all
>> +
>> +#
>> +# The RTEMS 4.11 base defines.
>> +#
>> +%include rtems-4.11-base.bset
>> +
>> +#
>> +# Tools configuration.
>> +#
>> +4.11/rtems-autotools
>> +devel/expat-2.1.0-1
>> +tools/rtems-binutils-2.24-or1k
>> +tools/rtems-gcc-4.8.2-newlib-2.1.0-or1k
>> +tools/rtems-gdb-7.7-or1k
>> diff --git a/rtems/config/tools/rtems-binutils-2.24-or1k.cfg
>> b/rtems/config/tools/rtems-binutils-2.24-or1k.cfg
>> new file mode 100644
>> index 0000000..d1e352a
>> --- /dev/null
>> +++ b/rtems/config/tools/rtems-binutils-2.24-or1k.cfg
>> @@ -0,0 +1,25 @@
>> +#
>> +# Binutils 2.24.
>> +#
>> +
>> +%include %{_configdir}/checks.cfg
>> +%include %{_configdir}/base.cfg
>> +
>> +%define binutils_version 2.24
>> +
>> +#
>> +# Enable deterministic archives by default. This will be the default
>> +# there all tools using this binutils will create deterministic
>> +# archives.
>> +#
>> +%define with_deterministic_archives 1
>> +
>> +#
>> +# or1k patches
>> +#
>> +%patch add binutils -p1 https://raw.githubusercontent.
>> com/heshamelmatary/or1k-rtems/master/patches/binutils-2.24-
>> or1k-rtems.diff
>> +
>>
>
> If you move this to the bset file can you use rtems-binutils-2.24.cfg ?
>
> Build set files support %source and %patch. This localises architecture
> specific patches to that architecture.
>
> That makes sense. I was just separating the whole process of patching,
custom configurations and building in earlier stages to easily catch up
errors. But now after every thing works fine, I will delete all *or1k*.cfg
files, and make changes as few as possible, most likely it will be just a
new .bset file as you suggested.

>
>  +#
>> +# 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.8.2-newlib-2.1.0-or1k.cfg
>> b/rtems/config/tools/rtems-gcc-4.8.2-newlib-2.1.0-or1k.cfg
>> new file mode 100644
>> index 0000000..be4b7cc
>> --- /dev/null
>> +++ b/rtems/config/tools/rtems-gcc-4.8.2-newlib-2.1.0-or1k.cfg
>>
>
> Same here ?
>
>
>  @@ -0,0 +1,39 @@
>> +#
>> +# GCC 4.8.2., Newlib-2.1.0
>> +#
>> +
>> +%include %{_configdir}/checks.cfg
>> +%include %{_configdir}/base.cfg
>> +%include %{_configdir}/versions.cfg
>> +
>> +%define newlib_version 2.1.0
>> +%define gcc_version    4.8.2
>> +%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
>> +
>> +%ifn %{defined with_iconv}
>> +%define with_iconv 1
>> +%endif
>> +
>> +#
>> +# Chris's patch to use the POSIX thread model for C++.
>> +#
>> +%patch add gcc %{rtems_gcc_patches}/gcc-rtems-thread-model-posix-1.diff
>> +
>> +#
>> +# or1k patch for gcc-4.8.2
>> +#
>> +%patch add gcc -p1 https://raw.githubusercontent.
>> com/heshamelmatary/or1k-rtems/master/patches/gcc-4.8.2-or1k-
>> rtems-29-4-2014.diff
>> +
>> +#
>> +# newlib-2.1.0 or1k patch
>> +#
>> +%patch add newlib -p1 https://raw.githubusercontent.
>> com/heshamelmatary/or1k-rtems/master/patches/newlib-cvs-
>> or1k-rtems-29-4-2014.diff
>> +
>> +# The gcc/newlib build instructions. We use 4.8 Release 1.
>> +#
>> +%include %{_configdir}/gcc-4.8-1.cfg
>> diff --git a/rtems/config/tools/rtems-gdb-7.7-or1k.cfg
>> b/rtems/config/tools/rtems-gdb-7.7-or1k.cfg
>> new file mode 100644
>> index 0000000..676e250
>> --- /dev/null
>> +++ b/rtems/config/tools/rtems-gdb-7.7-or1k.cfg
>> @@ -0,0 +1,28 @@
>> +#
>> +# GDB 7.7.
>> +#
>> +
>> +%include %{_configdir}/checks.cfg
>> +%include %{_configdir}/base.cfg
>> +
>> +%define gdb_version 7.7
>> +
>> +#
>> +# Clean up the sim-arange inline code so it builds.
>> +#
>> +%patch add gdb %{rtems_gdb_patches}/gdb-sim-arange-inline.diff
>> +%patch add gdb %{rtems_gdb_patches}/gdb-sim-cgen-inline.diff
>> +
>> +#
>> +# or1k patch
>> +#
>> +%patch add gdb -p1 https://raw.githubusercontent.
>> com/heshamelmatary/or1k-rtems/master/patches/gdb-7.7-or1k-rtems.diff
>> +
>> +%if %{_build_os} == freebsd
>> + %patch add gdb -p0 %{rtems_gdb_patches}/patch-
>> gdb-python-python-config.py
>> +%endif
>> +
>> +#
>> +# The gdb build instructions. We use 7.xx Release 1.
>> +#
>> +%include %{_configdir}/gdb-7-7-or1k.cfg
>> diff --git a/source-builder/config/gdb-7-7-or1k.cfg
>> b/source-builder/config/gdb-7-7-or1k.cfg
>> new file mode 100644
>> index 0000000..04d748f
>> --- /dev/null
>> +++ b/source-builder/config/gdb-7-7-or1k.cfg
>>
>
> Just looking at this file I cannot see what has changed ? Why do we need a
> special gdb build script ?
>
> Chris
>
>
>  @@ -0,0 +1,95 @@
>> +#
>> +# GDB 7.xx Version 1.
>> +#
>> +# This configuration file configure's, make's and install's gdb.
>> +#
>> +
>> +%include %{_configdir}/checks.cfg
>> +
>> +#
>> +# Select Snapshot Macro Maps
>> +#
>> +%select gdb-snapshot
>> +%select expat-snapshot
>> +
>> +#
>> +# The description.
>> +#
>> +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
>> +#
>> +%source set gdb http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2
>> +
>> +#
>> +#
>> +# Prepare the source code.
>> +#
>> +%prep
>> +  build_top=$(pwd)
>> +
>> +  source_dir_gdb="gdb-%{gdb_version}"
>> +  %source setup gdb -q -n gdb-%{gdb_version}
>> +  %patch setup gdb -p1
>> +
>> +  cd ${build_top}
>> +
>> +%build
>> +  build_top=$(pwd)
>> +
>> +  %{build_directory}
>> +
>> +  mkdir -p ${build_dir}
>> +  cd ${build_dir}
>> +
>> +  %{host_build_flags}
>> +
>> +  if test "%{_build}" != "%{_host}" ; then
>> +    GDB_LIBS_STATIC="-lexpat"
>> +  else
>> +    GDB_LIBS_STATIC="-lexpat"
>> +    GDB_LIBS="%{_forced_static}"
>> +  fi
>> +
>> +  LIBS_STATIC=${GDB_LIBS_STATIC} \
>> +  LIBS=${GDB_LIBS} \
>> +  ../${source_dir_gdb}/configure \
>> +    --build=%{_build} --host=%{_host} \
>> +    --target=%{_target} \
>> +    --verbose --disable-nls \
>> +    --without-included-gettext \
>> +    --disable-win32-registry \
>> +    --disable-werror \
>> +    --disable-sim \
>> +    --with-expat \
>> +    --without-python \
>> +    --prefix=%{_prefix} --bindir=%{_bindir} \
>> +    --exec-prefix=%{_exec_prefix} \
>> +    --includedir=%{_includedir} --libdir=%{_libdir} \
>> +    --mandir=%{_mandir} --infodir=%{_infodir}
>> +
>> +  %{__make} %{?_smp_mflags} all
>> +
>> +  cd ${build_top}
>> +
>> +%install
>> +  build_top=$(pwd)
>> +
>> +  %{__rmdir} $SB_BUILD_ROOT
>> +
>> +  cd ${build_dir}
>> +  %{__make} DESTDIR=$SB_BUILD_ROOT install
>> +
>> +  # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
>> +  %{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info*
>> +
>> +  %{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
>> +  touch $SB_BUILD_ROOT%{_infodir}/dir
>> +
>> +  cd ${build_top}
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140526/0879a235/attachment-0001.html>


More information about the devel mailing list