I am unable to link the application using arm-none-eabi-gcc.exe supplied with Arm GNU Toolchain 11.2-2022.02 prebuilt Windows package (available at https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads).
In case the application contains lot of object files (with total length of all object filenames > 32767 characters), the response file is used for arm-none-eabi-gcc.exe invocation - to avoid Windows CreateProcess limitation.
Internally, arm-none-eabi-gcc.exe runs collect2.exe, also using response file. However, collect2.exe then runs ld.exe with all object filepaths passed as-is, this leads to fatal error:
collect2.exe: fatal error: CreateProcess: No such file or directory compilation terminated.
A simple project to reproduce the issue is available at https://github.com/vmedcy/gcc-linker-bug
The build error is reproducible on multiple Windows 10 machines, also on GitHub Actions CI at https://github.com/vmedcy/gcc-linker-bug/actions/runs/2095187131
The root cause of collect2.exe not using the response file for final ld.exe invocation is likely related to HAVE_GNU_LD evaluating as "false" in "fork_execute "ld" invocations: https://gcc.gnu.org/git/?p=gcc.git;f=gcc/collect2.c;hb=refs/tags/releases/gcc-11.2.0
Probably, "--with-gnu-ld" configure options was missed in the toolchain build manifest.