We have gone through the points listed on MSDN WRT to this error ( except for #5 ). Three different people on different machines are getting the same problem. The PDB is created, but fails somewhere in the middle.
Details:
- 67 static libraries
- 4.27 GB of static libraries
- 1048575 bytes - size of PDB when linker fails
- The last couple of megabytes of the PDB are null ( zero's )
- Release build succeeds & produces a PDB ( we have it turn on, with no debugging info in the exe )
- Release build PDB is just under 1 GB.
We have disabled virus scanners. Watched with procmon.exe and saw no suspicions interactions with the PDB when the linker failed.
Related question suggests ~1 GB limit on PDB's - anyone/way to confirm that?
UPDATE & SOLUTION:
@Barry and the chromium team have come up with the solution. Here is the patch to the Chromium build system that implements the resolution.
Details
The PDB uses a virtual filesystem internally: MSF. When the linker creates the PDB file it defaults to an ( apparently non-configurable ) 2 kB page size. Apparently & fortunately when the compiler creates its PDB it defaults the page size to 4 kB. This compiler PDB can be hoisted and used as a base for the linker PDB.
Better solution As a Pre-Link Event on the project that is linking your exe or dll we can hoist the compiler to generate our required initial PDB:
cl -c "dummy_empty.cpp" /Zi /Fd"$(TargetDir)$(TargetName).pdb"
Original Solution
Make a C++ static library project with an empty cpp file, configure the 'Porgram Database File Name' to output something other than the default. Use some project build events ( I used 'Pre-Link Event') to copy in the previously created PDB into wherever you linker is expecting ( see Linker->Generate Program Database File ) to create its PDB. Fortunately the linker will adopt the copied in PDB and use its 4 kB page size. This will buy some time, and some space allowing up to a 2GB PDB.