[PATCH] D38977: COFF: Add type server pdb files to linkrepro tar file.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 15:10:23 PDT 2017


pcc added a comment.

In https://reviews.llvm.org/D38977#899088, @zturner wrote:

> It's possible I'm missing something here, but I don't see anything specific to linkrepro or TAR files in any of this patch.


The important part of this patch is the call to `takeBuffer` on line 229 of PDB.cpp. That will cause the argument to be added to the linkrepro if we are creating one. Admittedly it could be a little clearer what that function does, we may want to rename it now that we're starting to use it outside of the driver.

> This leads me to believe /LINKREPRO is doing a full PDB link, including merging types and symbols from all object files.  resolving type servers and merging those in as well.
> 
> If I understand this feature correctly, /LINKREPRO isn't actually supposed to //link// anything.  It just copies the necessary files to a TAR file and creates a response file so that that response file, combined with the TAR file can then be linked on a //different// machine.

That's not accurate. /linkrepro in LLD is implemented by adding files to the linkrepro tar file as a side effect of opening files during a full link (note that link.exe's implementation of linkrepro also does a full link). I suppose that it may be possible in principle to implement /linkrepro so that it just creates the tar file, but it seems simplest to do things this way to reduce the possibility of divergence between what linkrepro does and what regular links do.

> If my understanding is wrong feel free to correct me, but if it's right, then this seems overly heavyweight.  It looks like this is doing a full PDB link but injecting some sort of Writer class that instead of writing to an output executable + PDB file, writes to a TAR file.

No, the output files are not written to the tar file, only the inputs.


https://reviews.llvm.org/D38977





More information about the llvm-commits mailing list