[ORC] Force linking of eh-frame registration functions from LLJIT.cpp.
authorLang Hames <lhames@gmail.com>
Sun, 23 Oct 2022 20:07:52 +0000 (13:07 -0700)
committerLang Hames <lhames@gmail.com>
Sun, 23 Oct 2022 20:55:55 +0000 (13:55 -0700)
commite7673d982dc7ad8f848d79d6e457bf614ec1564f
tree30eeecd746493cf7e79c84bd750ad9b50ff1ba15
parentc8ca8fb9789a47766662c6e89c1903d1cb1d6d94
[ORC] Force linking of eh-frame registration functions from LLJIT.cpp.

Since aedeb8d5570, which switched to EPC-based eh-frame registrationin LLJIT,
the eh-frame registration functions need to be forcibly linked into the target
process.

Failure to link the eh-frame registration functions triggered a test failure in
https://green.lab.llvm.org/green/job/clang-stage1-RA/31497, which was fixed by
forcibly linking the registration functions into that test case in saf2b2214b4
(rdar://101083784), however it has also caused some tests (e.g. the C API unit
tests) that depend on successful construction of an LLJIT instance to be
skipped.

Moving the forcible registration into LLJIT.cpp fixes the general issue.
llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp
llvm/lib/ExecutionEngine/Orc/LLJIT.cpp