Re: Glob to match bare-metal SuperH target triple in config.gcc seems wrong (sh*-superh-elf)?
Oleg Endo via Gcc <[email protected]> Sat, 18 Apr 2026 12:10:45 +0900
| Newsgroups | gmane.comp.gcc.devel,gmane.linux.debian.ports.superh |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2026-04-14 at 08:42 +0200, John Paul Adrian Glaubitz via Gcc wrote: > Hi John, >=20 > On Tue, 2026-04-14 at 02:38 +0000, John Scott wrote: > > I noticed at https://forge.sourceware.org/gcc/gcc-mirror/src/branch/mas= ter/gcc/config.gcc#L3399 that > > a glob expression "sh*-superh-elf" is used, and it's apparently intende= d to match embedded SuperH > > targets. However, the use of the "superh" token in the target triple ap= pears 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 claus= e 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). >=20 > It actually makes sense since there used to be a company called "SuperH" = back then, see: >=20 > https://www.eetimes.com/hitachi-and-stmicro-form-superh-company/ >=20 > > 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. Fo= r example, sh2-superh-elf > > wouldn't get this "magic" treatment of being promoted to sh4. >=20 > Sounds like just a minor convenience feature to default the SH target to = sh4. The main purpose of SuperH Inc was to develop the SH5 aka SH64. SH5 consisted of the SHcompact instruction set and SHmedia instruction set.=20 SHcompact was essentially SH4 while SHmedia was the SIMD 64-bit next- generation-=C3=BCber-lord-CPU or something like that. > > This is, at the very least, confusing, and if it's on purpose some in-l= ine commentary would be helpful. > > Maybe there was a historical reason for this? Otherwise it would be fit= ting if the matching expression > > didn't include a manufacturer/vendor name because that is imprecise and= doesn't make a lot of sense here. >=20 I guess they tried to use "superh" as a name for ABI/flavor here, which defaulted to SH4 baseline. I don't think it has of any meaning or significance anymore. SH5 / SH64 support has been removed already a while ago. This might just be (yet another) leftover piece. Best regards, Oleg Endo