[all-commits] [llvm/llvm-project] 590326: [Orc] Support atexit in Orc(JITLink)

luxufan via All-commits all-commits at lists.llvm.org
Fri Oct 8 23:54:34 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 590326382dad4888111844efa5af0fdeff84c55c
      https://github.com/llvm/llvm-project/commit/590326382dad4888111844efa5af0fdeff84c55c
  Author: luxufan <932494295 at qq.com>
  Date:   2021-10-09 (Sat, 09 Oct 2021)

  Changed paths:
    M compiler-rt/lib/orc/elfnix_platform.cpp
    M compiler-rt/lib/orc/elfnix_platform.h
    A compiler-rt/test/orc/TestCases/Linux/x86-64/trivial-atexit.S
    M llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp

  Log Message:
  -----------
  [Orc] Support atexit in Orc(JITLink)

There is a bug reported at https://bugs.llvm.org/show_bug.cgi?id=48938

After looking through the glibc, I found the `atexit(f)` is the same as `__cxa_atexit(f, NULL, NULL)`. In orc runtime, we identify different JITDylib by their dso_handle value, so that a NULL dso_handle is invalid. So in this patch, I added a `PlatformJDDSOHandle` to ELFNixRuntimeState, and functions which are registered by atexit will be registered at PlatformJD.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D111413




More information about the All-commits mailing list