[all-commits] [llvm/llvm-project] 7937fe: [ORC][llvm-jitlink] Add support for forced loading...

Lang Hames via All-commits all-commits at lists.llvm.org
Tue Oct 15 21:22:30 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7937fe1a17f2c883f41e1bdefd0a1d9c93861532
      https://github.com/llvm/llvm-project/commit/7937fe1a17f2c883f41e1bdefd0a1d9c93861532
  Author: Lang Hames <lhames at gmail.com>
  Date:   2024-10-16 (Wed, 16 Oct 2024)

  Changed paths:
    A compiler-rt/test/orc/TestCases/Darwin/Generic/Inputs/EmptyClassFoo.m
    A compiler-rt/test/orc/TestCases/Darwin/Generic/llvm-jitlink-force-link-objc.m
    A compiler-rt/test/orc/TestCases/Linux/Generic/Inputs/SetGlobalIntXInConstructor.cpp
    A compiler-rt/test/orc/TestCases/Linux/Generic/llvm-jitlink-all-load.c
    M compiler-rt/test/orc/lit.cfg.py
    M llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
    M llvm/include/llvm/ExecutionEngine/Orc/MachO.h
    M llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
    M llvm/lib/ExecutionEngine/Orc/MachO.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.cpp

  Log Message:
  -----------
  [ORC][llvm-jitlink] Add support for forced loading of archive members.

This patch adds support for forced loading of archive members, similar to the
behavior of the -all_load and -ObjC options in ld64. To enable this, the
StaticLibraryDefinitionGenerator class constructors are extended with a
VisitMember callback that is called on each member file in the archive at
generator construction time. This callback can be used to unconditionally add
the member file to a JITDylib at that point.

To test this the llvm-jitlink utility is extended with -all_load (all platforms)
and -ObjC (darwin only) options. Since we can't refer to symbols in the test
objects directly (these would always cause the member to be linked in, even
without the new flags) we instead test side-effects of force loading: execution
of constructors and registration of Objective-C metadata.

rdar://134446111



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list