diff mbox

[2/2] toolchain-external: Add Sourcery CodeBench for Nios-II

Message ID 1376999946-3314-2-git-send-email-ezequiel.garcia@free-electrons.com
State Superseded
Headers show

Commit Message

Ezequiel Garcia Aug. 20, 2013, 11:59 a.m. UTC
From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>

This commit adds the pre-built Sourcery CodeBench toolchains
currently available for the Nios-II architecture.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
---
 toolchain/toolchain-external/Config.in   | 26 ++++++++++++++++++++++++++
 toolchain/toolchain-external/ext-tool.mk |  6 ++++++
 2 files changed, 32 insertions(+)

Comments

Arnout Vandecappelle Aug. 21, 2013, 6:15 a.m. UTC | #1
On 08/20/13 13:59, Ezequiel Garcia wrote:
> From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
>
> This commit adds the pre-built Sourcery CodeBench toolchains
> currently available for the Nios-II architecture.
>
> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> ---
>   toolchain/toolchain-external/Config.in   | 26 ++++++++++++++++++++++++++
>   toolchain/toolchain-external/ext-tool.mk |  6 ++++++
>   2 files changed, 32 insertions(+)
>
> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index ad1f203..9c0ffb1 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -402,6 +402,30 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203
>   comment "Sourcery CodeBench toolchains are only available for MIPS/MIPS64 o32 and n64"
>   	depends on BR2_MIPS_NABI32
>
> +config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12
> +	bool "Sourcery CodeBench Nios-II 2013.05-12"
> +	depends on BR2_nios2
> +	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
> +	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
> +	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
> +	select BR2_INSTALL_LIBSTDCPP
> +	select BR2_HOSTARCH_NEEDS_IA32_LIBS
> +	help
> +	  Sourcery CodeBench toolchain for the Nios-II architecture,
> +	  from Mentor Graphics.

  The help text should say which gcc and glibc version are included.

> +
> +config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
> +	bool "Sourcery CodeBench Nios-II 2013.05-43"

  Why do you want to support two patchlevels of the same base version?

  Regards,
  Arnout

> +	depends on BR2_nios2
> +	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
> +	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
> +	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
> +	select BR2_INSTALL_LIBSTDCPP
> +	select BR2_HOSTARCH_NEEDS_IA32_LIBS
> +	help
> +	  Sourcery CodeBench toolchain for the Nios-II architecture,
> +	  from Mentor Graphics.
> +
>   config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103
>   	bool "Sourcery CodeBench PowerPC 2011.03"
>   	depends on BR2_powerpc
> @@ -818,6 +842,8 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX
>   	default "mips-linux-gnu"         if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203
>   	default "mips-linux-gnu"         if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209
>   	default "mips-linux-gnu"         if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305
> +	default "nios2-linux-gnu"        if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
> +	default "nios2-linux-gnu"        if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12
>   	default "powerpc-linux-gnu"      if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
>   	default "powerpc-linux-gnu"      if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103
>   	default "sh-linux-gnu"           if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201103
> diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
> index 01be85c..1d7b2f4 100644
> --- a/toolchain/toolchain-external/ext-tool.mk
> +++ b/toolchain/toolchain-external/ext-tool.mk
> @@ -247,6 +247,12 @@ TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.09-99-mips-linux-gnu-i686-pc-linux-gnu.tar
>   else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305),y)
>   TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/mips-linux-gnu/
>   TOOLCHAIN_EXTERNAL_SOURCE = mips-2013.05-36-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
> +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12),y)
> +TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/nios2-linux-gnu/
> +TOOLCHAIN_EXTERNAL_SOURCE = sourceryg++-2013.05-12-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2
> +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43),y)
> +TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/nios2-linux-gnu/
> +TOOLCHAIN_EXTERNAL_SOURCE = sourceryg++-2013.05-43-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2
>   else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009),y)
>   TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/powerpc-linux-gnu/
>   TOOLCHAIN_EXTERNAL_SOURCE = freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-gnu.tar.bz2
>
Ezequiel Garcia Aug. 21, 2013, 1:32 p.m. UTC | #2
Hi Arnout,

On 21 August 2013 03:15, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 08/20/13 13:59, Ezequiel Garcia wrote:
>>
>> From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
>>
>> This commit adds the pre-built Sourcery CodeBench toolchains
>> currently available for the Nios-II architecture.
>>
>> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
>> ---
>>   toolchain/toolchain-external/Config.in   | 26 ++++++++++++++++++++++++++
>>   toolchain/toolchain-external/ext-tool.mk |  6 ++++++
>>   2 files changed, 32 insertions(+)
>>
>> diff --git a/toolchain/toolchain-external/Config.in
>> b/toolchain/toolchain-external/Config.in
>> index ad1f203..9c0ffb1 100644
>> --- a/toolchain/toolchain-external/Config.in
>> +++ b/toolchain/toolchain-external/Config.in
>> @@ -402,6 +402,30 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203
>>   comment "Sourcery CodeBench toolchains are only available for
>> MIPS/MIPS64 o32 and n64"
>>         depends on BR2_MIPS_NABI32
>>
>> +config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12
>> +       bool "Sourcery CodeBench Nios-II 2013.05-12"
>> +       depends on BR2_nios2
>> +       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
>> +       select BR2_TOOLCHAIN_EXTERNAL_GLIBC
>> +       select BR2_TOOLCHAIN_HAS_NATIVE_RPC
>> +       select BR2_INSTALL_LIBSTDCPP
>> +       select BR2_HOSTARCH_NEEDS_IA32_LIBS
>> +       help
>> +         Sourcery CodeBench toolchain for the Nios-II architecture,
>> +         from Mentor Graphics.
>
>
>  The help text should say which gcc and glibc version are included.
>
>

Yes, I was aware of that. I tried to find such information, but couldn't :-(

Any idea how do I get that information from the toolchain itself?

>> +
>> +config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
>> +       bool "Sourcery CodeBench Nios-II 2013.05-43"
>
>
>  Why do you want to support two patchlevels of the same base version?
>

Not sure, actually. Just added all the options currently available.

Do you think is silly? Should I leave the latest one alone?

Thanks,
Arnout Vandecappelle Aug. 21, 2013, 4:57 p.m. UTC | #3
On 08/21/13 15:32, Ezequiel García wrote:
> Hi Arnout,
>
> On 21 August 2013 03:15, Arnout Vandecappelle <arnout@mind.be> wrote:
>> On 08/20/13 13:59, Ezequiel Garcia wrote:
>>>
>>> From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
>>>
>>> This commit adds the pre-built Sourcery CodeBench toolchains
>>> currently available for the Nios-II architecture.
>>>
>>> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
>>> ---
>>>    toolchain/toolchain-external/Config.in   | 26 ++++++++++++++++++++++++++
>>>    toolchain/toolchain-external/ext-tool.mk |  6 ++++++
>>>    2 files changed, 32 insertions(+)
>>>
>>> diff --git a/toolchain/toolchain-external/Config.in
>>> b/toolchain/toolchain-external/Config.in
>>> index ad1f203..9c0ffb1 100644
>>> --- a/toolchain/toolchain-external/Config.in
>>> +++ b/toolchain/toolchain-external/Config.in
>>> @@ -402,6 +402,30 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203
>>>    comment "Sourcery CodeBench toolchains are only available for
>>> MIPS/MIPS64 o32 and n64"
>>>          depends on BR2_MIPS_NABI32
>>>
>>> +config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12
>>> +       bool "Sourcery CodeBench Nios-II 2013.05-12"
>>> +       depends on BR2_nios2
>>> +       depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
>>> +       select BR2_TOOLCHAIN_EXTERNAL_GLIBC
>>> +       select BR2_TOOLCHAIN_HAS_NATIVE_RPC
>>> +       select BR2_INSTALL_LIBSTDCPP
>>> +       select BR2_HOSTARCH_NEEDS_IA32_LIBS
>>> +       help
>>> +         Sourcery CodeBench toolchain for the Nios-II architecture,
>>> +         from Mentor Graphics.
>>
>>
>>   The help text should say which gcc and glibc version are included.
>>
>>
>
> Yes, I was aware of that. I tried to find such information, but couldn't :-(
>
> Any idea how do I get that information from the toolchain itself?

cross-gcc --version
cross-gdb --version
cross-ar --version
ls -l output/staging/lib*/libc-*.so

  Kernel version is a bit more difficult: cat 
output/staging/usr/include/linux/version.h and convert the decimal 
version number to hex.

  Look at the rest of the toolchain-external/Config.in for examples.

  The supported architectures should also be mentioned, but that may be 
more difficult.

>
>>> +
>>> +config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
>>> +       bool "Sourcery CodeBench Nios-II 2013.05-43"
>>
>>
>>   Why do you want to support two patchlevels of the same base version?
>>
>
> Not sure, actually. Just added all the options currently available.
>
> Do you think is silly? Should I leave the latest one alone?

  Yes, only the latest one.

  We do usually keep an older version around as well, but I'm not really 
sure why. For the Sourcery toolchains it makes sense because they have 
different gcc versions, but the Linaro toolchains often only have 
bugfixes between one version and the next.


  Regards,
  Arnout
Thomas Petazzoni Aug. 21, 2013, 6:47 p.m. UTC | #4
Dear Ezequiel García,

On Wed, 21 Aug 2013 10:32:25 -0300, Ezequiel García wrote:

> Yes, I was aware of that. I tried to find such information, but couldn't :-(
> 
> Any idea how do I get that information from the toolchain itself?

Usually, all the Sourcery CodeBench toolchain have a document in
share/doc/<tuple>/pdf/getting-started.pdf with many details about the
toolchain.

Otherwise:

 * nios-linux-gcc -v
 * nios-linux-gdb -v
 * find . -name 'ld-*.so' will identify which ld-2.xx.so, which will
   tell you the version of glibc

> >  Why do you want to support two patchlevels of the same base version?
> >
> 
> Not sure, actually. Just added all the options currently available.

Hum?

> Do you think is silly? Should I leave the latest one alone?

You can support multiple versions, but not multiple patchlevel of the
same version, because it's silly.

Since I know you know how kernel versions work, what you did is like
supporting 3.10.6 and 3.10.7: it's pointless, 3.10.7 is basically the
same as 3.10.6 with a few additional fixes. Of course, supporting both
3.9 and 3.10 might make sense.

Look at the other Sourcery Codebench toolchain entries in Buildroot. We
support multiple versions, but not multiple patchlevel of the same
version.

Thanks!

Thomas
Ezequiel Garcia Aug. 21, 2013, 7:18 p.m. UTC | #5
On 21 August 2013 15:47, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Ezequiel García,
>
> On Wed, 21 Aug 2013 10:32:25 -0300, Ezequiel García wrote:
>
>> Yes, I was aware of that. I tried to find such information, but couldn't :-(
>>
>> Any idea how do I get that information from the toolchain itself?
>
> Usually, all the Sourcery CodeBench toolchain have a document in
> share/doc/<tuple>/pdf/getting-started.pdf with many details about the
> toolchain.
>

Ah, good hint. The PDFs have many details, indeed.

> Otherwise:
>
>  * nios-linux-gcc -v
>  * nios-linux-gdb -v

Yup, I manage to get up to here....

>  * find . -name 'ld-*.so' will identify which ld-2.xx.so, which will
>    tell you the version of glibc
>

.. and I couldn't get to get the libc and binutils version.

>> >  Why do you want to support two patchlevels of the same base version?
>> >
>>
>> Not sure, actually. Just added all the options currently available.
>
> Hum?
>
>> Do you think is silly? Should I leave the latest one alone?
>
> You can support multiple versions, but not multiple patchlevel of the
> same version, because it's silly.
>
> Since I know you know how kernel versions work, what you did is like
> supporting 3.10.6 and 3.10.7: it's pointless, 3.10.7 is basically the
> same as 3.10.6 with a few additional fixes. Of course, supporting both
> 3.9 and 3.10 might make sense.
>
> Look at the other Sourcery Codebench toolchain entries in Buildroot. We
> support multiple versions, but not multiple patchlevel of the same
> version.
>

Sure. Now I see why it was silly.
Ezequiel Garcia Aug. 21, 2013, 7:23 p.m. UTC | #6
Hi Arnout,

On 21 August 2013 13:57, Arnout Vandecappelle <arnout@mind.be> wrote:
[...]
>
>  Kernel version is a bit more difficult: cat
> output/staging/usr/include/linux/version.h and convert the decimal version
> number to hex.
>

Right.

>  The supported architectures should also be mentioned, but that may be more
> difficult.
>

Mmm... what do you mean by supported architectures?
I'm not an expert Nios-II user (just started working on it) but there doesn't
seem to be any architectural variants.

>
>  We do usually keep an older version around as well, but I'm not really sure
> why. For the Sourcery toolchains it makes sense because they have different
> gcc versions, but the Linaro toolchains often only have bugfixes between one
> version and the next.
>

Speaking of toolchains. Any recomendations on how to *choose* a toolchain?

Should I safely use Sourcery?
Should I prefer Buildroot internal (when we add support for it)?
Which should be the rationale behind such decision? (aside from the
fact the buildroot toolchain allows to be tuned)

Thanks a lot for the help!
Arnout Vandecappelle Aug. 21, 2013, 7:27 p.m. UTC | #7
On 21/08/13 21:23, Ezequiel García wrote:
[snip]
> Speaking of toolchains. Any recomendations on how to *choose* a toolchain?
>
> Should I safely use Sourcery?
> Should I prefer Buildroot internal (when we add support for it)?
> Which should be the rationale behind such decision? (aside from the
> fact the buildroot toolchain allows to be tuned)

  External toolchain has the advantage that you don't have to spend time 
(about an hour) on building it.

  Internal toolchain has the advantage that it is configurable, and can 
be uClibc based and therefore smaller. The difference between uClibc and 
glibc is in the order of 1MB, so it only really makes sense when you want 
a really small rootfs.

  Regards,
  Arnout
diff mbox

Patch

diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index ad1f203..9c0ffb1 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -402,6 +402,30 @@  config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203
 comment "Sourcery CodeBench toolchains are only available for MIPS/MIPS64 o32 and n64"
 	depends on BR2_MIPS_NABI32
 
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12
+	bool "Sourcery CodeBench Nios-II 2013.05-12"
+	depends on BR2_nios2
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	select BR2_INSTALL_LIBSTDCPP
+	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	help
+	  Sourcery CodeBench toolchain for the Nios-II architecture,
+	  from Mentor Graphics.
+
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
+	bool "Sourcery CodeBench Nios-II 2013.05-43"
+	depends on BR2_nios2
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
+	select BR2_INSTALL_LIBSTDCPP
+	select BR2_HOSTARCH_NEEDS_IA32_LIBS
+	help
+	  Sourcery CodeBench toolchain for the Nios-II architecture,
+	  from Mentor Graphics.
+
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103
 	bool "Sourcery CodeBench PowerPC 2011.03"
 	depends on BR2_powerpc
@@ -818,6 +842,8 @@  config BR2_TOOLCHAIN_EXTERNAL_PREFIX
 	default "mips-linux-gnu"         if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203
 	default "mips-linux-gnu"         if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209
 	default "mips-linux-gnu"         if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305
+	default "nios2-linux-gnu"        if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
+	default "nios2-linux-gnu"        if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12
 	default "powerpc-linux-gnu"      if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
 	default "powerpc-linux-gnu"      if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103
 	default "sh-linux-gnu"           if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201103
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index 01be85c..1d7b2f4 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -247,6 +247,12 @@  TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.09-99-mips-linux-gnu-i686-pc-linux-gnu.tar
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305),y)
 TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/mips-linux-gnu/
 TOOLCHAIN_EXTERNAL_SOURCE = mips-2013.05-36-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_12),y)
+TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/nios2-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE = sourceryg++-2013.05-12-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43),y)
+TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/nios2-linux-gnu/
+TOOLCHAIN_EXTERNAL_SOURCE = sourceryg++-2013.05-43-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009),y)
 TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/powerpc-linux-gnu/
 TOOLCHAIN_EXTERNAL_SOURCE = freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-gnu.tar.bz2