[all-commits] [llvm/llvm-project] 83305f: [lld][WebAssembly] Fix bitcode LTO order in archiv...

Heejin Ahn via All-commits all-commits at lists.llvm.org
Tue Nov 28 17:44:47 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83305faeb54cf254d133e39ddac7f2fee36972cc
      https://github.com/llvm/llvm-project/commit/83305faeb54cf254d133e39ddac7f2fee36972cc
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2023-11-28 (Tue, 28 Nov 2023)

  Changed paths:
    A lld/test/wasm/lto/Inputs/comdat_ordering1.ll
    A lld/test/wasm/lto/Inputs/comdat_ordering2.ll
    A lld/test/wasm/lto/comdat_ordering.test
    M lld/wasm/SymbolTable.cpp

  Log Message:
  -----------
  [lld][WebAssembly] Fix bitcode LTO order in archive parsing (#73095)

When doing LTO on multiple archives, the order with which bitcodes are
linked to the LTO module is hard to control, given that processing
undefined symbols can lead to parsing of an object file, which in turn
lead to parsing of another object file before finishing parsing of the
previous file. This can result in encountering a non-prevailing comdat
first when linking, which can make the the symbol undefined, and the
real definition is added later with an additional prefix to avoid
duplication (e.g. `__cxx_global_var_init` and `__cxx_global_var_init.2`)

So this one-line fix ensures we compile bitcodes in the order that we
process comdats, so that when multiple archived bitcode files have the
same variable with the same comdat, we make sure that the prevailing
comdat will be linked first in the LTO.

Fixes #62243.




More information about the All-commits mailing list