https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79724
--- Comment #10 from Nicolas Boulenguez <nicolas at debian dot org> --- Hello. I suggest that Homebrew adopt a solution tested for years by Debian: * install the executables as TARGET-gcc-VERSION * add symbolic links if necessary (gcc, gcc-VERSION, TARGET-gcc) * apply the patch provided here over 3 years ago https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87777 This URL always links to latest rebase: https://salsa.debian.org/toolchain-team/gcc/-/blob/master/debian/patches/ada-gcc-name.diff Until the assumptions are made explicit, the upstream code trying to guess the name of the gcc executable will probably keep changing, as it has for at least ten years. I have counted at least 6 similar bugs, and that’s only on Debian. This leads to duplicate efforts. For example, the diagnostic of this specific index error is included in the patch above.