[all-commits] [llvm/llvm-project] 5255ca: [llvm-jitlink] Update handling of library options.

lhames via All-commits all-commits at lists.llvm.org
Tue Dec 14 18:50:08 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5255ca9726e9734eae5115488517175f9c94c9de
      https://github.com/llvm/llvm-project/commit/5255ca9726e9734eae5115488517175f9c94c9de
  Author: Lang Hames <lhames at gmail.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M compiler-rt/test/orc/TestCases/Darwin/arm64/trivial-objc-methods.S
    M compiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-objc-methods.S
    M compiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-swift-types-section.S
    A llvm/test/ExecutionEngine/JITLink/X86/Inputs/MachO_extra_def_strong.s
    A llvm/test/ExecutionEngine/JITLink/X86/Inputs/MachO_extra_def_weak.s
    R llvm/test/ExecutionEngine/JITLink/X86/Inputs/MachO_strong_def_extra.s
    R llvm/test/ExecutionEngine/JITLink/X86/Inputs/MachO_weak_defs_extra.s
    A llvm/test/ExecutionEngine/JITLink/X86/MachO_archive_support.s
    M llvm/test/ExecutionEngine/JITLink/X86/MachO_gdb_jit_nonzero_alignment_offsets.s
    M llvm/test/ExecutionEngine/JITLink/X86/MachO_weak_definitions.s
    M llvm/tools/llvm-jitlink/llvm-jitlink.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.h

  Log Message:
  -----------
  [llvm-jitlink] Update handling of library options.

Adds -L<search-path> and -l<library> options that are analogous to ld's
versions.

Each instance of -L<search-path> or -l<library> will apply to the most recent
-jd option on the command line (-jd <name> creates a JITDylib with the given
name). Library names will match against JITDylibs first, then llvm-jitlink will
look through the search paths for files named <search-path>/lib<library>.dylib
or <search-path>/lib<library>.a.

The default "main" JITDylib will link against all JITDylibs created by -jd
options, and all JITDylibs will link against the process symbols (unless
-no-process-symbols is specified).

The -dlopen option is renamed -preload, and will load dylibs into the JITDylib
for the ORC runtime only.

The effect of these changes is to make it easier to describe a non-trivial
program layout to llvm-jitlink for testing purposes. E.g. the following
invocation describes a program consisting of three JITDylibs: "main" (created
implicitly) containing main.o, "Foo" containing foo1.o and foo2.o, and linking
against library "bar" (not a JITDylib, so it must be a .dylib or .a on disk)
and "Baz" (which is a JITDylib), and "Baz" containing baz.o.

llvm-jitlink \
  main.o \
  -jd Foo foo1.o foo2.o -L${HOME}/lib -lbar -lBaz
  -jd Baz baz.o




More information about the All-commits mailing list