diff --git a/.cargo/config b/.cargo/config index 20ee1ec977..d51b0f5581 100644 --- a/.cargo/config +++ b/.cargo/config @@ -6,4 +6,3 @@ rustflags = [ [unstable] build-std = ["core", "alloc", "compiler_builtins"] -build-std-features = ["panic-unwind"] diff --git a/Cargo.toml b/Cargo.toml index 1a443a1dc8..f2a5c2c858 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,8 +61,14 @@ slab = ["slab_allocator"] x86_fsgsbase = [] [profile.dev] +# Avoids having to define the eh_personality lang item and reduces kernel size +panic = "abort" + # Kernel doesn't yet work great with debug mode :( opt-level = 3 [profile.release] +# Avoids having to define the eh_personality lang item and reduces kernel size +panic = "abort" + lto = true diff --git a/src/lib.rs b/src/lib.rs index 1e9413013b..5bde061a31 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,7 +50,6 @@ #![feature(concat_idents)] #![feature(core_intrinsics)] #![feature(integer_atomics)] -#![feature(lang_items)] #![feature(naked_functions)] #![feature(ptr_internals)] #![feature(slice_ptr_get, slice_ptr_len)] diff --git a/src/panic.rs b/src/panic.rs index 3655327fe1..e7eb44b488 100644 --- a/src/panic.rs +++ b/src/panic.rs @@ -5,10 +5,6 @@ use core::panic::PanicInfo; use crate::{cpu_id, context, interrupt, syscall}; -#[lang = "eh_personality"] -#[no_mangle] -pub extern "C" fn rust_eh_personality() {} - /// Required to handle panics #[panic_handler] #[no_mangle] @@ -44,12 +40,3 @@ pub extern "C" fn rust_begin_unwind(info: &PanicInfo) -> ! { pub extern fn rust_oom(_layout: Layout) -> ! { panic!("kernel memory allocation failed"); } - -#[allow(non_snake_case)] -#[no_mangle] -/// Required to handle panics -pub extern "C" fn _Unwind_Resume() -> ! { - loop { - unsafe { interrupt::halt(); } - } -}