Fix function signature for rust_eh_personality
While cg_llvm is very lax about mismatched function signatures, cg_clif will crash when there is any mismatch. It could be turned into an error, but without Cranelift changes can't just be ignored.
This commit is contained in:
@@ -12,7 +12,15 @@ fn panic(_: &PanicInfo) -> ! {
|
||||
}
|
||||
|
||||
#[lang = "eh_personality"]
|
||||
fn eh() {}
|
||||
fn eh(
|
||||
_version: i32,
|
||||
_actions: i32,
|
||||
_exception_class: u64,
|
||||
_exception_object: *mut (),
|
||||
_context: *mut (),
|
||||
) -> i32 {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[alloc_error_handler]
|
||||
fn oom(_: Layout) -> ! {
|
||||
|
||||
@@ -21,6 +21,12 @@ extern "C" fn __rust_foreign_exception() -> ! {
|
||||
}
|
||||
|
||||
#[lang = "eh_personality"]
|
||||
fn eh_personality() {
|
||||
fn eh_personality(
|
||||
_version: i32,
|
||||
_actions: i32,
|
||||
_exception_class: u64,
|
||||
_exception_object: *mut (),
|
||||
_context: *mut (),
|
||||
) -> i32 {
|
||||
loop {}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,13 @@ fn panic_handler(_: &core::panic::PanicInfo) -> ! {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn rust_eh_personality() {
|
||||
extern "C" fn rust_eh_personality(
|
||||
_version: i32,
|
||||
_actions: i32,
|
||||
_exception_class: u64,
|
||||
_exception_object: *mut (),
|
||||
_context: *mut (),
|
||||
) -> i32 {
|
||||
loop {}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
|
||||
// in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
|
||||
// unwind. So, for this test case we will define the symbol.
|
||||
#[lang = "eh_personality"]
|
||||
extern "C" fn rust_eh_personality() {}
|
||||
extern "C" fn rust_eh_personality(
|
||||
_version: i32,
|
||||
_actions: i32,
|
||||
_exception_class: u64,
|
||||
_exception_object: *mut (),
|
||||
_context: *mut (),
|
||||
) -> i32 {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
struct Page(#[allow(dead_code)] [[u64; 32]; 16]);
|
||||
|
||||
@@ -57,7 +57,15 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
|
||||
// in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
|
||||
// unwind. So, for this test case we will define the symbol.
|
||||
#[lang = "eh_personality"]
|
||||
extern "C" fn rust_eh_personality() {}
|
||||
extern "C" fn rust_eh_personality(
|
||||
_version: i32,
|
||||
_actions: i32,
|
||||
_exception_class: u64,
|
||||
_exception_object: *mut (),
|
||||
_context: *mut (),
|
||||
) -> i32 {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
struct Page(#[allow(dead_code)] [[u64; 32]; 16]);
|
||||
|
||||
@@ -12,4 +12,12 @@ pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
|
||||
}
|
||||
|
||||
#[lang = "eh_personality"]
|
||||
extern "C" fn eh_personality() {}
|
||||
extern "C" fn eh_personality(
|
||||
_version: i32,
|
||||
_actions: i32,
|
||||
_exception_class: u64,
|
||||
_exception_object: *mut (),
|
||||
_context: *mut (),
|
||||
) -> i32 {
|
||||
loop {}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,12 @@ pub fn test(_: DropMe) {
|
||||
}
|
||||
|
||||
#[rustc_std_internal_symbol]
|
||||
pub unsafe extern "C" fn rust_eh_personality() {}
|
||||
pub unsafe extern "C" fn rust_eh_personality(
|
||||
_version: i32,
|
||||
_actions: i32,
|
||||
_exception_class: u64,
|
||||
_exception_object: *mut (),
|
||||
_context: *mut (),
|
||||
) -> i32 {
|
||||
loop {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user