[PATCH] D136762: [LLD][COFF] Survive empty PCH signature

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 05:53:15 PDT 2022


aganea created this revision.
aganea added reviewers: rnk, mstorsjo, saudi, thieta.
Herald added a project: All.
aganea requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

While trying to use LLD with the Unreal Engine - which happens to heavily use PCH files - it was failing with "error: xxx.obj claims to be a PCH object, but does not have a valid signature". It seems recent versions of MSVC (or at least the one we use) do not generate the PCH signature in the S_OBJNAME record anymore. Instead we need to parse the entire .PCH.OBJ file until we reach the LF_ENDPRECOMP record, which contains a valid PCH signature. The code already was able to survive without that, by falling back to name lookup, but it's more reliable to use the `precompSourceMappings` map for matching the corresponding PCH file.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136762

Files:
  lld/COFF/DebugTypes.cpp
  lld/test/COFF/precomp-link.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136762.470793.patch
Type: text/x-patch
Size: 4644 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221026/fd0ec339/attachment.bin>


More information about the llvm-commits mailing list