Create entry points for unwind frame registry in libstd.
This commit is contained in:
parent
def917afeb
commit
c807ff3b44
3 changed files with 34 additions and 0 deletions
|
@ -400,6 +400,15 @@ pub mod __rand {
|
||||||
pub use rand::{thread_rng, ThreadRng, Rng};
|
pub use rand::{thread_rng, ThreadRng, Rng};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Rust runtime's startup objects depend on these symbols, so they must be public.
|
||||||
|
// Since sys_common isn't public, we have to re-export them here explicitly.
|
||||||
|
#[doc(hidden)]
|
||||||
|
#[unstable(feature = "eh_frame_registry", issue = "0")]
|
||||||
|
#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
|
||||||
|
pub mod __frame_registry {
|
||||||
|
pub use sys_common::unwind::imp::eh_frame_registry::*;
|
||||||
|
}
|
||||||
|
|
||||||
// Include a number of private modules that exist solely to provide
|
// Include a number of private modules that exist solely to provide
|
||||||
// the rustdoc documentation for primitive types. Using `include!`
|
// the rustdoc documentation for primitive types. Using `include!`
|
||||||
// because rustdoc only looks for these modules at the crate level.
|
// because rustdoc only looks for these modules at the crate level.
|
||||||
|
|
|
@ -128,6 +128,10 @@ extern {}
|
||||||
#[link(name = "c++abi")]
|
#[link(name = "c++abi")]
|
||||||
extern {}
|
extern {}
|
||||||
|
|
||||||
|
#[cfg(all(target_os = "windows", target_env="gnu"))]
|
||||||
|
#[link(name = "gcc_eh")]
|
||||||
|
extern {}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// iOS on armv7 uses SjLj exceptions and requires to link
|
// iOS on armv7 uses SjLj exceptions and requires to link
|
||||||
// against corresponding routine (..._SjLj_...)
|
// against corresponding routine (..._SjLj_...)
|
||||||
|
|
|
@ -238,3 +238,24 @@ pub mod eabi {
|
||||||
unsafe extern fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! {
|
unsafe extern fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! {
|
||||||
uw::_Unwind_Resume(panic_ctx as *mut uw::_Unwind_Exception);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue