[PDB] Fix bug when using multiple PCH header objects with the same name.A common pattern in Windows is to have all your precompiled headersuse an object named stdafx.obj. If you've got a project
[PDB] Fix bug when using multiple PCH header objects with the same name.A common pattern in Windows is to have all your precompiled headersuse an object named stdafx.obj. If you've got a project with manydifferent static libs, you might use a separate PCH for each one ofthese.During the final link step, a file from A might reference the PCHobject from A, but it will have the same name (stdafx.obj) as anyother PCH from another project. The only difference will be thepath. For example, A might be A/stdafx.obj while B is B/stdafx.obj.The existing algorithm checks only the filename that was passed onthe command line (or stored in archive), but this is insufficient inthe case where relative paths are used, because depending on thecommand line object file / library order, it might find the wrongPCH object first resulting in a signature mismatch.The fix here is to simply check whether the absolute path of thePCH object (which is stored in the input obj file for the file thatreferences the PCH) *ends with* the full relative path of whateveris specified on the command line (or is in the archive).Differential Revision: https://reviews.llvm.org/D66431llvm-svn: 374442
show more ...