[PATCH] D62935: [LTO][Legacy] Fix dependent libraries support by adding querying of the IRSymtab

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 16:45:32 PDT 2019


bd1976llvm created this revision.
bd1976llvm added reviewers: steven_wu, tejohnson, pcc, mehdi_amini.
Herald added a reviewer: deadalnix.
Herald added subscribers: llvm-commits, dang, dexonsmith, hiraditya, inglorion.
Herald added a project: LLVM.

Dependent libraries support for the legacy api was committed in a broken state (see: https://reviews.llvm.org/D60274). This was missed due to the painful nature of having to integrate the changes into a linker in order to test. This change implements support for dependent libraries in the legacy LTO api:

- I have removed the current api function, which returns a single string, and added functions to access each dependent library specifier individually.
- To reduce the testing pain, I have made the api functions as thin as possible to maximize coverage from llvm-lto.
- When doing ThinLTO the system linker will load the modules lazily when scanning the input files. Unfortunately, when modules are lazily loaded there is no access to module level named metadata. To fix this I have added api functions that allow querying the IRSymtab for the dependent libraries. I hope to expand the api in the future so that, eventually, all the information needed by a client linker during scan can be retrieved from the IRSymtab.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D62935

Files:
  llvm/include/llvm-c/lto.h
  llvm/include/llvm/LTO/legacy/LTOModule.h
  llvm/lib/LTO/LTOModule.cpp
  llvm/test/LTO/X86/Inputs/list-dependent-libraries.ll
  llvm/test/LTO/X86/list-dependent-libraries.ll
  llvm/test/tools/llvm-lto/error.ll
  llvm/tools/llvm-lto/llvm-lto.cpp
  llvm/tools/lto/lto.cpp
  llvm/tools/lto/lto.exports

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62935.203265.patch
Type: text/x-patch
Size: 11489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190605/7b9c3d12/attachment.bin>


More information about the llvm-commits mailing list