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

Rob Landley <[email protected]> Tue, 14 Apr 2026 17:58:11 -0500
Newsgroups gmane.linux.debian.ports.superh
Message-ID <[email protected]>
On 4/14/26 01:42, John Paul Adrian Glaubitz wrote:
> Hi John,
> 
> On Tue, 2026-04-14 at 02:38 +0000, John Scott wrote:
>> 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 tripl
>> "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).
> 
> It actually makes sense since there used to be a company called "SuperH" back then, see:
> 
> https://www.eetimes.com/hitachi-and-stmicro-form-superh-company/

Renesas was founded a year after that article. (Adding Mitsubishi to the 
pile.)

>> 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.
> 
> Sounds like just a minor convenience feature to default the SH target to sh4.

I'm told there was a brief period where hitachi tried to come out with a 
new chip design each year, which is why sh2, sh3, and sh4 came in rapid 
succession, then sh4 really took off and they focused on that until 
https://en.wikipedia.org/wiki/1997_Asian_financial_crisis happened and 
Hitachi cut its chip budget. A few years later they spun off their 
hardware arm in partnership with other japanese firms who couldn't 
afford their own chip lines anymore...

So there's a lot of embedded sh1/sh2 (nommu, started life as a 
home-grown alternative to motorola's m68k) and a lot of sh4 (QEMU has 
qemu-system-sh4 but not qemu-system-sh) but sh3 got overshadowed because 
it only had a year or so in the sun.

>> 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.
> 
> Is sh4-superh-elf actually a bare-metal target?

That's a Jeff question, but I do know that once upon a time "superh" was 
short for "super hitachi" but Renesas got VERY VERY ANGRY if you called 
it that and thus did a "kfc is NOT kentucky fried chicken" sort of thing 
about it...

> Adrian

Rob