diff options
| author | Vadim Chugunov <vadimcn@gmail.com> | 2015-10-18 14:31:32 -0700 |
|---|---|---|
| committer | Vadim Chugunov <vadimcn@gmail.com> | 2015-10-18 19:57:32 -0700 |
| commit | c807ff3b449a8dafc5cef539e5e65b2fe6dab879 (patch) | |
| tree | fbe9cf5d1554bc6f84376c49e69a751b39329346 /src/libstd/sys/common | |
| parent | def917afeb4ae4668010c2ff2b2757ed7ac4931a (diff) | |
| download | rust-c807ff3b449a8dafc5cef539e5e65b2fe6dab879.tar.gz rust-c807ff3b449a8dafc5cef539e5e65b2fe6dab879.zip | |
Create entry points for unwind frame registry in libstd.
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/libunwind.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/common/unwind/gcc.rs | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/libstd/sys/common/libunwind.rs b/src/libstd/sys/common/libunwind.rs index 04f677a90c4..74d334bd062 100644 --- a/src/libstd/sys/common/libunwind.rs +++ b/src/libstd/sys/common/libunwind.rs @@ -128,6 +128,10 @@ extern {} #[link(name = "c++abi")] extern {} +#[cfg(all(target_os = "windows", target_env="gnu"))] +#[link(name = "gcc_eh")] +extern {} + extern "C" { // iOS on armv7 uses SjLj exceptions and requires to link // against corresponding routine (..._SjLj_...) diff --git a/src/libstd/sys/common/unwind/gcc.rs b/src/libstd/sys/common/unwind/gcc.rs index 5ee14d9f57a..6d82eb7dfb1 100644 --- a/src/libstd/sys/common/unwind/gcc.rs +++ b/src/libstd/sys/common/unwind/gcc.rs @@ -238,3 +238,24 @@ pub mod eabi { unsafe extern fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! { uw::_Unwind_Resume(panic_ctx as *mut uw::_Unwind_Exception); } + +#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))] +pub mod eh_frame_registry { + #[link(name = "gcc_eh")] + extern { + fn __register_frame_info(eh_frame_begin: *const u8, object: *mut u8); + fn __deregister_frame_info(eh_frame_begin: *const u8, object: *mut u8); + } + #[cfg(not(test))] + #[no_mangle] + pub unsafe extern fn rust_eh_register_frames(eh_frame_begin: *const u8, + object: *mut u8) { + __register_frame_info(eh_frame_begin, object); + } + #[cfg(not(test))] + #[no_mangle] + pub unsafe extern fn rust_eh_unregister_frames(eh_frame_begin: *const u8, + object: *mut u8) { + __deregister_frame_info(eh_frame_begin, object); + } +} |
