Target triplet: sh-elf vs sh1-elf vs sh2-elf

Segher Boessenkool
Thu Jan 21 00:42:20 GMT 2021

On Wed, Jan 20, 2021 at 03:49:28PM -0500, John Scott via Gcc-help wrote:
> Hi,
> I'm interested in building the cross toolchain needed to build carl9170 
> wireless firmware. The docs say that it needs an SH-2 toolchain, but the build 
> scripts only use the 'sh-elf' tuple. (I've asked about this on the linux-
> wireless list but haven't garnered a response.)
> It seems like config.sub is equally happy to accept sh-elf and sh[1234]-elf, so 
> I wonder if the first is an alias and to what, or how Binutils+GCC interprets 
> the difference.

sh2-elf defaults to -m2, while sh-elf defaults to -m1.  This is only a
default, with either toolchain you can generate code for both targets.

(It could be that some other things or defaulted differently by the
target files, or even disabled,or hardcoded -- I only looked in


More information about the Gcc-help mailing list