Skip to contentSkip to conversation

sh: Add SH2A CodeSourcery external toolchain

PATCH New Phil Edworthy 3 participants 4 messages May 6, 2011 – Jul 12, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: Add SH2A CodeSourcery external toolchain

Added the CodeSourcery uCLinux/uClibc toolchain for the SH2A big endian devices.

---
 toolchain/toolchain-external/Config.in   |   13 +++++++++++++
 toolchain/toolchain-external/ext-tool.mk |    3 +++
 2 files changed, 16 insertions(+), 0 deletions(-)
toolchain/toolchain-external/Config.in +13 -0
index c95945f..cb489bd 100644
@@ -101,6 +101,18 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
             - SH4A, uClibc, little endian
             - SH4A, uClibc, big endian
 
+config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH2A_201009
+	bool "CodeSoucery SH 2010.09"
+	depends on BR2_sh2a_nofpueb || BR2_sh2eb
+	select BR2_TOOLCHAIN_EXTERNAL_UCLIBC
+	select BR2_INSTALL_LIBSTDCPP
+	help
+	  Toolchain for the SuperH architecture, from CodeSourcery. It
+	  uses gcc 4.5.1, binutils 2.20, uClibc 0.9.30, gdb 7.2.50 and
+	  kernel headers 2.6.35.2. It has support for
+	  the following variants:
+            - SH2A, uClibc, big endian
+
 config BR2_TOOLCHAIN_EXTERNAL_CUSTOM
        bool "Custom toolchain"
        help
@@ -138,6 +150,7 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX
 	default "mips-linux-gnu"         if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
 	default "powerpc-linux-gnu"      if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
 	default "sh-linux-gnu"           if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
+	default "sh-uclinux"             if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH2A_201009
 	default $(BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX) \
 					 if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
 
toolchain/toolchain-external/ext-tool.mk +3 -0
index 328f908..e23af99 100644
@@ -179,6 +179,9 @@ TOOLCHAIN_EXTERNAL_SOURCE=freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-g
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009),y)
 TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/superh/portal/package7783/public/sh-linux-gnu/
 TOOLCHAIN_EXTERNAL_SOURCE=renesas-2010.09-45-sh-linux-gnu-i686-pc-linux-gnu.tar.bz2
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH2A_201009),y)
+TOOLCHAIN_EXTERNAL_SITE=http://www.codesourcery.com/sgpp/lite/superh/portal/package7859/public/sh-uclinux/
+TOOLCHAIN_EXTERNAL_SOURCE=renesas-2010.09-60-sh-uclinux-i686-pc-linux-gnu.tar.bz2
 else
 # A value must be set (even if unused), otherwise the
 # $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) rule would override the main
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 sh: Add SH2A CodeSourcery external toolchain

Hello,

Quoted 2 lines · On Fri, 06 May 2011 15:23:04 +0100 Phil Edworthy <[email protected]>…

Added the CodeSourcery uCLinux/uClibc toolchain for the SH2A big endian devices.

However, I have a question regarding the sh2a_nofpueb and sh2eb target architecture variants to which this toolchain applies. In Buildroot, we use the target architecture variant to build the host tuple, which is then used as the --host=XXX-YYY argument to build autotools-based packages.

So for example, when sh2eb is selected, we pass "--host=sh2eb-linux" to the ./configure script of all autotools-based packages.

Unfortunately, neither sh2a_nofpueb nor sh2eb are recognized as correct machine types by config.sub. From packages/gnuconfig/config.sub:

        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \

So, a package such as dropbear fails to build with:

checking host system type... Invalid configuration sh2eb-linux': machine sh2eb' not recognized

I don't know anything about the various CPU types in the SuperH world, so I can't fix it myself, but obviously the target variants do need some cleanup/improvements. Could you help us to improve this ?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 sh: Add SH2A CodeSourcery external toolchain

Hi Thomas,

Quoted 20 lines
Quoted 2 lines · On Fri, 06 May 2011 15:23:04 +0100 Phil Edworthy <[email protected]>…

Added the CodeSourcery uCLinux/uClibc toolchain for the SH2A big endian devices.

However, I have a question regarding the sh2a_nofpueb and sh2eb target architecture variants to which this toolchain applies. In Buildroot, we use the target architecture variant to build the host tuple, which is then used as the --host=XXX-YYY argument to build autotools-based packages.

So for example, when sh2eb is selected, we pass "--host=sh2eb-linux" to the ./configure script of all autotools-based packages.

Unfortunately, neither sh2a_nofpueb nor sh2eb are recognized as correct machine types by config.sub. From packages/gnuconfig/config.sub:

Quoted 6 lines
        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \

So, a package such as dropbear fails to build with:

checking host system type... Invalid configuration sh2eb-linux': machine sh2eb' not recognized

Ah, I see. I just checked busybox built for sh2a.

Quoted 3 lines

I don't know anything about the various CPU types in the SuperH world, so I can't fix it myself, but obviously the target variants do need some cleanup/improvements. Could you help us to improve this ?

Hmm, SuperH has a lengthy mix of cpu types & pretty much everything I have done is with sh4a devices. I'll ask around to find out a bit more about sh2 devices and attempt to clean this up.

Thanks for pointing this out!
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110509/946da4b6/attachment.html>

#3 lore raw

PATCH 1/1 sh: Add SH2A CodeSourcery external toolchain

In reply to Phil Edworthy
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Phil" == Phil Edworthy <[email protected]> writes:

Phil> Added the CodeSourcery uCLinux/uClibc toolchain for the SH2A big Phil> endian devices.

Phil> Signed-off-by: Phil Edworthy <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard