Issue 182374
Summary [libc][hdrgen] hdrgen should use response file to avoid long command line arguments
Labels libc
Assignees
Reporter zeroomega
    Recent PR https://github.com/llvm/llvm-project/pull/175530 broke the libc build on Windows with error message:

```
[73/2673](65) Generating header stdckdint.h from C:/b/s/w/ir/x/w/llvm-llvm-project/runtimes/../libc/include/stdckdint.yaml
FAILED: C:/b/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins/include/armv7em-unknown-none-eabi/stdckdint.h 
libc\include\CMakeFiles\stdckdint.h-4ef000b.bat aa87def7fde3a956
goto was unexpected at this time.
```
We reproduced the issue locally and have discovered the issue is the argument list sent to the libc hdrgen being too long. On windows, hdrgen python script was started from a cmake generated batch file and each command line will have a 32KiB max length (with WCHAR, this is effective 16K characters). The build step in question just surpassed this limit, leading to a parsing error. The batch file in question can be seen https://gist.github.com/zeroomega/2e38832bba88e52756dfdd39d9ba7c72

In order to properly solve the issue, the hdrgen should use a response file to handle the long arguments.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to