Skip to content

Commit 4fc275d

Browse files
authored
Rollup merge of rust-lang#58453 - jethrogb:jb/sgx-panic-abort, r=nagisa
SGX target: fix panic = abort What is the difference between `no_mangle` and `rustc_std_internal_symbol`?
2 parents e855b05 + 347a42e commit 4fc275d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/libpanic_abort/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ pub unsafe extern fn __rust_start_panic(_payload: usize) -> u32 {
5858

5959
#[cfg(all(target_vendor="fortanix", target_env="sgx"))]
6060
unsafe fn abort() -> ! {
61-
extern "C" { pub fn panic_exit() -> !; }
62-
panic_exit();
61+
// call std::sys::abort_internal
62+
extern "C" { pub fn __rust_abort() -> !; }
63+
__rust_abort();
6364
}
6465
}
6566

src/libstd/sys/sgx/rwlock.rs

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ pub unsafe extern "C" fn __rust_print_err(m: *mut u8, s: i32) {
204204
}
205205

206206
#[no_mangle]
207+
// NB. used by both libunwind and libpanic_abort
207208
pub unsafe extern "C" fn __rust_abort() {
208209
::sys::abort_internal();
209210
}

0 commit comments

Comments
 (0)