[all-commits] [llvm/llvm-project] b77c6d: [JITLink] Fix alloc action call signature in InPro...

lhames via All-commits all-commits at lists.llvm.org
Sun Oct 31 10:37:00 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b77c6db9597b16076505ebfaa288ed4e26823232
      https://github.com/llvm/llvm-project/commit/b77c6db9597b16076505ebfaa288ed4e26823232
  Author: Lang Hames <lhames at gmail.com>
  Date:   2021-10-31 (Sun, 31 Oct 2021)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/JITLinkMemoryManager.cpp

  Log Message:
  -----------
  [JITLink] Fix alloc action call signature in InProcessMemoryManager.

Alloc actions should return a CWrapperFunctionResult. JITLink does not have
access to this type yet, due to library layering issues, so add a cut-down
version with a fixme.


  Commit: ff846fcb64c6a23eab04a5ef7d6c0d9cf867e18e
      https://github.com/llvm/llvm-project/commit/ff846fcb64c6a23eab04a5ef7d6c0d9cf867e18e
  Author: Lang Hames <lhames at gmail.com>
  Date:   2021-10-31 (Sun, 31 Oct 2021)

  Changed paths:
    M compiler-rt/lib/orc/CMakeLists.txt
    M compiler-rt/lib/orc/macho_platform.cpp
    M compiler-rt/lib/orc/macho_platform.h
    M llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
    M llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

  Log Message:
  -----------
  [ORC][ORC-RT] Switch MachO EH/TLV registration from EPC-calls to alloc actions.

MachOPlatform used to make an EPC-call (registerObjectSections) to register the
eh-frame and thread-data sections for each linked object with the ORC runtime.

Now that JITLinkMemoryManager supports allocation actions we can use these
instead of an EPC call. This saves us one EPC-call per object linked, and
manages registration/deregistration in the executor, rather than the controller
process. In the future we may use this to allow JIT'd code in the executor to
outlive the controller object while still being able to be cleanly destroyed.

Since the code for allocation actions must be available when the actions are
run, and since the eh-frame registration code lives in the ORC runtime itself,
this change required that MachO eh-frame support be split out of
macho_platform.cpp and into its own macho_ehframe_registration.cpp file that has
no other dependencies. During bootstrap we start by forcing emission of
macho_ehframe_registration.cpp so that eh-frame registration is guaranteed to be
available for the rest of the bootstrap process. Then we load the rest of the
MachO-platform runtime support, erroring out if there is any attempt to use
TLVs. Once the bootstrap process is complete all subsequent code can use all
features.


Compare: https://github.com/llvm/llvm-project/compare/ada545852197...ff846fcb64c6


More information about the All-commits mailing list