[all-commits] [llvm/llvm-project] 0071ea: [ORC] Export __cxa_atexit from the main JITDylib i...

lhames via All-commits all-commits at lists.llvm.org
Wed Apr 1 19:12:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0071eaaf0892d7ef733578312abefdcf84311071
      https://github.com/llvm/llvm-project/commit/0071eaaf0892d7ef733578312abefdcf84311071
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
    M llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll

  Log Message:
  -----------
  [ORC] Export __cxa_atexit from the main JITDylib in LLJIT.

Failure to export __cxa_atexit can lead to an attempt to import a definition
from the process itself (if __cxa_atexit is referenced from another JITDylib),
but the process definition will clash with the existing non-exported definition
to produce an unexpected DuplicateDefinitionError.

This patch fixes the immediate issue by exporting __cxa_atexit. It also fixes a
bug where atexit functions in other JITDylibs were not being run by adding a
copy of run_atexits_helper to every JITDylib.

A follow up patch will deal with the bug where definition generators are called
despite a non-exported definition being present.




More information about the All-commits mailing list