<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56109>56109</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Windows build error] LINK : fatal error LNK1189: library limit of 65535 objects exceeded
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
syheliel
</td>
</tr>
</table>
<pre>
# environment
**platform**: windows 10
**visual studio version**: 2022
**llvm version**: see following `git log` cmd
```
> git log
commit 21f557e13a2cf926a97d76ff30ca67bce56c64bb (HEAD -> main, origin/main, origin/HEAD)
Author: LLVM GN Syncbot <llvmgnsyncbot@gmail.com>
Date: Thu Jun 16 22:31:40 2022 +0000
[gn build] Port ff3989e6ae74
```
# reproduce
```
git clone https://github.com/llvm/llvm-project.git
cmake -G Ninja -S .\llvm\llvm -B build-tutorial-big -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_C_FLAGS="/bigobj" -DCMAKE_CXX_FLAGS="/bigobj" -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=On -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_OPTIMIZED_TABLEGEN=ON -DCMAKE_BUILD_TYPE=MinSizeRel && cd ./build-tutorial-big && ninja all
```
error message:
```
[967/3558] Building CXX object lib\Transforms\Vectorize\CMakeFiles\LLVMVectorize.dir\SLPVectorizer.cpp.obj
E:\llvm\llvm\lib\Transforms\Vectorize\SLPVectorizer.cpp(4626): warning C4018: '>=': signed/unsigned mismatch
[2263/3558] Building CXX object tools\clang\lib\AST\CMakeFiles\obj.clangAST.dir\AttrDocTable.cpp.obj
E:\llvm\clang\lib\AST\AttrDocTable.cpp(24): warning C4018: '<': signed/unsigned mismatch
[2444/3558] Building CXX object tools\clang\lib\CodeGen\CMakeFiles\obj.clangCodeGen.dir\CGExpr.cpp.obj
E:\llvm\clang\lib\CodeGen\CGExpr.cpp(3562): warning C4018: '<=': signed/unsigned mismatch
[3075/3558] Linking CXX executable bin\clang-repl.exe
FAILED: bin/clang-repl.exe lib/clang-repl.lib
cmd.exe /C "cd . && D:\GlobalScoopApps\apps\cmake\3.23.2\bin\cmake.exe -E vs_link_exe --intdir=tools\clang\tools\clang-repl\CMakeFiles\clang-repl.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x86\mt.exe --manifests -- "E:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.32.31326\bin\Hostx86\x86\link.exe" /nologo @CMakeFiles\clang-repl.rsp /out:bin\clang-repl.exe /implib:lib\clang-repl.lib /pdb:bin\clang-repl.pdb /version:0.0 /machine:X86 /STACK:10000000 /INCREMENTAL:NO /subsystem:console /DEF:"E:/build-tutorial-big/tools/clang/tools/clang-repl/clang-repl.def" && cd ."
LINK: command "E:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.32.31326\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\clang-repl.rsp /out:bin\clang-repl.exe /implib:lib\clang-repl.lib /pdb:bin\clang-repl.pdb /version:0.0 /machine:X86 /STACK:10000000 /INCREMENTAL:NO /subsystem:console /DEF:E:/build-tutorial-big/tools/clang/tools/clang-repl/clang-repl.def /MANIFEST /MANIFESTFILE:bin\clang-repl.exe.manifest" failed (exit code 1189) with the following output:
LINK : fatal error LNK1189: library limit of 65535 objects exceeded
[3088/3558] Linking CXX executable bin\clang.exe
ninja: build stopped: subcommand failed.
```
# related link
https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1189?view=msvc-170
I have tried to add `\bigobj` in `C/CXXflags`, but it's not working
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVV92T2jgM_2vYF08y-SCBPPCQDYHSAsssdLu9F8ZJDLhNbCZ29qN__UlO2C7b7fZ604c7JkNiW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