https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42947
--- Comment #6 from Sergei Trofimovich <slyfox at inbox dot ru> --- Created attachment 43931 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43931&action=edit 0001-gcc-config.gcc-sh-Disable-sysroot-suffix-PR42947.patch 0001-gcc-config.gcc-sh-Disable-sysroot-suffix-PR42947.patch implements "- drop SYSROOT_SUFFIX_SPEC support for sh* targets" above. Tested as: cc="${HOME}/dev/git/gcc-sh4-installed/bin/sh4-unknown-linux-gnu-gcc -B/usr/libexec/gcc/sh4-unknown-linux-gnu/" $ cc="${built}/sh4-unknown-linux-gnu-gcc" $ echo 'int main(){}' > 'a.c' $ $cc a.c -o a $ $cc a.c -o a.m4 -m4 $ $cc a.c -o a.m4 -m4-100 All 3 work now.