diff -Nru gcc-8.4.1-20200305.orig/gcc/gcc.c gcc-8.4.1-20200305/gcc/gcc.c --- gcc-8.4.1-20200305.orig/gcc/gcc.c 2020-03-10 11:34:46.000000000 +0000 +++ gcc-8.4.1-20200305/gcc/gcc.c 2021-06-11 20:54:35.938336123 +0000 @@ -2771,6 +2771,7 @@ bool do_multi) { struct file_at_path_info info; + char *path = NULL; #ifdef DEFAULT_ASSEMBLER if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0) @@ -2798,9 +2799,14 @@ info.suffix_len = strlen (info.suffix); info.mode = mode; - return (char*) for_each_path (pprefix, do_multi, + path = (char*) for_each_path (pprefix, do_multi, info.name_len + info.suffix_len, file_at_path, &info); +#ifdef CROSS_DIRECTORY_STRUCTURE + if (! path && (! strcmp (name, "as") || ! strcmp (name, "ld"))) + path = concat (DEFAULT_TARGET_MACHINE "-", name, NULL); +#endif + return path; } /* Ranking of prefixes in the sort list. -B prefixes are put before