llvm-project/llvm/lib/ExecutionEngine
Sunho Kim 7d101e43cd [ORC][LLJIT] Define atexit symbol in GenericLLVMIRPlatformSupport.
Define atexit symbol in GenericLLVMIRPlatformSupport so that it doesn't need to be defined by user.

On windows, llvm codegen emits atexit runtime calls to support global deinitializers as there is no lower function like cxa_atexit as in Itanium C++ ABI. ORC JIT user had to define custom atexit symbol manually. This was a hassle as it has to deal with dso_handle and cxa_atexit internals of LLJIT. If client didn't provide atexit definition, the default behaviour is just linking with host atexit function which is destined to fail as it calls dtors when the host program exits. This is after jit instances and buffers are freed, so users would see weird access violation exception from the uknown location. (in console application, the debugger thinks exception happened in scrt_common_main_seh)

This is a hack that has some caveats. (e.g. memory address is not identical) But, it's better than the situation described in the above. Ultimately, we will move on to ORC runtime that is able to solve the memory address issue properly.

Reviewed By: sgraenitz

Differential Revision: https://reviews.llvm.org/D128037
2022-06-26 03:50:08 +09:00
..
IntelJITEvents New tag for ittapi - fix an error related to cross-compiling ITTAPI in LLVM with mingw 2021-05-14 08:18:49 +03:00
Interpreter [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
JITLink [iwyu] Handle regressions in libLLVM header include 2022-06-22 18:50:39 +02:00
MCJIT [MC][re-land] Omit DWARF unwind info if compact unwind is present where eligible 2022-06-12 17:24:19 -04:00
OProfileJIT
Orc [ORC][LLJIT] Define atexit symbol in GenericLLVMIRPlatformSupport. 2022-06-26 03:50:08 +09:00
PerfJITEvents [perf] Fix a data race in the PerfJITEventListener 2021-06-29 08:30:31 -07:00
RuntimeDyld [MC][re-land] Omit DWARF unwind info if compact unwind is present where eligible 2022-06-12 17:24:19 -04:00
CMakeLists.txt [lli] Add JITLink in-process debug support 2021-03-02 15:07:36 +01:00
ExecutionEngine.cpp [llvm] Use range-based for loops (NFC) 2021-11-28 18:14:49 -08:00
ExecutionEngineBindings.cpp [NFC] Cleanup more AttributeList::addAttribute() 2021-08-17 21:05:41 -07:00
GDBRegistrationListener.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
SectionMemoryManager.cpp [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
TargetSelect.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00