From 91611fc3d0ee8a7a0a7accff4377e3a21fd7b6c4 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Fri, 5 Jan 2018 22:16:54 +0100 Subject: [PATCH] Let libpanic_abort call into libc's abort() on CloudABI. Ideally, we should make use of CloudABI's internal proc_raise(SIGABRT) system call. POSIX abort() requires things like flushing of stdios, which may not be what we want under panic conditions. Invoking the raw CloudABI system call would have prevented that. Unfortunately, we have to make use of the "cloudabi" crate to invoke raw CloudABI system calls. This is undesired, as discussed in the pull request (#47190). --- src/libpanic_abort/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libpanic_abort/lib.rs b/src/libpanic_abort/lib.rs index 29a9e1aadaf..c3bd6a2bc18 100644 --- a/src/libpanic_abort/lib.rs +++ b/src/libpanic_abort/lib.rs @@ -53,7 +53,7 @@ pub unsafe extern fn __rust_maybe_catch_panic(f: fn(*mut u8), pub unsafe extern fn __rust_start_panic(_data: usize, _vtable: usize) -> u32 { abort(); - #[cfg(unix)] + #[cfg(any(unix, target_os = "cloudabi"))] unsafe fn abort() -> ! { extern crate libc; libc::abort();