[PATCH] [RSB] Add support for building Epiphany tools

Hesham ALMatary heshamelmatary at gmail.com
Wed Apr 22 08:23:10 UTC 2015


On Tue, Apr 21, 2015 at 11:30 PM, Chris Johns <chrisj at rtems.org> wrote:
> On 22/04/2015 2:33 am, Hesham ALMatary wrote:
>> This patch adds support for building Epiphany tools.
>
> Great to see this support being adding.
>
>> Currently some tools
>> are fetched from my repositories (until my pull requests get merged), and
>> other tools are fetched from Adapteva repositories. In the future, the
>> tools should be fetched from GNU upstreams when Adapteva folks push
>> their latest changes there.
>
> Have you posted your changes to Adapteva ? Would they accept them ?
Yes. They merged my changes about two months ago (that's why I fetch
binutils from their repo), but I submitted a bug fix two days ago
(pull request still pending), that's why I don't use their GCC and GDB
repos. When my latest changes get merged I'll refer to their repos.
>
>> ---
>>  rtems/config/4.11/rtems-epiphany.bset  | 43 ++++++++++++++++++++++++++++++++++
>>  source-builder/config/binutils-2-1.cfg |  4 ++--
>>  source-builder/config/gcc-common-1.cfg |  5 ++--
>>  source-builder/config/gdb-7-1.cfg      |  4 ++--
>>  4 files changed, 50 insertions(+), 6 deletions(-)
>>  create mode 100644 rtems/config/4.11/rtems-epiphany.bset
>>
>> diff --git a/rtems/config/4.11/rtems-epiphany.bset b/rtems/config/4.11/rtems-epiphany.bset
>> new file mode 100644
>> index 0000000..429031f
>> --- /dev/null
>> +++ b/rtems/config/4.11/rtems-epiphany.bset
>> @@ -0,0 +1,43 @@
>> +#
>> +# Tools Set for RTEMS Epiphany 4.11 Stable
>> +#
>> +
>> +%define release 1
>> +
>> +%define rtems_arch epiphany
>> +
>> +#
>> +# Get GNU tools from external repositories.
>> +#
>> +%define binutils_external 1
>> +%define gcc_external 1
>> +%define gdb_external 1
>> +
>> +#
>> +# Expanded names of the GNU tools
>> +#
>> +%define binutils_expand_name epiphany-binutils-gdb-epiphany-binutils-2.23-software-cache
>> +%define gcc_expand_name epiphany-gcc-epiphany-gcc-4.9
>> +%define gdb_expand_name epiphany-binutils-gdb-epiphany-gdb-7.8
>> +
>
> Is this really 'binutils_source_name' or 'binutils_source_top' ?
This is name of the directory the result from expanding the zip file.
For example I am downloading a specific branch of a repo [1] the name
would be "repo_name+branch_name" (epiphany-gcc+epiphany-gcc-4.9).

[1] https://github.com/adapteva/epiphany-gcc/tree/epiphany-gcc-4.9
>
>> +#
>> +# Fetch GNU tools from external repos (temporarly).
>> +#
>> +%source set binutils https://github.com/adapteva/epiphany-binutils-gdb/archive/epiphany-binutils-2.23-software-cache.zip
>
> Is the expanded tree in the ZIP file not the same as the file name ?
>
No. The ZIP file is only the branch name, the the expanded directory
is "repo_name+branch_name". This is the main reason why I added this
tool_external define. The default cfg files (like gcc-common-1.cfg)
assume a pattern of the expanded directory (i.e, gcc-%{gcc_version}),
any other format wouldn't work. I came across the same issue when
trying to fetch GNU tools from OpenRISC repos. My solutions are: 1)
provide a separate config files for such an external tools that will
be redundant to handle only the different expansion name (I submitted
this version of the patch) and the other solution 2) is adding this
"external" features introduced in this patch.
>> +%source set gcc https://github.com/heshamelmatary/epiphany-gcc/archive/epiphany-gcc-4.9.zip
>> +%source set gdb https://github.com/heshamelmatary/epiphany-binutils-gdb/archive/epiphany-gdb-7.8.zip
>> +
>> +#
>> +# 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.23.1-1
>> +tools/rtems-gcc-4.9.1-newlib-git-1
>> +tools/rtems-gdb-7.8.1-1
>> +tools/rtems-tools-4.11-1
>> diff --git a/source-builder/config/binutils-2-1.cfg b/source-builder/config/binutils-2-1.cfg
>> index c74a2c7..d37674d 100644
>> --- a/source-builder/config/binutils-2-1.cfg
>> +++ b/source-builder/config/binutils-2-1.cfg
>> @@ -37,8 +37,8 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
>>  %prep
>>    build_top=$(pwd)
>>
>> -  source_dir_binutils="binutils-%{binutils_version}"
>> -  %source setup binutils -q -n binutils-%{binutils_version}
>> +  source_dir_binutils=%{?binutils_external:%{binutils_expand_name}}%{!?binutils_external:"binutils-%{binutils_version}"}
>> +  %source setup binutils -q -n %{?binutils_external:%{binutils_expand_name}}%{!?binutils_external:binutils-%{binutils_version}}
>
> Can this be simplified with something like:
>
> %binutils_sources=%{?binutils_source_name:%{binutils_source_name}}%{!?binutils_source_name:"binutils-%{binutils_version}"}
>
> source_dir_binutils=%{binutils_sources}
> %source setup binutils -q -n %{binutils_sources}
>
Sure, that's better.
> The same would go for the other tools.
>
> Chris
>
>
>>    %patch setup binutils -p1
>>
>>    cd ${build_top}
>> diff --git a/source-builder/config/gcc-common-1.cfg b/source-builder/config/gcc-common-1.cfg
>> index dd0cf4c..b6fa4bd 100644
>> --- a/source-builder/config/gcc-common-1.cfg
>> +++ b/source-builder/config/gcc-common-1.cfg
>> @@ -41,8 +41,9 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
>>    build_top=$(pwd)
>>
>>    # gcc and optional the g++ core if separate packages
>> -  source_dir_gcc="gcc-%{gcc_version}"
>> -  %source setup gcc -q -n gcc-%{gcc_version}
>> +  source_dir_gcc=%{?gcc_external:%{gcc_expand_name}}%{!?gcc_external:"gcc-%{gcc_version}"}
>> +  %source setup gcc -q -n %{?gcc_external:%{gcc_expand_name}}%{!?gcc_external:gcc-%{gcc_version}}
>> +
>>    %patch setup gcc -p1
>>    cd ${build_top}
>>
>> diff --git a/source-builder/config/gdb-7-1.cfg b/source-builder/config/gdb-7-1.cfg
>> index 6e84375..792db50 100644
>> --- a/source-builder/config/gdb-7-1.cfg
>> +++ b/source-builder/config/gdb-7-1.cfg
>> @@ -66,8 +66,8 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
>>  %prep
>>    build_top=$(pwd)
>>
>> -  source_dir_gdb="gdb-%{gdb_version}"
>> -  %source setup gdb -q -n gdb-%{gdb_version}
>> +  source_dir_gdb=%{?gdb_external:%{gdb_expand_name}}%{!?gdb_external:"gdb-%{gdb_version}"}
>> +  %source setup gdb -q -n %{?gdb_external:%{gdb_expand_name}}%{!?gdb_external:gdb-%{gdb_version}}
>>    %patch setup gdb -p1
>>
>>    cd ${build_top}
>>



-- 
Hesham



More information about the devel mailing list