[all-commits] [llvm/llvm-project] d02ef7: [LLJIT] Add convenience methods for loading dylibs...

lhames via All-commits all-commits at lists.llvm.org
Sun Mar 26 18:23:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d02ef707cbdab295aa4b645a068d298bfa85997a
      https://github.com/llvm/llvm-project/commit/d02ef707cbdab295aa4b645a068d298bfa85997a
  Author: Lang Hames <lhames at gmail.com>
  Date:   2023-03-26 (Sun, 26 Mar 2023)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
    M llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
    M llvm/tools/lli/lli.cpp

  Log Message:
  -----------
  [LLJIT] Add convenience methods for loading dylibs and linking static libs.

LLJIT::loadPlatformDynamicLibrary loads a dynamic library at a given path
(interpreted in the executor process -- the process containing the JIT'd code),
and returns a JITDylib (whose name is the given path) that reflects the symbols
in that library. LLJIT clients wishing to make the given symbols visible to
their JIT'd code can add this JITDylib to the link order of their JITDylib(s)
using JITDylib::addToLinkOrder.

The LLJIT::linkStaticLibraryInto overloads load a static library (or universal
binary) at a given path (interpreted in the controller process -- the process
containing the LLJIT instance) and adds its symbols to the given JITDylib.

The lli tool is updated to use LLJIT::linkStaticLibraryInto to implement the
extra-archive option.

LLJIT::loadPlatformDynamicLibrary is not tested in this patch as we don't have
a good way to produce dylibs in LLVM's regression test suite.




More information about the All-commits mailing list