Subject: sheb/shel toolchain problems?
To: None <,>
From: Andrew Gillham <>
List: port-sh3
Date: 02/03/2001 03:49:08

I was not able to cross build a working toolchain.  The problems I would
run into were messages like "can't write a.out file" from 'as', and
BFD errors from 'ld'.

To get a working libbfd I hacked Makefile like this:
---       Sat Feb  3 03:36:44 2001
+++ Makefile    Fri Jan 12 12:46:02 2001
@@ -178,7 +178,7 @@
 DEFAULT_VEC.sh3el=     shcoff_vec
 DEFAULT_VEC.sh3eb=     shcoff_vec
-SELECT_VECS+=          ${DEFAULT_VEC.sh3el} shlcoff_vec \
+SELECT_VECS+=          ${DEFAULT_VEC.sh3} shlcoff_vec \
                        bfd_elf32_shunx_vec bfd_elf32_shlunx_vec
 SRCS+=                 cpu-sh.c sh-dis.c \

This seemed to fix the problem with 'as', since it appeared to be trying
to use a BFD format that wasn't there or something.

For, I make the following change to Makefile:
--- Makefile    Fri Jan 12 12:47:33 2001
+++       Sat Feb  3 03:40:14 2001
@@ -14,6 +14,8 @@
     (${MACHINE_ARCH} == "mipsel") || \
     (${MACHINE_ARCH} == "powerpc") || \
     (${MACHINE_ARCH} == "sh3") || \
+    (${MACHINE_ARCH} == "sh3el") || \
+    (${MACHINE_ARCH} == "sh3eb") || \
     (${MACHINE_ARCH} == "sparc" && defined(ELF_PLEASE))
 PROG=          ld
 MAN=           ld.1
@@ -76,11 +78,13 @@
 DEFAULT_EMUL.powerpc=  elf32ppc

 ##### sh3 #####
+EMULS.sh3el=           shunx shlunx elf32shunx elf32shlunx
 EMULS.sh3=             shunx shlunx elf32shunx elf32shlunx
 .if defined(ELF_PLEASE)
 DEFAULT_EMUL.sh3=      elf32shunx
-DEFAULT_EMUL.sh3=      shunx
+DEFAULT_EMUL.sh3=      shlunx
+DEFAULT_EMUL.sh3el=    shlunx

 ##### sparc #####

This got me to a working 'ld' also, but neither patch is exactly
right.  I think there needs to be a check for sh3eb .vs. sh3el.
Also, gas appears to default to big endian, which ends up requiring
a '-Wa,-little' argument to gcc.  Should some patch be added to the
build to default to little endian?

Anyway, I am trying to get my dreamcast to be self-hosting, so the
toolchain is kind of important. :-)  The cross compile tools work
pretty nicely, but it appears nobody is using sh3el yet to selfhost?