Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
9 changed files
with
125 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
compiler-rt/test/orc/TestCases/FreeBSD/ehframe-default.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: %clangxx -fexceptions -fPIC -c -o %t %s | ||
// RUN: %llvm_jitlink %t | ||
|
||
extern "C" void llvm_jitlink_setTestResultOverride(long Value); | ||
|
||
int main(int argc, char *argv[]) { | ||
llvm_jitlink_setTestResultOverride(1); | ||
try { | ||
throw 0; | ||
} catch (int X) { | ||
llvm_jitlink_setTestResultOverride(X); | ||
} | ||
return 0; | ||
} |
15 changes: 15 additions & 0 deletions
15
compiler-rt/test/orc/TestCases/FreeBSD/ehframe-libunwind.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// REQUIRES: libunwind-available | ||
// RUN: %clangxx -fexceptions -fPIC -c -o %t %s | ||
// RUN: env LD_PRELOAD=%shared_libunwind %llvm_jitlink %t | ||
|
||
extern "C" void llvm_jitlink_setTestResultOverride(long Value); | ||
|
||
int main(int argc, char *argv[]) { | ||
llvm_jitlink_setTestResultOverride(1); | ||
try { | ||
throw 0; | ||
} catch (int X) { | ||
llvm_jitlink_setTestResultOverride(X); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: %clangxx -fexceptions -fPIC -c -o %t %s | ||
// RUN: %llvm_jitlink %t | ||
|
||
extern "C" void llvm_jitlink_setTestResultOverride(long Value); | ||
|
||
int main(int argc, char *argv[]) { | ||
llvm_jitlink_setTestResultOverride(1); | ||
try { | ||
throw 0; | ||
} catch (int X) { | ||
llvm_jitlink_setTestResultOverride(X); | ||
} | ||
return 0; | ||
} |
15 changes: 15 additions & 0 deletions
15
compiler-rt/test/orc/TestCases/Linux/ehframe-libunwind.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// REQUIRES: libunwind-available | ||
// RUN: %clangxx -fexceptions -fPIC -c -o %t %s | ||
// RUN: env LD_PRELOAD=%shared_libunwind %llvm_jitlink %t | ||
|
||
extern "C" void llvm_jitlink_setTestResultOverride(long Value); | ||
|
||
int main(int argc, char *argv[]) { | ||
llvm_jitlink_setTestResultOverride(1); | ||
try { | ||
throw 0; | ||
} catch (int X) { | ||
llvm_jitlink_setTestResultOverride(X); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters