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

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.superh,gmane.comp.gcc.devel
Message-ID <227995e2a9846e9f07457ae7f7bdc55ad4690ee1.camel@physik.fu-berlin.de>
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/

> 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.

> 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?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.