[all-commits] [llvm/llvm-project] a26bd9: [LinkerWrapper] Fix static library symbol resolution

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Jun 1 04:52:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a26bd95325f120d9737a0b03c80eabddb56f46db
      https://github.com/llvm/llvm-project/commit/a26bd95325f120d9737a0b03c80eabddb56f46db
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-06-01 (Thu, 01 Jun 2023)

  Changed paths:
    M clang/test/Driver/linker-wrapper-libs.c
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

  Log Message:
  -----------
  [LinkerWrapper] Fix static library symbol resolution

The linker wrapper performs its own very basic symbol resolution for the
purpose of supporting standard static library semantics. We do this here
because the Nvidia `nvlink` wrapper does not support static linking and
we have some offloading specific extensions.

Currently, we always place symbols in the "table" even if they aren't
extracted. This caused the logic to fail when many files were used that
referenced the same undefined variable. This patch changes the pass to
only add the symbols to the global "table" if the file is actually
extracted.

Reviewed By: tra

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




More information about the All-commits mailing list