Skip to content

Commit

Permalink
Rollup merge of rust-lang#58453 - jethrogb:jb/sgx-panic-abort, r=nagisa
Browse files Browse the repository at this point in the history
SGX target: fix panic = abort

What is the difference between `no_mangle` and `rustc_std_internal_symbol`?
  • Loading branch information
Centril authored Feb 23, 2019
2 parents decd787 + 347a42e commit 949ff12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libpanic_abort/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ pub unsafe extern fn __rust_start_panic(_payload: usize) -> u32 {

#[cfg(all(target_vendor="fortanix", target_env="sgx"))]
unsafe fn abort() -> ! {
extern "C" { pub fn panic_exit() -> !; }
panic_exit();
// call std::sys::abort_internal
extern "C" { pub fn __rust_abort() -> !; }
__rust_abort();
}
}

Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/sgx/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ pub unsafe extern "C" fn __rust_print_err(m: *mut u8, s: i32) {
}

#[no_mangle]
// NB. used by both libunwind and libpanic_abort
pub unsafe extern "C" fn __rust_abort() {
::sys::abort_internal();
}
Expand Down

0 comments on commit 949ff12

Please sign in to comment.