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

John Scott <[email protected]> Tue, 14 Apr 2026 02:38:14 +0000
Newsgroups gmane.linux.debian.ports.superh,gmane.comp.gcc.devel
Message-ID <[email protected]>
--=-qexMkIpqK3/+K62dlYkq
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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 i=
t'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 manuf=
acturer 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 use=
d in the manufacturer field anyway (Hitachi and Renesas would be more fitti=
ng 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 su=
ffix 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 m=
anufacturer/vendor name because that is imprecise and doesn't make a lot of=
 sense here.

Thanks

--=-qexMkIpqK3/+K62dlYkq
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----

iPsEABYKAKMWIQSiPzylvTnZ6xisfzWz9N0oYfTNugUCad2oj3IYaHR0cHM6Ly9q
b2huc2NvdHQubWUvLndlbGwta25vd24vbmkvc2hhLTI1Ni9zWUF3OTN6QUVrRkIy
RDREM1hOemRSeHEyMFBjNnByZGdtbEVWeXo0QUZRP2N0PWFwcGxpY2F0aW9uJTJG
cGdwLWtleXMSHGpzY290dEBwb3N0ZW8ubmV0AAoJELP03Shh9M26RhsA/iXjoDFY
E6dlGUlMDlCYHVzyElM+pK55Ze3gz77DehMtAP9EiVXBq4QnMtR5ijb5AyrofJu6
CIbr5ORKY0lQMpBQCQ==
=O+m+
-----END PGP SIGNATURE-----

--=-qexMkIpqK3/+K62dlYkq--