https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98145
Bug ID: 98145 Summary: On Windows .exe extension is missing when searching/calling mkoffload Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: brechtsanders at users dot sourceforge.net Target Milestone: --- I was trying to get nvptx offloading to work on Windows/MinGW-w64, and got the following output when testing the resulting build: lto-wrapper.exe: fatal error: could not find accel/nvptx-none/mkoffload in d:/prog/winlibs64-10.2.0-8.0.0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/10.2.0/;d:/prog/winlibs64-10.2.0-8.0.0/mingw64/bin/../libexec/gcc/;d:/prog/winlibs64-10.2.0-8.0.0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ (consider using '-B') compilation terminated. It looks to me like gcc/lto-wrapper.c needs to be fixed so it looks for mkoffload.exe instead of just mkoffload on Windows. Probably something like this but with some additional checks to only add the .exe on the Windows platform: patch -ulbf gcc/lto-wrapper.c << EOF @@ -827,6 +827,6 @@ char *suffix - = XALLOCAVEC (char, sizeof ("/accel//mkoffload") + strlen (target)); + = XALLOCAVEC (char, sizeof ("/accel//mkoffload.exe") + strlen (target)); strcpy (suffix, "/accel/"); strcat (suffix, target); - strcat (suffix, "/mkoffload"); + strcat (suffix, "/mkoffload.exe"); EOF