[ORC-RT][ORC] Handle dynamic unwind registration for libunwind
authorPeter S. Housel <housel@acm.org>
Thu, 2 Dec 2021 07:11:49 +0000 (23:11 -0800)
committerPeter S. Housel <housel@acm.org>
Fri, 6 May 2022 21:00:29 +0000 (14:00 -0700)
commit981523b2e4675d4be496a333583b2f728c057d02
treede940c6d5e75d8647ab421f8a5866e86a16c8df4
parent509b631f84e97e717a675a6ef60ae4728bb11551
[ORC-RT][ORC] Handle dynamic unwind registration for libunwind

This changes the ELFNix platform Orc runtime to use, when available,
the __unw_add_dynamic_eh_frame_section interface provided by libunwind
for registering .eh_frame sections loaded by JITLink. When libunwind
is not being used for unwinding, the ELFNix platform detects this and
defaults to the __register_frame interface provided by libgcc_s.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D114961
compiler-rt/lib/orc/elfnix_platform.cpp
compiler-rt/test/orc/TestCases/FreeBSD/ehframe-default.cpp [new file with mode: 0644]
compiler-rt/test/orc/TestCases/FreeBSD/ehframe-libunwind.cpp [new file with mode: 0644]
compiler-rt/test/orc/TestCases/Linux/ehframe-default.cpp [new file with mode: 0644]
compiler-rt/test/orc/TestCases/Linux/ehframe-libunwind.cpp [new file with mode: 0644]
compiler-rt/test/orc/lit.cfg.py
compiler-rt/test/orc/lit.site.cfg.py.in
llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp