[all-commits] [llvm/llvm-project] 242a9c: [LLD][COFF] Survive empty and invalid PCH signature

Alexandre Ganea via All-commits all-commits at lists.llvm.org
Sun Nov 20 07:41:05 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 242a9cf7e6759bdd6c4af524d544f562b7385d27
      https://github.com/llvm/llvm-project/commit/242a9cf7e6759bdd6c4af524d544f562b7385d27
  Author: Alexandre Ganea <alex_toresh at yahoo.fr>
  Date:   2022-11-20 (Sun, 20 Nov 2022)

  Changed paths:
    M lld/COFF/DebugTypes.cpp
    M lld/COFF/DebugTypes.h
    M lld/COFF/InputFiles.cpp
    M lld/docs/ReleaseNotes.rst
    M lld/test/COFF/precomp-link.test
    M llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
    M llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp
    M llvm/tools/llvm-readobj/COFFDumper.cpp

  Log Message:
  -----------
  [LLD][COFF] Survive empty and invalid PCH signature

Solve two issues that showed up when using LLD with Unreal Engine & FASTBuild:
1. It seems the S_OBJNAME record doesn't always record the "precomp signature". We were relying on that to match the PCH.OBJ with their dependent-OBJ.
2. MSVC link.exe is able to link a PCH.OBJ when the "precomp signatureƈ doesn't match, but LLD was failing. This was occuring since the Unreal Engine Build Tool was compiling the PCH.OBJ, but the dependent-OBJ were compiled & cached through FASTBuild. Upon a clean rebuild, the PCH.OBJs were recompiled by the Unreal Build Tool, thus the "precomp signatures" were changing; however the OBJs were already cached by FASTBuild, thus having an old "precomp signatures".

We now ignore "precomp signatures" and properly fallback to cmd-line name lookup, like MSVC link.exe does, and only fail if the PCH.OBJ type stream doesn't match the count expected by the dependent-OBJ.

Differential Revision: https://reviews.llvm.org/D136762




More information about the All-commits mailing list