Re: Glob to match bare-metal SuperH target triple in config.gcc seems wrong (sh*-superh-elf)?

Andrew Stubbs <[email protected]> Thu, 16 Apr 2026 10:23:19 +0100
Newsgroups gmane.comp.gcc.devel,gmane.linux.debian.ports.superh
Message-ID <[email protected]>
On 14/04/2026 03:38, John Scott wrote:
> Hi,
> 
> I noticed at https://forge.sourceware.org/gcc/gcc-mirror/src/branch/master/gcc/config.gcc#L3399 that a glob expression "sh*-superh-elf" is used, and it's apparently intended to match embedded SuperH targets. However, the use of the "superh" token in the target triple appears to be serving as a manufacturer name. This looks like it could be a mistake; for example, I simply use the target triple "sh-elf" when building Debian's bare-metal toolchain, and so this clause wouldn't take effect. It's also weird to see SuperH used in the manufacturer field anyway (Hitachi and Renesas would be more fitting if this were intended).
> On the other hand, such as at lines 3429 and 3466 there, it seems like "sh-superh-*" is intended to be the same as "sh4-*", but only if there is no suffix on the CPU name. For example, sh2-superh-elf wouldn't get this "magic" treatment of being promoted to sh4.
> 
> This is, at the very least, confusing, and if it's on purpose some in-line commentary would be helpful. Maybe there was a historical reason for this? Otherwise it would be fitting if the matching expression didn't include a manufacturer/vendor name because that is imprecise and doesn't make a lot of sense here.

This vendor tag was intended to match the preferred configuration used 
by the SuperH Inc. for their customers and internal users (primarily 
SH4, as you observed).  If those definitions happen to match what you 
need now then great, but since SuperH folded in 2004 I would not expect 
any ongoing support.

The vendor tag continued to be used by ST and others for while, but even 
that is ancient history now.

Andrew
Formerly of SuperH and ST.